/* ---------- Tokens ---------- */
/* Registered so the whole palette can animate when the time of day changes. */
@property --paper      { syntax: '<color>'; inherits: true; initial-value: #FBF3E4; }
@property --paper-2    { syntax: '<color>'; inherits: true; initial-value: #F3E6CD; }
@property --ink        { syntax: '<color>'; inherits: true; initial-value: #211A12; }
@property --ink-soft   { syntax: '<color>'; inherits: true; initial-value: #6B5D4B; }
@property --accent     { syntax: '<color>'; inherits: true; initial-value: #D9480F; }
@property --accent-ink { syntax: '<color>'; inherits: true; initial-value: #FFF8EC; }
@property --glow       { syntax: '<color>'; inherits: true; initial-value: #F6B93B; }
@property --film-hi    { syntax: '<color>'; inherits: true; initial-value: rgba(255,255,255,.82); }
@property --film-lo    { syntax: '<color>'; inherits: true; initial-value: rgba(255,255,255,.38); }
@property --fill       { syntax: '<number>'; inherits: false; initial-value: 1; }

:root {
  --paper: #FBF3E4;
  --paper-2: #F3E6CD;
  --ink: #211A12;
  --ink-soft: #6B5D4B;
  --accent: #D9480F;
  --accent-ink: #FFF8EC;
  --glow: #F6B93B;
  --film-hi: rgba(255,255,255,.82);
  --film-lo: rgba(255,255,255,.38);
  --line: color-mix(in srgb, var(--ink) 16%, transparent);
  --shadow: color-mix(in srgb, var(--ink) 22%, transparent);

  --slot-m: #F29F05;
  --slot-a: #0FA38B;
  --slot-n: #7C6CF2;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --font-gu: 'Anek Gujarati', 'Noto Sans Gujarati', 'Nirmala UI', 'Shruti', sans-serif;
  --font-hi: 'Anek Devanagari', 'Noto Sans Devanagari', 'Nirmala UI', 'Mangal', sans-serif;

  --gutter: clamp(16px, 5vw, 72px);
  --tilt: 0deg;
}

html[data-slot="noon"] {
  --paper: #EEF7F2;
  --paper-2: #D9EDE4;
  --ink: #0C2A28;
  --ink-soft: #45655F;
  --accent: #0A7F6C;
  --accent-ink: #F2FBF7;
  --glow: #34D1B2;
}

html[data-slot="night"] {
  --paper: #10112B;
  --paper-2: #191B40;
  --ink: #F4EEDD;
  --ink-soft: #A8A6C9;
  --accent: #FFC857;
  --accent-ink: #10112B;
  --glow: #8E7BFF;
  --film-hi: rgba(255,255,255,.13);
  --film-lo: rgba(255,255,255,.04);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  transition: --paper 1s ease, --paper-2 1s ease, --ink 1s ease, --ink-soft 1s ease,
              --accent 1s ease, --accent-ink 1s ease, --glow 1s ease,
              --film-hi 1s ease, --film-lo 1s ease;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

:lang(gu) { font-family: var(--font-gu); letter-spacing: 0; }
:lang(hi) { font-family: var(--font-hi); letter-spacing: 0; }

h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2 {
  font: 400 clamp(2rem, 4.4vw, 3.5rem)/1.05 var(--font-display);
  letter-spacing: -.015em;
  text-wrap: balance;
}
h3 { font: 500 1.3rem/1.2 var(--font-display); }
h1 em, h2 em { font-style: italic; color: var(--accent); }

.wrap { width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto; }
main > section:not(.open):not(.pitch):not(.scene) { padding: clamp(64px, 10vw, 128px) 0; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 14px; border-radius: 8px;
  background: var(--ink); color: var(--paper);
}
.skip:focus { top: 12px; }

.eyebrow {
  font: 500 .76rem/1.3 var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.eyebrow__gu {
  margin-left: .6em; padding-left: .8em;
  border-left: 1px solid var(--line);
  font-size: 1.25em; font-weight: 600; text-transform: none;
}

.fine { font-size: .82rem; line-height: 1.45; color: var(--ink-soft); }

.section-head { margin-bottom: clamp(28px, 4vw, 52px); max-width: 46rem; }
.section-head p { margin-top: 1rem; color: var(--ink-soft); font-size: 1.1rem; max-width: 34rem; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center p { margin-inline: auto; }

/* Perforation line that opens each section, like the seam between two pouches */
.perf {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: clamp(28px, 5vw, 56px);
  font: 500 .72rem/1 var(--font-mono);
  letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  color: var(--ink-soft);
}
.perf::before { content: "\2702"; font-size: 1rem; letter-spacing: 0; }
.perf::after { content: ""; flex: 1; border-top: 2px dashed var(--line); }
.perf span + span { padding-left: 14px; border-left: 1px solid var(--line); }
@media (max-width: 480px) {
  /* keep only the section name so the label never runs off a narrow screen */
  .perf { gap: 10px; letter-spacing: .1em; }
  .perf span:first-child { display: none; }
  .perf span + span { padding-left: 0; border-left: 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .9em 1.35em;
  border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font: 600 1rem/1 var(--font-body);
  text-decoration: none; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--small { padding: .65em 1em; font-size: .9rem; }
.btn:active { transform: scale(.97); }
/* Hover lift only where there is a real pointer, so it never sticks after a tap */
@media (hover: hover) {
  .btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -12px var(--accent); }
  .btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  margin-right: auto;
  font: 600 1.15rem/1 var(--font-display);
  text-decoration: none;
}
/* The mark is a dose written the Indian way: 1 – 0 – 1 */
.brand__mark { display: inline-flex; gap: 4px; }
.brand__mark i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.brand__mark i:nth-child(2) { background: transparent; box-shadow: inset 0 0 0 1.6px var(--ink); }

.slots { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.slots button {
  display: grid; place-items: center;
  width: 36px; height: 30px;
  border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-soft); cursor: pointer;
}
.slots button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.slots svg { width: 18px; height: 18px; }
@media (max-width: 560px) {
  .nav__cta { display: none; }
  .nav { padding-block: 6px; }
  .slots { padding: 2px; }
  .slots button { width: 44px; height: 44px; }
}
@media (max-width: 350px) {
  .nav { gap: 8px; }
  .brand { gap: 8px; font-size: 1.05rem; }
  .slots button { width: 40px; }
}

/* ---------- Foil cell ---------- */
.cell {
  --s: 44px;
  position: relative; flex: none; display: block;
  width: var(--s); height: var(--s);
  border-radius: calc(var(--s) * .22);
  background: linear-gradient(calc(118deg + var(--tilt)), #F5F7F8 0%, #B4BBC2 28%, #EDF0F2 46%, #9EA6AE 70%, #DCE1E5 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.55), inset 0 0 0 2px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.28);
}
.cell::before { /* blister dome */
  content: ""; position: absolute; inset: 13%;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.95), rgba(255,255,255,.3) 40%, rgba(0,0,0,.08) 100%);
  box-shadow: inset 0 -2px 4px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.08);
}
.cell::after { /* the pill inside */
  content: ""; position: absolute; inset: 27%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.55), transparent 55%), var(--pill, #fff);
  box-shadow: inset 0 -2px 3px rgba(0,0,0,.2), 0 1px 1px rgba(0,0,0,.25);
}
.cell--oblong::before { inset: 23% 9%; border-radius: 999px; }
.cell--oblong::after  { inset: 34% 18%; border-radius: 999px; }

.cell--num { --s: 64px; margin-bottom: 18px; transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.cell--num::after { display: none; }
.cell--num b {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 600 1.5rem/1 var(--font-display); color: #2B3138;
}

/* ---------- Pouch ---------- */
.pouch {
  --slot-color: var(--slot-m);
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 6px;
  background: linear-gradient(155deg, var(--film-hi), var(--film-lo));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
.pouch[data-slot="noon"]  { --slot-color: var(--slot-a); }
.pouch[data-slot="night"] { --slot-color: var(--slot-n); }
.pouch::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--slot-color); }

.pouch__seal {
  display: flex; align-items: center; justify-content: flex-end;
  height: 18px; padding-right: 10px;
  background: repeating-linear-gradient(90deg, transparent 0 4px, var(--line) 4px 5px);
  border-bottom: 1px dashed var(--line);
  font: 500 .56rem/1 var(--font-mono);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-soft);
}
.pouch__seal span { padding: 2px 6px; background: var(--paper); border-radius: 3px; }
.pouch__seal :lang(gu), .pouch__seal :lang(hi) { font-size: .7rem; }

.pouch__head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px 0 18px;
}
.pouch__slot { display: inline-flex; align-items: center; gap: 7px; font: 600 1.15rem/1 var(--font-display); }
.pouch__slot svg { width: 17px; height: 17px; color: var(--slot-color); }
.pouch__slot :lang(gu), .pouch__slot :lang(hi) { font-weight: 800; font-size: 1.2rem; }
.pouch__time { font: 500 .68rem/1 var(--font-mono); letter-spacing: .08em; color: var(--ink-soft); }

.pouch__body {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px;
  padding: 10px 12px 14px 18px;
}
.pouch__cells { display: flex; flex-wrap: wrap; gap: 6px; max-width: 98px; }
.pouch__cells .cell { --s: 44px; }
.pouch__print { font: 400 .68rem/1.45 var(--font-mono); }
.pouch__who { margin-bottom: 3px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.pouch__print ul { list-style: none; margin: 0; padding: 0; }
.pouch__print li + li { margin-top: 3px; }
.pouch__print small { display: block; font-size: .92em; color: var(--ink-soft); }

.pouch--empty { background: transparent; border-style: dashed; box-shadow: none; }
.pouch--empty .pouch__body { display: block; }
.pouch--empty .pouch__print { color: var(--ink-soft); font-size: .78rem; }

@keyframes print { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.pouch.is-printing .pouch__print { animation: print .6s steps(9) both; }

/* A roll: pouches joined by perforations */
.roll { display: grid; }
.roll .pouch { border-radius: 0; }
.roll .pouch + .pouch { border-top: 2px dashed var(--line); }
.roll .pouch:first-child { border-radius: 8px 8px 0 0; }
.roll .pouch:last-child  { border-radius: 0 0 8px 8px; }

/* ---------- Opening: the question, with room to breathe ---------- */
.open {
  display: grid; align-items: center;
  min-height: 100vh; min-height: 100svh;
  /* generous, but tied to the screen's height so the whole opening fits on one screen; the top also clears the fixed bar */
  padding: calc(62px + clamp(28px, 8vh, 96px)) 0 clamp(40px, 9vh, 112px);
  background: var(--paper-2);
  text-align: center;
}
/* The question every family asks, set large in Gujarati. Its colour sweeps in as the page opens,
   as if it were being asked. --fill is registered as a number so that sweep can be animated. */
.ask {
  --fill: 1;
  width: fit-content; margin-inline: auto;
  /* as wide as the screen allows; on a short screen its height is capped so the words under it stay in view */
  font: 800 clamp(4.2rem, min(19vw, 27vh), 16rem)/1.15 var(--font-gu);
  color: transparent;
  background:
    linear-gradient(var(--accent), var(--accent)) 0 0 / calc(var(--fill) * 100%) 100% no-repeat,
    linear-gradient(var(--line), var(--line));
  -webkit-background-clip: text; background-clip: text;
  animation: ask 1.3s cubic-bezier(.3, .6, .2, 1) .35s both;
}
@keyframes ask { from { --fill: 0; } to { --fill: 1; } }
.ask__gloss {
  margin-top: -.2em;
  font: italic 400 clamp(1.1rem, 2vw, 1.5rem)/1.3 var(--font-display);
  color: var(--ink-soft);
}
.open__copy { max-width: 40rem; margin: clamp(24px, 5vh, 56px) auto 0; }
.open__copy p { margin-top: 1rem; color: var(--ink-soft); font-size: 1.1rem; }

/* ---------- The pitch: what we do, beside today's three pouches ---------- */
.pitch {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center; gap: clamp(24px, 4vw, 64px);
  padding: clamp(64px, 10vw, 128px) var(--gutter);
}
.pitch__text { position: relative; z-index: 1; }
.pitch h2 { margin: .35em 0 .4em; }
.lede { max-width: 34em; color: var(--ink-soft); font-size: clamp(1.05rem, 1.35vw, 1.22rem); }
.pitch__cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 22px; }

.clock {
  display: flex; align-items: flex-start; gap: 10px;
  font: 500 .82rem/1.4 var(--font-mono);
  color: var(--ink);
}
.clock__dot { flex: none; width: 8px; height: 8px; margin-top: .42em; border-radius: 50%; background: var(--accent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.clock button {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.chips li {
  padding: .45em .9em; border: 1px solid var(--line); border-radius: 999px;
  font-size: .86rem; color: var(--ink-soft);
}

.tilt { margin-top: 22px; font: 500 .82rem/1.4 var(--font-mono); color: var(--ink-soft); }
.tilt span::before { content: "\2726"; margin-right: .6em; color: var(--accent); }
.tilt button {
  min-height: 44px; padding: .5em 1.1em;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--ink); cursor: pointer;
}

/* The sun (or moon) that moves across the pitch as the time of day changes */
.orb {
  position: absolute; left: 6%; top: 88%;
  width: 46vmax; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--glow) 0, transparent 64%);
  opacity: .55; transform: translate(-50%, -50%); pointer-events: none;
  transition: left 1.3s cubic-bezier(.6,.1,.2,1), top 1.3s cubic-bezier(.6,.1,.2,1),
              width 1.3s ease, opacity 1.3s ease;
}
html[data-slot="noon"]  .orb { left: 52%; top: -4%; opacity: .45; }
html[data-slot="night"] .orb { left: 90%; top: 16%; width: 24vmax; opacity: .6; }

.roll--pitch {
  position: relative; z-index: 1; justify-self: center;
  width: min(350px, 86vw);
  transform: rotate(-3deg);
  filter: drop-shadow(0 30px 34px var(--shadow));
}
.roll--pitch .pouch {
  opacity: .5; cursor: pointer;
  transition: transform .6s cubic-bezier(.2,.8,.2,1), opacity .6s ease, box-shadow .6s ease;
}
.roll--pitch .pouch.is-now {
  z-index: 2; opacity: 1;
  transform: translateX(18px) scale(1.05);
  border-radius: 6px;
  box-shadow: 0 0 0 1.5px var(--slot-color), 0 22px 46px -18px var(--slot-color);
}

@media (max-width: 900px) {
  .pitch { grid-template-columns: 1fr; gap: 40px; }
  .roll--pitch .pouch.is-now { transform: translateX(10px) scale(1.04); }
}
@media (max-width: 560px) {
  .pitch__cta { margin: 24px 0 20px; }
  .pitch__cta .btn { flex: 1 1 100%; padding-block: 1.1em; }
  .chips li { font-size: .9rem; }
  .pouch__cells { max-width: 88px; }
  .pouch__cells .cell { --s: 40px; }
  .pouch__body { gap: 12px; }
  .pouch__print { font-size: .74rem; }
  .pouch__time { font-size: .74rem; }
}

/* ---------- Scroll scene ---------- */
/* One screen for the pinned stage, then three and a half "stops" of 60vh: one per move, plus a rest on
   the finished week. scroll-margin cancels the page's anchor offset so "Watch a week get sorted" lands pinned. */
.scene { position: relative; height: calc(100vh + 210vh); scroll-margin-top: -72px; }
.scene__sticky {
  position: sticky; top: 0;
  display: grid; grid-template-columns: minmax(260px, 34%) minmax(0, 1fr);
  align-items: center; gap: clamp(20px, 4vw, 64px);
  height: 100vh; height: 100svh;
  padding: 76px var(--gutter) 28px;
  overflow: hidden;
}
.scene__captions { display: grid; margin-top: 18px; }
.caption {
  grid-area: 1 / 1;
  opacity: 0; transform: translateY(14px);
  transition: opacity .45s ease, transform .45s ease;
}
.caption.is-on { opacity: 1; transform: none; }
.caption h2 { font-size: clamp(1.7rem, 3.5vw, 3.1rem); }
.caption p { margin-top: 1rem; color: var(--ink-soft); max-width: 26rem; }

/* The four dots are buttons: tap one to jump to that part of the story */
.scene__dots { display: flex; margin: 18px 0 0 -11px; }
.scene__dots button {
  display: grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  border: 0; background: none; cursor: pointer;
}
.scene__dots button::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  box-shadow: inset 0 0 0 1.6px var(--ink);
  transition: background-color .3s ease;
}
.scene__dots button.is-on::before { background: var(--ink); }
@media (pointer: coarse) {
  .scene__dots { margin-left: -16px; }
  .scene__dots button { width: 44px; height: 44px; }
}

/* Each move is a transform or opacity transition only, so the GPU does it without repainting.
   main.js sets the target transform and a per-cell delay; data-step on the canvas drives the rest. */
.scene__canvas { position: relative; width: 100%; height: min(76vh, 640px); --s: 48px; }
.scene__canvas .cell {
  position: absolute; left: 0; top: 0;
  border-radius: 1px;
  will-change: transform;
  transition: transform .75s cubic-bezier(.22, .8, .24, 1);
}
.scene__canvas[data-step="2"] .cell,
.scene__canvas[data-step="3"] .cell { border-radius: calc(var(--s) * .26); }   /* corners rounded once cut */

.spouch {
  --slot-color: var(--slot-m);
  position: absolute; opacity: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 5px;
  background: linear-gradient(155deg, var(--film-hi), var(--film-lo));
  transition: opacity .45s ease var(--d, 0ms);
}
.scene__canvas[data-step="3"] .spouch { opacity: 1; }
.scene__canvas.is-instant .cell,
.scene__canvas.is-instant .spouch,
.scene__canvas.is-instant .shead { transition: none; }
.spouch[data-slot="noon"]  { --slot-color: var(--slot-a); }
.spouch[data-slot="night"] { --slot-color: var(--slot-n); }
.spouch::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--slot-color); }
.scene__canvas[data-step="3"] .spouch.is-now {
  overflow: visible;
  box-shadow: 0 0 0 2px var(--slot-color), 0 0 30px 2px var(--slot-color);
  animation: nowpulse 1.8s ease-in-out 1.4s infinite;   /* starts once the cells have landed */
}
@keyframes nowpulse { 50% { box-shadow: 0 0 0 2px var(--slot-color), 0 0 10px 0 var(--slot-color); } }

.shead {
  position: absolute; opacity: 0;
  transition: opacity .4s ease;
  transform: translate(-50%, -50%);
  font: 500 .66rem/1 var(--font-mono);
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-soft);
}
.shead svg { display: block; width: 20px; height: 20px; }
.shead[data-slot="morning"] { color: var(--slot-m); }
.shead[data-slot="noon"]    { color: var(--slot-a); }
.shead[data-slot="night"]   { color: var(--slot-n); }
.scene__canvas[data-step="3"] .shead { opacity: 1; }

@media (max-width: 820px) {
  .scene__sticky {
    grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr);
    align-items: stretch; gap: 12px;
    padding-top: 70px; padding-bottom: 14px;
  }
  .scene__captions { margin-top: 8px; }
  .caption h2 { font-size: clamp(1.45rem, 6.6vw, 2.3rem); }
  .caption p { margin-top: .5rem; font-size: .96rem; line-height: 1.5; }
  .scene__dots { margin-top: 2px; margin-bottom: -10px; }
  .scene__canvas { height: auto; min-height: 0; }
}
/* Short phones: give the animation the room instead of the label */
@media (max-width: 820px) and (max-height: 720px) {
  .scene__text .eyebrow { display: none; }
  .scene__captions { margin-top: 0; }
}

/* Reduced motion: no pinning, show the finished week and all four captions */
.scene--static { height: auto; }
.scene--static .scene__sticky { position: static; height: auto; overflow: visible; padding-top: clamp(64px, 10vw, 128px); }
.scene--static .scene__captions { gap: 28px; }
.scene--static .caption { grid-area: auto; opacity: 1; transform: none; }
.scene--static .scene__dots { display: none; }
.scene--static .scene__text .eyebrow { display: block; }
.scene--static .scene__canvas { height: clamp(260px, 76vh, 560px); }

/* ---------- Builder ---------- */
.build__grid {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: start; gap: clamp(20px, 4vw, 56px);
}
.build__left { display: grid; gap: 16px; min-width: 0; }
.rx {
  position: relative;
  padding: clamp(16px, 2.4vw, 30px);
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--paper-2);
}
.rx__row {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}
.rx__row--head {
  padding-top: 0;
  font: 500 .72rem/1 var(--font-mono);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft);
}
.rx__row .cell { --s: 34px; }
.rx__name { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.rx__name small { display: block; font-weight: 400; font-size: .84em; color: var(--ink-soft); }

.dose {
  display: grid; grid-template-columns: 40px 10px 40px 10px 40px;
  align-items: center; justify-items: center;
  font: 500 1.05rem/1 var(--font-mono);
  color: var(--ink-soft);
}
.dose button {
  width: 40px; height: 40px;
  border: 1.5px solid var(--line); border-radius: 50%;
  background: transparent; color: var(--ink-soft); cursor: pointer;
  transition: transform .15s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}
.dose button:hover { border-color: var(--ink); }
.dose button:active { transform: scale(.88); }
.dose button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.dose--head svg { width: 20px; height: 20px; }
.dose--head svg:nth-of-type(1) { color: var(--slot-m); }
.dose--head svg:nth-of-type(2) { color: var(--slot-a); }
.dose--head svg:nth-of-type(3) { color: var(--slot-n); }

.rx__controls { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; }
.rx--opts .fine { margin-top: 16px; }
.field {
  display: grid; gap: 7px;
  font: 500 .7rem/1 var(--font-mono);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft);
}
.field input, .field select {
  min-width: 0; width: 100%;
  padding: .72em .9em;
  border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink);
  font: 500 1rem/1.2 var(--font-body);
  letter-spacing: 0; text-transform: none;
}
.field input:focus, .field select:focus { border-color: var(--ink); outline: none; }
.rx__controls .field input { width: 11rem; }

