:root {
  color-scheme: dark;
  --ink: #080b13;
  --ink-raised: #0f1521;
  --ink-soft: #161e2d;
  --paper: #eee8d8;
  --paper-bright: #fffaf0;
  --paper-72: rgba(238, 232, 216, 0.72);
  --paper-48: rgba(238, 232, 216, 0.48);
  --paper-22: rgba(238, 232, 216, 0.22);
  --paper-12: rgba(238, 232, 216, 0.12);
  --geometry: #68d8cf;
  --matter: #f2b45f;
  --horizon: #f06d62;
  --wormhole: #b9a2ff;
  --photon: #d9f76f;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --body: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.2, 0.8, 0.2, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--ink);
  scrollbar-color: var(--paper-22) var(--ink);
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--paper);
  background:
    linear-gradient(rgba(104, 216, 207, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(104, 216, 207, 0.025) 1px, transparent 1px),
    var(--ink);
  background-size: 40px 40px;
  font-family: var(--body);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
summary {
  font: inherit;
}

button,
a,
summary,
input[type="range"] {
  -webkit-tap-highlight-color: transparent;
}

button,
summary {
  color: inherit;
}

button:not(:disabled),
summary {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--photon);
  outline-offset: 4px;
}

::selection {
  color: var(--ink);
  background: var(--geometry);
}

.reference-link {
  display: inline-block;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 30%, transparent);
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition-property: color, text-decoration-color;
  transition-duration: 140ms;
  transition-timing-function: var(--ease-soft);
}

.reference-link::after {
  display: inline-block;
  margin-left: 0.18em;
  color: var(--active-accent, var(--geometry));
  content: "↗";
  font: 750 clamp(7px, 0.5em, 10px)/1 var(--mono);
  opacity: 0.72;
  transform: translate3d(0, -0.34em, 0);
  transition-property: opacity, transform;
  transition-duration: 140ms;
  transition-timing-function: var(--ease-out);
}

.reference-link:hover {
  color: var(--paper-bright);
  text-decoration-color: var(--active-accent, var(--geometry));
}

.reference-link:hover::after {
  opacity: 1;
  transform: translate3d(1px, calc(-0.34em - 1px), 0);
}

.reference-label {
  margin: -6px 0 20px;
  color: var(--paper-48);
  font: 700 8px/1.45 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  top: calc(var(--safe-top) + 8px);
  left: calc(var(--safe-left) + 8px);
  z-index: 100;
  min-width: 44px;
  min-height: 44px;
  padding: 12px 16px;
  color: var(--ink);
  background: var(--photon);
  font: 700 12px/20px var(--mono);
  text-decoration: none;
  transform: translateY(-160%);
  transition-property: transform;
  transition-duration: 180ms;
  transition-timing-function: var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

.utility-bar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: calc(58px + var(--safe-top));
  padding: var(--safe-top) calc(22px + var(--safe-right)) 0 calc(22px + var(--safe-left));
  border-bottom: 1px solid var(--paper-12);
  background: rgba(8, 11, 19, 0.86);
  backdrop-filter: blur(12px);
}

.home-link {
  min-width: 44px;
  min-height: 44px;
}

.home-link {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 9px;
  color: var(--paper-72);
  font: 650 10px/1 var(--mono);
  letter-spacing: 0.11em;
  text-decoration: none;
  text-transform: uppercase;
  transition-property: color, transform;
  transition-duration: 150ms;
  transition-timing-function: var(--ease-soft);
}

.home-link:hover {
  color: var(--paper-bright);
  transform: translateX(-2px);
}

.utility-title {
  margin: 0;
  color: var(--paper-48);
  font: 650 10px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.action-button:active,
.segmented-control button:active,
.equation-term:active {
  scale: 0.96;
}

.worldline-nav {
  position: fixed;
  top: 58px;
  bottom: 0;
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 96px;
  padding-left: calc(20px + var(--safe-left));
  border-right: 1px solid var(--paper-12);
  background: rgba(8, 11, 19, 0.7);
}

.worldline-track {
  position: absolute;
  top: 17%;
  bottom: 17%;
  left: calc(27px + var(--safe-left));
  width: 1px;
  overflow: hidden;
  background: var(--paper-12);
}

.worldline-track i {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: var(--story-progress, 0%);
  background: var(--active-accent, var(--geometry));
  box-shadow: 0 0 10px var(--active-accent, var(--geometry));
  transition-property: height, background-color;
  transition-duration: 360ms;
  transition-timing-function: var(--ease-out);
}

.worldline-nav a {
  position: relative;
  display: grid;
  gap: 3px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 0 7px 22px;
  color: var(--paper-48);
  text-decoration: none;
  transition-property: color, transform;
  transition-duration: 180ms;
  transition-timing-function: var(--ease-out);
}

.worldline-nav a::before {
  position: absolute;
  top: 17px;
  left: 3px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--paper-22);
  border-radius: 50%;
  background: var(--ink);
  content: "";
  transition-property: background-color, border-color, scale, box-shadow;
  transition-duration: 220ms;
  transition-timing-function: var(--ease-out);
}

.worldline-nav a span,
.worldline-nav a b {
  font-family: var(--mono);
  text-transform: uppercase;
}

.worldline-nav a span {
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.1em;
}

.worldline-nav a b {
  color: var(--paper-22);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.worldline-nav a.is-active {
  color: var(--paper-bright);
  transform: translateX(3px);
}

.worldline-nav a.is-active::before {
  border-color: var(--active-accent, var(--geometry));
  background: var(--active-accent, var(--geometry));
  box-shadow: 0 0 12px var(--active-accent, var(--geometry));
  scale: 1.3;
}

main {
  margin-left: 96px;
}

.chapter,
.closing-chapter {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  padding: max(96px, 12vh) clamp(28px, 5vw, 84px) clamp(72px, 9vh, 110px);
  border-bottom: 1px solid var(--paper-12);
  scroll-margin-top: 58px;
}

.chapter::before,
.closing-chapter::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: radial-gradient(circle at 80% 40%, rgba(104, 216, 207, 0.055), transparent 38%);
  content: "";
}

