/* VitaBrew — one day, 06:00 → 22:00. Mobile-first. */

@font-face {
  font-family: "Figtree";
  src: url("../assets/fonts/figtree-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("../assets/fonts/figtree-latin-italic.woff2") format("woff2");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --peach: #f4d9c6;
  --cream: #f3ebdd;
  --amber: #e8b98a;
  --dusk: #7a4a33;
  --cocoa: #2a1a12;
  --ink: #3b2316;
  --ink-soft: #5a3828;
  --paper: #f7efe2;
  --gold: #c9a24a;
  --leaf: #4f7a3a;
  --sugar: #8f3a1f;

  --fg: var(--ink);
  --fg-soft: var(--ink-soft);
  --rule: color-mix(in srgb, var(--ink) 22%, transparent);

  --font: "Figtree", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --measure: 62ch;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.5;
  color: var(--fg);
  /* Daylight as material: the document itself is the day. JS re-aligns the stops to the real section offsets. */
  background-color: var(--peach);
  background-image: linear-gradient(
    to bottom,
    var(--peach) 0%,
    var(--cream) 22%,
    var(--cream) 45%,
    var(--amber) 60%,
    var(--amber) 76%,
    var(--dusk) 80%,
    var(--cocoa) 90%,
    var(--cocoa) 100%
  );
  background-repeat: no-repeat;
  background-size: 100% 100%;
  font-feature-settings: "tnum" 1, "ss01" 1;
  overflow-x: clip;
}
body.is-night { --fg: var(--paper); --fg-soft: color-mix(in srgb, var(--paper) 72%, transparent); --rule: color-mix(in srgb, var(--paper) 25%, transparent); }

::selection { background: var(--gold); color: var(--cocoa); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

img, svg, canvas { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; top: -100%; left: var(--gutter); z-index: 100; padding: .6rem 1rem; background: var(--cocoa); color: var(--paper); border-radius: 999px; }
.skip:focus { top: 1rem; }

/* ---------- Chrome: clock, nav, order ---------- */
.chrome {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .75rem;
  padding: max(.75rem, env(safe-area-inset-top)) var(--gutter) .75rem;
  color: var(--fg);
  transition: color .4s var(--ease-out);
  pointer-events: none;
}
.chrome::before {
  content: "";
  position: absolute; inset: 0 0 -1.25rem 0;
  background: linear-gradient(to bottom, var(--sky, var(--peach)) 55%, transparent);
  opacity: .96;
  z-index: -1;
  pointer-events: none;
}
.chrome > * { pointer-events: auto; }

.clock {
  display: inline-flex;
  align-items: baseline;
  gap: .5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.clock__dot {
  align-self: center;
  width: .55rem; height: .55rem;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 28%, transparent);
}
.clock__time { font-size: clamp(1.25rem, 1rem + 1.2vw, 1.75rem); font-variant-numeric: tabular-nums; }
.clock__label { font-size: .8rem; font-weight: 500; color: var(--fg-soft); text-transform: lowercase; }

.nav { justify-self: end; }
.nav__toggle {
  display: grid;
  gap: 5px;
  width: 2.5rem; height: 2.5rem;
  place-content: center;
  border-radius: 50%;
  border: 1px solid var(--rule);
}
.nav__toggle-bar { width: 18px; height: 2px; background: currentColor; transition: transform .3s var(--ease-out), opacity .3s; }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.nav__list {
  list-style: none;
  margin: 0; padding: 0;
  display: none;
}
.nav__hour { font-variant-numeric: tabular-nums; color: var(--fg-soft); margin-right: .5em; font-weight: 500; }

/* mobile: full-screen hour list */
body.nav-open { overflow: hidden; }
body.nav-open .nav__list {
  display: grid;
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: 6rem var(--gutter) 3rem;
  align-content: start;
  gap: 1rem;
  background: var(--cocoa);
  color: var(--paper);
  font-size: clamp(1.5rem, 6vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
body.nav-open .nav__list a { display: flex; align-items: baseline; padding-bottom: .5rem; border-bottom: 1px solid color-mix(in srgb, var(--paper) 18%, transparent); }
body.nav-open .nav__list .nav__hour { color: var(--gold); font-size: .55em; min-width: 4.5ch; }
body.nav-open .chrome { color: var(--paper); }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .65rem 1.1rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background .3s var(--ease-out), color .3s var(--ease-out), transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.pill:hover { transform: translateY(-1px); }
.pill--order { font-size: .9rem; }
.pill--primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--ink) 60%, transparent);
}
.pill--primary:hover { background: var(--cocoa); box-shadow: 0 16px 30px -12px color-mix(in srgb, var(--ink) 70%, transparent); }
body.is-night .pill--primary { background: var(--gold); color: var(--cocoa); border-color: var(--gold); }
.pill--ghost { border-color: var(--rule); }
.pill--lg { padding: 1rem 1.5rem; font-size: 1.05rem; }

/* ---------- 06:00 Hero ---------- */
.hero { position: relative; }
.hero__pin {
  min-height: 100svh;
  display: grid;
  grid-template-rows: minmax(0, 58svh) auto;
  padding-bottom: 1.5rem;
}
.film {
  position: relative;
  overflow: hidden;
  background: var(--peach);
}
.film__poster img, .film__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 60%;
}
.film__canvas { opacity: 0; transition: opacity .4s; }
.film.is-ready .film__canvas { opacity: 1; }
.film.is-ready .film__poster { visibility: hidden; }
.film::before {
  content: "";
  position: absolute; inset: 0 0 auto 0;
  height: 22%;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--peach) 85%, transparent), transparent);
  pointer-events: none;
  z-index: 1;
}
.film::after {
  /* ground the film into the daylight */
  content: "";
  position: absolute; inset: auto 0 0 0;
  height: 28%;
  background: linear-gradient(to bottom, transparent, var(--peach));
  pointer-events: none;
}