.seg { display: inline-flex; overflow: hidden; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); }
.seg button {
  padding: .72em .9em; border: 0;
  background: transparent; color: var(--ink); cursor: pointer;
  font: 500 .95rem/1.2 var(--font-body);
  letter-spacing: 0; text-transform: none;
}
.seg button:lang(gu) { font-family: var(--font-gu); }
.seg button:lang(hi) { font-family: var(--font-hi); }
.seg button + button { border-left: 1.5px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.rx__sum { margin-top: 20px; font: 400 clamp(1.15rem, 1.9vw, 1.5rem)/1.25 var(--font-display); }

.roll--day { filter: drop-shadow(0 24px 30px var(--shadow)); }
.roll--day .pouch__cells { max-width: 148px; }

@media (max-width: 900px) {
  /* One column, reordered: doses, then the pouches they change, then name and language */
  .build__grid { grid-template-columns: 1fr; gap: 16px; }
  .build__left { display: contents; }
  .roll--day { order: 2; }
  .rx--opts { order: 3; }
  /* finger-sized dose buttons */
  .dose { grid-template-columns: 46px 8px 46px 8px 46px; }
  .dose button { width: 46px; height: 46px; }
  .seg button { padding-block: .85em; }
}
@media (max-width: 560px) {
  .rx__row { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; }
  .rx__row .cell { --s: 30px; }
  .dose { grid-template-columns: 44px 6px 44px 6px 44px; }
  .dose button { width: 44px; height: 44px; }
  .roll--day .pouch__cells { max-width: 134px; }
  .rx__controls .field { flex: 1 1 100%; }
  .rx__controls .field input { width: 100%; }
  .seg { display: flex; }
  .seg button { flex: 1; }
}
@media (max-width: 350px) {
  /* drop the little pill picture so long medicine names still fit beside the buttons */
  .rx__row { grid-template-columns: minmax(0, 1fr) auto; }
  .rx__row > .cell, .rx__row--head > span:first-child { display: none; }
  .dose { grid-template-columns: 44px 3px 44px 3px 44px; }
}

/* ---------- How it works: four steps laid out like a strip of four cells ---------- */
.steps {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0; padding: 0; list-style: none;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--paper-2);
  overflow: hidden;
}
.step { padding: clamp(18px, 2.4vw, 30px); }
.step + .step { border-left: 2px dashed var(--line); }
@media (hover: hover) { .step:hover .cell--num { transform: rotate(-8deg) scale(1.08); } }
.step h3 { margin-bottom: .5rem; }
.step p { color: var(--ink-soft); font-size: .97rem; }
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .step:nth-child(3) { border-left: 0; }
  .step:nth-child(n+3) { border-top: 2px dashed var(--line); }
}
@media (max-width: 560px) {
  /* a vertical strip: number on the left, words on the right */
  .steps { grid-template-columns: 1fr; }
  .step { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; align-items: start; }
  .step + .step { border-left: 0; border-top: 2px dashed var(--line); }
  .step .cell--num { --s: 48px; grid-row: span 2; margin-bottom: 0; }
  .step .cell--num b { font-size: 1.2rem; }
  .step h3 { margin: .2rem 0 .35rem; }
  .step p { font-size: 1rem; }
}