.chapter[data-accent="matter"]::before {
  background: radial-gradient(circle at 68% 45%, rgba(242, 180, 95, 0.07), transparent 40%);
}

.chapter[data-accent="horizon"]::before {
  background: radial-gradient(circle at 73% 50%, rgba(240, 109, 98, 0.08), transparent 36%);
}

.chapter[data-accent="white-hole"]::before {
  background: radial-gradient(circle at 68% 50%, rgba(238, 232, 216, 0.07), transparent 36%);
}

.chapter[data-accent="wormhole"]::before,
.chapter[data-accent="photon"]::before {
  background: radial-gradient(circle at 68% 48%, rgba(185, 162, 255, 0.075), transparent 38%);
}

.story-motion-ready .chapter::before,
.story-motion-ready .closing-chapter::before {
  transform: translate3d(0, var(--story-bg-shift, 0), 0) scaleY(1.06);
  transition: transform 180ms linear;
}

.story-motion-ready .chapter-copy,
.story-motion-ready .hero-copy {
  opacity: var(--story-reveal-opacity, 0.08);
  transform: translate3d(0, calc(var(--story-reveal-offset, 64px) + var(--story-copy-shift, 0px)), 0);
  will-change: transform, opacity;
}

.story-motion-ready .chapter-copy > *,
.story-motion-ready .hero-copy > * {
  opacity: var(--story-child-opacity, 0);
  transform: translate3d(0, var(--story-child-offset, 24px), 0);
  will-change: transform, opacity;
}

.story-motion-ready .chapter .lab-stage,
.story-motion-ready .hero-chapter .equation-console,
.story-motion-ready .hero-chapter .math-map-wide {
  opacity: var(--story-stage-opacity, 0.08);
  transform: translate3d(0, calc(var(--story-stage-reveal-offset, 80px) + var(--story-stage-shift, 0px)), 0) scale(var(--story-stage-reveal-scale, 0.975));
  will-change: transform, opacity;
}

.story-motion-ready .hero-canvas {
  transform: translate3d(0, var(--story-bg-shift, 0), 0) scale(1.04);
  transition: transform 180ms linear;
}

.hero-chapter {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  align-items: start;
  gap: clamp(36px, 5vh, 60px);
  min-height: auto;
  overflow: hidden;
  padding-top: clamp(120px, 15vh, 180px);
  padding-bottom: clamp(120px, 15vh, 180px);
}

.hero-chapter::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(8, 11, 19, 0.98) 4%, rgba(8, 11, 19, 0.7) 46%, rgba(8, 11, 19, 0.08) 100%);
  content: "";
  pointer-events: none;
}

.scene-canvas {
  display: block;
  width: 100%;
  height: clamp(320px, 54vh, 580px);
  border: 0;
  background: transparent;
  touch-action: pan-y;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: -2;
  height: 100%;
}

.hero-copy {
  align-self: auto;
  width: min(900px, 100%);
  margin: 0 auto;
  padding-top: 3vh;
}

.hero-interpretation {
  padding-top: 0;
}

.chapter-kicker,
.stage-label,
.precision-note,
.range-ends,
.evidence-strip,
.status-badge,
.history-line,
.sources a span,
.branch-break {
  font-family: var(--mono);
  text-transform: uppercase;
}

.chapter-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--paper-48);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.12em;
}

.chapter-kicker span {
  color: var(--geometry);
}

[data-accent="matter"] .chapter-kicker span {
  color: var(--matter);
}

[data-accent="horizon"] .chapter-kicker span {
  color: var(--horizon);
}

[data-accent="wormhole"] .chapter-kicker span,
[data-accent="photon"] .chapter-kicker span {
  color: var(--wormhole);
}