.hero__copy {
  padding: 1rem var(--gutter) 0;
  display: grid;
  gap: 1rem;
  align-content: end;
}
.hero__title {
  font-size: clamp(2.5rem, 2rem + 5.5vw, 5rem);
  line-height: .96;
  font-weight: 800;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.hero__title .line { display: block; }
.hero__sub { max-width: 34ch; color: var(--fg-soft); font-size: clamp(1rem, .95rem + .4vw, 1.2rem); }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.hero__cue { display: inline-flex; align-items: baseline; gap: .5rem; font-weight: 600; color: var(--fg-soft); }
.hero__cue-hour { font-variant-numeric: tabular-nums; color: var(--fg); }
.hero__cue::before {
  content: "";
  width: 1px; height: 1.6rem;
  align-self: center;
  background: currentColor;
  transform-origin: top;
  animation: cue 1.8s var(--ease-out) infinite;
}
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------- Chapters ---------- */
.chapter {
  position: relative;
  padding: clamp(7.5rem, 18vh, 12rem) var(--gutter) clamp(5rem, 14vh, 10rem);
}
.chapter::before {
  /* hour stamp hairline */
  content: attr(data-stamp);
  position: absolute;
  top: clamp(4.5rem, 9vh, 6rem);
  left: var(--gutter);
  right: var(--gutter);
  padding-top: .5rem;
  border-top: 1px solid var(--rule);
  font-size: .85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--fg-soft);
}

