/* ============================================================
   Meteo Wave — meteowave.com
   Static, no build step, no framework.

   The page is a film. One WebGL stage and one particle canvas
   sit fixed behind fifteen sticky chapters; the living phone and
   the sun-dial are fixed above them. Chapters carry the copy;
   the stage carries the weather. See js/timeline.js.
   ============================================================ */

/* --- Fonts -------------------------------------------------- */
@font-face {
  font-family: 'Righteous';
  src: url('../fonts/righteous-latin.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212;
}
@font-face {
  font-family: 'Manrope';
  src: url('../fonts/manrope-var-latin.woff2') format('woff2');
  font-weight: 400 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212;
}

/* --- Tokens ------------------------------------------------- */
:root {
  --ink-0: #05070E;
  --ink-1: #0B1018;
  --paper: #EAF1FA;
  --mute: #AFBDCE;
  --mute-dim: #8494A8;

  --sun-1: #FFB43D;
  --sun-2: #FF7A1A;
  --cloud-blue: #6FA8F5;
  --bolt: #F5D46A;

  /* The two that chapter 10 inverts. Everything textual reads these. */
  --fg: var(--paper);
  --fg-mute: var(--mute);
  --bg: var(--ink-0);

  --line: rgba(255, 255, 255, 0.13);
  --line-soft: rgba(255, 255, 255, 0.07);
  --glass: rgba(8, 12, 21, 0.66);
  --glass-strong: rgba(6, 10, 18, 0.84);

  /* Driven by the timeline / chapters */
  --sky-top: #05070E;
  --sky-bot: #0B1120;
  --sun-x: 12vw;
  --sun-y: 88vh;
  --sun-op: 0;
  --cloud-op: 0.1;
  --storm: 0;
  --term: 0;             /* chapter 1: the dawn line across the wordmark */
  --snow-depth: 0;       /* chapter 10: snow on edges, 0..1 */

  --pad-x: clamp(1.15rem, 5vw, 4rem);
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Reset -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; background: var(--ink-0); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.6s var(--ease), color 0.6s var(--ease);
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--sun-1); outline-offset: 3px; border-radius: 4px; }

/* --- Type --------------------------------------------------- */
h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.04; font-weight: 800; letter-spacing: -0.025em; color: var(--fg); }
h1 { font-size: clamp(2.8rem, 7.5vw, 6rem); }
h2 { font-size: clamp(2rem, 5vw, 4rem); }
.h-hero { font-size: clamp(3rem, 9vw, 7.2rem); line-height: 0.98; }
p { margin: 0; }
.wordmark { font-family: 'Righteous', 'Manrope', sans-serif; font-weight: 400; letter-spacing: 0.005em; }
.wordmark-big {
  font-family: 'Righteous', 'Manrope', sans-serif;
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: clamp(0.8rem, 2vh, 1.4rem);
  /* Lit by the terminator: --term sweeps 0 → 1 across the letters. */
  background: linear-gradient(270deg,
    var(--sun-1) 0%, var(--sun-1) calc(var(--term) * 100% - 12%),
    #F5D46A calc(var(--term) * 100% - 2%),
    rgba(175, 189, 206, 0.28) calc(var(--term) * 100% + 6%), rgba(175, 189, 206, 0.28) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.eyebrow {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--sun-1); margin-bottom: clamp(0.7rem, 1.6vh, 1.1rem);
  display: flex; align-items: center; gap: 0.6rem;
}
.eyebrow::before { content: ''; width: 1.6rem; height: 1px; background: currentColor; opacity: 0.7; }
.lede { text-wrap: pretty; color: var(--fg-mute); font-size: clamp(1.02rem, 1.25vw, 1.25rem); max-width: 34ch; margin-top: clamp(0.9rem, 2vh, 1.4rem); line-height: 1.55; }
.note { color: var(--mute-dim); font-size: 0.86rem; margin-top: 0.9rem; max-width: 40ch; }
.accent {
  background: linear-gradient(100deg, var(--sun-1), var(--sun-2) 60%, #F5D46A);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pulse {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sun-1);
}
.pulse::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--sun-1); box-shadow: 0 0 0 0 rgba(255, 180, 61, 0.6); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 180, 61, 0.6); } 100% { box-shadow: 0 0 0 10px rgba(255, 180, 61, 0); } }