h1,
h2,
h3,
p,
blockquote,
figure {
  margin-top: 0;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

h1 {
  max-width: 950px;
  margin-bottom: 18px;
  color: var(--paper-bright);
  font-size: clamp(52px, 7.4vw, 112px);
  line-height: 0.88;
}

.opening-chapter .story-title {
  max-width: 11ch;
  margin-bottom: 28px;
  font-size: clamp(50px, 6.2vw, 92px);
}

.hero-copy h2 {
  max-width: 14ch;
  font-size: clamp(48px, 6vw, 92px);
}

.hero-thesis {
  max-width: 18ch;
  margin: 0 0 18px;
  color: var(--geometry);
  font-family: var(--display);
  font-size: clamp(26px, 3.2vw, 46px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

h2 {
  max-width: 13ch;
  margin-bottom: 24px;
  color: var(--paper-bright);
  font-size: clamp(42px, 5vw, 76px);
  line-height: 0.94;
}

h3 {
  margin-bottom: 0;
  color: var(--paper-bright);
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 580;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

p,
figcaption,
blockquote {
  text-wrap: pretty;
}

.hero-lede {
  max-width: 52ch;
  margin-bottom: 0;
  color: var(--paper-72);
  font-size: clamp(17px, 1.6vw, 22px);
  line-height: 1.55;
}

.equation-console {
  position: relative;
  align-self: auto;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 18px 20px 16px;
  border-top: 1px solid rgba(104, 216, 207, 0.48);
  border-bottom: 1px solid var(--paper-12);
  background: rgba(8, 11, 19, 0.7);
  backdrop-filter: blur(8px);
}

.equation-console::before {
  position: absolute;
  top: -4px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--geometry);
  box-shadow: 0 0 16px var(--geometry);
  content: "";
}

.equation {
  display: flex;
  align-items: center;
  gap: clamp(7px, 1.3vw, 18px);
  overflow-x: auto;
  padding: 2px 2px 7px;
  scrollbar-width: thin;
}

.equation-term {
  min-width: 88px;
  min-height: 64px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  text-align: center;
  transition-property: color, border-color, background-color, scale;
  transition-duration: 170ms;
  transition-timing-function: var(--ease-soft);
}

.equation-symbol {
  color: inherit;
  font-style: inherit;
  text-decoration-color: currentColor;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  cursor: help;
  transition-property: color, text-decoration-color;
  transition-duration: 140ms;
  transition-timing-function: var(--ease-soft);
}

.vector-symbol {
  position: relative;
  display: inline-block;
  min-width: 0.72em;
  padding-top: 0.13em;
  text-align: center;
}

.vector-symbol::before {
  position: absolute;
  top: 0.06em;
  right: 0.05em;
  left: 0.05em;
  border-top: 1px solid currentColor;
  content: "";
}

.vector-symbol::after {
  position: absolute;
  top: 0.015em;
  right: 0;
  width: 0.14em;
  height: 0.14em;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

.equation-symbol:hover,
.equation-symbol:focus,
.equation-symbol.is-explaining {
  color: var(--paper-bright);
  text-decoration-color: var(--photon);
}

abbr.equation-symbol:focus-visible {
  border-radius: 2px;
  outline: 2px solid var(--photon);
  outline-offset: 3px;
}

button.equation-symbol {
  cursor: pointer;
  text-decoration: none;
}

.equation-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  width: max-content;
  max-width: min(280px, calc(100vw - 24px));
  padding: 9px 11px;
  border: 1px solid rgba(104, 216, 207, 0.38);
  border-radius: 2px;
  color: var(--ink);
  background: var(--paper-bright);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  font: 650 11px/1.45 var(--body);
  text-wrap: pretty;
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px) scale(0.98);
  transform-origin: 50% 100%;
  transition-property: opacity, transform;
  transition-duration: 140ms;
  transition-timing-function: var(--ease-out);
}

.equation-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.equation-tooltip.is-below {
  transform-origin: 50% 0;
}

.equation-term > span,
.equation-constant,
.equation-operator {
  font-family: var(--display);
}

.equation-term > span {
  display: block;
  color: var(--paper-bright);
  font-size: clamp(25px, 3.2vw, 42px);
  line-height: 1;
}

.equation-term small {
  display: block;
  margin-top: 8px;
  color: var(--paper-48);
  font: 650 8px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.equation-term.is-active {
  border-color: rgba(104, 216, 207, 0.42);
  background: rgba(104, 216, 207, 0.08);
}

.equation-term.equation-matter.is-active {
  border-color: rgba(242, 180, 95, 0.5);
  background: rgba(242, 180, 95, 0.08);
}

.equation-operator {
  color: var(--paper-48);
  font-size: 26px;
}

.equation-constant {
  color: var(--paper-72);
  font-size: clamp(15px, 2vw, 24px);
  white-space: nowrap;
}

.equation-readout {
  min-height: 21px;
  margin: 8px 2px 15px;
  color: var(--geometry);
  font-size: 13px;
  line-height: 1.55;
}

.control-row,
.stage-controls {
  --range-color: var(--geometry);
}

[data-accent="matter"] .stage-controls {
  --range-color: var(--matter);
}

[data-accent="horizon"] .stage-controls {
  --range-color: var(--horizon);
}

[data-accent="wormhole"] .stage-controls,
[data-accent="photon"] .stage-controls {
  --range-color: var(--wormhole);
}

.control-row label,
.stage-controls label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
  color: var(--paper-72);
  font: 650 10px/1.3 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.control-row output,
.stage-controls output {
  color: var(--range-color);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

input[type="range"] {
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  accent-color: var(--range-color, var(--geometry));
  cursor: ew-resize;
}

.range-ends {
  display: flex;
  justify-content: space-between;
  margin-top: -5px;
  color: var(--paper-22);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.scroll-cue {
  position: absolute;
  right: clamp(24px, 5vw, 80px);
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 44px;
  min-height: 44px;
  color: var(--paper-48);
  font: 650 9px/1 var(--mono);
  letter-spacing: 0.09em;
  text-decoration: none;
  text-transform: uppercase;
}

.scroll-cue i {
  position: relative;
  width: 38px;
  height: 1px;
  overflow: hidden;
  background: var(--paper-22);
}

.scroll-cue i::after {
  position: absolute;
  inset: 0;
  background: var(--geometry);
  content: "";
  transform: translateX(-100%);
  animation: cue-travel 2.2s var(--ease-out) infinite;
}

@keyframes cue-travel {
  50%,
  100% { transform: translateX(100%); }
}

.split-chapter {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(520px, 1.28fr);
  align-items: center;
  gap: clamp(40px, 7vw, 112px);
}

.chapter-reverse .chapter-copy {
  grid-column: 2;
}

.chapter-reverse .lab-stage {
  grid-row: 1;
  grid-column: 1;
}

.chapter-copy {
  max-width: 560px;
}

#equivalence,
#curvature,
#black-hole {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  align-items: start;
  gap: clamp(28px, 4vh, 48px);
  padding-top: clamp(120px, 15vh, 180px);
  padding-bottom: clamp(120px, 15vh, 180px);
}

#equivalence .chapter-copy,
#curvature .chapter-copy,
#black-hole .chapter-copy {
  grid-row: auto;
  grid-column: 1;
  width: min(780px, 100%);
  max-width: none;
  margin: 0 auto;
}

#equivalence .chapter-copy > p:not(.chapter-kicker, .precision-note, .display-equation),
#curvature .chapter-copy > p:not(.chapter-kicker, .precision-note, .display-equation),
#black-hole .chapter-copy > p:not(.chapter-kicker, .precision-note, .display-equation) {
  max-width: 62ch;
}

#equivalence .chapter-copy::after,
#curvature .chapter-copy::after,
#black-hole .chapter-copy::after {
  display: block;
  width: 1px;
  height: clamp(58px, 8vh, 84px);
  margin: clamp(38px, 6vh, 68px) auto 0;
  background: linear-gradient(var(--geometry), transparent);
  content: "";
  opacity: 0.22;
  transform: scaleY(0.24);
  transform-origin: 50% 0;
  transition:
    opacity 420ms var(--ease-out),
    transform 620ms var(--ease-out);
}

#equivalence .chapter-copy::after {
  background: linear-gradient(var(--matter), transparent);
}

