/* Gallery — First Crack Coffee Roasters.
   A museum-quiet catalog: edge-to-edge light/dark tiles, one accent (Action Blue),
   one product shadow. Design tokens + shared components. */

/* ---------- Fonts (self-hosted, no CDN, one family / four weights) ---------- */

@font-face {
  font-family: "Inter";
  src: url("./assets/fonts/inter-300.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("./assets/fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("./assets/fonts/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("./assets/fonts/inter-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  /* Light surfaces */
  --canvas: #ffffff;
  --parchment: #f5f5f7;
  --pearl: #fafafc;
  /* Dark tiles */
  --tile-dark-1: #272729;
  --tile-dark-2: #2a2a2c;
  --tile-dark-3: #252527;
  --void: #000000;
  /* The one accent */
  --action: #0066cc;
  --action-focus: #0071e3;
  --action-on-dark: #2997ff;
  /* Ink on light */
  --ink: #1d1d1f;
  --ink-muted: #6e6e73;
  --ink-faint: #86868b;
  /* Text on dark */
  --on-dark: #ffffff;
  --on-dark-muted: #a1a1a6;
  /* Lines */
  --hairline: #d2d2d7;
  --divider-soft: #f0f0f0;

  /* Spacing — 8px base ladder */
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-17: 17px;
  --space-24: 24px;
  --space-32: 32px;
  --space-48: 48px;
  --space-80: 80px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 11px;
  --radius-lg: 18px;
  --radius-pill: 9999px;

  /* The single product shadow — nowhere but under a product render */
  --product-shadow: rgba(0, 0, 0, 0.22) 3px 5px 30px 0;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  --nav-h: 44px;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding-top: var(--nav-h);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  font-weight: 400;
  letter-spacing: -0.011em;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
p,
ul,
ol {
  margin: 0;
}

ul {
  list-style: none;
  padding: 0;
}

:focus-visible {
  outline: 2px solid var(--action-focus);
  outline-offset: 3px;
  border-radius: 3px;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* ---------- Type scale ---------- */

.hero-display {
  font-size: 56px;
  line-height: 1.07;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.display-l {
  font-size: 40px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.018em;
}

.display-m {
  font-size: 34px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.018em;
}

.lead {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: -0.012em;
}

.lead-airy {
  font-size: 24px;
  line-height: 1.45;
  font-weight: 300;
  letter-spacing: -0.012em;
}

.tagline {
  font-size: 21px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0;
}

.body-strong {
  font-size: 17px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.011em;
}

.body {
  font-size: 17px;
  line-height: 1.47;
  font-weight: 400;
  letter-spacing: -0.011em;
}

.caption {
  font-size: 14px;
  line-height: 1.43;
  font-weight: 400;
  letter-spacing: 0;
}

.fine-print {
  font-size: 12px;
  line-height: 1.3;
  font-weight: 400;
  letter-spacing: 0;
}

/* Section eyebrow (light section labels) — Caption 600, caps */
.eyebrow {
  font-size: 14px;
  line-height: 1.43;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Roast-level eyebrow on origin tiles — Tagline 700, caps */
.roast-eyebrow {
  font-size: 21px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ---------- Global nav (true-black slim bar) ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--void);
  color: var(--on-dark);
}

.nav__inner {
  height: var(--nav-h);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-24);
  display: flex;
  align-items: center;
  gap: var(--space-24);
}

.nav__wordmark {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--on-dark);
  margin-right: auto;
  white-space: nowrap;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav__link {
  font-size: 12px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--on-dark);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: opacity 120ms ease-out;
}

.nav__link:hover {
  opacity: 0.7;
}

.nav__link[aria-current="page"] {
  border-bottom-color: var(--on-dark);
}

.nav__cta {
  margin-left: 4px;
}

/* Menu toggle (checkbox hack) — hidden on desktop */
.nav__toggle {
  display: none;
}

.nav__menu-btn {
  display: none;
  font-size: 12px;
  letter-spacing: -0.01em;
  color: var(--on-dark);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  cursor: pointer;
  user-select: none;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: -0.011em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 120ms ease-out, color 120ms ease-out,
    transform 90ms ease-out;
}

.btn:active {
  transform: scale(0.95);
}

/* Primary pill — Action Blue fill, full pill */
.btn-primary {
  background: var(--action);
  color: var(--on-dark);
  border-radius: var(--radius-pill);
  padding: 11px 22px;
}

.btn-primary:hover {
  background: #0058b3;
}

/* Nav-scoped primary pill sits tighter to the 44px bar */
.nav .btn-primary {
  font-size: 13px;
  padding: 7px 15px;
}

/* Secondary ghost pill */
.btn-secondary {
  background: transparent;
  color: var(--action);
  border: 1px solid var(--action);
  border-radius: var(--radius-pill);
  padding: 11px 22px;
}

.btn-secondary:hover {
  background: rgba(0, 102, 204, 0.06);
}

/* On parchment the ghost pill fills with pearl and rings soft */
.tile--parchment .btn-secondary {
  background: var(--pearl);
  border-color: var(--action);
}

/* Dark utility button — ink fill, rect, radius sm */
.btn-utility {
  background: var(--ink);
  color: var(--on-dark);
  font-size: 14px;
  border-radius: var(--radius-sm);
  padding: 8px 15px;
}

/* ---------- Text links ---------- */

.text-link {
  color: var(--action);
  font-weight: 400;
  transition: color 120ms ease-out;
}

.text-link:hover {
  color: #0058b3;
}

.text-link::after {
  content: " \203A";
  font-weight: 400;
}

/* On dark tiles, in-copy links flip to sky blue */
.tile--dark .text-link,
.tile--dark-2 .text-link,
.tile--dark-3 .text-link {
  color: var(--action-on-dark);
}

.tile--dark .text-link:hover,
.tile--dark-2 .text-link:hover,
.tile--dark-3 .text-link:hover {
  color: #47a6ff;
}

/* ---------- Tiles (the gallery stack) ---------- */

.tile {
  padding: var(--space-80) 0;
}

.tile--canvas {
  background: var(--canvas);
  color: var(--ink);
}

.tile--parchment {
  background: var(--parchment);
  color: var(--ink);
}

.tile--dark {
  background: var(--tile-dark-1);
  color: var(--on-dark);
}

.tile--dark-2 {
  background: var(--tile-dark-2);
  color: var(--on-dark);
}

/* Featured surface (San Agustin) */
.tile--dark-3 {
  background: var(--tile-dark-3);
  color: var(--on-dark);
}

/* Muted copy tokens flip by surface */
.tile--canvas .muted,
.tile--parchment .muted {
  color: var(--ink-muted);
}

.tile--dark .muted,
.tile--dark-2 .muted,
.tile--dark-3 .muted {
  color: var(--on-dark-muted);
}

.tile--dark .eyebrow,
.tile--dark-2 .eyebrow,
.tile--dark-3 .eyebrow,
.tile--dark .roast-eyebrow,
.tile--dark-2 .roast-eyebrow,
.tile--dark-3 .roast-eyebrow {
  color: var(--on-dark-muted);
}

/* ---------- Containers ---------- */

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 var(--space-24);
}

.container--wide {
  max-width: 1200px;
}

.container--narrow {
  max-width: 720px;
}

/* ---------- Product shadow (the only shadow in the system) ---------- */

.product-shadow {
  box-shadow: var(--product-shadow);
}

/* ---------- Stacks & shared bits ---------- */

.stack {
  display: flex;
  flex-direction: column;
}

.stack > * + * {
  margin-top: var(--space-24);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12);
  margin-top: var(--space-32);
}

/* ---------- Hero ---------- */

.hero {
  text-align: center;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__eyebrow {
  margin-bottom: var(--space-24);
}

.hero__title {
  max-width: 16ch;
}

.hero__lead {
  margin-top: var(--space-24);
  max-width: 40ch;
  color: var(--ink-muted);
}

.hero .actions {
  justify-content: center;
}

.hero__render {
  width: 100%;
  max-width: 380px;
  margin: var(--space-48) auto 0;
  border-radius: var(--radius-sm);
}

/* ---------- Split (text + product) sections ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: var(--space-80);
}

.split__media {
  width: 100%;
}

.split__media img {
  width: 100%;
  border-radius: var(--radius-sm);
}

.split__title {
  max-width: 18ch;
}

.statement {
  max-width: 24ch;
}

/* ---------- Origin tile (reverent product frame) ---------- */

.origin-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 680px;
}

.origin-tile__region {
  margin-top: var(--space-8);
  color: var(--ink-muted);
}

.tile--dark-3 .origin-tile__region {
  color: var(--on-dark-muted);
}

.origin-tile__notes {
  margin-top: var(--space-24);
  max-width: 22ch;
}

.origin-tile__spec {
  margin-top: var(--space-24);
  padding: var(--space-12) var(--space-24);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-muted);
  letter-spacing: 0.01em;
}

