/* Glyssn home page, direction A "Chapters" (Claude Design canvas
   "Glyssn Website Redesign", 2026-11-09). Editorial plates numbered
   00–05; the coral scan line is the page turn. Same-origin only: fonts,
   images, this file and home.js. Without JS everything is visible; with
   JS each chapter wipes in behind a scan line the first time it arrives,
   the rail tracks where you are, and 03's lenses fill the chapter.
   Scroll-linked motion uses CSS view timelines where the browser has
   them and is simply absent where it doesn't. All motion stops under
   prefers-reduced-motion. */

@font-face { font-family: "Space Grotesk"; src: url("/fonts/SpaceGrotesk-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/SpaceGrotesk-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/SpaceGrotesk-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/SpaceGrotesk-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/JetBrainsMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/JetBrainsMono-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }

@view-transition { navigation: auto; }

:root {
  --paper: #F3EEE6;
  --white: #FFFFFF;
  --ink: #0F1419;
  --ink-2: #3A4046;          /* body on paper, 9.6:1 */
  --ink-3: #4A5056;          /* small mono on paper, 7.4:1 */
  --coral: #FF6B5E;
  --coral-ink: #C2412F;      /* coral text on paper, 4.7:1 */
  --teal: #2D6A7A;
  --sky: #A9D3EA;
  --on-ink: rgba(243,238,230,.74);
  --line: rgba(15,20,25,.12);
  --line-ink: rgba(243,238,230,.14);
  --fd: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --fm: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1320px;
  --bar: 68px;
  --rail-room: 96px;         /* space kept clear of the floating rail */
  --ease: cubic-bezier(.6, 0, .2, 1);
  --cycle: 8s;               /* hero loop: 6 s sweep + 2 s rest */
  --sweep: 6s;
  --beat4: 2.553s;           /* one bar at 94 BPM, the hero's tempo */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--fd); font-size: 17px; line-height: 1.6; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* ── Bar: brand and status. It tucks away while you read down and
      comes back the moment you scroll up. ── */
.bar {
  position: sticky; top: 0; z-index: 50; height: var(--bar);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--gutter);
  background: rgba(243,238,230,.86); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: background-color .4s ease, color .4s ease, border-color .4s ease, translate .5s var(--ease);
}
.bar.tuck { translate: 0 -100%; }
.bar.on-ink { background: rgba(15,20,25,.84); color: var(--paper); border-color: var(--line-ink); }
.bar.on-coral { background: rgba(255,107,94,.9); border-color: rgba(15,20,25,.16); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand svg { width: 26px; height: 26px; transition: transform .5s var(--ease); }
.brand:hover svg { transform: rotate(90deg); }
.brand span { font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.status { display: flex; align-items: center; gap: 8px; font-family: var(--fm); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.bar.on-coral .status .dot { background: var(--ink); }

/* ── Floating rail ── */
.rail {
  --rail-bg: var(--paper);
  position: fixed; z-index: 60; left: 20px; top: 50%; translate: 0 -50%;
  display: flex; flex-direction: column; gap: 10px; padding: 8px;
  border-radius: 999px; background: var(--rail-bg); color: var(--ink);
  border: 1px solid var(--line); box-shadow: 0 12px 34px rgba(15,20,25,.12);
  font-family: var(--fm); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  transition: background-color .45s ease, color .45s ease, border-color .45s ease, opacity .5s var(--ease), translate .5s var(--ease);
}
.rail.on-ink { --rail-bg: var(--ink); color: var(--paper); border-color: var(--line-ink); }
.rail.on-coral { --rail-bg: var(--coral); border-color: rgba(15,20,25,.2); }
.rail.on-sky { --rail-bg: var(--sky); }
.rail a {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; text-decoration: none;
  background: var(--rail-bg); transition: background-color .35s ease, color .35s ease, scale .35s var(--ease);
}
.rail a:hover { scale: 1.08; }
.rail a[aria-current="true"] { background: var(--ink); color: var(--paper); }
.rail a[aria-current="true"] .n { color: var(--coral); }
.rail.on-ink a[aria-current="true"] { background: var(--paper); color: var(--ink); }
.rail.on-ink a[aria-current="true"] .n { color: var(--coral-ink); }
.rail .t {
  position: absolute; left: calc(100% + 14px); top: 50%; translate: -8px -50%;
  padding: 7px 12px; border-radius: 999px; background: var(--ink); color: var(--paper);
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .3s ease, translate .4s var(--ease);
}
.rail a:hover .t, .rail a:focus-visible .t, .rail a.flash .t { opacity: 1; translate: 0 -50%; }
.rail .track { position: absolute; left: 50%; top: 27px; bottom: 27px; width: 2px; margin-left: -1px; background: rgba(127,127,127,.28); }
.rail .track i { position: absolute; inset: 0; background: var(--coral); transform-origin: top center; transform: scaleY(var(--p, 0)); }
.rail.on-coral .track i { background: var(--ink); }

/* ── Plates ── */
.plate { position: relative; padding: clamp(88px, 11vw, 136px) 0; overflow-x: clip; background: var(--paper); }
.chapter { border-top: 1px solid var(--line); container-type: inline-size; }
.ink { background: var(--ink); color: var(--paper); border-top-color: var(--ink); }
.coral { background: var(--coral); color: var(--ink); border-top-color: var(--coral); }
.sky { background: var(--sky); color: var(--ink); border-top-color: var(--sky); }
.label { font-family: var(--fm); font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--coral-ink); margin-bottom: 12px; }
.ink .label { color: var(--coral); }
.coral .label, .sky .label { color: var(--ink); }
h2 { font-size: clamp(40px, 5.2vw, 76px); font-weight: 700; line-height: .95; letter-spacing: -.04em; }
.chap-head { display: flex; align-items: flex-end; gap: clamp(16px, 2.5vw, 36px); flex-wrap: wrap; margin-bottom: clamp(44px, 5vw, 72px); }
.chap-head .num { font-size: clamp(120px, 16vw, 230px); font-weight: 700; line-height: .74; letter-spacing: -.065em; }
.chap-head > div { padding-bottom: 6px; }
#play .num { color: var(--sky); }
#hear .num { color: var(--coral); }
#voices .num { color: var(--paper); }
#keep .num { color: var(--teal); }
#ideas .num { color: var(--paper); }

/* ── 00 Hero ── */
.hero { padding-top: clamp(40px, 5vw, 64px); overflow: hidden; }
.ghost { position: absolute; right: -24px; top: 24px; font-size: clamp(200px, 30vw, 440px); font-weight: 700; line-height: .8; letter-spacing: -.07em; color: rgba(15,20,25,.045); pointer-events: none; }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(32px, 4vw, 64px); align-items: end; }
.hero-copy { display: flex; flex-direction: column; gap: 28px; padding-bottom: 8px; }
.eyebrow { font-family: var(--fm); font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--coral-ink); }
h1 { font-size: clamp(50px, 7.2vw, 118px); font-weight: 700; line-height: .88; letter-spacing: -.05em; text-wrap: balance; }
.lede { max-width: 500px; font-size: 19px; line-height: 1.55; color: var(--ink-2); }
.ctas { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 16px 28px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-weight: 600; font-size: 15px; text-decoration: none;
  transition: transform .3s var(--ease), background-color .3s ease;
}
.btn span { transition: transform .3s var(--ease); }
.btn:hover { background: #1d252c; }
.btn:hover span { transform: translateX(4px); }
.fine { font-family: var(--fm); font-size: 12px; color: var(--ink-3); }

.frame { display: flex; flex-direction: column; gap: 12px; }
.screen { position: relative; aspect-ratio: 4 / 5; border-radius: 6px; overflow: hidden; background: #1A3A4A; container-type: inline-size; }
.media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame figcaption { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--fm); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }

/* the app's overlay: boxes light as the line reaches them (delay = x% of the sweep) */
.zone {
  position: absolute; left: calc(var(--x) * 1%); border: 1px solid rgba(255,255,255,.92);
  --d: calc(var(--x) * var(--sweep) / 100);
  animation: lit var(--cycle) ease-out var(--d) infinite backwards;
}
.zone::after { content: ""; position: absolute; inset: -6px; border: 1px solid var(--coral); opacity: 0; animation: ring var(--cycle) ease-out var(--d) infinite backwards; }
.zone.hot { border-color: var(--coral); }
.tag { position: absolute; bottom: calc(100% + 6px); left: -1px; white-space: nowrap; font-family: var(--fm); font-size: 10px; font-weight: 600; padding: 3px 7px; border-radius: 3px; background: rgba(15,20,25,.76); color: #fff; }
.zone.hot .tag { background: var(--coral); color: var(--ink); }
.z1 { --x: 14; top: 22%; width: 26%; height: 15%; }
.z2 { --x: 50; top: 46%; width: 32%; height: 14%; }
.z3 { --x: 28; top: 72%; width: 22%; height: 12%; }
.sweep { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.sweep i { position: absolute; top: 0; left: 0; width: 2px; height: 100%; background: var(--coral); box-shadow: 0 0 18px var(--coral), 0 0 40px rgba(255,107,94,.5); animation: sweep var(--cycle) linear infinite; }
.readout { position: absolute; left: 14px; bottom: 14px; padding: 8px 12px; border-radius: 8px; background: rgba(15,20,25,.72); color: #fff; font-family: var(--fm); font-size: 12px; }
.readout b { color: var(--coral); font-weight: 600; }

/* ── 01 Play ── */
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.mode { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 210px); gap: 28px; align-items: end; padding: clamp(24px, 3vw, 36px); background: var(--white); border-radius: 6px; transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.mode:hover { transform: translateY(-6px); box-shadow: 0 30px 60px rgba(15,20,25,.12); }
.mode.dark { background: var(--ink); color: var(--paper); }
.mode-copy { display: flex; flex-direction: column; gap: 12px; }
.slash { font-family: var(--fm); font-size: 12px; color: var(--coral-ink); }
.mode.dark .slash { color: var(--coral); }
.mode h3 { font-size: clamp(26px, 2.6vw, 34px); font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.mode-copy p:last-child { font-size: 16px; color: var(--ink-2); }
.mode.dark .mode-copy p:last-child { color: var(--on-ink); }
.mode img { border-radius: 22px; box-shadow: 0 20px 50px rgba(15,20,25,.18); }

/* ── 02 Hear ── */
.score { counter-reset: s; }
.score li { display: grid; grid-template-columns: 130px minmax(0, 1fr) minmax(170px, 230px) minmax(0, 1.25fr); gap: clamp(16px, 2.4vw, 32px); align-items: center; padding: 26px 0; border-top: 1px solid var(--line-ink); }
.score li:last-child { border-bottom: 1px solid var(--line-ink); }
.score .in { font-family: var(--fm); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--on-ink); }
.score .out { font-size: clamp(32px, 3.4vw, 46px); font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.score .desc { font-size: 15px; line-height: 1.55; color: var(--on-ink); }
.sw { display: block; height: 10px; border-radius: 5px; position: relative; overflow: hidden; transform-origin: left center; }
.sw-hue { background: linear-gradient(90deg, #FF6B5E, #FFE566, #6BFF9E, #5EC3FF, #B36BFF, #FF6B5E); }
.sw-light { background: linear-gradient(90deg, #0d111a, #F8F6F0); outline: 1px solid var(--line-ink); }
.sw-motion i { position: absolute; inset: 0 0 0 -9px; background: repeating-linear-gradient(90deg, var(--coral) 0 3px, transparent 3px 9px); animation: drift 1.1s linear infinite; }
.sw-sat { background: linear-gradient(90deg, #8a8a8a, #FF6B5E); }
.sw-depth { background: linear-gradient(90deg, #F2EEE8, #8FA6B3 55%, #1A3A4A); }
.score-note { max-width: 640px; margin-top: 40px; font-size: 18px; line-height: 1.6; color: var(--paper); }

/* ── 03 Voices and lenses ── */
#voices { transition: color .6s ease; }
#voices > .wrap { position: relative; z-index: 1; }
.voices { display: flex; flex-wrap: wrap; column-gap: clamp(20px, 3vw, 44px); row-gap: 2px; font-size: clamp(44px, 6.4vw, 96px); font-weight: 700; letter-spacing: -.045em; line-height: 1.04; }
.voices li { display: inline-flex; align-items: baseline; gap: 10px; transition: transform .4s var(--ease); }
.voices small { font-family: var(--fm); font-size: 12px; font-weight: 400; letter-spacing: 0; opacity: .78; }
.voices li:hover { transform: translateX(6px); }
.voices-note { max-width: 620px; margin-top: 36px; font-size: 17px; line-height: 1.6; }
.lens-hint { display: none; }
.js .lens-hint { display: block; margin-top: 44px; font-family: var(--fm); font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.lenses { display: grid; grid-template-columns: repeat(6, minmax(0, 120px)); gap: 14px; margin-top: 48px; }
.js .lens-hint + .lenses { margin-top: 16px; }
.lens { appearance: none; display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.lens img { width: 100%; aspect-ratio: 100 / 134; object-fit: cover; border-radius: 10px; box-shadow: 0 14px 30px rgba(15,20,25,.22); transition: transform .4s var(--ease), outline-color .3s ease; outline: 2px solid transparent; outline-offset: 3px; }
.lens:hover img { transform: translateY(-6px) rotate(-1.5deg); }
.lens[aria-pressed="true"] img { transform: translateY(-8px); outline-color: currentColor; }
.lens span { font-family: var(--fm); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.lens[aria-pressed="true"] span::before { content: "● "; color: var(--coral); }

/* the lens stage: each press adds a layer that fills out from the tile */
.lens-stage { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; opacity: var(--lens-o, 1); transition: opacity .25s linear; }
.lens-stage.leaving { opacity: 0; transition-duration: .6s; }
.lens-layer { position: absolute; inset: 0; background: #0F1419; clip-path: circle(0 at var(--cx, 50%) var(--cy, 50%)); transition: clip-path 1.1s var(--ease); }
.lens-layer.full { clip-path: circle(150vmax at var(--cx, 50%) var(--cy, 50%)); }
.lens-layer .kb { position: absolute; inset: -5%; animation: drift-bg 18s ease-in-out infinite alternate; will-change: transform; }
.lens-layer .kb img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.lens-layer .kb::after { content: ""; position: absolute; inset: 0; }
.lens-layer::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15,20,25,.72), rgba(15,20,25,.56) 50%, rgba(15,20,25,.22)); }
.lens-layer .scan { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; z-index: 1; background: var(--coral); box-shadow: 0 0 16px var(--coral), 0 0 40px rgba(255,107,94,.5); animation: sweep-wide 7s linear infinite; }
.lens-layer[data-lens="trace"] .kb img { filter: url(#f-trace); }
.lens-layer[data-lens="dither"] .kb img { filter: url(#f-dither); }
.lens-layer[data-lens="dither"] .kb::after { background: radial-gradient(circle, rgba(15,20,25,.6) 1.1px, transparent 1.7px) 0 0 / 5px 5px; mix-blend-mode: multiply; }
.lens-layer[data-lens="vapor"] .kb img { filter: url(#f-vapor); }
.lens-layer[data-lens="riso"] .kb img { filter: url(#f-riso); }
.lens-layer[data-lens="riso"] .kb::after { background: repeating-linear-gradient(90deg, rgba(255,107,94,.38) 0 7px, transparent 7px 15px), repeating-linear-gradient(0deg, rgba(255,107,94,.3) 0 5px, transparent 5px 13px); mix-blend-mode: multiply; }
.lens-layer[data-lens="thermal"] .kb img { filter: url(#f-thermal); }
#voices.lensing { color: var(--paper); }
#voices.lensing .label { color: var(--coral); }
#voices.lensing .lens[aria-pressed="true"] span::before { color: var(--coral); }

/* ── 04 Keep ── */
.keep-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(40px, 5vw, 72px); align-items: center; }
.stems { display: flex; flex-direction: column; gap: 14px; }
.stems p { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 20px; align-items: center; }
.stems span { font-family: var(--fm); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.stems i { display: block; height: 34px; transform-origin: left center; }
.s-melody i { background: repeating-linear-gradient(90deg, var(--coral) 0 5px, transparent 5px 9px); }
.s-pads i { background: repeating-linear-gradient(90deg, var(--teal) 0 5px, transparent 5px 8px); height: 22px; }
.s-bass i { background: repeating-linear-gradient(90deg, #1A3A4A 0 5px, transparent 5px 18px); }
.s-rhythm i { background: repeating-linear-gradient(90deg, #E8836F 0 4px, transparent 4px 26px); height: 28px; }
.s-melody span { color: var(--coral-ink); } .s-pads span { color: var(--teal); } .s-bass span { color: #1A3A4A; } .s-rhythm span { color: #A8442F; }
.keep-copy, .ideas-copy { max-width: 600px; margin-top: 36px; font-size: 18px; line-height: 1.6; color: var(--ink-2); }
.keep-copy p + p, .ideas-copy p + p { margin-top: 14px; }
.keep-copy a { color: var(--coral-ink); text-underline-offset: 3px; }
.phone { justify-self: center; width: 100%; max-width: 320px; padding: 9px; border-radius: 44px; background: var(--ink); box-shadow: 0 40px 90px rgba(15,20,25,.25); }
.phone img { border-radius: 36px; }

/* ── 05 Ideas ── */
.ideas-grid { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: clamp(40px, 5vw, 72px); align-items: center; }
.ideas-copy { color: #22303A; }
.prog { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 560px; }
.prog p { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 10px; background: rgba(255,255,255,.5); border: 1px solid rgba(15,20,25,.12); animation: chord calc(var(--beat4) * 4) ease-out infinite both; }
.prog p:nth-child(2) { animation-delay: var(--beat4); }
.prog p:nth-child(3) { animation-delay: calc(var(--beat4) * 2); }
.prog p:nth-child(4) { animation-delay: calc(var(--beat4) * 3); }
.prog b { font-size: clamp(30px, 3.4vw, 44px); font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.prog span { font-family: var(--fm); font-size: 12px; font-weight: 600; }
.prog-cap { margin-top: 12px; font-family: var(--fm); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.fine-print { font-family: var(--fm); font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--ink); }

/* ── End ── */
.listing { display: flex; align-items: center; gap: clamp(20px, 3vw, 36px); margin-bottom: clamp(48px, 6vw, 80px); }
.app-icon {
  width: clamp(112px, 15vw, 200px); height: auto; aspect-ratio: 1; border-radius: 22.5%;
  box-shadow: 0 0 0 1px rgba(243,238,230,.1), 0 30px 80px rgba(255,107,94,.22), 0 10px 40px rgba(169,211,234,.12);
  animation: bob 6s ease-in-out infinite;
}
.listing-name { font-size: clamp(30px, 3.4vw, 48px); font-weight: 700; line-height: 1; letter-spacing: -.035em; }
.listing-sub { margin-top: 10px; font-family: var(--fm); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--on-ink); }
.end h2 { font-size: clamp(56px, 9.4vw, 156px); line-height: .86; letter-spacing: -.055em; transform-origin: left bottom; }
.end em { font-style: normal; color: var(--coral); }
.end-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; margin-top: clamp(56px, 7vw, 96px); padding-top: 28px; border-top: 1px solid var(--line-ink); }
.end-row > p { max-width: 520px; font-size: 16px; color: var(--on-ink); }
.foot-links { display: flex; gap: 24px; flex-wrap: wrap; font-size: 15px; }
.foot-links a { text-decoration: none; background: linear-gradient(var(--coral), var(--coral)) left bottom / 0 1px no-repeat; transition: background-size .35s var(--ease); }
.foot-links a:hover { background-size: 100% 1px; }
.meta { margin-top: 20px; font-family: var(--fm); font-size: 11px; color: rgba(243,238,230,.58); }
.meta + .meta { margin-top: 6px; }

/* ── Page turns (only when home.js has run: html.js) ──
   A chapter's content is revealed left to right behind a coral line,
   the same gesture as the scan crossing a photo. The open state reaches
   past the box so shadows and hover lifts aren't cut off. */
.js .chapter > .wrap { clip-path: inset(-40vh -12% -40vh -50vw); transition: clip-path 1.15s var(--ease); }
.js .chapter:not(.is-in) > .wrap { clip-path: inset(-40vh 100% -40vh -50vw); }
.js .chapter::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 2px; z-index: 2;
  background: var(--coral); box-shadow: 0 0 16px var(--coral), 0 0 36px rgba(255,107,94,.45);
  opacity: 0; transform: translateX(-4px); pointer-events: none;
}
.js .coral::after { background: var(--paper); box-shadow: 0 0 16px var(--paper); }
.js .chapter.is-in::after { animation: turn 1.15s var(--ease) forwards; }
.js .chapter.is-in .sw { animation: grow 1.2s var(--ease) both; }
.js .chapter.is-in .stems i { animation: grow 1.3s var(--ease) both; }
.js .chapter.is-in .stems p:nth-child(2) i { animation-delay: .08s; }
.js .chapter.is-in .stems p:nth-child(3) i { animation-delay: .16s; }
.js .chapter.is-in .stems p:nth-child(4) i { animation-delay: .24s; }

/* ── The deck: each section slides up over the one before it. A plate
      pins once its bottom reaches the bottom of the screen (home.js sets
      --h to its height), so nothing is covered before it's been read.
      Without JS the page scrolls normally. ── */
.js .plate { position: sticky; top: min(0px, calc(100vh - var(--h, 100vh))); transform-origin: 50% max(50%, calc(100% - 50vh)); }
.js .plate::before { content: ""; position: absolute; inset: 0; z-index: 4; background: var(--ink); opacity: 0; pointer-events: none; }

/* ── Scroll-linked motion (view timelines; skipped where unsupported).
      Keyframes move translate/scale/rotate, not transform, so hover
      transforms still stack on top. ── */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .hero { view-timeline: --hero block; }
    .hero h1 { animation: out-h1 linear both; animation-timeline: --hero; animation-range: exit 0% exit 100%; }
    .hero .lede, .hero .ctas, .hero .eyebrow { animation: out-fade linear both; animation-timeline: --hero; animation-range: exit 0% exit 70%; }
    .hero .frame { animation: out-frame linear both; animation-timeline: --hero; animation-range: exit 0% exit 100%; }
    .hero .ghost { animation: out-ghost linear both; animation-timeline: --hero; animation-range: exit 0% exit 100%; }

    .chap-head .num { animation: in-num linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .chap-head .label, .chap-head h2 { animation: in-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .mode, .voices-note, .keep-copy p, .ideas-copy p, .prog, .prog-cap, .end-row { animation: in-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .mode img { animation: drift-y linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
    .score li { animation: in-slide linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .sw, .js .chapter.is-in .sw { animation: grow linear both; animation-timeline: view(); animation-range: entry 30% entry 100%; }
    .voices li { animation: in-fan linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .voices li:nth-child(odd) { --r: -3deg; } .voices li:nth-child(even) { --r: 3deg; }
    .lenses li { animation: in-fan linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .lenses li:nth-child(1) { --r: -9deg; } .lenses li:nth-child(2) { --r: 6deg; } .lenses li:nth-child(3) { --r: -4deg; }
    .lenses li:nth-child(4) { --r: 8deg; } .lenses li:nth-child(5) { --r: -6deg; } .lenses li:nth-child(6) { --r: 5deg; }
    .stems i, .js .chapter.is-in .stems i { animation: grow linear both; animation-timeline: view(); animation-range: entry 10% entry 100%; }
    .js .chapter.is-in .stems p i { animation-delay: 0s; }
    .phone { animation: in-phone linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .listing { animation: in-icon linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .end h2 { animation: in-zoom linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
  }

  /* the deck in motion: the arriving plate comes in as a card with
     rounded shoulders; the one under it sinks and dims as it's covered */
  @supports (animation-timeline: view()) and (timeline-scope: --a) {
    main { timeline-scope: --s1, --s2, --s3, --s4, --s5, --s6; }
    #play { view-timeline: --s1 block; }
    #hear { view-timeline: --s2 block; }
    #voices { view-timeline: --s3 block; }
    #keep { view-timeline: --s4 block; }
    #ideas { view-timeline: --s5 block; }
    .end { view-timeline: --s6 block; }
    .js .plate:not(.hero) { animation: card-in linear both; animation-timeline: view(); animation-range: entry 0% contain 0%; }
    .js #top, .js #play, .js #hear, .js #voices, .js #keep, .js #ideas { animation-name: sink; animation-timing-function: linear; animation-fill-mode: both; animation-range: entry 0% contain 0%; }
    .js #play, .js #hear, .js #voices, .js #keep, .js #ideas { animation-name: card-in, sink; animation-range: entry 0% contain 0%, entry 0% contain 0%; }
    .js #top { animation-timeline: --s1; }
    .js #play { animation-timeline: view(), --s2; }
    .js #hear { animation-timeline: view(), --s3; }
    .js #voices { animation-timeline: view(), --s4; }
    .js #keep { animation-timeline: view(), --s5; }
    .js #ideas { animation-timeline: view(), --s6; }
    .js #top::before { animation: veil linear both; animation-timeline: --s1; animation-range: entry 0% contain 0%; }
    .js #play::before { animation: veil linear both; animation-timeline: --s2; animation-range: entry 0% contain 0%; }
    .js #hear::before { animation: veil linear both; animation-timeline: --s3; animation-range: entry 0% contain 0%; }
    .js #voices::before { animation: veil linear both; animation-timeline: --s4; animation-range: entry 0% contain 0%; }
    .js #keep::before { animation: veil linear both; animation-timeline: --s5; animation-range: entry 0% contain 0%; }
    .js #ideas::before { animation: veil linear both; animation-timeline: --s6; animation-range: entry 0% contain 0%; }
  }
}

/* ── Keyframes ── */
@keyframes sweep { 0% { transform: translateX(-2px); } 75%, 100% { transform: translateX(100cqw); } }
@keyframes sweep-wide { 0% { transform: translateX(-2px); } 80%, 100% { transform: translateX(100cqw); } }
@keyframes lit { 0% { opacity: .35; } 3% { opacity: 1; } 70% { opacity: 1; } 80%, 100% { opacity: .35; } }
@keyframes ring { 0% { opacity: 0; transform: scale(1.18); } 3% { opacity: 1; transform: scale(1); } 22%, 100% { opacity: 0; transform: scale(1); } }
@keyframes drift { to { transform: translateX(9px); } }
@keyframes drift-bg { from { transform: scale(1.06) translate(-1.5%, 1%); } to { transform: scale(1) translate(1.5%, -1%); } }
@keyframes turn { 0% { opacity: 1; transform: translateX(0); } 88% { opacity: 1; } 100% { opacity: 0; transform: translateX(100cqw); } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes chord {
  0%, 22% { background: var(--ink); color: var(--paper); border-color: var(--ink); }
  27%, 100% { background: rgba(255,255,255,.5); color: var(--ink); border-color: rgba(15,20,25,.12); }
}
@keyframes out-h1 { to { translate: 0 -22%; opacity: .1; } }
@keyframes out-fade { to { opacity: 0; translate: 0 -24px; } }
@keyframes out-frame { to { scale: .88; rotate: -2.5deg; translate: 0 8%; opacity: .55; } }
@keyframes out-ghost { to { translate: -16% 0; } }
@keyframes in-num { from { opacity: 0; translate: -22% 0; } to { opacity: 1; translate: 0 0; } }
@keyframes in-rise { from { opacity: 0; translate: 0 56px; } to { opacity: 1; translate: 0 0; } }
@keyframes in-slide { from { opacity: 0; translate: -56px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes in-fan { from { opacity: 0; translate: 0 64px; rotate: var(--r, 0deg); } to { opacity: 1; translate: 0 0; rotate: 0deg; } }
@keyframes in-phone { from { opacity: 0; translate: 0 110px; rotate: 6deg; } to { opacity: 1; translate: 0 0; rotate: 0deg; } }
@keyframes in-zoom { from { opacity: .1; scale: .8; } to { opacity: 1; scale: 1; } }
@keyframes drift-y { from { translate: 0 28px; } to { translate: 0 -28px; } }
@keyframes card-in { from { border-radius: 36px 36px 0 0; box-shadow: 0 -30px 70px rgba(15,20,25,.28); } to { border-radius: 0; box-shadow: 0 0 0 rgba(15,20,25,0); } }
@keyframes sink { from { scale: 1; } to { scale: .94; } }
@keyframes veil { from { opacity: 0; } to { opacity: .55; } }
@keyframes bob { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -8px; rotate: -2deg; } }
@keyframes in-icon { from { opacity: 0; translate: 0 70px; scale: .86; } to { opacity: 1; translate: 0 0; scale: 1; } }

@media (prefers-reduced-motion: reduce) {
  .sweep i, .zone, .zone::after, .sw-motion i, .prog p, .lens-layer .kb, .lens-layer .scan, .app-icon { animation: none; }
  .sweep i { transform: translateX(46cqw); }
  .lens-layer .scan { display: none; }
  .prog p:nth-child(1) { background: var(--ink); color: var(--paper); }
  .js .chapter > .wrap { clip-path: none; transition: none; }
  .js .chapter::after { display: none; }
  .js .chapter.is-in .sw, .js .chapter.is-in .stems i { animation: none; }
  .mode, .btn, .btn span, .brand svg, .voices li, .lens img, .foot-links a, .bar, .rail, .rail a, .rail .t, .lens-layer, #voices { transition: none; }
}
@media print {
  .bar, .rail, .sweep, .zones, .lens-stage, .lens-hint { display: none; }
  .js .chapter > .wrap { clip-path: none; }
}

/* ── Responsive ── */
@media (min-width: 900px) {
  /* keep content clear of the rail when the column reaches the window edge */
  .wrap { padding-left: max(var(--gutter), calc(var(--rail-room) - max(0px, (100vw - var(--max)) / 2))); }
}
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .frame { max-width: 560px; }
  .modes { grid-template-columns: minmax(0, 1fr); }
  .score li { grid-template-columns: 110px minmax(0, 1fr) minmax(130px, 180px); }
  .score .desc { grid-column: 1 / -1; }
  .keep-grid, .ideas-grid { grid-template-columns: minmax(0, 1fr); }
  .ideas-grid .phone { order: 2; }
}
@media (max-width: 899px) {
  /* the rail becomes a pill floating at the bottom */
  .rail {
    left: 50%; top: auto; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); translate: -50% 0;
    flex-direction: row; gap: 2px; padding: 5px;
  }
  .rail a { width: auto; min-width: 38px; height: 38px; padding: 0 11px; border-radius: 999px; gap: 7px; }
  .rail a:hover { scale: 1; }
  .rail .t { position: static; display: none; padding: 0; background: none; color: inherit; opacity: 1; translate: none; transition: none; }
  .rail a[aria-current="true"] .t { display: inline; }
  .rail .track { left: 22px; right: 22px; top: auto; bottom: 2px; width: auto; height: 2px; margin: 0; }
  .rail .track i { transform-origin: left center; transform: scaleX(var(--p, 0)); }
  .js .rail.away { opacity: 0; translate: -50% 28px; pointer-events: none; }
  .end { padding-bottom: calc(clamp(88px, 11vw, 136px) + 40px); }
}
@media (max-width: 560px) {
  :root { --bar: 60px; }
  body { font-size: 16px; }
  .bar { gap: 12px; }
  .status { font-size: 10px; letter-spacing: .1em; }
  .mode { grid-template-columns: minmax(0, 1fr); }
  .mode img { max-width: 240px; justify-self: center; }
  .score li { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 10px; }
  .score .sw { grid-column: 1 / -1; order: -1; }
  .lenses { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .prog { gap: 6px; }
  .prog p { padding: 12px 10px; }
  .lede { font-size: 17px; }
  .ghost { display: none; }
}