#black-hole .chapter-copy::after {
  background: linear-gradient(var(--horizon), transparent);
}

#equivalence.is-story-active .chapter-copy::after,
#curvature.is-story-active .chapter-copy::after,
#black-hole.is-story-active .chapter-copy::after {
  opacity: 0.72;
  transform: scaleY(1);
}

#equivalence .lab-stage,
#curvature .lab-stage,
#black-hole .lab-stage {
  grid-row: auto;
  grid-column: 1;
  width: min(1080px, 100%);
  margin: 0 auto;
}

#equivalence .scene-canvas,
#curvature .scene-canvas,
#black-hole .scene-canvas {
  height: clamp(440px, 62vh, 680px);
}

#white-hole,
#wormhole,
#laser {
  align-content: start;
  align-items: start;
  padding-top: clamp(120px, 15vh, 180px);
  padding-bottom: clamp(120px, 15vh, 180px);
}

#white-hole,
#wormhole,
#laser .laser-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(28px, 4vh, 48px);
}

#white-hole .chapter-copy,
#wormhole .chapter-copy,
#laser .chapter-copy {
  grid-row: auto;
  grid-column: 1;
  width: min(780px, 100%);
  max-width: none;
  margin: 0 auto;
}

#white-hole .chapter-copy > p:not(.chapter-kicker, .precision-note, .display-equation),
#wormhole .chapter-copy > p:not(.chapter-kicker, .precision-note, .display-equation),
#laser .chapter-copy > p:not(.chapter-kicker, .precision-note, .display-equation) {
  max-width: 62ch;
}

#white-hole .chapter-copy::after,
#wormhole .chapter-copy::after,
#laser .chapter-copy::after {
  display: block;
  width: 1px;
  height: clamp(58px, 8vh, 84px);
  margin: clamp(38px, 6vh, 68px) auto 0;
  background: linear-gradient(var(--paper-bright), transparent);
  content: "";
  opacity: 0.22;
  transform: scaleY(0.24);
  transform-origin: 50% 0;
  transition:
    opacity 420ms var(--ease-out),
    transform 620ms var(--ease-out);
}

#wormhole .chapter-copy::after {
  background: linear-gradient(var(--wormhole), transparent);
}

#laser .chapter-copy::after {
  background: linear-gradient(var(--photon), transparent);
}

#white-hole.is-story-active .chapter-copy::after,
#wormhole.is-story-active .chapter-copy::after,
#laser.is-story-active .chapter-copy::after {
  opacity: 0.72;
  transform: scaleY(1);
}

#white-hole .lab-stage,
#wormhole .lab-stage,
#laser .lab-stage {
  grid-row: auto;
  grid-column: 1;
  width: min(1080px, 100%);
  margin: 0 auto;
}

#white-hole .scene-canvas,
#wormhole .scene-canvas,
#laser .scene-canvas {
  height: clamp(440px, 62vh, 680px);
}

#laser .branch-break {
  width: min(1080px, 100%);
  margin-bottom: clamp(74px, 10vh, 120px);
}

.story-motion-ready #laser .branch-break {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity 520ms var(--ease-out),
    transform 520ms var(--ease-out);
}

.story-motion-ready #laser.is-story-active .branch-break {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.story-motion-ready .closing-chapter > * {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition:
    opacity 480ms var(--ease-out),
    transform 480ms var(--ease-out);
}

.story-motion-ready .closing-chapter.is-story-active > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.story-motion-ready .closing-chapter > :nth-child(2) { transition-delay: 55ms; }
.story-motion-ready .closing-chapter > :nth-child(3) { transition-delay: 110ms; }
.story-motion-ready .closing-chapter > :nth-child(4) { transition-delay: 165ms; }
.story-motion-ready .closing-chapter > :nth-child(n + 5) { transition-delay: 220ms; }

.chapter-copy > p:not(.chapter-kicker, .precision-note, .display-equation) {
  max-width: 48ch;
  margin-bottom: 18px;
  color: var(--paper-72);
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.65;
}

.chapter-copy blockquote {
  max-width: 38ch;
  margin: 30px 0;
  padding: 0 0 0 18px;
  border-left: 2px solid var(--matter);
  color: var(--paper-bright);
  font-family: var(--display);
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.38;
}

.precision-note {
  max-width: 62ch;
  margin-bottom: 0;
  color: var(--paper-48);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.65;
  letter-spacing: 0.07em;
}

.display-equation {
  position: relative;
  margin: 28px 0 !important;
  padding-bottom: 64px;
  color: var(--paper-bright) !important;
  font: 500 clamp(30px, 3.5vw, 50px)/1 var(--display) !important;
  letter-spacing: -0.02em;
}

.lab-stage {
  position: relative;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border-top: 1px solid var(--paper-22);
  border-bottom: 1px solid var(--paper-12);
  background: rgba(15, 21, 33, 0.74);
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.28),
    inset 0 1px rgba(255, 255, 255, 0.025);
}

