/* ==========================================================================
   Trzecia w nocy — styles.css
   Immersive scroll film. Display: Big Shoulders variable 100..900 (local,
   fonts/BigShoulders-Variable.woff2). Body: Manrope 400/500 (fonts/fonts.css).
   Warm ivory on petrol-black, carmine = danger (night), amber = dawn.
   Runtime hooks (see CONTRACT.md): html.no-js/.js, html.motion-on/.motion-off,
   --p on .scrub-scene and [data-track], --mx/--my on .scrub-media,
   --story and --warmth on html, body.mood-*, .video-ready/.video-failed,
   .is-past/.is-active on .step. The loop orbit reads --p on .loop plus
   .is-active on .cycle-word (one carmine word per quarter turn).
   ========================================================================== */

/* ---------- 0. Fonts ---------------------------------------------------- */
@font-face {
  font-family: "Big Shoulders";
  src: url("fonts/BigShoulders-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- 1. Tokens --------------------------------------------------- */
:root {
  --font-display: "Big Shoulders", "Big Shoulders Display", "Arial Narrow", "Helvetica Neue Condensed", Impact, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* small viewport height with a plain vh fallback for older engines */
  --vh100: 100vh;

  --fs-body: clamp(1.125rem, 1.02rem + 0.32vw, 1.3125rem); /* 18–21px */
  --lh-body: 1.6;
  --measure: 62ch;

  --ivory: #f2eadc;
  --ink: #ddd5c8;
  --muted: #a69e92;
  --dim: #7e776c;

  --bg: #0d1214;
  --bg-deep: #090c0e;
  --bg-panel: #12191c;
  --petrol: #1d3138;

  --carmine: #d7444b;
  --carmine-deep: #9e2229;
  --amber: #e9a94f;
  --amber-light: #f2c483;

  --line: rgb(242 234 220 / 0.14);
  --line-soft: rgb(242 234 220 / 0.08);

  --gutter: clamp(1.1rem, 4vw, 3rem);
  --wrap: 1248px;
  --topbar-h: 3.4rem;

  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}
@supports (height: 1svh) {
  :root {
    --vh100: 100svh;
  }
}

/* ---------- 2. Base ----------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  background: var(--bg);
  overflow-x: clip;
  scroll-padding-top: calc(var(--topbar-h) + 0.75rem);
  -webkit-text-size-adjust: 100%;
}
html.motion-on {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--bg);
  overflow-x: clip;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 1.4s var(--ease-soft);
}
body.mood-night { --bg: #0d1214; }
body.mood-turn  { --bg: #090c0e; }
body.mood-dawn  { --bg: #10181c; }
body.mood-warm  { --bg: #161a1a; }

::selection {
  background: var(--carmine);
  color: var(--bg-deep);
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}
figure {
  margin: 0;
}
h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--ivory);
  text-wrap: balance;
}
p {
  margin: 0;
  text-wrap: pretty;
}
p + p {
  margin-top: 1.25em;
}
strong, b {
  font-weight: 500;
  color: var(--ivory);
}
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgb(242 234 220 / 0.38);
  text-underline-offset: 0.16em;
  transition: color 0.25s, text-decoration-color 0.25s;
}
a:hover {
  color: var(--ivory);
  text-decoration-color: var(--amber);
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}
section:focus,
main:focus,
footer:focus {
  outline: none;
}

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

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.7em 1em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--bg-deep);
  background: var(--amber);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.25s var(--ease-out);
}
.skip-link:focus-visible {
  transform: none;
  outline-color: var(--ivory);
}

/* Accent words */
.cold {
  color: var(--carmine);
}
.warm {
  color: var(--amber);
}

/* ---------- 3. Room light (fixed, behind content) ----------------------- */
.light {
  position: fixed;
  inset: -12%;
  z-index: -1;
  pointer-events: none;
}
.light::before,
.light::after {
  content: "";
  position: absolute;
  inset: 0;
  transition: opacity 0.6s linear;
}
/* night: cold carmine from the window, upper right */
.light::before {
  background:
    radial-gradient(58% 55% at 78% 8%, rgb(215 68 75 / 0.2), transparent 70%),
    radial-gradient(45% 40% at 18% 96%, rgb(29 49 56 / 0.5), transparent 70%);
  opacity: calc(1 - var(--warmth, 0));
}
/* dawn/epilogue: amber lamp warmth from lower left */
.light::after {
  background:
    radial-gradient(60% 60% at 24% 92%, rgb(233 169 79 / 0.2), transparent 70%),
    radial-gradient(45% 45% at 84% 10%, rgb(242 196 131 / 0.1), transparent 70%);
  opacity: var(--warmth, 0);
}

/* ---------- 4. Progress + topbar --------------------------------------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: 3px;
  background: rgb(242 234 220 / 0.08);
  pointer-events: none;
}
.progress-fill {
  display: block;
  height: 100%;
  transform-origin: 0 50%;
  transform: scaleX(var(--story, 0));
  background: linear-gradient(90deg, var(--carmine), var(--amber));
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  min-height: var(--topbar-h);
  padding: 0.55rem var(--gutter);
  background: linear-gradient(to bottom, rgb(9 12 14 / 0.82), rgb(9 12 14 / 0.55) 70%, rgb(9 12 14 / 0));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent);
  mask-image: linear-gradient(to bottom, #000 78%, transparent);
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--ivory);
  text-decoration: none;
  white-space: nowrap;
}
.topbar-chapter {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-chapter:empty {
  display: none;
}
.topbar-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-left: auto;
}

.tool,
.chapters-close {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.5em 0.85em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ivory);
  background: rgb(242 234 220 / 0.06);
  border: 1px solid rgb(242 234 220 / 0.18);
  border-radius: 0.2rem;
  transition: background-color 0.25s, border-color 0.25s, color 0.25s, opacity 0.25s;
}
.tool:hover,
.chapters-close:hover {
  background: rgb(242 234 220 / 0.14);
  border-color: rgb(242 234 220 / 0.36);
}
.tool[aria-expanded="true"] {
  background: var(--ivory);
  color: var(--bg-deep);
}
.tool[disabled],
.tool[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}
.tool[aria-busy="true"] {
  cursor: progress;
  border-color: var(--amber);
}
.tool-state {
  color: var(--muted);
}
.tool[aria-pressed="true"] .tool-state {
  color: var(--amber);
}
.no-js .topbar-tools {
  display: none;
}

/* ---------- 5. Chapters dialog ------------------------------------------ */
.chapters {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(100vw - 2rem, 34rem);
  max-height: min(88vh, 46rem);
  max-height: min(88svh, 46rem);
  padding: 0;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--ivory);
  overflow: auto;
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.55);
}
.chapters::backdrop {
  background: rgb(6 8 9 / 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.motion-on .chapters[open] {
  animation: dialog-in 0.32s var(--ease-out);
}
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.chapters-inner {
  padding: clamp(1.25rem, 4vw, 2.25rem);
}
.chapters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.chapters-head h2 {
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 0.95;
}
.chapters-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.chapters-list a {
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.6rem 0.5rem;
  border-top: 1px solid var(--line-soft);
  color: var(--ivory);
  text-decoration: none;
  transition: background-color 0.2s;
}
.chapters-list li:last-child a {
  border-bottom: 1px solid var(--line-soft);
}
.chapters-list a:hover {
  background: rgb(242 234 220 / 0.06);
}
.ch-no {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--amber);
}
.ch-name {
  font-weight: 500;
  font-size: 1.02rem;
}

.sound-settings {
  display: grid;
  gap: 0.6rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.sound-settings label {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--muted);
}
.sound-settings input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1.6rem;
  margin: 0;
  background: transparent;
  accent-color: var(--amber);
  cursor: pointer;
}
.sound-settings input[type="range"]::-webkit-slider-runnable-track {
  height: 0.3rem;
  border-radius: 999px;
  background: rgb(242 234 220 / 0.18);
}
.sound-settings input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: -0.43rem;
  border-radius: 50%;
  border: 2px solid var(--bg-panel);
  background: var(--amber);
}
.sound-settings input[type="range"]::-moz-range-track {
  height: 0.3rem;
  border-radius: 999px;
  background: rgb(242 234 220 / 0.18);
}
.sound-settings input[type="range"]::-moz-range-thumb {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 2px solid var(--bg-panel);
  background: var(--amber);
}
.sound-settings input[type="range"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- 6. Layout primitives --------------------------------------- */
.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}
.prose {
  max-width: var(--measure);
}
.prose > p {
  max-width: var(--measure);
}