/* --- The stage ---------------------------------------------- */
.stage, .fx, .sky-dom {
  /* inset alone: on iOS the fixed layer then follows the visible area as the
     toolbar shows and hides; 100svh left a dark band when it collapsed */
  position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
.stage { z-index: 0; background: var(--ink-0); }
.fx { z-index: 2; }
.sky-dom { z-index: 1; overflow: hidden; }
.sky-dom .sun {
  /* moved by transform only (no layout, no repaint per frame); the soft edge
     is in the gradient itself rather than a blur filter */
  position: absolute; left: 0; top: 0;
  width: clamp(120px, 18vw, 260px); aspect-ratio: 1; border-radius: 50%;
  transform: translate3d(calc(var(--sun-x, 50vw) - 50%), calc(var(--sun-y, 50vh) - 50%), 0);
  background: radial-gradient(circle, #FFF3D6 0%, #FFE2A6 18%, var(--sun-1) 34%, rgba(255, 140, 40, 0.5) 50%, rgba(255, 122, 26, 0.16) 62%, rgba(255, 122, 26, 0) 74%);
  opacity: var(--sun-op);
  will-change: transform, opacity;
}
html.stage-lost .stage { opacity: 0; }
/* If the GPU context is gone for more than a moment (phones under memory
   pressure), the active chapter shows its rendered still instead of black. */
html.stage-fallback .ch.is-active .ch-still { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
html.stage-fallback .phone { opacity: 0 !important; }

/* --- Header ------------------------------------------------- */
.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  padding: clamp(0.7rem, 1.6vh, 1.1rem) 0;
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
/* No backdrop-filter anywhere over the stage: a blur of a canvas that redraws
   every frame is re-rendered every frame, and it was the costliest thing on
   screen while scrolling. A denser tint reads the same. */
.site-head.is-stuck { background: rgba(5, 7, 14, 0.66); border-color: var(--line-soft); }
html[data-chapter="ch14"] .site-head { opacity: 0; pointer-events: none; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 var(--pad-x); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 1.05rem; color: var(--fg); }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.head-tools { display: flex; align-items: center; gap: 0.6rem; }
.sound-toggle {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.5rem 0.8rem; border-radius: 999px; border: 1px solid var(--line);
  color: var(--fg-mute); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em;
  transition: color 0.3s, border-color 0.3s, background-color 0.3s;
}
.sound-toggle:hover { color: var(--fg); border-color: rgba(255, 255, 255, 0.28); }
.sound-toggle[data-sound="on"] { color: var(--sun-1); border-color: rgba(255, 180, 61, 0.55); background: rgba(255, 180, 61, 0.08); }
.sound-toggle .ic-on { display: none; }
.sound-toggle[data-sound="on"] .ic-on { display: block; }
.sound-toggle[data-sound="on"] .ic-off { display: none; }
.pill {
  display: inline-flex; align-items: center; padding: 0.55rem 1rem; border-radius: 999px;
  white-space: nowrap; overflow: hidden;
  background: linear-gradient(135deg, var(--sun-1), var(--sun-2)); color: #1a1206;
  font-weight: 800; font-size: 0.84rem; letter-spacing: 0.02em;
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  /* hidden = no width either, so the sound button sits at the edge */
  max-width: 0; padding-inline: 0; margin-left: -0.6rem;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), max-width 0.5s var(--ease), padding 0.5s var(--ease), margin 0.5s var(--ease);
}
html[data-chapter="ch03"] .pill, html[data-chapter="ch04"] .pill, html[data-chapter="ch05"] .pill,
html[data-chapter="ch06"] .pill, html[data-chapter="ch07"] .pill, html[data-chapter="ch08"] .pill,
html[data-chapter="ch09"] .pill, html[data-chapter="ch10"] .pill, html[data-chapter="ch11"] .pill,
html[data-chapter="ch12"] .pill, html[data-chapter="ch13"] .pill, html.is-static .pill { opacity: 1; transform: none; pointer-events: auto; max-width: 12rem; padding-inline: 1rem; margin-left: 0; }

/* --- Chapters ----------------------------------------------- */
#film { position: relative; z-index: 3; }
/* A chapter is (1 + len) viewports tall; its sticky frame holds for `len`
   viewports and then scrolls away. The next chapter starts one viewport
   early (negative margin) and stacks above, so that push is never seen and
   no scroll is dead: chapter N+1 activates the instant N's hold ends. */
.ch { position: relative; height: calc((1 + var(--len, 1)) * 100svh); margin-bottom: -100svh; z-index: var(--z, 1); }
.ch:last-of-type { margin-bottom: 0; }
.ch-stick { position: sticky; top: 0; height: 100svh; height: 100dvh; overflow: hidden; transition: opacity 0.45s var(--ease); }
.ch:not(.is-active) { pointer-events: none; }
.ch:not(.is-active) .ch-stick { opacity: 0; pointer-events: none; }
html:not(.is-static) .ch:not(.is-near) > .ch-stick { content-visibility: hidden; }
html.is-static .ch:not(.is-active), html.is-static .ch:not(.is-active) .ch-stick { opacity: 1; pointer-events: auto; }
.scene { position: absolute; inset: 0; pointer-events: none; }
.scene > * { pointer-events: auto; }
.ch-still { display: none; }

.ch-copy {
  position: absolute; z-index: 5; max-width: min(46ch, 88vw);
  padding: 0 var(--pad-x);
  will-change: opacity, transform;
}
.ch-copy.at-left { left: 0; top: 50%; transform: translateY(-50%); }
.ch-copy.at-right { right: 0; top: 50%; transform: translateY(-50%); text-align: right; }
.ch-copy.at-right .lede, .ch-copy.at-right .note { margin-left: auto; }
.ch-copy.at-center { left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; max-width: min(60ch, 90vw); }
.ch-copy.at-center .lede, .ch-copy.at-center .note { margin-left: auto; margin-right: auto; }
.ch-copy.at-top { left: 0; right: 0; top: clamp(5.5rem, 12vh, 8rem); max-width: none; }

.scroll-cue { margin-top: clamp(1.4rem, 4vh, 2.6rem); width: 26px; height: 42px; border: 2px solid rgba(234, 241, 250, 0.35); border-radius: 14px; position: relative; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; border-radius: 2px; background: var(--sun-1); transform: translateX(-50%); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { transform: translate(-50%, 0); opacity: 1; } 70% { transform: translate(-50%, 14px); opacity: 0; } 100% { opacity: 0; } }

/* Copy reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* --- Buttons ------------------------------------------------ */
.store-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: clamp(1.2rem, 3vh, 2rem); }
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 1.35rem; border-radius: 999px;
  background: rgba(14, 18, 28, 0.55); border: 1px solid var(--line);
  color: var(--fg); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.01em;
  transition: transform 0.25s var(--ease), background-color 0.25s, border-color 0.25s;
}
.btn:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.11); border-color: rgba(255, 255, 255, 0.24); }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn-primary { background: linear-gradient(135deg, var(--sun-1), var(--sun-2)); color: #1a1206; border-color: transparent; box-shadow: 0 10px 30px -10px rgba(255, 140, 40, 0.55); }
.btn-primary:hover { background: linear-gradient(135deg, #FFC15C, #FF8C3A); }
.btn-ghost { background: transparent; }

/* --- Live card + cities (chapter 13) ------------------------ */
.live-wrap {
  position: absolute; z-index: 6; right: var(--pad-x); top: 50%; transform: translateY(-50%);
  width: min(560px, 52vw); display: grid; gap: 1rem;
}
.live-card {
  background: var(--glass-strong); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 1.2rem 1.3rem;
  color: var(--paper);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7);
}
.live-head { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); }
.live-body { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.6rem; }
.live-body img { width: 64px; height: 64px; }
.live-temp { font-family: 'Righteous', 'Manrope', sans-serif; font-size: 3.2rem; line-height: 1; }
.live-temp sup { font-size: 1.2rem; vertical-align: top; margin-left: 0.15rem; color: var(--mute); }
.live-cond { font-weight: 700; margin-top: 0.3rem; }
.live-meta { color: var(--mute); font-size: 0.86rem; }
.geo-btn { margin-top: 0.9rem; width: 100%; justify-content: center; }
.live-note { color: var(--mute-dim); font-size: 0.78rem; margin-top: 0.5rem; text-align: center; }
.is-loading .live-temp, .is-loading .city-temp { opacity: 0.45; }
.is-offline .live-cond, .is-offline .city-cond { color: var(--sun-2); }

.city-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; }
.city {
  text-align: left; padding: 0.85rem 0.95rem; border-radius: var(--r-md);
  background: rgba(10, 14, 24, 0.72); border: 1px solid var(--line-soft); color: var(--paper);
  transition: transform 0.3s var(--ease), border-color 0.3s, background-color 0.3s;
}
.city:hover, .city.is-active { transform: translateY(-3px); border-color: rgba(255, 180, 61, 0.5); background: rgba(12, 18, 30, 0.85); }
.city.is-pinned { border-color: var(--sun-1); box-shadow: 0 0 0 1px var(--sun-1), 0 12px 30px -12px rgba(255, 150, 40, 0.5); }
.city-name { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); }
.city-row { display: flex; align-items: center; justify-content: space-between; margin-top: 0.3rem; }
.city-temp { font-family: 'Righteous', 'Manrope', sans-serif; font-size: 1.9rem; line-height: 1; }
.city-temp sup { font-size: 0.9rem; vertical-align: top; color: var(--mute); }
.city-row img { width: 36px; height: 36px; }
.city-cond { font-size: 0.86rem; font-weight: 700; margin-top: 0.15rem; }
.city-meta { font-size: 0.74rem; color: var(--mute-dim); }
.globe-chip { display: inline-block; margin-top: 1rem; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute-dim); border: 1px solid var(--line-soft); border-radius: 999px; padding: 0.3rem 0.7rem; }