.lab-stage::before {
  position: absolute;
  top: -3px;
  left: 0;
  z-index: 2;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--geometry);
  box-shadow: 0 0 12px var(--geometry);
  content: "";
}

[data-accent="matter"] .lab-stage::before {
  background: var(--matter);
  box-shadow: 0 0 12px var(--matter);
}

[data-accent="horizon"] .lab-stage::before {
  background: var(--horizon);
  box-shadow: 0 0 12px var(--horizon);
}

[data-accent="wormhole"] .lab-stage::before,
[data-accent="photon"] .lab-stage::before {
  background: var(--wormhole);
  box-shadow: 0 0 12px var(--wormhole);
}

.stage-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 74px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--paper-12);
}

.stage-label {
  margin: 0 0 6px;
  color: var(--paper-48);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.lab-stage > .stage-equation {
  --equation-accent: var(--geometry);
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(190px, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 64px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--paper-12);
  background: rgba(8, 11, 19, 0.42);
}

.chapter-equation {
  --equation-accent: var(--geometry);
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(260px, 1.15fr);
  align-items: center;
  gap: 18px;
  width: min(760px, 100%);
  margin: 0 0 30px;
  padding: 16px 18px;
  border-top: 1px solid var(--paper-12);
  border-bottom: 1px solid var(--paper-12);
  background: linear-gradient(90deg, rgba(8, 11, 19, 0.66), rgba(8, 11, 19, 0.18));
}

[data-accent="matter"] .chapter-equation {
  --equation-accent: var(--matter);
}

[data-accent="horizon"] .chapter-equation {
  --equation-accent: var(--horizon);
}

[data-accent="white-hole"] .chapter-equation {
  --equation-accent: var(--paper-bright);
}

[data-accent="wormhole"] .chapter-equation,
[data-accent="photon"] .chapter-equation {
  --equation-accent: var(--wormhole);
}

.math-map {
  --map-accent: var(--geometry);
  position: relative;
  width: 100%;
  margin: 30px 0 34px;
  overflow: hidden;
  border-top: 1px solid color-mix(in srgb, var(--map-accent) 42%, transparent);
  border-bottom: 1px solid var(--paper-12);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--map-accent) 5%, transparent), transparent 55%),
    rgba(8, 11, 19, 0.62);
  box-shadow: 0 24px 62px rgba(0, 0, 0, 0.2);
}

.math-map[data-map-accent="matter"] { --map-accent: var(--matter); }
.math-map[data-map-accent="horizon"] { --map-accent: var(--horizon); }
.math-map[data-map-accent="wormhole"],
.math-map[data-map-accent="photon"] { --map-accent: var(--wormhole); }
.math-map[data-map-accent="white-hole"] { --map-accent: var(--paper-bright); }

.math-map::before {
  position: absolute;
  top: -3px;
  left: 0;
  z-index: 2;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--map-accent);
  box-shadow: 0 0 16px var(--map-accent);
  content: "";
}

.math-map-wide {
  width: min(1080px, 100%);
  margin: 0 auto;
}

.math-map-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  min-height: 92px;
  padding: 17px 20px 16px;
  border-bottom: 1px solid var(--paper-12);
}

.math-map-heading h3 {
  max-width: 30ch;
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.15;
}

.math-map-kicker {
  margin: 0 0 8px;
  color: var(--map-accent);
  font: 720 8px/1.3 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.math-map-readout {
  padding-bottom: 2px;
  color: var(--map-accent);
  font: 700 9px/1.4 var(--mono);
  letter-spacing: 0.04em;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
}

.math-map-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 0.34fr);
  min-height: 330px;
}

.math-map-formula {
  margin: 0 !important;
  padding: 17px 20px 18px;
  border-bottom: 1px solid var(--paper-12);
  color: var(--map-accent) !important;
  background: rgba(8, 11, 19, 0.34);
  font: 500 clamp(25px, 3vw, 40px)/1.15 var(--display) !important;
  letter-spacing: -0.025em;
  text-align: center;
  white-space: nowrap;
}

.math-map-canvas {
  display: block;
  width: 100%;
  height: 330px;
  background:
    linear-gradient(rgba(238, 232, 216, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238, 232, 216, 0.018) 1px, transparent 1px);
  background-size: 20px 20px;
}

.math-map-canvas-double {
  height: 500px;
}

.math-map-reading {
  display: grid;
  align-content: center;
  gap: 0;
  border-left: 1px solid var(--paper-12);
}

.math-map-reading p {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  margin: 0;
  padding: 16px;
  color: var(--paper-48);
  font-size: 11px;
  line-height: 1.5;
}

.math-map-reading p + p {
  border-top: 1px solid var(--paper-12);
}

.math-map-reading b {
  color: var(--map-accent);
  font: 720 8px/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.math-map-controls {
  --range-color: var(--map-accent);
  padding: 15px 20px 14px;
  border-top: 1px solid var(--paper-12);
  background: color-mix(in srgb, var(--map-accent) 3%, transparent);
}

.math-map-controls-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--paper-12);
}

.math-map-controls-grid .math-map-controls {
  border-top: 0;
}

.math-map-controls-grid .math-map-controls + .math-map-controls {
  border-left: 1px solid var(--paper-12);
}

.math-map-controls label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 7px;
  color: var(--paper-72);
  font: 650 9px/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.math-map-controls output {
  color: var(--map-accent);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.math-map figcaption {
  margin: 0;
  padding: 13px 20px 15px;
  border-top: 1px solid var(--paper-12);
  color: var(--paper-48);
  font-size: 11px;
  line-height: 1.55;
}

.field-balance-equation {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--paper-12);
  background:
    linear-gradient(90deg, rgba(104, 216, 207, 0.07), transparent 62%),
    rgba(8, 11, 19, 0.42);
}