.scene {
  position: relative;
  scroll-margin-top: var(--topbar-h);
}
.chapter {
  padding-block: clamp(5rem, 12vh, 9rem);
}
.chapter > * + * {
  margin-top: clamp(3rem, 8vh, 6rem);
}
.chapter--turn {
  background: linear-gradient(180deg, rgb(0 0 0 / 0) 0, rgb(0 0 0 / 0.32) 30vh, rgb(0 0 0 / 0.32));
}
.chapter--dawn {
  background: linear-gradient(180deg, rgb(233 169 79 / 0) 0, rgb(233 169 79 / 0.055) 30vh, rgb(233 169 79 / 0.07));
}
.chapter--warm {
  background: linear-gradient(180deg, rgb(242 196 131 / 0.07) 0, rgb(242 196 131 / 0.1) 40vh, rgb(242 196 131 / 0.1));
}

/* Chapter head */
.chapter-head {
  margin-bottom: clamp(2rem, 5vh, 3.25rem);
}
.chapter-no {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--carmine);
}
.chapter-no::before {
  content: "";
  flex: none;
  width: 2.25rem;
  height: 2px;
  background: currentColor;
}
.chapter--dawn .chapter-no,
.chapter--warm .chapter-no {
  color: var(--amber);
}
.chapter h2 {
  font-size: clamp(3rem, 7.2vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
}
/* heading motifs: the story tightens, then breathes out */
.chapter .h-press {
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -0.045em;
}
.chapter .h-turn {
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.005em;
}
.chapter .h-dawn {
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.02em;
}
.chapter-when {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  line-height: 1;
  letter-spacing: 0.03em;
  color: var(--amber);
}

/* Text roles */
.lede {
  font-size: 1.2em;
  font-weight: 500;
  line-height: 1.48;
  color: var(--ivory);
}
.strong {
  font-size: 1.08em;
  font-weight: 500;
  color: var(--ivory);
}
.key {
  margin-block: 1.6em 1.1em;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 3.2vw, 3rem);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ivory);
}
.key--sm {
  font-size: clamp(1.55rem, 2.5vw, 2.3rem);
}
.key--break {
  margin-top: 2em;
  font-weight: 900;
  font-size: clamp(2.5rem, 4.8vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-shadow: 0 0 40px rgb(215 68 75 / 0.35);
}
.key--returns {
  display: grid;
  gap: 0.08em;
}
/* each return lands heavier and tighter than the last */
.ret {
  display: block;
  padding-left: calc(var(--i, 0) * 1.15em);
  font-weight: calc(600 + var(--i, 0) * 150);
  letter-spacing: calc(0em - var(--i, 0) * 0.015em);
  opacity: calc(0.5 + var(--i, 0) * 0.25);
}
/* after the turn the key lines lose weight and open up */
.chapter--dawn .key,
.chapter--warm .key {
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: 0.01em;
}
.finale {
  font-family: var(--font-display);
  font-weight: 550;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: 0.005em;
  color: var(--ivory);
}
p + .finale {
  margin-top: 1.4em;
}
.finale + .finale {
  margin-top: 0.6em;
}

/* ---------- 7. Scrub media --------------------------------------------- */
.scrub-media {
  position: relative;
  overflow: hidden;
  background: var(--bg-deep);
  --focus: 50% 50%;
}
.scrub-media picture {
  display: block;
  width: 100%;
  height: 100%;
}
.scrub-photo {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus);
}
.scrub-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s linear;
}
.motion-on .scrub-scene.video-ready .scrub-video {
  opacity: 1;
}
/* pointer depth, bounded ±8px by JS; slight scale hides the edges */
.motion-on .scrub-media .scrub-photo,
.motion-on .scrub-media .scrub-video {
  transform: translate3d(var(--mx, 0px), var(--my, 0px), 0) scale(1.035);
  transition: transform 0.22s linear, opacity 0.35s linear;
  will-change: transform;
}
/* distance: film already moves the couple apart, never add motion */
.distance-media .scrub-photo,
.distance-media .scrub-video {
  transform: none !important;
  will-change: auto;
}