/* --- Chapter 14 / 15 furniture ----------------------------- */
.ch-black .ch-stick { background: #000; }
.one-line { font-size: clamp(1.4rem, 3vw, 2.4rem); font-weight: 700; line-height: 1.35; color: var(--paper); letter-spacing: -0.01em; }
.one-line .live-word { color: var(--sun-1); }
.one-line .w { display: inline-block; opacity: 0; transform: translateY(0.3em); transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); }
.one-line .w.is-in { opacity: 1; transform: none; }
.pocket .icon-slot { width: clamp(120px, 16vw, 180px); aspect-ratio: 1; margin: 0 auto clamp(1rem, 3vh, 1.8rem); }
.pocket .icon-slot svg { width: 100%; height: 100%; filter: drop-shadow(0 30px 50px rgba(255, 140, 40, 0.25)); }
.credits { margin-top: clamp(1rem, 3vh, 1.6rem); display: grid; gap: 0.35rem; color: var(--mute); font-size: 0.92rem; }
.credit-k { display: inline-block; min-width: 6.5em; text-align: right; margin-right: 0.8em; color: var(--mute-dim); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; }
.credit-v { color: var(--paper); font-weight: 700; }
.pocket .store-row { justify-content: center; }

/* --- The living phone --------------------------------------- */
.phone {
  --px: 50vw; --py: 60vh; --ps: 1; --pr: 0deg; --po: 0; --pt: 0deg;
  position: fixed; left: 0; top: 0; z-index: 4; pointer-events: none;
  width: clamp(228px, 21vw, 300px); aspect-ratio: 9 / 19.2;
  transform: translate(calc(var(--px) - 50%), calc(var(--py) - 50%)) rotate(var(--pr)) scale(var(--ps));
  opacity: var(--po);
  will-change: transform, opacity;
  perspective: 1200px;
}
.phone-body {
  position: absolute; inset: 0; border-radius: 12% / 5.6%;
  background: #0b0d12;
  box-shadow:
    inset 0 0 0 2px #23262e, inset 0 0 0 5px #0a0b0f,
    0 40px 90px -30px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.05);
  transform: rotateX(var(--pt));
  transform-style: preserve-3d;
}
.phone-glass {
  position: absolute; inset: 5px; border-radius: 10.5% / 4.9%; overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bot));
  color: #F5F8FF; font-size: clamp(0.62rem, 0.9vw, 0.8rem); line-height: 1.3;
}
.phone-glass::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 38%);
}
.phone-glass::before {
  content: ''; position: absolute; top: 2.2%; left: 50%; transform: translateX(-50%);
  width: 34%; height: 4.2%; border-radius: 999px; background: #05060a; z-index: 3;
}
.phone.is-off .phone-glass { background: #05060a; }
.phone-screen { position: absolute; inset: 0; z-index: 2; overflow: hidden; border-radius: inherit; background: #000; }
/* The screenshot carries its own Dynamic Island; draw ours only on a dark screen. */
.phone:not(.is-off) .phone-glass::before { display: none; }
.phone-overlay { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.phone-reflect {
  position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.55) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 62% 18%, rgba(255, 255, 255, 0.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 52%, rgba(255, 255, 255, 0.45) 50%, transparent 51%),
    radial-gradient(1px 1px at 34% 70%, rgba(255, 255, 255, 0.4) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 50% 88%, rgba(255, 255, 255, 0.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 12% 84%, rgba(255, 255, 255, 0.35) 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 8%, rgba(255, 255, 255, 0.45) 50%, transparent 51%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 60%);
  transition: opacity 1.2s var(--ease);
}
.phone.is-reflecting .phone-reflect { opacity: 1; }
.phone-glow {
  --g: 0;
  position: absolute; inset: -60% -70%; border-radius: 50%; pointer-events: none; z-index: -1;
  background: radial-gradient(closest-side, rgba(200, 220, 255, 0.35), rgba(200, 220, 255, 0));
  opacity: var(--g);
}

/* Phone screen: a real app screenshot, edge to edge under the glass. */
.ps-shot { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; user-select: none; -webkit-user-drag: none; }

/* --- The sun-dial ------------------------------------------- */
.dial {
  position: fixed; left: 50%; bottom: calc(max(env(safe-area-inset-bottom), 8px) + 18px); z-index: 30;
  width: min(640px, 72vw); height: 56px; transform: translateX(-50%) translateY(20px);
  opacity: 0; pointer-events: none; transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.dial.is-on { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
.dial-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dial-track { stroke: rgba(255, 180, 61, 0.28); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.dial-ring { stroke: var(--sun-1); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 1200; stroke-dashoffset: 1200; }
.dial-labels { position: absolute; left: 0; right: 0; bottom: -16px; display: flex; justify-content: space-between; font-size: 0.62rem; letter-spacing: 0.12em; color: var(--mute-dim); font-weight: 700; }
.dial-sun {
  position: absolute; width: 18px; height: 18px; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, #FFF3D6, var(--sun-1) 55%, var(--sun-2)); box-shadow: 0 0 18px rgba(255, 180, 61, 0.7);
  cursor: grab; touch-action: none;
}
.dial.is-dragging .dial-sun { cursor: grabbing; transform: translate(-50%, -50%) scale(1.25); }
html[data-chapter="ch10"] .dial-labels { color: #4b5563; }

/* --- Footer ------------------------------------------------- */
.site-foot { position: relative; z-index: 3; background: var(--ink-0); color: var(--mute); padding: 2.5rem 0 calc(2rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-soft); }
.site-foot .wrap { padding: 0 var(--pad-x); }
.foot-grid { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.foot-links { display: flex; gap: 1.4rem; flex-wrap: wrap; font-size: 0.9rem; font-weight: 700; }
.foot-links a:hover { color: var(--paper); }
.foot-legal { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1.6rem; font-size: 0.8rem; color: var(--mute-dim); }
.foot-legal a { color: var(--mute); }

/* --- QA still mode: one chapter pinned, nothing scrolls ------ */
html[data-still] .ch { height: 100svh; }
html[data-still] .ch-stick { display: none; }
html[data-still] .ch.is-active .ch-stick { display: block; position: fixed; inset: 0; height: 100svh; }
html[data-still] .site-foot { display: none; }
html[data-still] .reveal { opacity: 1; transform: none; }
html[data-nocopy] .ch-copy, html[data-nocopy] .site-head, html[data-nocopy] .dial, html[data-nocopy] .live-wrap { visibility: hidden !important; }

/* --- Static tier: the film as fifteen postcards ------------- */
html.is-static .stage, html.is-static .fx, html.is-static .sky-dom, html.is-static .phone, html.is-static .dial { display: none; }
html.is-static .ch { height: auto; min-height: 0; margin-bottom: 0; }
html.is-static .ch-stick { position: relative; height: auto; min-height: 70svh; overflow: visible; display: grid; grid-template-columns: 1fr; }
html.is-static .ch-still { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.6; }
html.is-static .ch-copy { position: relative; transform: none; left: auto; top: auto; padding: clamp(4rem, 12vh, 7rem) var(--pad-x); max-width: min(60ch, 92vw); }
html.is-static .ch-copy.at-center { margin: 0 auto; }
html.is-static .live-wrap { position: relative; transform: none; left: auto; right: auto; top: auto; bottom: auto; width: auto; padding: 0 var(--pad-x) 3rem; }
html.is-static .scene { display: none; }
html.is-static .scroll-cue { display: none; }
html.is-static .one-line .w { opacity: 1; transform: none; }

/* --- Responsive --------------------------------------------- */
@media (max-width: 900px) {
  h1 { font-size: clamp(2.4rem, 11vw, 3.6rem); }
  h2 { font-size: clamp(1.7rem, 7.6vw, 2.6rem); }
  .h-hero { font-size: clamp(2.8rem, 15vw, 4.6rem); }
  .ch-copy.at-left, .ch-copy.at-right { top: clamp(5rem, 11vh, 7rem); transform: none; left: 0; right: 0; text-align: left; max-width: none; }
  .ch-copy.at-right .lede, .ch-copy.at-right .note { margin-left: 0; }
  .lede { max-width: 30ch; font-size: 1rem; }
  .phone { width: clamp(150px, 42vw, 200px); }
  .live-wrap { left: var(--pad-x); right: var(--pad-x); top: auto; bottom: max(env(safe-area-inset-bottom), 12px); transform: none; width: auto; gap: 0.6rem; }
  .live-card { padding: 0.9rem 1rem; }
  .live-body img { width: 48px; height: 48px; }
  .live-temp { font-size: 2.4rem; }
  .geo-btn { margin-top: 0.5rem; padding: 0.6rem 1rem; }
  .live-note { display: none; }
  .city-grid { grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
  .city { padding: 0.55rem 0.6rem; }
  .city-temp { font-size: 1.4rem; }
  .city-row img { width: 26px; height: 26px; }
  .city-meta { display: none; }
  .dial { width: min(520px, 86vw); height: 44px; bottom: calc(max(env(safe-area-inset-bottom), 6px) + 16px); }
  html[data-chapter="ch13"] .dial { opacity: 0; pointer-events: none; }
  .sound-label { display: none; }
  .sound-toggle { padding: 0.5rem 0.6rem; }
  .credit-k { min-width: 0; display: block; text-align: center; margin: 0; }
  .credits { font-size: 0.86rem; }
}
@media (max-width: 480px) {
  .store-row { gap: 0.5rem; }
  .btn { padding: 0.7rem 1rem; font-size: 0.88rem; }
  .city-grid { grid-template-columns: repeat(2, 1fr); }
  .city:nth-child(n+5) { display: none; }
}

/* --- Subpages: About, FAQ, Privacy, Terms --------------------- */
/* A static sky, a fixed header with a two-link nav, prose. No engine. */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(180deg, #05070E 0%, #0B1120 60%, #131A2C 100%); }
.sky::after { content: ''; position: absolute; inset: 0; background: radial-gradient(60% 40% at 80% 0%, rgba(255, 140, 40, 0.10), transparent 70%); }
.wrap { width: min(1180px, 100% - 2 * var(--pad-x)); margin-inline: auto; }
.site-head .wrap { width: auto; margin: 0; }
.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a { font-size: 0.9rem; font-weight: 700; color: var(--mute); transition: color 0.2s; }
.nav a:hover { color: var(--paper); }
body.page main { padding: clamp(7rem, 16vh, 10rem) 0 clamp(4rem, 10vh, 7rem); }
main > .wrap.prose { padding-top: clamp(7rem, 16vh, 10rem); padding-bottom: clamp(4rem, 10vh, 7rem); }
.prose { max-width: 74ch; margin-inline: auto; }
.prose h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.prose h2 { font-size: clamp(1.25rem, 2.4vw, 1.55rem); margin-top: 2.8rem; margin-bottom: 0.7rem; }
.prose h3 { margin-top: 1.7rem; margin-bottom: 0.4rem; font-size: 1.02rem; }
.prose p, .prose li { color: var(--mute); }
.prose p + p { margin-top: 0.9rem; }
.prose ul { padding-left: 1.1rem; margin: 0.7rem 0 0; display: grid; gap: 0.45rem; }
.prose a { color: var(--sun-1); text-decoration: underline; text-underline-offset: 3px; }
.prose table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.9rem; }
.prose th, .prose td { text-align: left; padding: 0.68rem 0.8rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.prose th { color: var(--paper); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.prose td { color: var(--mute); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.updated { color: var(--mute-dim); font-size: 0.85rem; margin-top: 0.6rem; }
.site-foot .wrap { width: auto; }