.field-balance-label {
  margin: 0;
  color: var(--geometry);
  font: 720 8px/1.4 var(--mono);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.field-balance-symbolic {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 42px);
  color: var(--paper-bright);
  font: 500 clamp(25px, 3.1vw, 40px)/1.2 var(--display);
  letter-spacing: -0.025em;
}

.field-balance-symbolic i {
  color: var(--geometry);
  font-family: var(--mono);
  font-size: 0.72em;
  font-style: normal;
}

.field-balance-numbers {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--paper-12);
  color: var(--matter);
  font: 650 clamp(19px, 2.3vw, 30px)/1.2 var(--mono);
  font-variant-numeric: tabular-nums;
}

.field-balance-numbers b {
  color: var(--geometry);
  font: 720 8px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.field-balance-limit {
  max-width: 80ch;
  margin: 0;
  color: var(--paper-48);
  font-size: 11px;
  line-height: 1.55;
}

.field-map-body {
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.34fr);
  min-height: 390px;
}

.field-equation-map .math-map-canvas {
  height: 390px;
}

.field-map-reading p {
  grid-template-columns: 72px 1fr;
  padding-top: 14px;
  padding-bottom: 14px;
}

.field-balance-ledger {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--paper-12);
  background: rgba(8, 11, 19, 0.28);
}

.field-balance-ledger article {
  min-width: 0;
  padding: 16px;
}

.field-balance-ledger article + article {
  border-left: 1px solid var(--paper-12);
}

.field-balance-ledger span {
  display: block;
  margin-bottom: 7px;
  color: var(--paper-48);
  font: 700 8px/1.3 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.field-balance-ledger strong {
  display: block;
  min-height: 1.35em;
  margin-bottom: 8px;
  color: var(--geometry);
  font: 600 clamp(17px, 1.7vw, 23px)/1.25 var(--mono);
  font-variant-numeric: tabular-nums;
}

.field-balance-ledger article:nth-child(2) strong {
  color: var(--wormhole);
}

.field-balance-ledger article:nth-child(3) strong {
  color: var(--matter);
}

.field-balance-ledger p {
  margin: 0;
  color: var(--paper-48);
  font-size: 10px;
  line-height: 1.5;
}

.field-stage {
  width: min(1080px, 100%);
  margin: 0 auto;
}

.field-stage .scene-canvas {
  height: clamp(440px, 62vh, 680px);
}

.chapter-reverse .lab-stage > .stage-equation {
  grid-template-columns: 1fr;
  gap: 6px;
}

[data-accent="matter"] .lab-stage > .stage-equation {
  --equation-accent: var(--matter);
}

[data-accent="horizon"] .lab-stage > .stage-equation {
  --equation-accent: var(--horizon);
}

[data-accent="white-hole"] .lab-stage > .stage-equation {
  --equation-accent: var(--paper-bright);
}

[data-accent="wormhole"] .lab-stage > .stage-equation,
[data-accent="photon"] .lab-stage > .stage-equation {
  --equation-accent: var(--wormhole);
}

.stage-equation-math {
  margin: 0;
  color: var(--equation-accent);
  font: 500 clamp(21px, 2.1vw, 29px)/1.1 var(--display);
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.stage-equation-copy {
  margin: 0;
  color: var(--paper-48);
  font-size: 11px;
  line-height: 1.45;
  text-wrap: pretty;
}

.lab-stage figcaption {
  min-height: 45px;
  margin: 0;
  padding: 10px 18px 12px;
  border-top: 1px solid var(--paper-12);
  color: var(--paper-48);
  font-size: 11px;
  line-height: 1.45;
}

.stage-controls {
  padding: 16px 18px 15px;
  border-top: 1px solid var(--paper-12);
}

.dual-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--paper-12);
}

.dual-controls .stage-controls {
  border-top: 0;
}

.dual-controls .stage-controls + .stage-controls {
  border-left: 1px solid var(--paper-12);
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--paper-12);
}

.segmented-control button {
  min-width: 64px;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--paper-48);
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition-property: color, background-color, scale;
  transition-duration: 150ms;
  transition-timing-function: var(--ease-soft);
}

.segmented-control button.is-active {
  color: var(--ink);
  background: var(--matter);
}

.action-button {
  min-width: 128px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(104, 216, 207, 0.46);
  border-radius: 2px;
  color: var(--geometry);
  background: rgba(104, 216, 207, 0.07);
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition-property: color, background-color, border-color, scale;
  transition-duration: 150ms;
  transition-timing-function: var(--ease-soft);
}

.action-button:hover {
  color: var(--ink);
  background: var(--geometry);
}

.action-button-coral {
  border-color: rgba(240, 109, 98, 0.5);
  color: var(--horizon);
  background: rgba(240, 109, 98, 0.07);
}

.action-button-coral:hover {
  background: var(--horizon);
}

.action-button-violet {
  border-color: rgba(185, 162, 255, 0.52);
  color: var(--wormhole);
  background: rgba(185, 162, 255, 0.07);
}

.action-button-violet:hover {
  background: var(--wormhole);
}

.evidence-strip,
.history-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.evidence-strip {
  margin-top: 28px;
}

.evidence-strip span,
.history-line span {
  padding: 8px 9px;
  border: 1px solid var(--paper-12);
  color: var(--paper-48);
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.06em;
}

.evidence-strip b,
.history-line b {
  color: var(--paper-bright);
  font-weight: 720;
}

.lab-stage-dark {
  background: #07090e;
}