/* ---------- 8. Hero ----------------------------------------------------- */
.hero {
  height: 150vh;
  height: 150svh;
  background: var(--bg-deep);
}
.hero-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
.hero-media {
  position: absolute;
  inset: 0;
  --focus: 50% 50%;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to top, rgb(9 12 14 / 0.94) 0%, rgb(9 12 14 / 0.6) 30%, rgb(9 12 14 / 0) 60%),
    linear-gradient(to right, rgb(9 12 14 / 0.72) 0%, rgb(9 12 14 / 0.28) 42%, rgb(9 12 14 / 0) 62%),
    linear-gradient(to bottom, rgb(9 12 14 / 0.55), rgb(9 12 14 / 0) 22%);
}
/* the room goes dark as the opening ends */
.hero-scrim::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: calc(var(--p, 0) * 0.72);
}
.hero-type {
  position: absolute;
  z-index: 2;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(max(6vh, 2.5rem) + env(safe-area-inset-bottom, 0px));
  max-width: min(52vw, 46rem);
}
.hero-clock {
  margin: 0 0 0.14em;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(6rem, min(16vw, 30vh), 19rem);
  font-size: clamp(6rem, min(16vw, 30svh), 19rem);
  line-height: 0.8;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ivory);
  text-shadow: 0 0 60px rgb(215 68 75 / 0.25);
}
.hero-line {
  max-width: 14ch;
  font-weight: 800;
  font-size: clamp(2.3rem, min(5vw, 8.6vh), 5.4rem);
  font-size: clamp(2.3rem, min(5vw, 8.6svh), 5.4rem);
  line-height: 0.94;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.scroll-cue {
  position: relative;
  display: inline-block;
  margin-top: clamp(1.25rem, 3vh, 2rem);
  padding-left: 2.4rem;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--muted);
  text-decoration: none;
}
.scroll-cue::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1.6rem;
  height: 2px;
  background: var(--amber);
  transform-origin: 0 50%;
}
.scroll-cue:hover {
  color: var(--ivory);
}
.motion-on .scroll-cue::before {
  animation: cue 2.4s var(--ease-soft) infinite;
}
@keyframes cue {
  0%, 100% { transform: scaleX(1); opacity: 1; }
  50%      { transform: scaleX(0.35); opacity: 0.5; }
}

/* ---------- 8b. Campaign: a typographic interlude ----------------------- */
.about {
  --about-rail: clamp(10rem, 19vw, 17rem);
  --about-gap: clamp(2rem, 4vw, 4rem);
  --about-shift: 18px;
  position: relative;
  padding-block: clamp(3rem, 5vw, 4.5rem) clamp(1.25rem, 3vw, 2.75rem);
  isolation: isolate;
}
.about::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -6rem 0 -4rem;
  pointer-events: none;
  background: radial-gradient(ellipse at 75% 40%, rgb(158 34 41 / 0.09), transparent 62%);
}
.about:focus { outline: none; }
.about-inner { position: relative; }
.about-text {
  display: grid;
  grid-template-columns: var(--about-rail) minmax(0, 1fr);
  column-gap: var(--about-gap);
  margin: 0;
}
.about-intro {
  padding-top: clamp(0.8rem, 2vw, 1.8rem);
  font-size: clamp(0.9rem, 1.2vw, 1rem);
  font-weight: 500;
  line-height: 1.6;
  color: var(--muted);
}
.about-signature {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 12vw, 10rem);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ivory);
}
.about-name {
  color: var(--ivory);
  text-decoration: none;
}
.about-word {
  position: relative;
  transition: color 220ms var(--ease-soft);
}
.about-word--first { display: block; }
.about-word--last {
  display: inline-block;
  margin-left: 0.85em;
  color: var(--carmine);
}
.about-period {
  display: inline-block;
  color: var(--carmine);
}
.about-name:hover .about-word--first,
.about-name:focus-visible .about-word--first { color: var(--ink); }
.about-name:hover .about-word--last,
.about-name:focus-visible .about-word--last { color: #f06b70; }
.about-name:focus-visible {
  outline: none;
}
.about-name:focus-visible .about-word {
  text-decoration: underline;
  text-decoration-color: var(--amber);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.12em;
}
.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2rem;
  list-style: none;
  padding: 0;
  margin: 1.6rem 0 0 calc(var(--about-rail) + var(--about-gap) + clamp(3.825rem, 10.2vw, 8.5rem));
}
.about-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
  padding: 0.25em 0.05em;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration-color: rgb(166 158 146 / 0.5);
  text-underline-offset: 0.6em;
}
.about-links a:hover,
.about-links a:focus-visible {
  color: var(--ivory);
  text-decoration-color: var(--carmine);
}
.motion-on .about-word--first {
  transform: translateX(calc((var(--p, 0.5) - 0.5) * var(--about-shift)));
}
.motion-on .about-word--last,
.motion-on .about-period {
  transform: translateX(calc((0.5 - var(--p, 0.5)) * var(--about-shift)));
}
@media (max-width: 740px) {
  .about {
    --about-shift: 10px;
    padding-block: 2.8rem 1.25rem;
  }
  .about-text {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 1.6rem;
  }
  .about-intro {
    padding-top: 0;
    font-size: 0.875rem;
    line-height: 1.55;
  }
  .about-signature {
    font-size: clamp(4.5rem, 20vw, 8rem);
    line-height: 0.97;
  }
  .about-links {
    margin: 1.2rem 0 0 clamp(3.825rem, 17vw, 6.8rem);
    gap: 0 1.75rem;
  }
}
@media (max-height: 480px) and (min-width: 741px) {
  .about { padding-block: 2.25rem 1rem; }
  .about-signature { font-size: clamp(4.5rem, 10vw, 7rem); }
  .about-links { margin-top: 1rem; }
}
@media print {
  .about::before { display: none; }
  .about .about-word,
  .about .about-period { transform: none !important; }
}