/* ---------- Promises ---------- */
.promise__grid {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  align-items: start; gap: clamp(24px, 5vw, 72px);
}
.never { margin: 0; padding: 0; list-style: none; }
.never li { padding: 20px 0; border-top: 1px solid var(--line); }
.never li:last-child { border-bottom: 1px solid var(--line); }
.never b {
  display: block; margin-bottom: 6px;
  font: 400 clamp(1.5rem, 2.6vw, 2.1rem)/1.1 var(--font-display);
  text-decoration: line-through;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}
.never p { color: var(--ink-soft); max-width: 32rem; }

.limits {
  position: sticky; top: 92px;
  padding: clamp(18px, 2.4vw, 28px);
  border: 1.5px dashed var(--line); border-radius: 16px;
}
.limits h3 { margin: 10px 0 8px; }
.limits p { color: var(--ink-soft); font-size: .97rem; }
.limits ul { margin: 14px 0 0; padding-left: 1.1em; }
.limits li { padding: 2px 0; }
@media (max-width: 900px) {
  .promise__grid { grid-template-columns: 1fr; }
  .limits { position: static; }
}

/* ---------- Waitlist ---------- */
.join__pouch {
  position: relative; overflow: hidden;
  max-width: 720px; margin-inline: auto;
  border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(155deg, var(--film-hi), var(--film-lo));
  box-shadow: 0 30px 50px -30px var(--shadow);
}
.join__seal {
  display: flex; align-items: center; justify-content: space-between;
  height: 38px; padding: 0 16px;
  background: repeating-linear-gradient(90deg, transparent 0 5px, var(--line) 5px 6px);
  border-bottom: 2px dashed var(--line);
  font: 500 .64rem/1 var(--font-mono);
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-soft);
  transform-origin: left bottom;
  transition: transform .9s cubic-bezier(.5,0,.2,1), opacity .9s ease, margin-top .9s cubic-bezier(.5,0,.2,1);
}
.join__seal span { padding: 3px 8px; border-radius: 4px; background: var(--paper); }
.join__pouch.is-open .join__seal { transform: rotate(-9deg) translate(-12%, -120%); opacity: 0; margin-top: -38px; }