.chapter__head { display: grid; gap: 1rem; max-width: 40rem; margin-bottom: clamp(2.5rem, 7vh, 4.5rem); }
.chapter__title {
  font-size: clamp(2rem, 1.4rem + 3.6vw, 4rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.chapter__lede { color: var(--fg-soft); font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); max-width: 38ch; }
.chapter__foot { max-width: 52ch; margin-top: 1.5rem; font-size: .9rem; color: var(--fg-soft); }

/* 07:00 Steps */
.steps { list-style: none; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.step {
  display: grid;
  grid-template-columns: 5.5ch 1fr;
  grid-template-areas: "hour title" "hour body";
  column-gap: 1rem;
  row-gap: .35rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}
.step__hour { grid-area: hour; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--fg-soft); font-size: .95rem; padding-top: .35em; }
.step__hour small { font-size: .7em; }
.step__title { grid-area: title; font-size: clamp(1.35rem, 1.1rem + 1.2vw, 1.9rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.step p { grid-area: body; color: var(--fg-soft); max-width: 42ch; }

/* 09:00 Facts table */
.facts {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.facts th, .facts td { text-align: left; padding: .9rem 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.facts thead th { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-soft); border-bottom-color: var(--fg); }
.facts tbody th { font-weight: 500; color: var(--fg-soft); width: 40%; }
.facts td { font-weight: 700; font-size: clamp(1.1rem, 1rem + .8vw, 1.6rem); letter-spacing: -0.01em; }
.facts td data { font-size: 1.25em; }
.facts__us { color: var(--fg); }
.facts__them { color: var(--fg-soft); font-weight: 500; }
.facts tbody .facts__them { font-weight: 500; }
.facts tbody tr:first-child .facts__us data { color: var(--leaf); }
.facts tbody tr:first-child .facts__them data { color: var(--sugar); }
.facts__note { margin-top: 1rem; font-size: .85rem; color: var(--fg-soft); }

/* 12:00 Flavours (pinned crossfade) */
.chapter--flavours { padding-top: 0; padding-bottom: 0; }
.chapter--flavours::before { z-index: 2; }
.flavours__pin {
  min-height: 100svh;
  display: grid;
  grid-template-rows: minmax(0, 40svh) auto;
  align-content: start;
  padding-top: clamp(4.5rem, 10vh, 6rem);
  padding-bottom: 1rem;
}
.flavours__stage { position: relative; display: grid; place-items: center; }
.flavours__pouch {
  grid-area: 1 / 1;
  width: min(80vw, 40svh);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 1.25rem;
  opacity: 0;
  transform: scale(.96);
  transition: opacity .6s var(--ease-out), transform .8s var(--ease-out);
  filter: drop-shadow(0 30px 40px rgba(59, 35, 22, .18));
}
.flavours__pouch.is-active { opacity: 1; transform: none; }
.flavours__copy { display: grid; gap: 1rem; align-content: start; padding-top: 1rem; }
.flavours__copy .chapter__title { font-size: clamp(1.6rem, 1.2rem + 2.4vw, 4rem); }
.flavours__list { list-style: none; padding: 0; display: grid; border-top: 1px solid var(--rule); }
.flavour { border-bottom: 1px solid var(--rule); }
.flavour__btn {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name facts" "notes facts";
  column-gap: 1rem;
  padding: .7rem 0;
  text-align: left;
  transition: color .3s, padding-left .4s var(--ease-out);
  color: var(--fg-soft);
}
.flavour.is-active .flavour__btn { color: var(--fg); }
.flavour__name { grid-area: name; font-size: clamp(1.25rem, 1rem + 1.4vw, 2rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.flavour__notes { grid-area: notes; font-size: .9rem; }
.flavour__facts { grid-area: facts; align-self: center; font-variant-numeric: tabular-nums; font-size: .85rem; font-weight: 600; text-align: right; max-width: 11ch; }
.flavour.is-active .flavour__name::before {
  content: "";
  display: inline-block;
  width: .5em; height: .5em;
  margin-right: .4em;
  border-radius: 50%;
  background: var(--leaf);
  vertical-align: .15em;
}
.flavours__price { font-weight: 600; color: var(--fg-soft); font-variant-numeric: tabular-nums; }

/* 15:00 Curve */
.curve { display: grid; gap: .75rem; }
.curve__svg { width: 100%; height: clamp(220px, 46vw, 420px); overflow: visible; }
.curve__grid line { stroke: var(--rule); stroke-width: 1; }
.curve__line { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.curve__line--sugar { stroke: var(--sugar); stroke-dasharray: 6 8; }
.curve__line--vita { stroke: var(--leaf); stroke-width: 5; }
.curve__slump { stroke: var(--sugar); stroke-width: 1; stroke-dasharray: 2 6; vector-effect: non-scaling-stroke; opacity: .9; }
.curve__axis { list-style: none; padding: 0; display: flex; justify-content: space-between; font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--fg-soft); }
.curve__legend { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: baseline; font-size: .9rem; font-weight: 600; }
.curve__key::before { content: ""; display: inline-block; width: 1.4em; height: 4px; margin-right: .5em; vertical-align: .25em; border-radius: 2px; }
.curve__key--vita::before { background: var(--leaf); }
.curve__key--sugar::before { height: 0; border-top: 4px dashed var(--sugar); border-radius: 0; }
.curve__callout { margin-left: auto; color: var(--sugar); font-weight: 700; font-variant-numeric: tabular-nums; }

/* 18:00 Inside */
.inside { display: grid; border-top: 1px solid var(--rule); }
.inside__row { display: grid; gap: .5rem; padding: 1.5rem 0; border-bottom: 1px solid var(--rule); }
.inside dt { font-size: clamp(1.25rem, 1rem + 1.2vw, 1.8rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.inside dd { margin: 0; color: var(--fg-soft); max-width: 58ch; }

/* 20:00 About (night ink) */
.chapter--about, .chapter--order, .footer { --fg: var(--paper); --fg-soft: color-mix(in srgb, var(--paper) 72%, transparent); --rule: color-mix(in srgb, var(--paper) 25%, transparent); color: var(--fg); }
.about { display: grid; gap: 2rem; max-width: 46rem; }
.about__body { display: grid; gap: 1.25rem; font-size: clamp(1.05rem, 1rem + .5vw, 1.35rem); line-height: 1.5; max-width: 60ch; }
.about__body p:first-child::first-letter { font-size: 2.2em; font-weight: 800; float: left; line-height: .85; margin: .08em .12em 0 0; color: var(--gold); }
.about__address { font-style: normal; display: grid; gap: .25rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); color: var(--fg-soft); }
.about__address span:first-child { color: var(--fg); font-weight: 700; }
.about__address a { color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 22:00 Order */
.chapter--order { padding-bottom: clamp(4rem, 10vh, 7rem); }
.order { display: grid; gap: 1.5rem; max-width: 46rem; }
.order__title { font-size: clamp(2.25rem, 1.6rem + 4.2vw, 4.75rem); line-height: 1; font-weight: 800; letter-spacing: -0.035em; text-wrap: balance; }
.order__lede { color: var(--fg-soft); max-width: 40ch; font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); }
.order__actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.order__skus { list-style: none; padding: 0; margin-top: .5rem; display: grid; border-top: 1px solid var(--rule); max-width: 28rem; font-variant-numeric: tabular-nums; }
.order__skus li { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--rule); font-weight: 600; }
.order__skus li span:last-child { color: var(--gold); }

.footer {
  padding: 2rem var(--gutter) max(2rem, env(safe-area-inset-bottom));
  display: grid;
  gap: .5rem;
  font-size: .85rem;
  color: var(--fg-soft);
  border-top: 1px solid var(--rule);
}
.footer__note { display: block; }
.footer__hours { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- Tablet / desktop ---------- */
@media (min-width: 768px) {
  .nav__toggle { display: none; }
  .nav__list { display: flex; gap: 1.5rem; font-size: .9rem; font-weight: 600; }
  .nav__list a { display: inline-flex; align-items: baseline; gap: .35rem; padding: .25rem 0; border-bottom: 1px solid transparent; transition: border-color .3s; }
  .nav__list a:hover, .nav__list a.is-current { border-bottom-color: currentColor; }
  .nav__hour { margin-right: 0; font-size: .8em; }
  .chrome { grid-template-columns: 1fr auto 1fr; }
  .nav { justify-self: center; }
  .pill--order { justify-self: end; }

  .hero__pin { grid-template-rows: none; min-height: 100svh; height: 100svh; padding: 0; }
  .film { position: absolute; inset: 0; }
  .film::after { height: 32%; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--peach) 80%, transparent)); }
  .film__poster img, .film__canvas { object-position: 50% 50%; }
  .hero__copy {
    position: absolute;
    inset: auto var(--gutter) clamp(2rem, 7vh, 4rem) var(--gutter);
    grid-template-columns: minmax(0, 46%) 1fr;
    grid-template-areas: "title ." "sub ." "actions .";
    gap: 1.25rem;
  }
  .hero__title { grid-area: title; }
  .hero__sub { grid-area: sub; }
  .hero__actions { grid-area: actions; }

  .chapter__head { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 2rem 4rem; max-width: none; align-items: end; }
  .chapter__lede { max-width: 40ch; justify-self: start; padding-bottom: .4rem; }

  .steps { grid-template-columns: repeat(3, 1fr); border-top: 0; column-gap: 2rem; }
  .step { grid-template-columns: 1fr; grid-template-areas: "hour" "title" "body"; border-top: 1px solid var(--rule); padding-top: 1.25rem; }
  .step__hour { padding-top: 0; }

  .facts tbody th { width: 34%; }
  .facts td { font-size: clamp(1.4rem, 1rem + 1.4vw, 2.4rem); }

  .flavours__pin { grid-template-rows: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 3rem; min-height: 100svh; height: 100svh; padding-top: 0; padding-bottom: 0; }
  .flavours__pouch { width: min(46vw, 78svh); border-radius: 1.5rem; }
  .flavours__copy { padding-top: 0; }

  .inside__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 2rem; padding: 2rem 0; }

  .footer { grid-template-columns: 1fr auto; align-items: baseline; }
}

@media (min-width: 1200px) {
  .hero__copy { grid-template-columns: minmax(0, 40%) 1fr; }
  .chapter { padding-left: max(var(--gutter), calc((100vw - 1400px) / 2)); padding-right: max(var(--gutter), calc((100vw - 1400px) / 2)); }
  .chapter::before { left: max(var(--gutter), calc((100vw - 1400px) / 2)); right: max(var(--gutter), calc((100vw - 1400px) / 2)); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero__cue::before { animation: none; transform: none; }
  .flavours__pouch, .pill, .flavour__btn, .nav__toggle-bar { transition: none; }
}