/* ---------- 9. Split (chapter 1, epilogue) ------------------------------ */
.split {
  display: grid;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.split-media {
  position: relative;
  overflow: hidden;
  background: var(--bg-deep);
}
.split-media > img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.split-media .scrub-media {
  aspect-ratio: 16 / 9;
}
.epilog-visual {
  --focus: 62% 50%;
}
.light-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to right, rgb(9 12 14 / 0.92), rgb(9 12 14 / 0.35) 45%, rgb(9 12 14 / 0) 70%);
  opacity: calc(1 - var(--p, 1) * 0.78);
}
.motion-on .media-lift > img {
  transform: scale(calc(1 + (1 - var(--p, 1)) * 0.06));
  transform-origin: 50% 60%;
  transition: transform 0.2s linear;
}

/* ---------- 10. Stats --------------------------------------------------- */
.stat {
  margin-block: clamp(1.75rem, 4vh, 2.75rem);
}
.stat-figure {
  display: flex;
  align-items: baseline;
  gap: 0.12em;
  margin: 0;
  font-family: var(--font-display);
  line-height: 0.85;
  color: var(--ivory);
}
.stat-value {
  font-weight: 900;
  font-size: clamp(4.8rem, 10vw, 9rem);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-unit {
  font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2.8rem);
  color: var(--muted);
}
.stat-unit.cold {
  color: var(--carmine);
}
.stat-caption {
  max-width: 46ch;
  margin-top: 1rem;
  font-size: 0.92em;
  line-height: 1.5;
  color: var(--muted);
}
.stat-note {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.05;
  color: var(--ivory);
}
.stat--band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: center;
  margin-block: clamp(3rem, 8vh, 6rem);
}
.stat--band .stat-value {
  font-size: clamp(5.5rem, 12vw, 11rem);
}
.stat--band .stat-unit {
  font-size: clamp(2.2rem, 4.5vw, 4.4rem);
}
.stat--band .stat-caption {
  margin-top: 0;
  max-width: 52ch;
}

/* ---------- 11. Glass (chapter 2) --------------------------------------- */
.glass {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}
.glass-stage {
  position: relative;
}
.glass-media {
  --focus: 68% 50%;
  width: 100%;
  aspect-ratio: 16 / 9;
}
.glass-beats {
  max-width: var(--measure);
}
.beat + .beat {
  margin-top: clamp(3rem, 8vh, 5rem);
}
.beat-title {
  margin-bottom: 0.9rem;
  font-weight: 800;
  font-size: clamp(2.2rem, 3.8vw, 3.4rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
}
.beat .key {
  margin-top: 1.1em;
}

/* ---------- 12. Loop (chapter 3): the orbit ------------------------------
   Base = compact static list (no JS, motion off, very low viewports).
   With html.motion-on and at least 360px of height the stage pins for
   600svh and the four words orbit the centred "i znowu" 1800deg, i.e. five
   full turns, one per viewport of scroll, straight from --p on .loop.
   Each word is counter-rotated so its baseline stays level. While pinned,
   app.js marks one word .is-active per quarter turn (20 stages) and only
   that word is carmine; the static list keeps its authored colours. */
.loop {
  position: relative;
  height: auto;
}
.loop-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 30rem;
  min-height: max(min(var(--vh100), 62vw), 30rem);
  padding: calc(var(--topbar-h) + 1.5rem) var(--gutter) 2.5rem;
  overflow: hidden;
  background: var(--bg-deep);
}
.loop-media {
  position: absolute;
  inset: 0;
}
.loop-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 78% 50%;
}
.loop-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(46% 42% at 50% 52%, rgb(9 12 14 / 0.9), rgb(9 12 14 / 0.52) 62%, rgb(9 12 14 / 0.66) 100%),
    linear-gradient(to bottom, rgb(9 12 14 / 0.6), rgb(9 12 14 / 0) 24%);
}
.loop-orbit {
  --spin: calc(var(--p, 0) * 1800deg);
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  text-align: center;
}
.loop-ring {
  display: none;
}
.cycle {
  display: grid;
  gap: 0.3em;
  list-style: none;
  margin: 0;
  padding: 0;
}
.cycle-word {
  --a: calc(var(--i, 0) * 90deg);
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4.2vw, 2.8rem);
  line-height: 1.05;
  color: var(--ink);
  text-shadow: 0 0.15rem 1.2rem rgb(9 12 14 / 0.95), 0 0 2.4rem rgb(9 12 14 / 0.8);
}
.cycle-again {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  line-height: 1.08;
  color: var(--ivory);
  text-shadow: 0 0.2rem 1.6rem rgb(9 12 14 / 0.95);
}
.again-line {
  display: block;
}
.again-line:nth-child(2) {
  color: var(--ink);
}
.again-line:nth-child(3) {
  color: var(--muted);
}