.zone-key {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 34px;
  border-top: 1px solid var(--paper-12);
  color: var(--paper-48);
  font: 650 8px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.zone-key span:first-child {
  padding-left: 18px;
  color: var(--horizon);
}

.zone-key span:last-child {
  padding-right: 18px;
  text-align: right;
}

.zone-key b {
  color: var(--paper-bright);
  font-weight: 720;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 0 0 24px;
  padding: 0 10px;
  border: 1px solid var(--paper-22);
  color: var(--paper-72);
  font-size: 8px;
  font-weight: 720;
  letter-spacing: 0.1em;
}

.status-badge::before {
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--paper-48);
  content: "";
}

[data-status="theoretical-unobserved"] {
  border-color: rgba(185, 162, 255, 0.36);
  color: var(--wormhole);
}

[data-status="theoretical-unobserved"]::before {
  background: var(--wormhole);
}

.direction-glyph {
  min-width: 64px;
  color: var(--paper-bright);
  font: 500 38px/1 var(--display);
  text-align: center;
  transform: rotate(var(--direction-rotation, 0deg));
  transition-property: transform, color;
  transition-duration: 260ms;
  transition-timing-function: var(--ease-out);
}

.laser-chapter {
  padding-right: clamp(28px, 6vw, 100px);
  padding-left: clamp(28px, 6vw, 100px);
}

.branch-break {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 15px;
  margin: 0 auto clamp(48px, 7vh, 82px);
  color: var(--wormhole);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.branch-break i {
  height: 1px;
  background: linear-gradient(90deg, var(--wormhole), var(--photon));
}

.laser-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(540px, 1.28fr);
  align-items: center;
  gap: clamp(44px, 7vw, 112px);
}

.lab-stage-laser::before {
  background: var(--photon);
  box-shadow: 0 0 12px var(--photon);
}

.closing-chapter {
  display: grid;
  place-content: center;
  min-height: 100svh;
  text-align: center;
}

.closing-chapter h2 {
  max-width: 18ch;
  margin-right: auto;
  margin-left: auto;
  font-size: clamp(44px, 6vw, 88px);
}

.closing-chapter > p:not(.chapter-kicker) {
  max-width: 60ch;
  margin: 0 auto 38px;
  color: var(--paper-72);
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.65;
}

.closing-chapter .chapter-kicker {
  justify-content: center;
}

.history-line {
  justify-content: center;
  max-width: 980px;
  margin: 0 auto 38px;
}

.sources {
  width: min(980px, 100%);
  margin: 0 auto;
  border-top: 1px solid var(--paper-22);
  border-bottom: 1px solid var(--paper-12);
  text-align: left;
}

.sources summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 4px;
  color: var(--paper-72);
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.09em;
  list-style: none;
  text-transform: uppercase;
}

.sources summary::-webkit-details-marker {
  display: none;
}

.sources summary::after {
  color: var(--geometry);
  content: "+";
  font-size: 18px;
  transition-property: transform;
  transition-duration: 180ms;
  transition-timing-function: var(--ease-out);
}

.sources summary span {
  margin-left: auto;
  margin-right: 16px;
  color: var(--paper-22);
  font-size: 8px;
}

.sources[open] summary::after {
  transform: rotate(45deg);
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  padding: 1px 0;
  background: var(--paper-12);
}

.sources a {
  display: grid;
  gap: 7px;
  min-height: 84px;
  padding: 16px;
  color: var(--paper-72);
  background: var(--ink-raised);
  text-decoration: none;
  transition-property: color, background-color;
  transition-duration: 160ms;
  transition-timing-function: var(--ease-soft);
}

.sources a:hover {
  color: var(--paper-bright);
  background: var(--ink-soft);
}

.sources a span {
  color: var(--geometry);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.sources a b {
  font-size: 13px;
  font-weight: 570;
  line-height: 1.35;
}

.restart-link {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 12px;
  min-width: 44px;
  min-height: 44px;
  margin: 32px auto 0;
  color: var(--geometry);
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.09em;
  text-decoration: none;
  text-transform: uppercase;
}

.noscript-message {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 90;
  max-width: 380px;
  padding: 14px;
  border: 1px solid var(--horizon);
  color: var(--paper-bright);
  background: var(--ink);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .split-chapter,
  .laser-layout {
    grid-template-columns: minmax(230px, 0.7fr) minmax(440px, 1.3fr);
    gap: 44px;
  }

  .chapter,
  .closing-chapter {
    padding-right: 32px;
    padding-left: 32px;
  }

  h2 {
    font-size: clamp(40px, 5.5vw, 64px);
  }
}

@media (max-width: 840px) {
  body {
    padding-bottom: calc(60px + var(--safe-bottom));
  }

  .utility-bar {
    grid-template-columns: 1fr 1fr;
    padding-right: calc(12px + var(--safe-right));
    padding-left: calc(12px + var(--safe-left));
  }

  .utility-title {
    display: none;
  }

  .worldline-nav {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    flex-direction: row;
    justify-content: flex-start;
    width: auto;
    height: calc(60px + var(--safe-bottom));
    padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left);
    overflow-x: auto;
    border-top: 1px solid var(--paper-12);
    border-right: 0;
    background: rgba(8, 11, 19, 0.94);
    backdrop-filter: blur(12px);
    scrollbar-width: none;
  }

  .worldline-nav::-webkit-scrollbar {
    display: none;
  }

  .worldline-track {
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    height: 1px;
  }

  .worldline-track i {
    width: var(--story-progress, 0%);
    height: 1px;
    transition-property: width, background-color;
  }

  .worldline-nav a {
    flex: 0 0 80px;
    align-content: center;
    min-height: 59px;
    padding: 8px 8px 8px 19px;
  }

  .worldline-nav a::before {
    top: 25px;
    left: 4px;
  }

  main {
    margin-left: 0;
  }

  .chapter,
  .closing-chapter {
    min-height: auto;
    padding: 94px 22px 78px;
    scroll-margin-top: 58px;
  }

  .hero-chapter {
    min-height: auto;
    padding-top: 110px;
  }

  .hero-copy,
  .equation-console {
    width: 100%;
  }

  .hero-copy {
    align-self: center;
  }

  h1 {
    font-size: clamp(50px, 12vw, 88px);
  }

  .split-chapter,
  .laser-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 46px;
  }

  .chapter-reverse .chapter-copy,
  .chapter-reverse .lab-stage {
    grid-row: auto;
    grid-column: 1;
  }

  .chapter-copy {
    max-width: 640px;
  }

  h2 {
    max-width: 15ch;
    font-size: clamp(42px, 9vw, 68px);
  }

  .scene-canvas {
    height: min(62vw, 500px);
    min-height: 330px;
  }

  .math-map-body {
    grid-template-columns: 1fr;
  }

  .math-map-reading {
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--paper-12);
    border-left: 0;
  }

  .field-map-reading {
    grid-template-columns: repeat(2, 1fr);
  }

  .field-balance-ledger {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-balance-ledger article:nth-child(3) {
    border-top: 1px solid var(--paper-12);
    border-left: 0;
  }

  .field-balance-ledger article:nth-child(4) {
    border-top: 1px solid var(--paper-12);
  }

  .math-map-reading p {
    grid-template-columns: 1fr;
  }

  .math-map-reading p + p {
    border-top: 0;
    border-left: 1px solid var(--paper-12);
  }

  .laser-chapter {
    padding-right: 22px;
    padding-left: 22px;
  }
}