.tile--dark-3 .origin-tile__spec {
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--on-dark-muted);
}

.origin-tile__render {
  width: 100%;
  max-width: 340px;
  margin: var(--space-48) auto 0;
}

.origin-tile__link {
  margin-top: var(--space-32);
}

.origin-tile .roast-eyebrow {
  margin-bottom: var(--space-24);
}

/* ---------- Origin detail grid (beans page) ---------- */

.origin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-24);
  margin-top: var(--space-48);
}

.origin-detail {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-24);
  display: flex;
  flex-direction: column;
}

.origin-detail__roast {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: var(--space-12);
}

.origin-detail__name {
  margin-bottom: var(--space-4);
}

.origin-detail__region {
  color: var(--ink-muted);
  margin-bottom: var(--space-17);
}

.origin-detail__notes {
  margin-bottom: var(--space-24);
}

.origin-detail__spec {
  margin-top: auto;
  border-top: 1px solid var(--hairline);
  padding-top: var(--space-17);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.origin-detail__spec-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-17);
}

.origin-detail__spec-row dt {
  color: var(--ink-muted);
}

.origin-detail__spec-row dd {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
}

/* ---------- Brew spec sheet (tech-spec panel) ---------- */

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-24);
  margin-top: var(--space-48);
}

.spec-sheet {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-32) var(--space-24);
}