@media (min-height: 360px) {
  .motion-on .loop {
    height: 600vh;
    height: 600svh;
  }
  .motion-on .loop-stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    min-height: 0;
    padding: var(--topbar-h) var(--gutter) 0;
  }
  .motion-on .loop-media img {
    transform: scale(calc(1.04 + var(--p, 0) * 0.08));
    transform-origin: 50% 50%;
  }
  /* --d: orbit box, bounded by width, a cap and the height left under the topbar.
     --r: label orbit radius. Labels are capped at 1.15r so the widest can never
     reach the viewport edge (r + 0.575r <= 0.55d <= 46vw). */
  .motion-on .loop-orbit {
    --d: min(84vw, 44rem, calc(var(--vh100) - var(--topbar-h) - 2.5rem));
    --r: calc(var(--d) * 0.35);
    --label: clamp(1rem, calc(var(--d) * 0.038), 1.7rem);
    --core: clamp(1.3rem, calc(var(--d) * 0.056), 2.5rem);
    display: grid;
    place-items: center;
    gap: 0;
    width: var(--d);
    height: var(--d);
  }
  .motion-on .loop-ring {
    display: block;
    position: absolute;
    inset: 6%;
    border: 1px solid rgb(215 68 75 / 0.22);
    border-radius: 50%;
    pointer-events: none;
    transform: rotate(var(--spin));
  }
  /* a short carmine arc on the outer ring makes the turn legible between words */
  .motion-on .loop-ring::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgb(215 68 75 / 0) 0deg, rgb(215 68 75 / 0.85) 70deg, rgb(215 68 75 / 0) 74deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  }
  .motion-on .loop-ring--2 {
    inset: 24%;
    border-color: rgb(242 234 220 / 0.14);
    border-style: dashed;
    transform: rotate(calc(var(--spin) * -0.6));
  }
  .motion-on .loop-ring--2::before {
    content: none;
  }
  .motion-on .cycle {
    display: block;
    position: absolute;
    inset: 0;
  }
  .motion-on .cycle-word {
    position: absolute;
    left: 50%;
    top: 50%;
    max-width: calc(var(--r) * 1.15);
    font-size: var(--label);
    line-height: 1.04;
    transform:
      translate(-50%, -50%)
      rotate(calc(var(--a) + var(--spin)))
      translateX(var(--r))
      rotate(calc(-1 * (var(--a) + var(--spin))))
      scaleX(var(--squeeze, 1))
      skewX(var(--pitch, 0deg));
    transition: color 0.18s var(--ease-soft);
  }
  .motion-on .cycle-word .w2 {
    white-space: nowrap;
  }
  /* sequential highlight: colour only, so nothing moves, reflows or changes
     weight on activation. The permanent .cold of the last word yields to the
     sequence here and only here (the static list below 360px keeps it). */
  .motion-on .cycle-word.cold:not(.is-active) {
    color: var(--ink);
  }
  .motion-on .cycle-word.is-active {
    color: var(--carmine);
  }
  /* the centre thickens with every turn */
  .motion-on .cycle-again {
    position: relative;
    z-index: 2;
    font-size: var(--core);
    font-weight: calc(500 + var(--p, 0) * 400);
    line-height: 1.05;
    transform: scale(calc(1 + var(--p, 0) * 0.08));
  }
}

/* ---------- 12b. Narrative type motifs ---------------------------------
   Authored treatments for a few locked phrases. Running paragraphs are
   never touched; the orbit words carry the same classes in both states. */
.m-tense,
.m-flee {
  display: inline-block;
  transform: scaleX(var(--squeeze, 1)) skewX(var(--pitch, 0deg));
}
.m-tense {
  --squeeze: 0.92;
  font-weight: 900;
  letter-spacing: -0.045em;
}
.m-flee {
  --pitch: -9deg;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.m-relief {
  font-weight: 320;
  letter-spacing: 0.07em;
  color: var(--ivory);
}
.m-void {
  font-weight: 450;
  letter-spacing: 0.18em;
}
.m-apart {
  font-weight: 350;
  letter-spacing: 0.12em;
}
.cycle-word.m-tense {
  color: var(--ivory);
}
.cycle-word.cold {
  color: var(--carmine);
}

/* ---------- 13. Distance (chapter 4) ------------------------------------ */
.distance {
  position: relative;
}
.distance-media {
  --focus: 50% 50%;
  width: 100%;
  aspect-ratio: 1280 / 712;
}
.gap-shadow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to right, rgb(9 12 14 / 0) 26%, rgb(9 12 14 / 0.78) 50%, rgb(9 12 14 / 0) 74%);
  opacity: calc(var(--p, 1) * 0.9);
}
/* the word thins and spreads as the couple drift apart */
.distance-word {
  margin-top: 0.15em;
  font-family: var(--font-display);
  font-weight: calc(880 - var(--p, 1) * 460);
  font-size: clamp(4rem, 11vw, 10rem);
  line-height: 0.9;
  letter-spacing: calc(0.02em + var(--p, 1) * 0.2em);
  text-transform: lowercase;
  color: var(--ivory);
}

/* ---------- 14. Research finding (≈2×) ---------------------------------- */
.finding {
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 3rem);
  background: linear-gradient(135deg, rgb(242 234 220 / 0.055), rgb(242 234 220 / 0.02));
  border-top: 2px solid var(--carmine);
}
.finding-title {
  margin-bottom: clamp(1.25rem, 3vh, 2rem);
  font-weight: 600;
  font-size: clamp(1.35rem, 2.1vw, 1.8rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--muted);
}
.finding-grid {
  display: grid;
  grid-template-columns: minmax(11rem, 1fr) minmax(0, 2.2fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}
.finding-figure {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(5.5rem, 11vw, 10rem);
  line-height: 0.85;
  letter-spacing: -0.02em;
  color: var(--ivory);
  white-space: nowrap;
}
.finding-sym {
  font-weight: 700;
  font-size: 0.56em;
  color: var(--carmine);
  vertical-align: 0.28em;
}
/* the label is the only text here; methods and caveats live in #zrodla */
.finding-label {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.55rem, 2.6vw, 2.3rem);
  line-height: 1.02;
  color: var(--ivory);
}