.join__inner { padding: clamp(18px, 3vw, 36px); }
.pin label {
  display: block; margin-bottom: 10px;
  font: 500 .72rem/1 var(--font-mono);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft);
}
.pin__row { display: flex; gap: 10px; }
.pin__row input {
  flex: 1; min-width: 0;
  padding: .45em .6em;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--paper); color: var(--ink);
  font: 500 clamp(1.4rem, 3.4vw, 2rem)/1.2 var(--font-mono);
  letter-spacing: .28em;
}
.pin__row input::placeholder { color: var(--line); }
.pin__row input:focus { border-color: var(--ink); outline: none; }
.pin__msg { min-height: 1.6em; margin-top: 12px; font-weight: 500; }
.pin__msg.is-bad { color: var(--accent); }

.join__more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .8s cubic-bezier(.5,0,.2,1); }
.join__more > div { overflow: hidden; min-height: 0; visibility: hidden; transition: visibility 0s .8s; }
.join__pouch.is-open .join__more { grid-template-rows: 1fr; }
.join__pouch.is-open .join__more > div { visibility: visible; transition-delay: 0s; }

.wait {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 8px; padding-top: 22px;
  border-top: 2px dashed var(--line);
}
.wait .btn, .wait .fine, .wait__err { grid-column: 1 / -1; }
.wait .btn { justify-self: start; }
.wait__err { color: var(--accent); font-weight: 500; }
.wait__err:empty { display: none; }
@media (max-width: 560px) { .wait { grid-template-columns: 1fr; } }

