/* Halfnoon (demo by Corlo Studio). Phone first; desktop from 1024px. */

@property --paper  { syntax: '<color>'; inherits: true; initial-value: #F1EEE8; }
@property --accent { syntax: '<color>'; inherits: true; initial-value: #8A5A00; }

:root {
  --ink: #1B1A17;
  --ink-soft: #5C5850;
  --line: rgba(27, 26, 23, .14);
  --paper: #F1EEE8;
  --accent: #8A5A00;
  --liquid: #E9B949;
  --liquid-deep: #C98A1B;
  --liquid-surface: #F3D27C;
  --print: #1B1A17;
  --surface: #FBFAF7;

  --f-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --f-body: "Geist", "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Geist Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --strip-h: 28px;
  --head-h: 52px;
  --chrome: calc(var(--strip-h) + var(--head-h) + var(--safe-t));
  --bar-h: calc(64px + var(--safe-b));
  --pad: 20px;
  --hb: min(62lvh, 720px);            /* hero bottle height on desktop */

  transition: --paper .9s ease, --accent .9s ease;
}
:root.js[data-variant="dawn"] {
  --paper: #E8ECEA; --accent: #2F6B62; --liquid: #A9CFC4; --liquid-deep: #5E9E90; --liquid-surface: #CFE6DF;
}
:root.js[data-variant="dusk"] {
  --paper: #E7DDD2; --accent: #8C2F17; --liquid: #B5532F; --liquid-deep: #7A2A16; --liquid-surface: #CF7A55; --print: #F6EEE4;
}
/* same values without JS; kept in separate rules because a browser without :has() drops the whole selector list */
:root.no-js:has(#v-dawn:checked) {
  --paper: #E8ECEA; --accent: #2F6B62; --liquid: #A9CFC4; --liquid-deep: #5E9E90; --liquid-surface: #CFE6DF;
}
:root.no-js:has(#v-dusk:checked) {
  --paper: #E7DDD2; --accent: #8C2F17; --liquid: #B5532F; --liquid-deep: #7A2A16; --liquid-surface: #CF7A55; --print: #F6EEE4;
}

/* one variant's text at a time; all three are in the HTML */
:root.js[data-text="dawn"] .v:not(.v--dawn),
:root.js[data-text="noon"] .v:not(.v--noon),
:root.js[data-text="dusk"] .v:not(.v--dusk) { display: none; }
:root.no-js:has(#v-dawn:checked) .v:not(.v--dawn),
:root.no-js:has(#v-noon:checked) .v:not(.v--noon),
:root.no-js:has(#v-dusk:checked) .v:not(.v--dusk) { display: none; }
/* no JS and no :has(): nothing can follow the radios, so the list becomes a plain price list and the page stays on Noon Oil */
@supports not selector(:has(*)) {
  .no-js .v:not(.v--noon) { display: none; }
  .no-js .rows input { display: none; }
  .no-js .row { pointer-events: none; cursor: default; }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 96px; scroll-padding-bottom: calc(var(--bar-h) + 16px); }
body {
  margin: 0; color: var(--ink); background: var(--paper);
  font: 400 16px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
h1, h2, h3, p, ul, figure, fieldset { margin: 0; padding: 0; }
ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: block; }
.defs { position: absolute; }

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* ---------- fixed chrome ---------- */
.strip {
  position: fixed; z-index: 7; top: 0; left: 0; right: 0;
  height: calc(var(--strip-h) + var(--safe-t)); padding: var(--safe-t) 8px 0;
  text-align: center; overflow: hidden;
  background: var(--ink); color: #F7F4EE;
  font: 400 12px/28px var(--f-mono); letter-spacing: .04em; white-space: nowrap;
}
.strip a { text-underline-offset: 3px; }
@media (max-width: 359.98px) { .strip { font-size: 11px; letter-spacing: .01em; } }
.strip a:focus-visible { outline-color: #F7F4EE; }

.head {
  position: fixed; z-index: 6; left: 0; right: 0; top: calc(var(--strip-h) + var(--safe-t));
  height: var(--head-h); padding: 0 var(--pad);
  display: flex; align-items: center; justify-content: space-between;
  pointer-events: none;
}
.head > * { pointer-events: auto; }
.wordmark { font: 500 13px/1 var(--f-body); letter-spacing: .3em; text-decoration: none; padding: 16px 0; }
.bag-btn {
  font: 400 13px/1 var(--f-mono); letter-spacing: .04em; text-decoration: none;
  min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: flex-end;
}
.bag-btn:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- the 3D canvas ---------- */
.stage {
  position: fixed; left: 0; top: 0; z-index: 0;
  width: 100vw; height: 100vh; height: 100lvh;
  display: block; opacity: 0; transition: opacity .6s ease;
  touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.gl .stage { opacity: 1; }
.stage.is-cut { opacity: 0; transition: none; }
:root:is(.no-js, .no-gl) .stage { display: none; }
@media (hover: hover) and (pointer: fine) {
  .gl .stage { cursor: grab; }
  .gl.is-dragging .stage { cursor: grabbing; }
}

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--f-display); font-weight: 300; font-optical-sizing: auto; text-wrap: balance; }
h1 { font-size: clamp(34px, 10.4vw, 40px); line-height: .98; letter-spacing: -.02em; }
h2 { font-size: clamp(30px, 4vw, 60px); line-height: 1.05; letter-spacing: -.015em; }
h3 { font-weight: 400; font-size: clamp(28px, 3vw, 44px); line-height: 1.05; letter-spacing: -.01em; }
.eyebrow {
  font: 400 12px/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft);
  margin-bottom: 14px;
}
.eyebrow__n { color: var(--accent); margin-right: 1.4em; }
.body, .sub { max-width: 42ch; text-wrap: pretty; }
.sub { color: var(--ink-soft); margin-top: 12px; }
h2 + .body, h2 + .swap { margin-top: 16px; }
.meta { font: 400 13px/1.4 var(--f-mono); letter-spacing: .02em; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.small { font: 400 12px/1.5 var(--f-mono); color: var(--ink-soft); margin-top: 16px; max-width: 46ch; }
.price { font-family: var(--f-mono); font-weight: 400; font-size: 15px; font-variant-numeric: tabular-nums; }
.hint {
  font: 400 12px/1.4 var(--f-mono); letter-spacing: .04em; color: var(--ink-soft);
  display: flex; align-items: center; gap: 10px; margin-top: 14px;
  transition: opacity .4s ease;
}
.hint svg { fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.has-turned .hint--drag { opacity: 0; }
.swap, .price { transition: opacity .1s linear; }
.is-swapping .swap, .is-swapping .price { opacity: 0; }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  height: 52px; padding: 0 28px; border-radius: 26px;
  font: 500 16px/1 var(--f-body); text-decoration: none; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary .price { color: inherit; }
.btn--ghost { border: 1px solid var(--ink); margin-top: 22px; }
.btn--wide { width: 100%; }
.btn--hero { width: 240px; }
.btn--bar { min-width: 136px; padding: 0 22px; height: 48px; border-radius: 24px; }
.btn:active { transform: translateY(1px); }
@media (hover: hover) {
  .btn--primary:hover { background: #33312C; }
  .btn--ghost:hover { background: rgba(27, 26, 23, .06); }
}
.btn__label, .btn__done { transition: opacity .2s ease; }
.btn__done { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; opacity: 0; }
.btn__done svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.is-added .btn__label { opacity: 0; }
.is-added .btn__done { opacity: 1; }

/* ---------- swatches and pickers ---------- */
.sw { display: block; flex: none; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(27, 26, 23, .22); }
.sw--dawn { background: #A9CFC4; }
.sw--noon { background: #E9B949; }
.sw--dusk { background: #B5532F; }
.chips input, .rows input, .swatches input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; pointer-events: none; }
.chip, .row, .swatch { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.chip:focus-within, .row:focus-within, .swatch:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
@supports selector(:has(*)) {
  .chip:focus-within, .row:focus-within, .swatch:focus-within { outline: none; }
  .chip:has(:focus-visible), .row:has(:focus-visible), .swatch:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
}

.chips { display: flex; gap: 6px 22px; flex-wrap: wrap; justify-content: flex-end; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font: 500 15px/1 var(--f-body); border-radius: 4px; }
.chip__t { padding-bottom: 3px; border-bottom: 1.5px solid transparent; }
.chip input:checked ~ .chip__t { border-bottom-color: var(--accent); }

.swatches { display: flex; gap: 2px; margin-left: -8px; }
.swatch { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.swatch .sw { width: 28px; height: 28px; box-shadow: inset 0 0 0 1.5px rgba(27, 26, 23, .55); }
.swatch input:checked ~ .sw { box-shadow: inset 0 0 0 1.5px rgba(27, 26, 23, .55), 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink); }
.bar__name { flex: 1 1 0; min-width: 0; font: 400 11px/1.2 var(--f-mono); letter-spacing: .02em; color: var(--ink); }

.rows { margin-top: 20px; border-top: 1px solid var(--line); }
.row {
  display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 2px;
  border-bottom: 1px solid var(--line); font: 500 15px/1.3 var(--f-body);
}
.row .sw { width: 16px; height: 16px; }
.row input:checked ~ .sw { box-shadow: inset 0 0 0 1px rgba(27, 26, 23, .22), 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink); }
.row__t { flex: 1; min-width: 0; }
.row__n { font: 400 12px/1 var(--f-mono); color: var(--ink-soft); margin-right: 12px; }
.row__d { font-weight: 400; color: var(--ink-soft); }
.row input:checked ~ .row__t { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.row__p { font: 400 15px/1 var(--f-mono); font-variant-numeric: tabular-nums; }

.pick { margin-top: 26px; }
.pick .meta { margin-top: 8px; }
.pick__d { margin-top: 12px; color: var(--ink); }
.pick + .btn { margin-top: 22px; }

/* ---------- ingredients ---------- */
.ingr { margin-top: 18px; border-top: 1px solid var(--line); }
.ingr li { display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.glyph { width: 40px; height: 40px; flex: none; fill: none; stroke: var(--ink); stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.ingr__n { font: 400 21px/1.15 var(--f-display); letter-spacing: -.005em; }
.ingr__d { font-size: 15px; line-height: 1.4; color: var(--ink-soft); margin-top: 2px; }

/* ---------- sections: phone ---------- */
main { position: relative; z-index: 1; pointer-events: none; } /* let presses fall through to the fixed canvas; interactive children re-enable below */
.beat { position: relative; pointer-events: none; }
.copy__in, .buy-row, .hint, .fig { pointer-events: auto; }
.fig { display: none; }

/* with 3D: tall scroll sections; each beat's copy is fixed in the bottom zone on a paper fade
   and cross-fades while its section is current (page.js sets .is-in) */
:root.js:not(.no-gl) .beat { height: 120svh; }
:root.js:not(.no-gl) #s0 { height: 100svh; }
:root.js:not(.no-gl) #s2 { height: 140svh; }
:root.js:not(.no-gl) #s3 { height: 150svh; }
:root.js:not(.no-gl) .pin .copy {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 96px var(--pad) calc(var(--bar-h) + 16px);
  background: linear-gradient(to bottom, transparent, var(--paper) 96px);
}
:root.js:not(.no-gl) .copy { transition: opacity .5s ease .12s, transform .5s ease .12s; }
:root.js:not(.no-gl) .beat:not(.is-in) .copy { opacity: 0; transform: translateY(12px); transition: opacity .22s ease, transform .22s ease; }
:root.js:not(.no-gl) .beat:not(.is-in) .copy * { pointer-events: none; }

@supports not (height: 1svh) {
  :root.js:not(.no-gl) .beat { height: 120vh; }
  :root.js:not(.no-gl) #s0 { height: 100vh; }
  :root.js:not(.no-gl) #s2 { height: 140vh; }
  :root.js:not(.no-gl) #s3 { height: 150vh; }
  .beat--hero { min-height: 100vh; }
}

/* hero */
.beat--hero { display: flex; flex-direction: column; min-height: 100svh; padding-top: var(--chrome); overflow: clip; }
.zone { position: relative; z-index: 0; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; transition: opacity .6s ease, visibility 0s linear .6s; }
.zone::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 50%; width: 120lvh; height: 100lvh; max-width: 200vw;
  transform: translate(-50%, -45%); background: radial-gradient(closest-side, #fff, rgba(255, 255, 255, 0)); pointer-events: none;
}
.poster { height: min(100%, 48.4lvh); width: auto; max-width: 100%; aspect-ratio: 90 / 132; }
.gl .zone { opacity: 0; visibility: hidden; }
/* context lost: the drawn bottle covers for the canvas until it is restored */
.gl.gl-lost .zone { opacity: 1; visibility: visible; transition: none; }
.gl.gl-lost .stage { opacity: 0; transition: none; }
.print text { fill: var(--print); fill-opacity: .92; }
.print path { stroke: var(--print); }
.print .p-top { fill: #1B1A17; }
.p-word { font-family: var(--f-body); font-weight: 500; }
.p-num { font-family: var(--f-display); font-weight: 300; }
.p-name { font-family: var(--f-display); font-style: italic; font-weight: 400; }
.p-mono { font-family: var(--f-mono); }
.p-ingr text { font-family: var(--f-body); font-size: 2.7px; }
.hero-copy { position: relative; z-index: 1; margin-top: auto; padding: 0 var(--pad) calc(var(--bar-h) + 16px); }
.buy-row, .cue { display: none; }
/* short phones drop the sub (it repeats in S5). Keyed to svh, not a height query:
   iOS Safari re-evaluates height queries as its toolbar hides, which popped the sub in mid-scroll */
.sub { overflow: hidden; max-height: clamp(0px, (100svh - 699.5px) * 999, 12em); margin-top: clamp(0px, (100svh - 699.5px) * 999, 12px); }
@supports not (height: 1svh) { @media (max-height: 699px) { .sub { display: none; } } }

/* S4 and S5 on phones: the bottle owns the top, then a solid paper panel scrolls up over it */
@media (max-width: 767.98px) and (orientation: portrait), (max-width: 559.98px) {
  :root.js:not(.no-gl) .beat--flow { height: auto; min-height: 120svh; padding-top: 52svh; }
  /* window measured in the canvas's own unit (lvh), so it always clears the bottle (base at 46lvh) */
  :root.js:not(.no-gl) #s5 { min-height: 100svh; padding-top: 42svh; padding-top: 50lvh; }
  /* S4's panel ends here: fade it out instead of a hard paper edge across the bottle */
  :root.js:not(.no-gl) #s5::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 64px;
    background: linear-gradient(to bottom, var(--paper), transparent); pointer-events: none;
  }
  :root.js:not(.no-gl) .beat.beat--flow .copy { position: static; opacity: 1; transform: none; padding-bottom: 56px; }
  :root.js:not(.no-gl) .beat.beat--flow .copy * { pointer-events: auto; }
  :root.js:not(.no-gl) #s5 .copy { padding-bottom: 72px; }
  /* the hero copy is in normal flow under a bottle that stays put: it goes at once when scrolling starts (page.js) */
  :root.js:not(.no-gl) .beat--hero:not(.is-in) .copy { transform: none; transition: opacity .12s linear; }
  /* S3 on phones: the scroll lifts the dropper and a tap on the bulb does too, so the button's 74 px goes to the bottle */
  :root.js:not(.no-gl) #s3 .js-dropper { display: none; }
  :root.js:not(.no-gl) #s3 .pin .copy { padding-top: 64px; background: linear-gradient(to bottom, transparent, var(--paper) 64px); }
}

/* ---------- bottle controls ---------- */
.ctl {
  position: fixed; z-index: 3; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(var(--bar-h) + 12px);
  display: flex; gap: 8px; padding: 4px; border-radius: 26px; background: var(--paper);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.ctl:focus-within { opacity: 1; pointer-events: auto; }
.ctl__b {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  color: rgba(27, 26, 23, .6); border: 1px solid rgba(27, 26, 23, .22); transition: color .2s ease, border-color .2s ease;
}
.ctl__b svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.ctl__b:hover, .ctl__b:focus-visible, .ctl__b.is-on { color: var(--ink); border-color: var(--ink); }
:root:is(.no-js, .no-gl) .gl-only { display: none !important; }
.gl-wait .gl-only { visibility: hidden; }

/* ---------- phone bar ---------- */
.bar {
  position: fixed; z-index: 5; left: 0; right: 0; bottom: 0;
  height: var(--bar-h); padding: 0 var(--pad) var(--safe-b);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--paper); border-top: 1px solid var(--line);
  transition: transform .3s ease, visibility 0s linear 0s;
}
.bar-off .bar { transform: translateY(100%); visibility: hidden; transition: transform .3s ease, visibility 0s linear .3s; }
.no-js .bar, .no-js .chips { display: none; }   /* without JS the one working picker is the list in section 5 */

/* ---------- footer ---------- */
.foot {
  position: relative; z-index: 4; background: var(--paper); border-top: 1px solid var(--line);
  padding: 56px var(--pad) calc(56px + var(--safe-b));
}
.foot__lead { font: 300 clamp(26px, 3.4vw, 44px)/1.08 var(--f-display); letter-spacing: -.015em; max-width: 20ch; }
.foot__body { margin-top: 18px; max-width: 46ch; color: var(--ink-soft); }
.foot__cta { margin-top: 26px; }
.foot__cta a { font-weight: 500; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 5px; display: inline-block; padding: 12px 0; }
.foot__small { font: 400 12px/1.5 var(--f-mono); color: var(--ink-soft); margin-top: 18px; }
.foot__small a { text-underline-offset: 3px; }

/* ---------- bag dialog ---------- */
.bag {
  width: 100%; max-width: 100%; max-height: 85svh; margin: auto 0 0; padding: 24px var(--pad) calc(18px + var(--safe-b));
  border: 0; border-radius: 16px 16px 0 0; background: var(--surface); color: var(--ink); overflow: auto;
}
.bag::backdrop { background: rgba(27, 26, 23, .35); }
.bag[open] { animation: bag-in .28s ease; }
@keyframes bag-in { from { opacity: 0; transform: translateY(16px); } }
.bag__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.bag__h { font: 300 30px/1.08 var(--f-display); letter-spacing: -.015em; text-wrap: balance; }
.bag__h:focus-visible { outline: none; }
.bag__x { width: 44px; height: 44px; margin: -8px -10px 0 0; display: grid; place-items: center; border-radius: 50%; flex: none; }
.bag__x svg { fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; }
.bag__lines { margin-top: 14px; }
.bag__line { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.bag__line .sw { width: 28px; height: 28px; grid-row: span 2; }
.bag__name { font-weight: 500; }
.bag__name small { font: 400 12px/1 var(--f-mono); color: var(--ink-soft); margin-left: 8px; }
.bag__line .price { text-align: right; }
.bag__tools { display: flex; align-items: center; gap: 4px; }
.step { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.step span { width: 28px; height: 28px; border: 1px solid rgba(27, 26, 23, .4); border-radius: 50%; display: grid; place-items: center; font: 400 16px/1 var(--f-mono); }
.bag__qty { min-width: 2ch; text-align: center; font: 400 15px/1 var(--f-mono); font-variant-numeric: tabular-nums; }
.bag__rm { font: 400 12px/1 var(--f-mono); color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; min-height: 44px; padding: 0 2px; justify-self: end; }
.bag__empty { margin: 18px 0 8px; color: var(--ink-soft); }
.bag__sub { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 0 18px; border-top: 1px solid var(--line); font-weight: 500; }
.bag__p { margin: 14px 0 22px; max-width: 44ch; }
.bag .btn--ghost { margin-top: 10px; }
.bag__foot { font: 400 12px/1.4 var(--f-mono); letter-spacing: .04em; color: var(--ink-soft); text-align: center; margin-top: 18px; }
.bag [hidden] { display: none !important; }

/* ---------- between phone and desktop (tablets, landscape phones): bottle left, copy right ---------- */
@media (min-width: 768px) and (max-width: 1023.98px), (orientation: landscape) and (min-width: 560px) and (max-width: 1023.98px) {
  :root { --pad: max(28px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); }
  h1 { font-size: clamp(34px, min(6vw, 11svh), 64px); }
  .beat--hero { display: block; height: 100svh; padding: 0; }
  .zone { position: absolute; left: 25%; top: 50lvh; height: calc(min(62lvh, 720px) * 1.1); aspect-ratio: 90 / 132; transform: translate(-50%, -50%); }
  .poster { height: 100%; }
  .hero-copy { position: absolute; left: 46%; right: 0; top: var(--chrome); bottom: var(--bar-h); display: flex; flex-direction: column; justify-content: center; padding: 0 var(--pad) 0 0; }
  :root.js:not(.no-gl) .pin .copy { left: 46%; right: var(--pad); bottom: auto; top: calc(50% + (var(--chrome) - var(--bar-h)) / 2); padding: 0; background: none; }
  :root.js:not(.no-gl) .pin .copy__in { transform: translateY(-50%); }
  :root.js:not(.no-gl) .beat--flow { height: auto; min-height: 120svh; padding: calc(var(--chrome) + 32px) 0 calc(var(--bar-h) + 48px); display: flex; align-items: center; }
  :root.js:not(.no-gl) #s5 { min-height: 100svh; }
  :root.js:not(.no-gl) .beat--flow .pin { width: 100%; }
  :root.js:not(.no-gl) .beat.beat--flow .copy { position: static; margin-left: 46%; padding-right: var(--pad); }
  :root.js:not(.no-gl) .beat.beat--flow .copy__in { transform: none; }
}
/* portrait tablets: the bottle is wide relative to the page, give it more room */
@media (min-width: 768px) and (max-width: 1023.98px) and (orientation: portrait) {
  :root.js:not(.no-gl) .pin .copy { left: 52%; }
}
/* very short screens (landscape phones, heavy zoom): nothing is pinned, copy scrolls with its section */
@media (max-height: 559.98px) and (min-width: 560px) and (max-width: 1023.98px) {
  :root.js:not(.no-gl) .beat { display: flex; align-items: center; }
  :root.js:not(.no-gl) .beat--hero { display: block; }
  :root.js:not(.no-gl) .pin { width: 100%; }
  :root.js:not(.no-gl) .beat .pin .copy { position: static; margin-left: 46%; padding: 0 var(--pad) 0 0; background: none; opacity: 1; transform: none; }
  :root.js:not(.no-gl) .beat .pin .copy * { pointer-events: auto; }
  :root.js:not(.no-gl) .beat .pin .copy__in { transform: none; }
}
/* short AND narrow (heavy zoom, e.g. 320x256): sections 1-3 stop pinning too; copy scrolls up over the bottle on its paper fade, like S4/S5 */
@media (max-height: 559.98px) and (max-width: 559.98px) {
  :root.js:not(.no-gl) :is(#s1, #s2, #s3) { height: auto; min-height: 120svh; padding-top: 52svh; }
  :root.js:not(.no-gl) .beat .pin .copy { position: static; opacity: 1; transform: none; padding-bottom: 56px; }
  :root.js:not(.no-gl) .beat .pin .copy * { pointer-events: auto; }
}

/* ---------- desktop ---------- */
@media (min-width: 1024px) {
  :root {
    --head-h: 64px; --pad: 48px; --bar-h: 0px;
    --edge: max(48px, calc((100vw - 1440px) / 2 + 48px));
    --col: calc((min(100vw, 1440px) - 96px - 352px) / 12);
  }
  body { font-size: 17px; line-height: 1.55; }
  h1 { font-size: clamp(40px, min(6vw, 10.5svh), 104px); }
  .head { padding: 0 var(--edge); }
  .bar { display: none; }
  .ingr__n { font-size: 24px; }

  .beat--hero { display: block; height: 100svh; padding: 0; }
  .zone { position: absolute; left: 50%; top: 47lvh; height: calc(var(--hb) * 1.1); aspect-ratio: 90 / 132; transform: translate(-50%, -50%); }
  .poster { height: 100%; }
  .hero-copy { position: static; padding: 0; }
  .hero-copy .copy__in { position: absolute; left: var(--edge); bottom: 56px; width: calc(5 * var(--col) + 128px); }
  .hint--drag { position: absolute; left: 50%; top: calc(47lvh + var(--hb) / 2 + 72px); transform: translateX(-50%); margin: 0; white-space: nowrap; }
  .buy-row { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; position: absolute; right: var(--edge); bottom: 56px; transition: opacity .5s ease; }
  .cue {
    display: block; position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
    font: 400 12px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft);
    transition: opacity .4s ease;
  }
  .cue::after { content: ""; display: block; width: 1px; height: 18px; margin: 8px auto 0; background: currentColor; opacity: .6; }
  .has-scrolled .cue { opacity: 0; }
  :root.js:not(.no-gl) .beat--hero:not(.is-in) .buy-row { opacity: 0; pointer-events: none; }
  .sub { max-height: none; margin-top: 12px; }
  @media (max-height: 699px) { .sub { display: block; } .hint--drag { display: none; } }

  :root.js:not(.no-gl) .pin .copy { right: auto; bottom: auto; top: calc(50% + 24px); padding: 0; background: none; }
  :root.js:not(.no-gl) .pin .copy__in { transform: translateY(-50%); }
  :root.js:not(.no-gl) .beat--left .copy { left: calc(var(--edge) + var(--col) + 32px); width: calc(4 * var(--col) + 96px); max-width: 420px; }
  :root.js:not(.no-gl) .beat--right .copy { left: calc(var(--edge) + 6 * (var(--col) + 32px)); width: calc(5 * var(--col) + 128px); max-width: 520px; }
  :root.js:not(.no-gl) #s5 .copy { max-width: 460px; }
  :root.js:not(.no-gl) #s5 { height: 100svh; }

  .ctl { opacity: 1; pointer-events: auto; padding: 0; background: none; right: var(--edge); bottom: 32px; animation: ctl-c .4s ease; }
  .ctl__b { width: 40px; height: 40px; }
  [data-beat="0"] .ctl { right: auto; bottom: auto; left: 50%; top: calc(47lvh + var(--hb) / 2 + 18px); transform: translateX(-50%); animation-name: ctl-a; }
  [data-beat="5"] .ctl { right: auto; bottom: auto; left: 34%; top: calc(50lvh + min(29lvh, 337px) + 18px); transform: translateX(-50%); animation-name: ctl-b; }
  .at-foot .ctl { opacity: 0; pointer-events: none; }

  .foot { padding: 88px var(--edge) 72px; }

  .bag { width: 420px; max-width: calc(100vw - 32px); margin: auto; padding: 28px; border-radius: 14px; }
}
@keyframes ctl-a { from { opacity: 0; } }
@keyframes ctl-b { from { opacity: 0; } }
@keyframes ctl-c { from { opacity: 0; } }

/* short desktop windows: the two long panels scroll instead of pinning */
@media (min-width: 1024px) and (max-height: 719.98px) {
  :root.js:not(.no-gl) .beat--flow, :root.js:not(.no-gl) #s5 { height: auto; min-height: 120svh; padding: 120px 0 80px; display: flex; align-items: center; }
  :root.js:not(.no-gl) .beat--flow .pin { width: 100%; }
  :root.js:not(.no-gl) .beat.beat--flow .copy { position: static; margin-left: calc(var(--edge) + 6 * (var(--col) + 32px)); opacity: 1; transform: none; }
  :root.js:not(.no-gl) .beat.beat--flow .copy * { pointer-events: auto; }
  :root.js:not(.no-gl) .beat.beat--flow .copy__in { transform: none; }
}

/* ---------- no WebGL or no JavaScript: a complete page with drawn figures ---------- */
:root:is(.no-js, .no-gl) .beat { padding: 56px var(--pad); }
:root:is(.no-js, .no-gl) .beat--hero { padding: var(--chrome) 0 0; min-height: 0; }
:root:is(.no-js, .no-gl) .zone { flex: none; height: 56svh; min-height: 320px; padding: 8px 0; }
:root:is(.no-js, .no-gl) .poster { height: 100%; }
:root:is(.no-js, .no-gl) .hero-copy { padding-bottom: 40px; }
:root:is(.no-js, .no-gl) .fig { display: block; margin: 0 auto 28px; }
:root:is(.no-js, .no-gl) .fig svg { width: auto; height: min(46svh, 420px); max-width: 100%; margin: 0 auto; }
:root:is(.no-js, .no-gl) .fig--base svg { height: min(30svh, 260px); -webkit-mask-image: linear-gradient(to bottom, transparent, #000 45%); mask-image: linear-gradient(to bottom, transparent, #000 45%); }
:root:is(.no-js, .no-gl) .fig--dropper svg { height: min(60svh, 520px); }
/* tablets and landscape phones: the poster sits in the free band between the header and the bar */
@media (min-width: 768px) and (max-width: 1023.98px), (orientation: landscape) and (min-width: 560px) and (max-width: 1023.98px) {
  :root:is(.no-js, .no-gl) .zone {
    top: calc(var(--chrome) + (100svh - var(--chrome) - var(--bar-h)) / 2);
    height: min(calc(min(62lvh, 720px) * 1.1), calc(100svh - var(--chrome) - var(--bar-h) - 8px));
    min-height: 0; padding: 0;
  }
}
@media (min-width: 1024px) {
  :root:is(.no-js, .no-gl) .beat { padding: 96px var(--edge); }
  :root:is(.no-js, .no-gl) .beat--hero { padding: 0; height: auto; min-height: 100svh; }
  :root:is(.no-js, .no-gl) .zone { height: calc(var(--hb) * 1.1); min-height: 0; padding: 0; }
  :root:is(.no-js, .no-gl) .pin { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; max-width: 1344px; margin: 0 auto; }
  :root:is(.no-js, .no-gl) .fig { margin: 0; }
  :root:is(.no-js, .no-gl) .beat--left .fig { order: 2; }
  :root:is(.no-js, .no-gl) .beat--left .copy { justify-self: end; width: 100%; max-width: 440px; }
  :root:is(.no-js, .no-gl) .beat--right .copy { max-width: 520px; }
  :root:is(.no-js, .no-gl) #s2 .pin { grid-template-columns: 1fr; justify-items: center; }
  :root:is(.no-js, .no-gl) #s2 .copy { justify-self: center; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  :root { transition: --paper .2s linear, --accent .2s linear; }
  html { scroll-behavior: auto; }
  .stage, .zone { transition-duration: .2s; }
  :root.js:not(.no-gl) .copy { transition: opacity .2s linear; }
  :root.js:not(.no-gl) .beat:not(.is-in) .copy { transform: none; }
  .bag[open], .ctl, [data-beat] .ctl { animation: none; }
  .bar, .bar-off .bar { transition: none; }
  .btn:active { transform: none; }
  .stage.is-blink { animation: blink .2s linear; }
}
@keyframes blink { from { opacity: 0; } }

@media (forced-colors: active) {
  .btn, .ctl__b, .bag, .sw { border: 1px solid ButtonText; }
  .sw { forced-color-adjust: none; }
}
@media print {
  .stage, .bar, .ctl, .cue, .hint { display: none !important; }
}