/* ---------- 15. Reflection (chapter 5) ---------------------------------- */
.reflection {
  height: 155vh;
  height: 155svh;
}
.reflection-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--bg-deep);
}
.reflection-media {
  position: absolute;
  inset: 0;
  --focus: 50% 50%;
}
.reflection-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to top, rgb(9 12 14 / 0.94), rgb(9 12 14 / 0.5) 34%, rgb(9 12 14 / 0) 62%),
    linear-gradient(to bottom, rgb(9 12 14 / 0.5), rgb(9 12 14 / 0) 20%);
  opacity: calc(0.8 + var(--p, 0) * 0.2);
}
.reflection-copy {
  position: absolute;
  z-index: 2;
  left: var(--gutter);
  right: var(--gutter);
  bottom: max(7vh, 2.5rem);
  max-width: 38ch;
  margin: 0;
  font-size: 1.22em;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ivory);
}

/* ---------- 16. Dawn (chapter 6) ---------------------------------------- */
.dawn {
  position: relative;
}
.dawn-media {
  --focus: 50% 50%;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 92vh;
  max-height: 92svh;
}
.dawn-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(200deg, rgb(242 196 131 / 0.34), rgb(233 169 79 / 0.08) 45%, rgb(9 12 14 / 0) 70%),
    linear-gradient(to top, rgb(9 12 14 / 0.4), rgb(9 12 14 / 0) 35%);
  opacity: calc(0.35 + var(--p, 1) * 0.45);
}

/* ---------- 17. Path: seven days, one fall ------------------------------ */
.path-block {
  position: relative;
  --axis-h: clamp(120px, 14vw, 190px);
  padding-top: 1rem;
}
.path-line {
  position: absolute;
  left: 0;
  top: 1rem;
  width: 100%;
  height: var(--axis-h);
  overflow: visible;
}
.path-ghost,
.path-draw {
  fill: none;
  stroke-width: 3px;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.path-ghost {
  stroke: rgb(242 234 220 / 0.18);
}
.path-draw {
  stroke: var(--amber);
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--p, 0));
  filter: drop-shadow(0 0 6px rgb(233 169 79 / 0.45));
}
.path {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: calc(var(--axis-h) + 4.5rem);
}
.step {
  position: relative;
  padding: calc(var(--axis-h) * 0.2667 + 1.1rem) 0.2rem 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.1rem, 1.55vw, 1.45rem);
  line-height: 1.05;
  text-align: center;
  color: rgb(242 234 220 / 0.6);
  transition: color 0.4s var(--ease-soft);
}
.step::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(var(--axis-h) * 0.2667);
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgb(242 234 220 / 0.55);
  background: var(--bg);
  transform: translate(-50%, -50%);
  transition: background-color 0.35s, border-color 0.35s, box-shadow 0.35s;
}
.step--fall {
  padding-top: calc(var(--axis-h) * 0.7667 + 1.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--carmine);
}
.step--return,
.step--on {
  font-weight: 700;
}
.step--fall::before {
  top: calc(var(--axis-h) * 0.7667);
  border-color: var(--carmine);
}
.step.is-past {
  color: rgb(242 234 220 / 0.9);
}
.step.is-past::before {
  background: var(--ivory);
  border-color: var(--ivory);
}
.step.is-active {
  color: var(--amber);
}
.step.is-active::before {
  background: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 0 0 6px rgb(233 169 79 / 0.22);
}
.step--fall.is-past,
.step--fall.is-active {
  color: var(--carmine);
}
.step--fall.is-past::before,
.step--fall.is-active::before {
  background: var(--carmine);
  border-color: var(--carmine);
  box-shadow: 0 0 0 6px rgb(215 68 75 / 0.22);
}
.step--return.is-past,
.step--return.is-active,
.step--on.is-past,
.step--on.is-active {
  color: var(--amber);
}
.step--return.is-past::before,
.step--on.is-past::before {
  background: var(--amber);
  border-color: var(--amber);
}

/* ---------- 18. Epilogue extras + sources ------------------------------- */
.restart-row {
  margin-top: clamp(2.5rem, 6vh, 4rem);
}
.restart {
  display: inline-block;
  padding: 0.85em 1.5em;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1;
  letter-spacing: 0.03em;
  color: var(--ivory);
  border: 1px solid var(--amber);
  border-radius: 0.2rem;
  text-decoration: none;
  transition: background-color 0.25s, color 0.25s;
}
.restart:hover {
  background: var(--amber);
  color: var(--bg-deep);
}

.sources {
  padding: clamp(4rem, 10vh, 7rem) 0 clamp(4rem, 8vh, 6rem);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgb(9 12 14 / 0.4), rgb(9 12 14 / 0.75));
  color: var(--muted);
  scroll-margin-top: var(--topbar-h);
}
.sources h2 {
  font-weight: 800;
  font-size: clamp(2.6rem, 5.5vw, 4.4rem);
  line-height: 0.92;
  letter-spacing: -0.01em;
}
.sources-lead {
  max-width: var(--measure);
  margin-top: 1.5rem;
  font-size: 1.05em;
  font-weight: 500;
  color: var(--ink);
}
.sources-list {
  counter-reset: src;
  list-style: none;
  max-width: 74ch;
  margin: clamp(2rem, 5vh, 3.5rem) 0 0;
  padding: 0;
  font-size: 0.94em;
  line-height: 1.6;
}
.sources-list > li {
  position: relative;
  padding: 1.75rem 0 1.75rem 3.4rem;
  border-top: 1px solid var(--line-soft);
}
.sources-list > li::before {
  counter-increment: src;
  content: counter(src, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--amber);
}
.sources-list p + p {
  margin-top: 0.6em;
}
.source-title {
  font-weight: 500;
  color: var(--ivory);
}
.sources-list ul {
  margin: 0.7em 0 0.8em;
  padding-left: 1.2em;
}
.sources-list ul li + li {
  margin-top: 0.5em;
}
.sources-list ul li::marker {
  color: var(--amber);
}
.sources-list a {
  color: var(--ink);
}
.sources-list a:hover {
  color: var(--ivory);
}
/* bottom of the footer: measurement settings (shown by analytics.js) and the credit */
.sources-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.75rem;
  max-width: 74ch;
  margin-top: clamp(2rem, 5vh, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.94em;
}
.credit {
  margin: 0;
  color: var(--muted);
}
.credit a {
  display: inline-block;
  padding-block: 0.3em;
  color: var(--ink);
}
.credit a:hover {
  color: var(--ivory);
}