@media (max-width: 560px) {
  .home-link span:last-child {
    display: none;
  }

  .hero-chapter {
    min-height: auto;
  }

  .hero-chapter::after {
    background: linear-gradient(180deg, rgba(8, 11, 19, 0.62), rgba(8, 11, 19, 0.9) 65%, var(--ink));
  }

  .chapter,
  .closing-chapter {
    padding-right: 16px;
    padding-left: 16px;
  }

  h1 {
    font-size: clamp(48px, 15vw, 74px);
  }

  h2 {
    font-size: clamp(40px, 12vw, 58px);
  }

  .equation-console {
    padding-right: 12px;
    padding-left: 12px;
  }

  .equation {
    gap: 5px;
  }

  .equation-term {
    min-width: 76px;
    padding-right: 6px;
    padding-left: 6px;
  }

  .equation-term > span {
    font-size: 26px;
  }

  .equation-constant {
    font-size: 13px;
  }

  .scroll-cue {
    right: 16px;
    left: 16px;
    justify-content: flex-end;
  }

  .stage-heading {
    align-items: flex-start;
    padding-right: 12px;
    padding-left: 12px;
  }

  .math-map-heading {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .field-balance-equation {
    padding-right: 12px;
    padding-left: 12px;
  }

  .field-balance-symbolic {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    font-size: clamp(23px, 8vw, 32px);
  }

  .field-balance-symbolic i {
    transform: rotate(90deg);
    transform-origin: 10px 50%;
  }

  .field-balance-numbers {
    align-items: flex-start;
    flex-direction: column;
  }

  .field-equation-map .math-map-canvas {
    height: 350px;
  }

  .field-map-reading {
    grid-template-columns: 1fr;
  }

  .field-map-reading p {
    grid-template-columns: 74px 1fr;
  }

  .field-balance-ledger {
    grid-template-columns: 1fr;
  }

  .field-balance-ledger article + article,
  .field-balance-ledger article:nth-child(3),
  .field-balance-ledger article:nth-child(4) {
    border-top: 1px solid var(--paper-12);
    border-left: 0;
  }

  .math-map-readout {
    text-align: left;
    white-space: normal;
  }

  .math-map-formula {
    overflow-x: auto;
    padding-right: 12px;
    padding-left: 12px;
    font-size: clamp(23px, 8vw, 34px) !important;
    text-align: left;
    scrollbar-width: thin;
  }

  .math-map-canvas {
    height: 300px;
  }

  .math-map-canvas-double {
    height: 530px;
  }

  .math-map-reading {
    grid-template-columns: 1fr;
  }

  .math-map-reading p {
    grid-template-columns: 42px 1fr;
    padding: 13px 12px;
  }

  .math-map-reading p + p {
    border-top: 1px solid var(--paper-12);
    border-left: 0;
  }

  .math-map-controls,
  .math-map figcaption {
    padding-right: 12px;
    padding-left: 12px;
  }

  .math-map-controls-grid {
    grid-template-columns: 1fr;
  }

  .math-map-controls-grid .math-map-controls + .math-map-controls {
    border-top: 1px solid var(--paper-12);
    border-left: 0;
  }

  .math-map-controls label {
    gap: 10px;
  }

  .math-map figcaption {
    padding-right: 12px;
    padding-left: 12px;
  }

  .stage-heading h3 {
    font-size: 18px;
  }

  .lab-stage > .stage-equation,
  .chapter-equation {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px;
  }

  .stage-equation-math {
    font-size: 23px;
    white-space: normal;
  }

  .action-button {
    min-width: 110px;
    padding-right: 10px;
    padding-left: 10px;
    font-size: 8px;
  }

  .scene-canvas {
    height: 360px;
    min-height: 300px;
  }

  .dual-controls {
    grid-template-columns: 1fr;
  }

  .dual-controls .stage-controls + .stage-controls {
    border-top: 1px solid var(--paper-12);
    border-left: 0;
  }

  .segmented-control button {
    min-width: 54px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .branch-break {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .branch-break i {
    grid-row: 2;
  }

  .sources-grid {
    grid-template-columns: 1fr;
  }

  .history-line span {
    flex: 1 0 42%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .scroll-cue i::after {
    display: none;
  }
}