.wait__done { margin-top: 8px; padding-top: 22px; border-top: 2px dashed var(--line); }
.wait__done h3 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: 8px; }
.wait__done .fine { margin-top: 14px; }
.wait__done:focus { outline: none; }

/* ---------- FAQ ---------- */
.faq__grid { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: clamp(20px, 5vw, 72px); }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 0; cursor: pointer; list-style: none;
  font: 500 1.15rem/1.3 var(--font-display);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "0"; flex: none;
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--line);
  font: 500 .9rem/1 var(--font-mono);
  color: var(--ink-soft);
}
.faq details[open] summary::after { content: "1"; background: var(--ink); color: var(--paper); box-shadow: none; }
.faq details p { padding: 0 46px 20px 0; color: var(--ink-soft); }
@media (max-width: 900px) { .faq__grid { grid-template-columns: 1fr; gap: 0; } }
@media (max-width: 560px) {
  .faq summary { font-size: 1.08rem; }
  .faq details p { padding-right: 0; }
}

/* ---------- Footer ---------- */
.foot { padding: 40px 0 56px; border-top: 2px dashed var(--line); }
.foot__grid { display: grid; gap: 14px; }
.foot p { max-width: 44rem; color: var(--ink-soft); font-size: .92rem; }
.foot__small { font: 400 .76rem/1.5 var(--font-mono); letter-spacing: .04em; }

/* ---------- Phone dock: the main button, always within thumb reach ---------- */
.dock { display: none; }
@media (max-width: 560px) {
  .dock {
    position: fixed; z-index: 40;
    left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    display: flex; align-items: center; justify-content: center;
    min-height: 54px; padding: 0 1.2em;
    border-radius: 999px;
    background: var(--accent); color: var(--accent-ink);
    font: 600 1.05rem/1 var(--font-body); text-decoration: none;
    box-shadow: 0 16px 30px -12px rgba(0,0,0,.55), 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent);
    transform: translateY(170%); visibility: hidden;
    transition: transform .45s cubic-bezier(.2,.8,.2,1), visibility 0s .45s;
  }
  .dock.is-on { transform: none; visibility: visible; transition-delay: 0s; }
  .foot { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- Reveal on scroll (only when JS is running) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
.js [data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; transition: none; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .orb, .roll--pitch .pouch, .join__seal, .join__more, .dock { transition: none; }
  .ask, .clock__dot, .pouch.is-printing .pouch__print, .scene__canvas[data-step="3"] .spouch.is-now { animation: none; }
}