/* ---------- 19. Desktop (≥ 900px) --------------------------------------- */
@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
  }
  .split--reverse {
    grid-template-columns: minmax(0, 54fr) minmax(0, 46fr);
  }
  .split .chapter-head {
    margin-bottom: clamp(1.5rem, 4vh, 2.5rem);
  }

  .glass {
    display: grid;
    grid-template-columns: minmax(0, 52fr) minmax(0, 48fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
  }
  .motion-on .glass-stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    padding: calc(var(--topbar-h) + 1.5rem) 0 1.5rem;
  }
  .motion-on .glass-media {
    aspect-ratio: auto;
    height: 100%;
  }
  .motion-on .glass-beats {
    padding-block: 24vh 12vh;
  }
  .motion-on .beat {
    display: grid;
    align-content: center;
    min-height: 60vh;
    padding-block: 2rem;
  }
}

/* ---------- 20. Narrow (< 900px) ---------------------------------------- */
@media (max-width: 899.98px) {
  .hero {
    height: 140vh;
    height: 140svh;
  }
  .hero-type {
    max-width: none;
    bottom: max(5vh, 2rem);
  }
  .hero-clock {
    font-size: clamp(4.4rem, min(26vw, 20vh), 9rem);
    font-size: clamp(4.4rem, min(26vw, 20svh), 9rem);
  }
  .hero-line {
    max-width: none;
    font-size: clamp(1.9rem, min(9vw, 7.5vh), 3.4rem);
    font-size: clamp(1.9rem, min(9vw, 7.5svh), 3.4rem);
  }
  .hero-scrim {
    background:
      linear-gradient(to top, rgb(9 12 14 / 0.95) 0%, rgb(9 12 14 / 0.7) 32%, rgb(9 12 14 / 0.05) 58%),
      linear-gradient(to bottom, rgb(9 12 14 / 0.6), rgb(9 12 14 / 0) 20%);
  }

  .glass-stage {
    position: relative;
    margin-bottom: clamp(2.5rem, 7vh, 4rem);
  }

  /* reflection: relative stage, copy below, laptop + face protected */
  .reflection {
    height: auto;
  }
  .reflection-stage {
    position: relative;
    height: auto;
    overflow: visible;
  }
  .reflection-media {
    position: relative;
    inset: auto;
    aspect-ratio: 16 / 9;
  }
  .reflection-scrim {
    display: none;
  }
  .reflection-copy {
    position: static;
    max-width: var(--measure);
    margin: 1.5rem var(--gutter) 0;
  }

  /* timeline: vertical CSS axis */
  .path-line {
    display: none;
  }
  .path-block {
    padding-top: 0;
    max-width: 30rem;
  }
  .path {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
    min-height: 0;
    padding: 0.5rem 0;
  }
  .path::before,
  .path::after {
    content: "";
    position: absolute;
    left: 0.75rem;
    top: 1rem;
    bottom: 1rem;
    width: 3px;
    margin-left: -1.5px;
    border-radius: 999px;
    pointer-events: none;
  }
  .path::before {
    background: rgb(242 234 220 / 0.18);
  }
  .path::after {
    background: var(--amber);
    transform-origin: 50% 0;
    transform: scaleY(var(--p, 0));
    box-shadow: 0 0 8px rgb(233 169 79 / 0.45);
  }
  .step,
  .step--fall {
    padding: 0.5rem 0 0.5rem 2.75rem;
    text-align: left;
    font-size: clamp(1.25rem, 5vw, 1.5rem);
  }
  .step::before,
  .step--fall::before {
    left: 0.75rem;
    top: 50%;
  }
  /* the fall dips sideways off the axis and returns */
  .step--fall {
    padding-left: 4.5rem;
  }
  .step--fall::before {
    left: 2.5rem;
  }
  .step--fall::after {
    content: "";
    position: absolute;
    left: 0.75rem;
    top: 50%;
    width: 1.75rem;
    height: 3px;
    margin-top: -1.5px;
    background: var(--carmine);
    opacity: 0.8;
  }
}