.spec-sheet__title {
  margin-bottom: var(--space-4);
  color: var(--ink);
}

.spec-sheet__sub {
  color: var(--ink-muted);
  margin-bottom: var(--space-24);
}

.spec-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-17);
  padding: var(--space-12) 0;
  border-top: 1px solid var(--hairline);
}

.spec-row:last-child {
  border-bottom: 1px solid var(--hairline);
}

.spec-row__label {
  color: var(--ink-muted);
}

.spec-row__value {
  color: var(--ink);
  text-align: right;
}

/* ---------- Info / utility card ---------- */

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-24);
  margin-top: var(--space-48);
}

.info-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: var(--space-24);
}

.info-card__title {
  margin-bottom: var(--space-12);
  color: var(--ink);
}

.info-card__detail {
  color: var(--ink-muted);
}

.info-card__detail + .info-card__detail {
  margin-top: var(--space-4);
}

.info-card__link {
  display: inline-block;
  margin-top: var(--space-17);
}

/* ---------- Section heads ---------- */

.section-head {
  max-width: 30ch;
}

.section-head .eyebrow {
  margin-bottom: var(--space-17);
}

.section-head--center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-lead {
  margin-top: var(--space-24);
  max-width: 46ch;
}

.tile--canvas .section-lead,
.tile--parchment .section-lead {
  color: var(--ink-muted);
}

.tile--dark .section-lead,
.tile--dark-2 .section-lead,
.tile--dark-3 .section-lead {
  color: var(--on-dark-muted);
}

/* ---------- Prose ---------- */

.prose {
  max-width: 62ch;
}

.prose > * + * {
  margin-top: var(--space-24);
}

.prose p {
  color: var(--ink);
}

.about-figure {
  margin: var(--space-48) 0 0;
}

.about-figure img {
  width: 100%;
  border-radius: var(--radius-lg);
}

.about-figure figcaption {
  margin-top: var(--space-12);
  color: var(--ink-muted);
}

/* ---------- CTA band ---------- */

.cta-band {
  text-align: center;
}

.cta-band .actions {
  justify-content: center;
}

.cta-band__lead {
  margin-top: var(--space-17);
  max-width: 44ch;
  margin-left: auto;
  margin-right: auto;
  color: var(--ink-muted);
}

/* ---------- Footer (the one dense region) ---------- */

.footer {
  background: var(--parchment);
  color: var(--ink-muted);
  padding: 64px 0;
}

.footer__top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-48);
}

.footer__wordmark {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.011em;
  color: var(--ink);
}

.footer__blurb {
  margin-top: var(--space-12);
  max-width: 30ch;
  color: var(--ink-muted);
  line-height: 2;
}

.footer__col h4 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: var(--space-12);
}

.footer__col ul {
  line-height: 2.1;
}

.footer__col a {
  color: var(--ink-muted);
  transition: color 120ms ease-out;
}

.footer__col a:hover {
  color: var(--action);
}

.footer__legal {
  margin-top: var(--space-48);
  padding-top: var(--space-24);
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-17);
  justify-content: space-between;
  color: var(--ink-faint);
}

/* ---------- Motion ---------- */

@keyframes product-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: product-in 0.6s ease-out both;
}

/* ---------- Responsive ---------- */

@media (max-width: 833px) {
  body {
    /* nav collapses but height stays */
  }

  .tile {
    padding: var(--space-48) 0;
  }

  /* Nav collapses to wordmark + menu button */
  .nav__menu-btn {
    display: inline-block;
  }

  .nav__links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--void);
    padding: var(--space-8) var(--space-24) var(--space-24);
    display: none;
  }

  .nav__toggle:checked ~ .nav__links {
    display: flex;
  }

  .nav__link {
    padding: var(--space-12) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav__link[aria-current="page"] {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    font-weight: 600;
  }

  .nav__cta {
    margin: var(--space-12) 0 0;
    align-self: flex-start;
  }

  /* Mobile type scale */
  .hero-display {
    font-size: 34px;
    line-height: 1.1;
  }

  .display-l {
    font-size: 30px;
    line-height: 1.12;
  }

  .display-m {
    font-size: 27px;
    line-height: 1.22;
  }

  .lead {
    font-size: 21px;
    line-height: 1.25;
  }

  .lead-airy {
    font-size: 20px;
    line-height: 1.5;
  }

  .tagline {
    font-size: 19px;
    line-height: 1.25;
  }

  .roast-eyebrow {
    font-size: 19px;
  }

  /* Collapse two-up layouts to single column */
  .split {
    grid-template-columns: 1fr;
    gap: var(--space-32);
  }

  .split--flip .split__media {
    order: -1;
  }

  .origin-grid,
  .spec-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .footer__top {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-32);
  }
}

@media (max-width: 520px) {
  .footer__top {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .btn:active {
    transform: none;
  }

  .animate-in {
    animation: none;
  }
}