/* ---------- 21. Phones (< 700px) ---------------------------------------- */
@media (max-width: 699.98px) {
  .hero-media {
    --focus: 50% 42%;
  }
  .glass-media {
    --focus: 70% 50%;
    aspect-ratio: 4 / 3;
  }
  .distance-media {
    aspect-ratio: 4 / 3;
  }
  .dawn-media {
    --focus: 62% 50%;
    aspect-ratio: 4 / 3;
  }
  .epilog-visual,
  .split-media .scrub-media {
    --focus: 70% 50%;
    aspect-ratio: 4 / 3;
  }
  .reflection-media {
    aspect-ratio: 4 / 3;
  }
  .loop-media img {
    object-position: 78% 50%;
  }
  /* phones still orbit five times: radius from viewport width, two-line long
     words, lighter tracking so nothing reaches the centre or the edges */
  .motion-on .loop-orbit {
    --d: min(88vw, calc(var(--vh100) - var(--topbar-h) - 2.5rem));
    --label: clamp(1.375rem, 5.5vw, 1.5rem);
    --core: clamp(1.2rem, 5.6vw, 1.6rem);
  }
  .motion-on .cycle-word .w2 {
    display: block;
  }
  .m-relief {
    font-weight: 400;
  }
  .m-void {
    letter-spacing: 0.14em;
  }
  .stat--band {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .finding-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .finding-figure {
    font-size: clamp(4.5rem, 24vw, 6.5rem);
  }
  .distance-word {
    letter-spacing: calc(0.02em + var(--p, 1) * 0.12em);
  }
  .chapter {
    padding-block: clamp(4rem, 10vh, 6rem);
  }
  .sources-list > li {
    padding-left: 2.8rem;
  }
}

/* very small phones: let the toolbar wrap gracefully */
@media (max-width: 420px) {
  .topbar {
    gap: 0.4rem 0.75rem;
    padding-inline: 0.85rem;
  }
  .tool,
  .chapters-close {
    padding: 0.45em 0.7em;
    font-size: 0.88rem;
  }
  .wordmark {
    font-size: 1.15rem;
  }
}

/* ---------- 22. Short landscape / zoom ---------------------------------- */
@media (max-height: 540px) {
  .hero-type {
    bottom: 1.5rem;
  }
  .hero-clock {
    font-size: clamp(3.5rem, 22svh, 8rem);
  }
  .hero-line {
    font-size: clamp(1.6rem, 8svh, 3rem);
  }
  .scroll-cue {
    margin-top: 0.75rem;
  }
  /* low landscape (844x390): still a full five-turn orbit, smaller radius
     and type so the whole circle sits under the topbar */
  .motion-on .loop-orbit {
    --d: min(84vw, calc(var(--vh100) - var(--topbar-h) - 2rem));
    --label: 1.125rem;
    --core: 1.3rem;
  }
  .motion-on .cycle-word .w2 {
    display: block;
  }
  .m-relief {
    font-weight: 400;
  }
  .m-void {
    letter-spacing: 0.14em;
  }
  .cycle-word {
    font-size: clamp(1.4rem, 6vw, 2.4rem);
  }
  .reflection-copy {
    font-size: 1.05em;
    bottom: 1.5rem;
  }
}

/* ---------- 23. No JS / motion off: one compact readable film ----------- */
/* (the loop's compact list is its base state; see section 12) */
html:not(.motion-on) .hero,
html:not(.motion-on) .reflection {
  height: auto;
}
html:not(.motion-on) .hero-stage,
html:not(.motion-on) .reflection-stage {
  position: relative;
  top: auto;
}
html:not(.motion-on) .hero-stage {
  height: auto;
  min-height: 100vh;
  min-height: 100svh;
}
html:not(.motion-on) .reflection-stage {
  height: auto;
  min-height: min(100svh, 56.25vw);
}
html:not(.motion-on) .scrub-video {
  display: none;
}
html:not(.motion-on) .hero-scrim::after {
  opacity: 0;
}
html:not(.motion-on) .light-veil {
  opacity: 0.25;
}
html:not(.motion-on) .gap-shadow {
  opacity: 0.75;
}
html:not(.motion-on) .dawn-veil {
  opacity: 0.7;
}
html:not(.motion-on) .distance-word {
  font-weight: 420;
  letter-spacing: 0.16em;
}
html:not(.motion-on) .path-draw {
  stroke-dashoffset: 0;
}
html:not(.motion-on) .path::after {
  transform: scaleY(1);
}
html:not(.motion-on) .step {
  color: rgb(242 234 220 / 0.92);
}
html:not(.motion-on) .step::before {
  background: var(--ivory);
  border-color: var(--ivory);
}
html:not(.motion-on) .step--fall {
  color: var(--carmine);
}
html:not(.motion-on) .step--fall::before {
  background: var(--carmine);
  border-color: var(--carmine);
}
html:not(.motion-on) .step--return,
html:not(.motion-on) .step--on {
  color: var(--amber);
}
html:not(.motion-on) .step--return::before,
html:not(.motion-on) .step--on::before {
  background: var(--amber);
  border-color: var(--amber);
}
html:not(.motion-on) .light::before,
html:not(.motion-on) .light::after,
html:not(.motion-on) .scrub-video,
html:not(.motion-on) .progress-fill {
  transition: none;
}

/* ---------- 24. Print --------------------------------------------------- */
@media print {
  .topbar, .progress, .light, .skip-link, .scroll-cue, .scrub-video, .restart-row, .consent, .analytics-settings {
    display: none !important;
  }
  body {
    color: #000;
    background: #fff;
  }
}

/* Integration refinements after rendered review. */
.stat-unit { margin-left: .12em; }
.chapter-no::before, .scroll-cue::before { content: none; }
@media (max-width: 899px) {
  .dawn-media { --focus: 100% 50%; }
  .motion-on .dawn-media .scrub-photo, .motion-on .dawn-media .scrub-video { transform: none; }
}

/* Awaiting the replacement score. */
#sound-toggle, .sound-settings { display: none; }

@media (max-width: 1199px) { .hero-media { --focus: 72% 50%; } }
@media (max-width: 899px) and (orientation: portrait) { .hero-media { --focus: 50% 42%; } }
.step--fall.is-past::before { box-shadow: none; }

/* Long source identifiers remain readable on narrow phones. */
.sources-list a { overflow-wrap: anywhere; }

/* ---------- 25. Visit measurement: consent panel + settings button --------
   Owned by analytics.js; everything stays hidden (attribute) unless a valid
   measurement ID is configured outside local preview. Scoped to .consent,
   .consent-btn and .analytics-settings; the story runtime never reads these. */
.consent {
  position: fixed;
  z-index: 35;
  right: var(--gutter);
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  width: min(100% - 2 * var(--gutter), 24rem);
  max-height: calc(var(--vh100) - 2rem);
  padding: 1.1rem 1.25rem 1.2rem;
  overflow: auto;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  box-shadow: 0 18px 48px rgb(0 0 0 / 0.45);
}
.consent[hidden],
.consent-state[hidden],
.consent-btn[hidden] {
  display: none;
}
.consent-title {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--ivory);
}
.consent-text {
  margin: 0;
  color: var(--muted);
}
.consent-state {
  margin: 0.6rem 0 0;
  font-weight: 500;
  color: var(--amber-light);
}
.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}
/* equal, unemphasised choices in the topbar tool language */
.consent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5em 1em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ivory);
  background: rgb(242 234 220 / 0.06);
  border: 1px solid rgb(242 234 220 / 0.22);
  border-radius: 0.2rem;
  transition: background-color 0.25s, border-color 0.25s;
}
.consent-btn:hover {
  background: rgb(242 234 220 / 0.14);
  border-color: rgb(242 234 220 / 0.4);
}
.analytics-settings {
  font-weight: 500;
  color: var(--ink);
}
