/* ═══════════════════════════════════════
   ROCHE ROCK N' ROLL — Storymap Styles
   Aesthetic: Dark editorial, stone & ochre
═══════════════════════════════════════ */

@property --mask-stop {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 55%;
}

/* Intro sketch transitions (Level 1.5) — registered so they interpolate.
   If @property is unsupported the states still switch, just without the
   animated in-between. */
@property --bloom {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 0%;
}
@property --rise {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 0%;
}
/* Chapter page contours, 0 → 1 as they draw out — registered so Chapter 3's
   (which runs on a clock, not the scroll) can transition */
@property --cd {
  syntax: '<number>';
  inherits: false;
  initial-value: 1;
}
/* Hero Begin button rim light — registered so the conic sweep can spin */
@property --hs-rim {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

:root {
  --stone:    #1a1814;
  --stone-mid:#2e2b26;
  --stone-lt: #908f8e;
  --parchment:#f0ead8;
  --cream:    #faf7f0;
  --ochre:    #c8962a;
  --ochre-lt: #e8b84b;
  --rust:     #8b3a2a;
  --mist:     rgba(240,234,216,0.08);

  /* Three faces, three jobs:
     --font-hero     the hero's title and subtitle, and the chapter titles
     --font-heading  every level heading: Piazzolla, semibold and a touch
                     open (--heading-weight, --heading-tracking)
     --font-body     everything else: Golos Text (see @font-face below);
                     the hero's small line and scroll cue keep Signika */
  --font-hero:    'BJ Cree', Georgia, serif;
  --font-heading: 'Piazzolla', Georgia, serif;
  --heading-weight: 600;
  --heading-stretch: normal;
  --heading-tracking: 0.015em;
  /* BJ Cree's own word space is very wide (0.635em, wider than its n);
     the hero and chapter titles close it to an ordinary space, and gaps
     built between separate pieces of a heading use the same measure */
  --heading-space: 0.26em;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Golos Body', system-ui, sans-serif;

  --panel-w: 380px;
  --transition: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--stone);
  color: var(--parchment);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.75;
  overflow-x: hidden;
}

/* ── Typography ── */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.1;
}

/* The body font: Golos Text, from the site's own files, scaled to 111% so
   its x-height matches the Signika it replaced (Signika at 117%). Its
   lightest weight is 400, so text set at 300 shows at 400. */
@font-face { font-family: 'Golos Body'; font-style: normal; font-weight: 400; font-display: swap; size-adjust: 111%; src: url("fonts/golos/golos-text-400.woff") format("woff"); }
@font-face { font-family: 'Golos Body'; font-style: normal; font-weight: 500; font-display: swap; size-adjust: 111%; src: url("fonts/golos/golos-text-500.woff") format("woff"); }
@font-face { font-family: 'Golos Body'; font-style: normal; font-weight: 600; font-display: swap; size-adjust: 111%; src: url("fonts/golos/golos-text-600.woff") format("woff"); }
@font-face { font-family: 'Golos Body'; font-style: normal; font-weight: 700; font-display: swap; size-adjust: 111%; src: url("fonts/golos/golos-text-700.woff") format("woff"); }

/* Signika, kept for the hero's small line and scroll cue */
@font-face { font-family: 'Signika Body'; font-style: normal; font-weight: 300; font-display: swap; size-adjust: 117%; src: url("fonts/signika/signika-300.woff") format("woff"); }
@font-face { font-family: 'Signika Body'; font-style: normal; font-weight: 400; font-display: swap; size-adjust: 117%; src: url("fonts/signika/signika-400.woff") format("woff"); }
@font-face { font-family: 'Signika Body'; font-style: normal; font-weight: 500; font-display: swap; size-adjust: 117%; src: url("fonts/signika/signika-500.woff") format("woff"); }
@font-face { font-family: 'Signika Body'; font-style: normal; font-weight: 600; font-display: swap; size-adjust: 117%; src: url("fonts/signika/signika-600.woff") format("woff"); }
@font-face { font-family: 'Signika Body'; font-style: normal; font-weight: 700; font-display: swap; size-adjust: 117%; src: url("fonts/signika/signika-700.woff") format("woff"); }

/* Every level heading, whatever its own rule says: Piazzolla, semibold.
   (The timeline's title is one in all but tag.) */
h1, h2, h3, h4, h5, h6, .tl-title-heading {
  font-family: var(--font-heading) !important;
  font-weight: var(--heading-weight) !important;
  font-stretch: var(--heading-stretch);
  word-spacing: normal;
}
/* ...and their letter-spacing, over each heading's own; never the hero's
   or the chapter titles' */
:is(h1, h2, h3, h4, h5, h6, .tl-title-heading):not(.hero-title, .hero-subtitle, .chapter-title) {
  letter-spacing: var(--heading-tracking) !important;
}
/* The hero's title and subtitle, and the chapter titles: BJ Cree, its
   wide word space closed to an ordinary one */
.hero-title, .title-line, .hero-subtitle, .chapter-title, .chapter-title * {
  font-family: var(--font-hero) !important;
  font-stretch: normal;
  word-spacing: calc(var(--heading-space) - 0.635em);
}
.hero-title, .title-line, .hero-subtitle { font-weight: 400 !important; }
.hero-eyebrow, .hero-scroll-cue { font-family: 'Signika Body', system-ui, sans-serif; }
.chapter-title { font-weight: 600 !important; }
/* and one colour: white, every word of every heading alike (no accent words) */
h1, h2, h3, h4, h5, h6,
.hero-title, .title-line, .tl-title-heading,
:is(h1, h2, h3, h4, h5, h6, .hero-title, .tl-title-heading) * {
  color: #fff !important;
}
/* ...except the headings on cards that turn light: the context notes and
   the About cards keep their own ink, black while active or hovered */
.rb-title, #level-epilogue .text-level-heading, .about-bio-name, .about-bio-label {
  color: var(--c-ink) !important;
}

/* No italics anywhere: emphasis is carried by colour (an accented word
   keeps its ochre), never by slant — and no slant is faked either */
*, *::before, *::after { font-style: normal !important; }
html { font-synthesis: none; }

strong { font-weight: 500; color: var(--ochre-lt); }
em { color: var(--parchment); }

/* ══════════════════════════════════════
   HERO SKETCH — opening layer above the drone hero
   .hs-camera is sized to cover the section and positioned by JS
   (translate + scale from its top-left corner). Every layer fills
   the camera, so all positions below are fractions of the drawing.
══════════════════════════════════════ */
#hero-sketch {
  position: relative;
  height: 100vh;
  height: 100svh;   /* tablets: fill the screen without hiding under the browser bar */
  min-height: 600px;
  overflow: hidden;
}

.hero-sketch {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #07090b;
}

.hs-camera {
  position: absolute;
  left: 0; top: 0;
  transform-origin: 0 0;
  will-change: transform;
  opacity: 0;
}

.hs-layer,
.hs-land-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hs-sky  { transform-origin: 50% 100%; will-change: transform; }
.hs-land, .hs-land-shade { will-change: transform; }   /* lifted at the open, settles with the camera */

/* Figure depth planes are scaled about the camera's anchor by JS */
.hs-figures,
.hs-foreground { will-change: transform; }

.hs-figures img,
.hs-foreground img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Firelight on the figures: a copy of the figure baked once with the
   fire's light screened over it (bakeFirelight in main.js), covering just
   the patch the light reaches. JS flickers only its opacity, which the
   compositor handles for free — no live masks or blend modes. Must match
   LIT_CROP in main.js. */
.hs-firelit {
  position: absolute;
  left: 18.5%; top: 38%;
  width: 60%; height: 62%;
  opacity: 0;
  will-change: opacity;
  pointer-events: none;
}
/* Fire is drawn by a shader into a canvas over just its own patch of the
   drawing (x 40–60%, y 42–90%); must match FIRE_CROP in main.js */
.hs-fire {
  position: absolute;
  left: 40%; top: 41.989%;
  width: 20%; height: 48.029%;
  pointer-events: none;
}

/* The moon fills only a small patch of its full-size layer, so it is
   cropped to that patch (x 40–60%, y 1–31%) to keep the under-cloud
   blur cheap. The img is scaled back up so it stays in register. */
.hs-moon {
  position: absolute;
  left: 40%; top: 1%;
  width: 20%; height: 30%;
  overflow: hidden;
  will-change: filter, opacity;
}
.hs-moon img {
  position: absolute;
  left: -200%; top: -3.3333%;
  width: 500%; height: 333.3333%;
}

/* Darkens the land to a silhouette: a canvas baked from the land's own
   alpha by bakeShade() in main.js */
.hs-land-shade canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Generated cloud canvases (see paintClouds in main.js) */
.hs-wisps {
  position: absolute;
  left: 0; top: 0;
  width: 200%; height: 55%;
  display: flex;
  will-change: transform;
}
.hs-wisps canvas { width: 50%; height: 100%; }

.hs-veil {
  position: absolute;
  will-change: transform, opacity;
}
.hs-veil canvas { width: 100%; height: 100%; }
.hs-veil-back  { left: 18%; top: 0%;  width: 60%; height: 34%; }
.hs-veil-front { left: 26%; top: 5%;  width: 46%; height: 26%; }

/* Firelight thrown over the ground and the figures */
.hs-fire-glow {
  position: absolute;
  left: 28%; top: 50%;
  width: 41%; height: 52%;
  background: radial-gradient(closest-side, rgba(255, 150, 60, 0.34), rgba(255, 120, 40, 0.12) 55%, transparent);
  mix-blend-mode: screen;
  will-change: opacity;
  pointer-events: none;
}

/* Stars sit in the camera (so the moon, clouds and land cover them) but
   JS undoes the camera's transform, so the canvas maps 1:1 to the screen
   and the stars stay crisp at any zoom */
.hs-stars {
  position: absolute;
  left: 0; top: 0;
  transform-origin: 0 0;
  will-change: transform;
  pointer-events: none;
}

/* Embers only fly above the fire, so the canvas covers just that band */
.hs-embers {
  position: absolute;
  left: 30%; top: 20%;
  width: 40%; height: 70%;
  pointer-events: none;
}

/* Marcellus (SIL OFL, fonts/Marcellus-OFL.txt) — the floating words'
   typeface; main.js also reads this file for the glyph outlines it draws */
@font-face {
  font-family: 'Marcellus';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/Marcellus-Regular.ttf) format('truetype');
}

/* Floating words — spawned and animated by initHeroSketch. They sit in
   the camera, so JS sizes .hs-words in proportion to the drawing. */
.hs-words {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hs-word {
  position: absolute;
  /* Glyphs are drawn as SVG (see makeWord); the font here is only the
     plain-text fallback */
  font-family: 'Marcellus', Georgia, serif;
  letter-spacing: 0.06em;   /* matches WORD_TRACKING in main.js */
  font-size: 1em;
  font-weight: 400;
  line-height: 1;
  color: #eef2f8;   /* moonlit, a touch cool */
  /* Soft glow, so the words read as light in the sky; must match WORD_GLOW in main.js */
  filter: drop-shadow(0 0 0.2em rgba(200, 215, 255, 0.22)) drop-shadow(0 0 0.8em rgba(170, 195, 255, 0.1));
  white-space: nowrap;
  will-change: transform, opacity;
}

.hs-word svg {
  display: block;
  overflow: visible;
}

/* Each letter's ink, and the fine line that traces its outline; both
   start hidden and are revealed by showWord. JS paints both with the
   word's moonlight gradient (lightWord); these colours are fallbacks */
.hs-word .hs-ink {
  fill: currentColor;
  fill-opacity: 0;
}
.hs-word .hs-stroke {
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;   /* outline units: 100 to the em */
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-opacity: 0;
}

/* Title — JS places its centre between the moon and the rock peak
   (GSAP owns its transform, including the -50% centring) */
.hs-title {
  position: absolute;
  left: 50%; top: 22%;
  margin: 0;
  font-family: 'BJ Cree', var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  font-weight: 600;
  letter-spacing: -0.03em;   /* BJ Cree has no condensed width; tracking tightens it */
  line-height: 1;
  color: #fff;
  /* As a filter, not a text-shadow, so it doesn't show through the
     moonlit fill below; must match TITLE_SHADOW in main.js */
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7)) drop-shadow(0 4px 20px rgba(0, 0, 0, 0.6));
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

/* Moonlit fill: a radial gradient centred on the moon, set by lightTitle() */
.hs-title-lit {
  color: transparent;
  -webkit-background-clip: text;
          background-clip: text;
  background-color: #fff;   /* until lightTitle() runs */
}

/* ── Roche Rock focus (initHeroSketch: buildRockFocus / setFocus) ──
   Once the title has settled the hero gets .hs-rr-ready; hovering the rock
   or "Roche Rock" adds .hs-rr-focus: the moonlight gathers on the rock,
   the rest of the scene dims a little, and "Roche Rock" warms to a matte
   gold — its moonlit gradient stops each blend toward gold by --rr-gold
   (see lightTitle), so the words change colour in place. */
@property --rr-gold {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}
.hs-title-rr {
  --rr-gold: 0;
  transition: --rr-gold 0.9s ease;
}
.hs-rr-ready .hs-title-rr { pointer-events: auto; }
.hs-rr-focus .hs-title-rr { --rr-gold: 1; }

.hs-title-a { transition: opacity 0.9s ease; }
.hs-rr-focus .hs-title-a { opacity: 0.82; }

/* The scene's darkening (multiplied, so it deepens rather than greys)
   and the lit copy of the land round the rock; both painted by
   buildRockFocus. .hs-rocklit is placed over its patch by JS. */
.hs-dim,
.hs-rocklit {
  position: absolute;
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}
.hs-dim {
  inset: 0;
  width: 100%;
  height: 100%;
  mix-blend-mode: multiply;
}
.hs-rr-focus .hs-dim     { opacity: 1; }      /* TUNE: darkening (DARK in main.js sets its depth) */
.hs-rr-focus .hs-rocklit { opacity: 0.62; }   /* TUNE: light on the rock */

.hs-rr-focus .hs-begin { filter: brightness(0.85); }

/* Begin button — under "Roche Rock" in the title, right of the rock.
   Gold taken from the fire glow; a faint amber wash and a soft backdrop blur keep the
   text legible while the sky still shows through. */
.hs-begin {
  position: absolute;
  left: 0; top: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.85em 1.7em;
  font-family: 'Quattrocento Sans', var(--font-body);
  font-size: clamp(0.85rem, 1vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fbe8cc;
  background: rgba(255, 170, 100, 0.07);
  border: 1px solid rgba(255, 215, 170, 0.7);
  border-radius: 2px;
  box-shadow: 0 0 18px rgba(255, 150, 60, 0.15);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;   /* GSAP autoAlpha reveals it */
  transition: background 0.3s ease, border-color 0.3s ease, filter 0.9s ease;
}

/* Rim light: a golden conic sweep spinning round the edge, cut to a thin
   ring with the same mask trick as .reins-cta::before */
.hs-begin::before {
  content: '';
  position: absolute;
  inset: -1px;
  padding: 1.5px;
  border-radius: 2px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  background: conic-gradient(from var(--hs-rim),
    rgba(200, 150, 42, 0) 0deg,
    rgba(232, 184, 75, 0.6) 50deg,
    #ffe2a0 72deg,
    #fffaf0 80deg,
    rgba(232, 184, 75, 0) 82deg);
  pointer-events: none;
  animation: hs-begin-rim 4s linear infinite;
}

@keyframes hs-begin-rim {
  to { --hs-rim: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
  .hs-begin::before { animation: none; display: none; }
}

.hs-begin:hover,
.hs-begin:focus-visible {
  background: rgba(255, 170, 100, 0.14);
  border-color: #ffdcb0;
}

.hs-begin-arrow { transition: transform 0.3s ease; }
.hs-begin:hover .hs-begin-arrow,
.hs-begin:focus-visible .hs-begin-arrow { transform: translateX(0.25em); }

/* Soundscape toggle */
.hs-sound {
  position: absolute;
  right: 1.5rem; bottom: 1.5rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.1rem 0.65rem 0.9rem;
  font-family: 'Quattrocento Sans', var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(12, 14, 16, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.hs-sound-icon { width: 19px; height: 19px; }

.hs-sound:hover,
.hs-sound:focus-visible {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(12, 14, 16, 0.65);
}

.hs-sound .hs-sound-waves      { display: none; }
.hs-sound.is-on .hs-sound-waves { display: inline; }
.hs-sound.is-on .hs-sound-mute  { display: none; }

/* ══════════════════════════════════════
   LEVEL 1: HERO
══════════════════════════════════════ */
/* #hero sets display:flex, which would beat the [hidden] attribute */
#hero[hidden] { display: none; }

#hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, transparent 45%);
  pointer-events: none;
  z-index: 0;
}

.hero-bg video,
.hero-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.hero-final-frame {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.5s ease;
  pointer-events: none;
}

/* Dark curtain — GSAP slides this up from bottom as hero exits */
.hero-veil {
  position: absolute;
  inset: 0;
  background: var(--stone);
  transform: translateY(105%);
  pointer-events: none;
  z-index: 1;
}

.hero-placeholder-bg {
  width: 100%; height: 100%;
  background: linear-gradient(160deg, #1a1510 0%, #2d2318 40%, #0e1a20 100%);
  /* Simulated terrain texture */
  background-image:
    radial-gradient(ellipse at 30% 60%, rgba(139,88,42,0.3) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 30%, rgba(30,50,60,0.4) 0%, transparent 50%),
    linear-gradient(160deg, #1a1510 0%, #2d2318 40%, #0e1a20 100%);
}

.hero-content {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 6vh 2rem 0;
  text-align: center;
  will-change: opacity, transform;
  --mask-stop: 35%;
  mask-image: linear-gradient(to top, transparent var(--mask-stop), black calc(var(--mask-stop) + 20%));
  transition: --mask-stop 4s ease-out;
  pointer-events: none;
}

.hero-content.mask-done {
  --mask-stop: -25%;
}

.hero-text-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 1rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--parchment);
  margin-bottom: 1.5rem;
  opacity: 0; /* animated by Anime.js */
  text-shadow: 0 2px 12px rgba(0,0,0,1), 0 4px 40px rgba(0,0,0,1), 0 8px 80px rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  gap: 0.5em;
}


.hero-title {
  font-size: clamp(3rem, 7.5vw, 6rem);
  color: var(--cream);
  text-shadow: 0 2px 12px rgba(0,0,0,1), 0 4px 40px rgba(0,0,0,1), 0 8px 100px rgba(0,0,0,0.95);
  display: flex;
  flex-direction: row;
  gap: var(--heading-space);      /* 'to' to 'Roche': the same as every other word space */
  flex-wrap: nowrap;
  white-space: nowrap;
}

.anim-char {
  display: inline-block;
  will-change: transform, opacity;
}

.title-line {
  display: inline;
  opacity: 0; /* animated by Anime.js */
}

.title-italic {
  font-style: italic;
  color: var(--ochre-lt);
}

.hero-subtitle {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  text-shadow: 0 2px 12px rgba(0,0,0,1), 0 4px 40px rgba(0,0,0,1), 0 8px 80px rgba(0,0,0,0.95);
  font-style: italic;
  color: var(--parchment);
  opacity: 0.9;
  margin-top: 1rem;
  opacity: 0; /* animated */
}

.hero-scroll-cue {
  margin-top: 2.5rem;
  padding: 0.75rem 1.75rem;
  border: 1px solid var(--ochre);
  color: var(--ochre-lt);
  background: none;
  font-family: var(--font-body);
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0; /* animated */
  transition: background 0.3s, color 0.3s;
}

.hero-scroll-cue:hover {
  background: var(--ochre);
  color: var(--stone);
}

.hero-scroll-line {
  width: 1px;
  height: 64px;
  margin-top: 1.25rem;
  background: rgba(200, 150, 42, 0.18);
  position: relative;
  overflow: hidden;
  opacity: 0; /* animated */
}

.hero-scroll-line-pulse {
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(to bottom, transparent, var(--ochre), transparent);
  animation: scroll-pulse 1.8s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%   { top: -50%; }
  100% { top: 100%; }
}

.scroll-arrow {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--ochre), transparent);
  animation: arrow-pulse 2s ease-in-out infinite;
}

@keyframes arrow-pulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.2); }
}

/* ══════════════════════════════════════
   CHAPTER TITLE CARD
   Rises out of the hero's dark veil, holds, then hands off
   to the level below it. Reusable: add a .chapter-card
   section with data-chapter-next="<id of next section>".
══════════════════════════════════════ */
/* Covers the level it sits in until it opens. The doors carry the ground and
   the contours; everything else rides above them. */
/* The chapter page belongs to this level. It covers it, then rises out of
   frame — the setup text comes up as the chapter goes, which is the movement
   an auto-scroll makes, without leaving the level or moving the scrollbar. */
.chapter-card {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  pointer-events: none;
  /* Approach, driven from the scroll by initChapterCards. The fallback is 1:
     if that never runs, the card is simply visible with no parallax, rather
     than invisible. Visibility must not depend on a handler firing. */
  opacity: var(--enter, 1);
  transform: translateY(calc((1 - var(--enter, 1)) * 9vh));
}

/* the title sits about a third of the way down, not centred: the space
   above it is half the space below */
.chapter-card::before,
.chapter-card::after { content: ''; }
.chapter-card::before { flex: 1; }
.chapter-card::after  { flex: 2; }

/* and once it is playing it is fully present, whatever the approach said */
.chapter-card.is-playing,
.chapter-card.is-leaving {
  opacity: 1;
  transform: none;
}

.chapter-inner {
  position: relative;
  z-index: 1;
  clip-path: inset(0 0 0 0);
  will-change: clip-path;
  backface-visibility: hidden;
  text-align: center;
  padding: 0 6vw;
}

.chapter-eyebrow {
  font-family: 'Roboto Mono', monospace;
  font-size: 1.32rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: #87998d;
  margin: 0 0 clamp(1.1rem, 2.4vh, 1.6rem);
  overflow: hidden;
}
.chapter-eyebrow span {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
}
.chapter-card.is-playing .chapter-eyebrow span {
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.04s, opacity 0.3s ease 0.04s;
}

/* hairline that splits open from the centre: a wipe, both edges travelling
   out, so the line and its glint are uncovered in place, not stretched */
.chapter-rule {
  width: min(44vw, 560px);
  height: 2px;
  margin: 0 auto clamp(1.3rem, 3vh, 2.1rem);
  background: rgba(216, 168, 110, 0.5);
  clip-path: inset(0 50% 0 50%);
}
.chapter-rule i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 237, 210, 1), transparent);
  opacity: 0;
}
.chapter-card.is-playing .chapter-rule {
  clip-path: inset(0 0 0 0);
  transition: clip-path 0.75s cubic-bezier(0.65, 0, 0.2, 1) 0.06s;
}
.chapter-card.is-playing .chapter-rule i {
  opacity: 1;
  transition: opacity 0.45s ease 0.2s;
}

.chapter-title {
  font-family: 'Archivo', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(3rem, 7vw, 6rem);
  letter-spacing: -0.035em;
  line-height: 1;
  color: #e9f1ea;
  /* the clip (its rise) reaches past the 1em line, above for the caps and
     quotes and below for the descenders, so no letter is cut. The top is
     taken back by its margin; the foot is not, as the page's own clip
     (.chapter-inner) ends where the title's box does */
  padding: 0.15em 0 0.3em;
  margin: -0.15em 0 0;
  overflow: hidden;
}
/* starts clear below the clip's foot (1em line + 0.3em) */
.chapter-title span {
  display: inline-block;
  transform: translateY(140%);
}
.chapter-card.is-playing .chapter-title span {
  transform: translateY(0);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1) 0.06s;
}

/* The heading flies up and out — travel, not a fade. A shorter distance than
   the full viewport: covering 115vh in half a second is what made it look
   like a jump cut rather than a move. */
/* The heading closes in on itself, horizontally, both sides to the centre.
   This is the mechanism the text-transition libraries use for a centre wipe —
   a clip-path inset driven from both edges — written in CSS so it stays on
   the compositor rather than being set per frame from JS. */
.chapter-card.is-leaving .chapter-inner {
  /* top and bottom edges meet in the middle, shrinking a little as they close */
  clip-path: inset(50% 0 50% 0);
  transform: scale(0.93);
  transition: clip-path 0.7s cubic-bezier(0.62, 0.02, 0.34, 1),
              transform 0.78s cubic-bezier(0.5, 0, 0.3, 1);
}

/* ── Chapters 2 and 3: pages that carry their own ground ──
   Chapter 1 sits on the intro's own ground. The 3D slide and Monte Carlo have
   none to offer while their content waits (a live canvas, a fixed map), so
   these pages bring one in the level's colour, opaque from the first pixel as
   the level itself is. Only the title rides the approach; `translate`, so it
   never fights the leaving transform. Each palette takes its eyebrow and
   title from the level it opens and its rule from the level before, as
   Chapter 1 does (lichen intro, apricot firelight). */
/* one screen at the level's top, for levels that aren't a single screen */
.chapter-card--screen {
  bottom: auto;
  height: 100vh;
}
.chapter-card--ground {
  opacity: 1;
  transform: none;
  background: var(--chapter-ground);
}
.chapter-card--ground .chapter-inner {
  opacity: var(--enter, 1);
  translate: 0 calc((1 - var(--enter, 1)) * 9vh);
}
.chapter-card--ground.is-playing .chapter-inner,
.chapter-card--ground.is-leaving .chapter-inner {
  opacity: 1;
  translate: none;
}
/* passed by without playing: the level stands as it would once it had gone */
.chapter-card.is-done { visibility: hidden; }

/* The Context: What is this experience?'s near-black into the cutout
   level's sunlit photo. The page's ground is Level 3's own (its teal splash
   on near-black), opaque, so the break is felt, dressed in the notes' gold:
   the leader lines' glow on the rule, the cutouts' rim-glow round the
   title, a warm pool under it. The ground is its own layer
   (.chapter-ground) so that, as the page leaves, it can lift away on its
   own, the level coming up under it (.ctx-rise). Above the
   notes, their progress (10) and the pop-up (15). */
#chapter-context { background: none; z-index: 20; }
#chapter-context .chapter-ground {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 46% 34% at 50% 36%, rgba(200, 150, 42, 0.10), transparent 70%),
    radial-gradient(ellipse 80% 70% at 14% 12%, rgba(24, 168, 168, 0.24), transparent 60%),
    radial-gradient(ellipse 65% 65% at 88% 90%, rgba(22, 120, 136, 0.12), transparent 62%),
    linear-gradient(168deg, #0c1013 0%, #080a0d 52%, #050607 100%);
}
/* room inside the inner's clip for the glows */
#chapter-context .chapter-inner { padding: 3rem 6vw; }
#chapter-context .chapter-eyebrow { color: #d6bd84; }
/* the wipe's clip reaches past the hairline, so its glow is not cut off */
#chapter-context .chapter-rule {
  background: rgba(200, 168, 74, 0.6);
  box-shadow: 0 0 6px rgba(200, 168, 74, 0.7);
  clip-path: inset(-8px 50% -8px 50%);
}
#chapter-context.is-playing .chapter-rule { clip-path: inset(-8px 0 -8px 0); }
#chapter-context .chapter-rule i {
  background: linear-gradient(to right, transparent, rgba(255, 238, 204, 1), transparent);
}
/* a filter, not text-shadow: the title's overflow clip (its rise) would
   cut a text-shadow square */
#chapter-context .chapter-title {
  color: #f6efe2;
  filter: drop-shadow(0 0 16px rgba(232, 184, 75, 0.4)) drop-shadow(0 0 40px rgba(200, 150, 42, 0.22));
}
/* Leaving, everything goes up, as the scroll does. The ground, its contours
   with it, lifts off the top of the frame; a gradient tail below it (out of
   sight at rest, under the card's clip) takes its foot from solid to clear,
   so the level comes up through a soft edge rather than a line. The title
   rises off ahead of it, faster, fading. The level comes up from below as
   the ground uncovers it (.ctx-rise). */
#chapter-context .chapter-ground::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 40vh;
  background: linear-gradient(to bottom, #050607, rgba(5, 6, 7, 0));
}
#chapter-context.is-leaving .chapter-ground {
  transform: translateY(calc(-100% - 40vh));
  transition: transform 1s cubic-bezier(0.6, 0, 0.3, 1);
}
#chapter-context.is-leaving .chapter-inner {
  clip-path: inset(-3rem 0 -3rem 0);
  transform: translateY(-42vh);
  opacity: 0;
  transition: transform 0.75s cubic-bezier(0.55, 0, 0.3, 1),
              opacity 0.5s ease 0.2s;
}
#chapter-context.is-leaving {
  visibility: hidden;
  transition: visibility 0s linear 1s;
}

/* Chapter 2: the timeline's ochre into the 3D slide's night sky */
#chapter-2 { --chapter-ground: #071425; }
#chapter-2 .chapter-eyebrow { color: #8ea3c0; }
#chapter-2 .chapter-rule { background: rgba(232, 184, 75, 0.5); }
#chapter-2 .chapter-rule i {
  background: linear-gradient(to right, transparent, rgba(255, 240, 204, 1), transparent);
}
#chapter-2 .chapter-title { color: #edf1f7; }
/* the ground goes as the title closes, uncovering the slide's entrance */
#chapter-2.is-leaving {
  opacity: 0;
  transition: opacity 0.5s ease 0.25s;
}

/* Chapter 3: the viewshed's blue into Monte Carlo's green. Above the fixed
   map overlays (≤ 850), below the level nav (950). */
#chapter-3 {
  --chapter-ground: #0b1015;
  z-index: 900;
  opacity: 0;
}
/* Chapter 4 scrolls up from the bottom of the screen as the narrative map leaves
   through the top. The ground rides exactly with the map (RISE_MS and RISE_EASE
   in main.js); the rest arrive in layers, each at its own time, pace and style. */
#chapter-3 { background: transparent; }
#chapter-3.is-playing,
#chapter-3.is-leaving {
  opacity: 1;
  transition: none;
}
.chapter-layer {
  position: absolute;
  inset: -2px 0 0;               /* no seam against the map above it */
  z-index: 0;
  pointer-events: none;
  will-change: translate;
}
.chapter-layer--ground { background: var(--chapter-ground); }
/* The introduction's splash (.intro-light), same shapes and placement, in this
   chapter's green: top right, with a fainter echo bottom left */
.chapter-layer--gradient {
  inset: -20%;
  background:
    radial-gradient(35.7% 31.4% at 71.4% 24.3%, rgba(111, 196, 138, 0.30) 0%, rgba(126, 207, 160, 0.10) 40%, transparent 70%),
    radial-gradient(30% 27% at 21.4% 81.4%, rgba(111, 196, 138, 0.10) 0%, transparent 72%);
}
@keyframes ch3-rise      { from { translate: 0 100vh; } to { translate: 0 0; } }
@keyframes ch3-gradient  { from { translate: 0 100vh; opacity: 0.1; } to { translate: 0 0; opacity: 1; } }
@keyframes ch3-contours  { from { translate: 0 118vh; } to { translate: 0 0; } }
@keyframes ch3-text      { from { translate: 0 46vh; opacity: 0; } to { translate: 0 0; opacity: 1; } }
#chapter-3.is-playing .chapter-layer--ground {
  animation: ch3-rise 0.7s cubic-bezier(0.2, 0, 0.15, 1) both;
}
#chapter-3.is-playing .chapter-layer--gradient {
  animation: ch3-gradient 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}
#chapter-3.is-playing .chapter-contours {
  will-change: translate;
  animation: ch3-contours 1s cubic-bezier(0.12, 0.75, 0.2, 1) 0.14s both;
}
#chapter-3.is-playing .chapter-inner {
  animation: ch3-text 1.25s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s both;
}
#chapter-3 .chapter-title span { opacity: 0; }
#chapter-3.is-playing .chapter-title span {
  opacity: 1;
  transition: transform 0.85s cubic-bezier(0.16, 1, 0.3, 1) 1s, opacity 0.5s ease 1s;
}
#chapter-3.is-playing .chapter-eyebrow span {
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.8s, opacity 0.5s ease 0.8s;
}
#chapter-3.is-playing .chapter-rule {
  transition: clip-path 0.95s cubic-bezier(0.65, 0, 0.2, 1) 0.9s;
}
#chapter-3.is-playing .chapter-rule i {
  transition: opacity 0.5s ease 1.15s;
}
/* riding down off the screen as the reader goes back up to the narrative map
   (transitionToNarrative): the page has already cut away, so it holds the
   screen for the ride */
#chapter-3.is-riding {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  height: 100vh;
}
@media (prefers-reduced-motion: reduce) {
  #chapter-3.is-playing .chapter-layer,
  #chapter-3.is-playing .chapter-contours,
  #chapter-3.is-playing .chapter-inner { animation: none !important; }
  #chapter-3.is-playing .chapter-title span,
  #chapter-3.is-playing .chapter-eyebrow span,
  #chapter-3.is-playing .chapter-rule,
  #chapter-3.is-playing .chapter-rule i { transition-duration: 0.01s !important; transition-delay: 0s !important; }
}
#chapter-3 .chapter-eyebrow { color: #86b593; }
#chapter-3 .chapter-rule { background: rgba(126, 207, 234, 0.5); }
#chapter-3 .chapter-rule i {
  background: linear-gradient(to right, transparent, rgba(214, 246, 224, 1), transparent);
}
#chapter-3 .chapter-title { color: #e8f0ec; }
/* Carried off by Monte Carlo's scan line: the ground is cut back from the
   bottom up on the line's own timing (level-wipe-line), so what is below the
   line is the map and what is above it is still the chapter. */
#chapter-3.is-leaving {
  animation: chapter-ground-wipe 0.85s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}
@keyframes chapter-ground-wipe {
  from { clip-path: inset(0 0 0 0); }
  to   { clip-path: inset(0 0 100% 0); }
}

/* Epilogue: Level 11's blue-white light into About's dawn. It sits on About's
   own ground, as Chapter 1 does on the intro's, so it carries none. */
#chapter-epilogue .chapter-rule { background: rgba(205, 225, 255, 0.5); }
#chapter-epilogue .chapter-rule i {
  background: linear-gradient(to right, transparent, rgba(255, 236, 222, 1), transparent);
}
#chapter-epilogue .chapter-title { color: #f4e8e1; }

/* ── The chapter pages' contours ──────────────────────────
   Chapters 2 and 3: one of the survey sheets per page, drawn in an accent of the levels either
   side: the sheet is a mask, so only its lines take the colour. They spread
   out from behind the title on a soft front and settle a touch in scale,
   driven by --draw: the scroll over the last screen of the approach
   (initChapterCards), so they finish exactly as the level lands. The
   Epilogue has none: it sits on About's own sky. Strength is
   per sheet (their lines are stored at different alphas), set a little under
   the levels' own contours so the title keeps the contrast. */
.chapter-contours {
  --cd: var(--draw, 1);
  --cd-front: calc(var(--cd) * 125% - 25%);
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--contour-ink);
  opacity: var(--contour-k);
  transform: scale(calc(1.06 - 0.06 * var(--cd)));
  -webkit-mask-image: radial-gradient(circle farthest-corner at 50% 36%, #000 var(--cd-front), transparent calc(var(--cd-front) + 25%)),
                      var(--contour-sheet);
          mask-image: radial-gradient(circle farthest-corner at 50% 36%, #000 var(--cd-front), transparent calc(var(--cd-front) + 25%)),
                      var(--contour-sheet);
  -webkit-mask-size: 100% 100%, cover;
          mask-size: 100% 100%, cover;
  -webkit-mask-position: 0 0, 50% 50%;
          mask-position: 0 0, 50% 50%;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-composite: source-in;
          mask-composite: intersect;
}

/* The Context: the leader lines' gold, over the dimmed photo */
#chapter-context {
  --contour-sheet: url("images/contours/contours_bg_3.webp");
  --contour-ink: #e0b860;
  --contour-k: 0.55;
}
/* Chapter 2: the timeline's ochre, on the 3D slide's navy */
#chapter-2 {
  --contour-sheet: url("images/contours/contours_bg_1.webp");
  --contour-ink: #f0c25a;
  --contour-k: 0.68;
}
/* Chapter 3: Monte Carlo's green. It arrives on a cut, with no scroll to
   follow, so its contours draw on the clock as the page plays instead. */
#chapter-3 {
  --contour-sheet: url("images/contours/contours_bg_5.webp");
  --contour-ink: #6fc48a;
  --contour-k: 1;
}
/* they fly in whole (the rise above), not drawn on over the top of it */
#chapter-3 .chapter-contours { --cd: 1; }
/* ── Step 1 arrives as the chapter leaves ─────────────────
   The prose is held out of the way until then, so it flies in with the icons
   rather than being uncovered already in place. */
/* The column arrives in pieces rather than as one slab: each part travels its
   own distance, at its own speed, on its own curve, so they read as separate
   things settling instead of one block sliding. */
#introduction:not(.chapter-done) .intro-heading { transform: translateX(calc(-100% - 8vw)); }
#introduction:not(.chapter-done) .intro-notes   { transform: translateX(calc(-100% - 14vw)); }
#introduction:not(.chapter-done) .intro-orbs    { opacity: 0; transform: translateY(22px); }

#introduction.chapter-done .intro-heading {
  transform: translateX(0);
  transition: transform 0.82s cubic-bezier(0.24, 0.86, 0.3, 1) 0.1s;
}
#introduction.chapter-done .intro-notes {
  transform: translateX(0);
  transition: transform 1.15s cubic-bezier(0.16, 0.9, 0.28, 1) 0.26s;
}
#introduction.chapter-done .intro-orbs {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease 0.62s,
              transform 0.8s cubic-bezier(0.2, 1.1, 0.35, 1) 0.62s;
}

/* ══════════════════════════════════════
   LEVEL 2: INTRODUCTION — the fragments field

   300vh tall; .intro-sticky pins for the first 200vh, giving
   three beat anchors at sectionTop + n × 100vh. The canvas
   behind the prose runs many → few → one empty across them.
══════════════════════════════════════ */
#introduction {
  --moss-deep: #04130d;
  --apricot: #d8a86e;
  --lichen: #87998d;

  position: relative;
  height: 300vh;
  background-color: #03100b;
  background-image: linear-gradient(158deg, #082018 0%, #05170f 54%, #03100b 100%);
}

.intro-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

/* warm apricot splash — top right, with a fainter echo bottom left */
.intro-light {
  position: absolute;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(35.7% 31.4% at 71.4% 24.3%, rgba(224, 157, 92, 0.30) 0%, rgba(216, 168, 110, 0.10) 40%, transparent 70%),
    radial-gradient(30% 27% at 21.4% 81.4%, rgba(224, 157, 92, 0.10) 0%, transparent 72%);
  animation: intro-light-drift 38s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes intro-light-drift {
  from { transform: translate3d(-3%, -2%, 0) scale(1); }
  to   { transform: translate3d(3%, 2.5%, 0) scale(1.1); }
}

/* Survey contours under the field. A pre-rasterised, pre-tinted bitmap, NOT
   a source SVG: a vector background is re-rasterised per tile on every
   repaint, which is what made this level lag. */
.intro-sticky::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("images/contours/contours_bg_intro.webp") 50% 50% / cover no-repeat;
  /* Driven by initIntroduction: the contours belong to beat 1, and are gone
     by the time Britain is drawn — they make the coastline hard to read. */
  opacity: var(--contour-opacity, 0.55);
}

/* the marks themselves */
.intro-field {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

/* Left-hand scrim: the field is full-bleed, so the prose needs its own
   ground. Nothing decorative — it only buys contrast. */
.intro-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    rgba(3, 16, 11, 0.95) 0%,
    rgba(3, 16, 11, 0.90) 26%,
    rgba(3, 16, 11, 0.58) 43%,
    rgba(3, 16, 11, 0) 60%
  );
}

.intro-layout {
  /* A full-viewport box sitting over the canvas. Without this it swallows the
     cursor across the whole map, so the field's own hover never sees it; only
     the prose column needs to be interactive. */
  pointer-events: none;
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  align-items: center;
  /* the extra bottom padding lifts the centred column above the midline */
  padding: 0 6vw 16vh;
}

/* ── TEXT COLUMN — no card, no frame. The prose is the level. ── */
.intro-col-text {
  --orb-gutter: clamp(1.1rem, 1.6vw, 1.6rem);
  pointer-events: auto;
  width: clamp(360px, 35vw, 540px);
  display: flex;
  flex-direction: column;
}

/* shares the notes' gutter so the two line up; the orbs sit outside it */
.intro-heading {
  will-change: transform;
  padding-left: var(--orb-gutter);
  text-shadow: 0 1px 16px rgba(3, 16, 11, 0.8);
  font-family: 'Archivo', system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(2.352rem, 3.472vw, 3.192rem);
  letter-spacing: -0.028em;
  line-height: 1.07;
  color: #e9f1ea;
  margin: 0 0 clamp(1.4rem, 3.6vh, 34px);
}

/* Archivo has no loaded italic — colour carries the emphasis instead */
/* The markup carries an <em>; the heading reads as one colour and upright. */
.intro-heading em {
  font-style: normal;
  font-weight: inherit;
  color: inherit;
}

/* Notes are grid-stacked so the box sizes to the tallest one. The active
   note sits at rest; upcoming notes wait below, spent ones lift away. */
/* Progress orbs sit in this gutter — the same marker language the narrative
   map uses for its steps, so the intro reads as part of the same system. */
.intro-notes {
  will-change: transform;
  position: relative;
  display: grid;
  padding-left: var(--orb-gutter);
}

.intro-note {
  position: relative;
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(26px);
  filter: blur(6px);
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.6s ease;
}

.intro-note.is-past {
  transform: translateY(-26px);
  filter: blur(6px);
}
.intro-note.is-active {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  pointer-events: auto;
}

.intro-note p {
  /* keeps the prose legible where a bright icon drifts behind it */
  text-shadow: 0 1px 14px rgba(3, 16, 11, 0.85);
  font-size: clamp(1.1rem, 1.42vw, 1.4rem);
  line-height: 1.66;
  color: rgba(233, 241, 234, 0.93);
  max-width: 44ch;
}
.intro-note strong { font-weight: 400; color: #e7bb87; }

/* Words that stand in for something on the map. Marked, not decorated: a
   slight lift on hover, matching what lights up out there. */
.intro-note strong[data-link] {
  cursor: pointer;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}
.intro-note strong[data-link]:hover {
  color: #ffe3bb;
  text-shadow: 0 0 20px rgba(216, 168, 110, 0.6);
}
.intro-note p + p { margin-top: 1.05em; }

/* Beat orbs: the narrative map's step markers, reused. Hollow ahead, filled
   behind, filled and lit for the one being read. */
.intro-orbs {
  position: absolute;
  left: calc(var(--orb-gutter) * -1);
  top: 0.55em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(9px, 1.3vh, 15px);
  pointer-events: none;
}

.intro-orb {
  width: clamp(9px, 0.78vw, 12px);
  height: clamp(9px, 0.78vw, 12px);
  border-radius: 50%;
  border: 1.5px solid rgba(200, 150, 42, 0.38);
  background: transparent;
  transition: background 0.55s ease, border-color 0.55s ease,
              box-shadow 0.55s ease, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.intro-orb.past {
  background: var(--ochre);
  border-color: var(--ochre);
  opacity: 0.7;
}
.intro-orb.current {
  background: var(--ochre);
  border-color: var(--ochre);
  box-shadow: 0 0 10px rgba(200, 150, 42, 0.65), 0 0 3px var(--ochre);
  transform: scale(1.18);
}

/* Step arrows under the active note, right-aligned to its text. Shown only
   after the viewer has paused on a step (initIntroduction toggles
   .is-visible and places them); the up arrow is clear on step 1. */
.intro-nav {
  /* top/left set from initIntroduction, against the active note */
  position: absolute;
  top: 100%;
  left: 0;
  display: flex;
  gap: 12px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.intro-nav.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.intro-nav-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(200, 150, 42, 0.45);
  background: rgba(3, 16, 11, 0.35);
  color: rgba(233, 241, 234, 0.85);
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease,
              color 0.25s ease, box-shadow 0.25s ease, opacity 0.3s ease;
}
.intro-nav-btn:hover,
.intro-nav-btn:focus-visible {
  outline: none;
  border-color: var(--ochre);
  background: rgba(200, 150, 42, 0.14);
  color: #ffe3bb;
  box-shadow: 0 0 14px rgba(200, 150, 42, 0.35);
}
.intro-nav-btn.is-off {
  opacity: 0;
  pointer-events: none;
}

/* the down arrow nudges downward, asking to be taken */
.intro-nav.is-visible .intro-nav-down svg {
  animation: intro-nav-nudge 1.8s ease-in-out infinite;
}
@keyframes intro-nav-nudge {
  0%, 100% { transform: translateY(-2px); }
  50%      { transform: translateY(3px); }
}

/* The bead that shoots between orbs on a step, and the trail it drags.
   Positioned and animated from initIntroduction. */
.intro-orb-comet {
  position: absolute;
  left: 50%;
  width: clamp(9px, 0.78vw, 12px);
  height: clamp(9px, 0.78vw, 12px);
  border-radius: 50%;
  background: #ffe3bb;
  box-shadow: 0 0 12px rgba(224, 157, 92, 0.9), 0 0 4px var(--ochre);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.intro-orb-trail {
  position: absolute;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: linear-gradient(to bottom, rgba(255, 227, 187, 0.85), rgba(200, 150, 42, 0.5));
  box-shadow: 0 0 6px rgba(224, 157, 92, 0.6);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .intro-light { animation: none; }
  .intro-note { transition-duration: 0.01s; }
  .intro-nav.is-visible .intro-nav-down svg { animation: none; }
  .chapter-card .chapter-eyebrow span,
  .chapter-card .chapter-rule,
  .chapter-card .chapter-rule i,
  .chapter-card .chapter-title span,
  .chapter-card.is-leaving .chapter-inner,
  #chapter-2.is-leaving { transition-duration: 0.01s; }
  #chapter-context.is-leaving,
  #chapter-context.is-leaving .chapter-inner,
  #chapter-context.is-leaving .chapter-ground { transition-duration: 0.01s; transition-delay: 0s; }
  #chapter-3.is-leaving,
  #context.is-rising .ctx-rise * { animation-duration: 0.01s; animation-delay: 0s; }
  #chapter-3.is-playing { transition-duration: 0.01s; }
  .chapter-contours { --cd: 1 !important; transition-duration: 0.01s !important; }
  /* About has no entrance under reduced motion (initAboutEntrance), so its
     content is simply held until the page has gone */
  #level-epilogue:not(.chapter-done) .about-inner { visibility: hidden; }
}

/* ══════════════════════════════════════
   LEVEL 2: CONTEXT
══════════════════════════════════════ */
#context {
  position: relative;
}

.context-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}


.context-media {
  position: absolute;
  inset: 0;
}

/* ── Chapter 2's arrival: a pop-up book ──
   The photo in four pieces (sky with the rock taken out, moor, rock,
   chapel), under the chapter page while #context.is-rising
   (initContextReveal). As the page's ground lifts away, the sky and moor
   zoom out into place together, rising a little as they come, the moor
   from further in so the two read as separate planes; then the rock folds
   up off the page from its foot, with a paper spring. The chapel is not
   here: it rises on note 2 (.ctx-chapel). The moor is painted over the rock,
   so the rock rises from behind it. Transform and
   opacity only. At rest the pieces are the photo exactly, so dropping the class
   hands over to the level with no visible change. Below the chapter page
   (20). The pieces at rest are base_nochapel.webp. */
.ctx-rise {
  position: absolute;
  inset: 0;
  z-index: 15;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
}
#context.is-rising .ctx-rise { visibility: visible; }
.ctx-rise img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  backface-visibility: hidden;
}
/* layers only while they move: held permanently, four full-frame textures
   sat in GPU memory for the whole visit */
#context.is-rising .ctx-rise img { will-change: transform, opacity; }
/* the zoom's centre for the sky and moor; the rock's hinge, at its foot */
.ctx-rise-sky,
.ctx-rise-land { transform-origin: 45% 62%; }
.ctx-rise-rock { transform-origin: 40% 80%; }

#context.is-rising .ctx-rise-sky {
  animation: ctx-zoom-sky 1.15s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}
#context.is-rising .ctx-rise-land {
  animation: ctx-zoom-land 1.15s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}
#context.is-rising .ctx-rise-rock {
  animation: ctx-fold-rock 0.6s cubic-bezier(0.3, 1.3, 0.5, 1) 0.8s both,
             ctx-pop-in 0.22s 0.8s both;
}
@keyframes ctx-zoom-sky {
  from { transform: translateY(8vh) scale(1.3); }
  to   { transform: none; }
}
@keyframes ctx-zoom-land {
  from { transform: translateY(16vh) scale(1.5); }
  to   { transform: none; }
}
/* lying back on the page, standing up from the hinge; it fades in over the
   start of the fold, so it is never drawn edge-on */
@keyframes ctx-fold-rock {
  from { transform: perspective(1400px) rotateX(70deg); }
  to   { transform: perspective(1400px) rotateX(0deg); }
}
@keyframes ctx-pop-in {
  from { opacity: 0; animation-timing-function: cubic-bezier(0.25, 0.6, 0.35, 1); }
  to   { opacity: 1; }
}

/* Single layer that pans & zooms — image and anchors move together */
.context-transform-layer {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  transform: scale(1) translate(0%, 0%);
  transition: transform 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.context-transform-layer img {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* The photo: the base (without the chapel), the chapel, and a copy of the
   rock over it to hide it while it is down. Desaturates + dims when a
   highlight step is active — piece by piece, so that on the chapel's own
   note it rises in full colour from behind the greyed rock. Each piece is
   its own layer, so the dim runs on the compositor rather than repainting
   full-frame images every frame. */
.ctx-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.ctx-scene > img {
  transition: filter 0.7s ease;
  will-change: filter;
}
.ctx-scene.is-dimmed > img {
  filter: saturate(0.2) brightness(0.5);
}
#context.is-chapel-step .ctx-scene.is-dimmed > .ctx-chapel {
  filter: none;
}
.ctx-base {
  position: relative;
}
.ctx-scene .ctx-chapel,
.ctx-scene .ctx-rock-cover {
  position: absolute;
  inset: 0;
}

/* The chapel is down behind the rock until note 2. Going up it springs, a
   beat into the camera's move; going down it plays the same move in reverse
   (the spring's curve mirrored: a lift, then the drop), staying in colour
   until it is behind the rock and fading only at the end. Each direction's
   transition is the state it goes to. Selectors as specific as the scene's
   own `> img` rule, or that rule's transition wins and the chapel jumps. */
.ctx-scene > .ctx-chapel {
  transform: translateY(12vh);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.5, -0.3, 0.7, 0),
              opacity 0.15s linear 0.45s,
              filter 0.7s ease 0.6s;
}
#context.is-chapel-up .ctx-scene > .ctx-chapel {
  transform: none;
  opacity: 1;
  transition: transform 0.6s cubic-bezier(0.3, 1.3, 0.5, 1) 0.25s,
              opacity 0.2s ease-out 0.25s,
              filter 0.7s ease;
}
/* its highlight and rim-glow wait for it to be up (the highlight's delay
   is set with its opacity, in updateHighlight) */
.ctx-glow[data-highlight="1"].is-active {
  animation-delay: 0.75s, 1.9s;
}

/* Dark veil — between base and cutouts, deepens the dimming effect */
.ctx-dim-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 9, 11, 0.4);
  opacity: 0;
  transition: opacity 0.7s ease, background-color 0.7s ease;
  pointer-events: none;
  z-index: 1;
}

.ctx-dim-overlay.is-active {
  opacity: 1;
}

/* Final segue step (no cutout) — push the whole frame further back so the
   centred card reads on its own */
#context.is-segue .ctx-scene.is-dimmed > img {
  filter: saturate(0.65) brightness(0.35);
}

#context.is-segue .ctx-dim-overlay {
  background: rgba(6, 9, 11, 0.58);
}

/* Golden rim-glow — blurred warm copy of the cutout, sits just beneath it.
   Blooms bright when the step activates, then settles into a slow breathe. */
.ctx-glow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  /* the blurred, gilded copy is baked (images/Level3/*_glow.webp, the
     cutouts with blur(14px) brightness(1.4) sepia(0.55) saturate(1.7) at
     a quarter size): a live blur over the whole frame was redrawn every
     frame the camera moved */
  will-change: opacity;
}

.ctx-glow.is-active {
  animation:
    ctx-glow-bloom 1.15s ease-out forwards,
    ctx-glow-breathe 3.4s 1.15s ease-in-out infinite alternate;
}

@keyframes ctx-glow-bloom {
  0%   { opacity: 0; }
  30%  { opacity: 0.8; }
  100% { opacity: 0.32; }
}

@keyframes ctx-glow-breathe {
  from { opacity: 0.32; }
  to   { opacity: 0.5; }
}

/* Highlight cutouts — above the veil, show the feature in full colour */
.ctx-highlight {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.55s ease;
}

/* Leader lines — tie each note card to the feature it describes.
   Lives inside the transform layer so it pans/zooms with the image. */
.ctx-leader-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* over the notes (10), and over the latches (13) and pins (12): the line
     loops over each eyelet's ring and down into its hole */
  z-index: 14;
  pointer-events: none;
  overflow: visible;
}

/* stroke widths are set per step (placeLeader), so they read the same
   at every zoom */
.ctx-leader-svg line {
  stroke: #f2f0ea;                /* the note's own fill: a strap of the note */
  stroke-linecap: round;
}

/* its shadow (a second stroke, initContextReveal's setLatch): fallen a few
   pixels below it, soft, as the note's own shadow falls, so the strap sits
   at the note's depth over the photo rather than outlined on it. The blur
   is on one short line, redrawn only while the line is placed. */
.ctx-leader-svg line.ctx-leader-case {
  stroke: rgba(0, 0, 0, 0.34);
  stroke-linecap: butt;           /* ends under the rings, never in their holes */
  filter: blur(1.5px);
}
/* the latch: where the line leaves its note, a gold eyelet set in the
   chip out of the note's side (.rb-tab), the line fixed to it */
.ctx-latch { z-index: 13; }
.ctx-latch-dot {
  position: absolute;
  left: -8px;
  top: -8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  /* an eyelet: a gold ring round a hole through the chip (.rb-tab's mask) */
  background: transparent;
  border: 2.5px solid #d4a032;
  box-sizing: border-box;
  opacity: 0;
}

/* Feature pin — gold dot with an expanding pulse ring at the line's end */
.ctx-pin {
  position: absolute;
  z-index: 12;
  pointer-events: none;
  transform: scale(var(--inv-scale, 1));
  transition: transform 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* the pin: the latch's eyelet again (a gold ring round an open centre, the
   photo showing through), so both ends of the strap are the same piece */
.ctx-pin-dot {
  position: absolute;
  left: -8px;
  top: -8px;
  width: 16px;
  height: 16px;
  box-sizing: border-box;
  border-radius: 50%;
  background: transparent;
  border: 2.5px solid #d4a032;
  opacity: 0;
}

/* a white ring round the pin, the anchor the line is fixed to on the
   feature (the pulse runs out from inside it) */
.ctx-pin-dot::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.92);
}
.ctx-pin-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(232, 184, 75, 0.75);
  animation: ctx-pin-pulse 2.2s ease-out infinite;
}

@keyframes ctx-pin-pulse {
  0%   { transform: scale(0.55); opacity: 0.9; }
  70%  { transform: scale(2.2);  opacity: 0; }
  100% { transform: scale(2.2);  opacity: 0; }
}

/* Cards must sit above highlights */
.pin-anchor {
  position: absolute;
  left: var(--px, 50%);
  top:  var(--py, 50%);
  transform: translate(-50%, -50%) scale(var(--inv-scale, 1));
  transform-origin: center;
  transition: transform 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 10;
}

/* Step orbs, the site's step markers (as the introduction's and Level 3's),
   in this level's gold: hollow ahead, filled behind, filled and lit for the
   note being read. Anchored to the sticky, not the image. */
.ctx-progress {
  position: absolute;
  right: clamp(1.5rem, 2.4vw, 2.5rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  pointer-events: none;
}
.ctx-progress-dots {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(9px, 1.3vh, 15px);
}
.ctx-pdot {
  width: clamp(9px, 0.78vw, 12px);
  height: clamp(9px, 0.78vw, 12px);
  border-radius: 50%;
  border: 1.5px solid rgba(240, 214, 150, 0.5);
  background: transparent;
  transition: background 0.55s ease, border-color 0.55s ease, opacity 0.55s ease,
              box-shadow 0.55s ease, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.ctx-pdot.is-past {
  background: #e0b860;
  border-color: #e0b860;
  opacity: 0.7;
}
.ctx-pdot.is-active {
  background: #e8b84b;
  border-color: #e8b84b;
  box-shadow: 0 0 10px rgba(232, 184, 75, 0.65), 0 0 3px #e8b84b;
  transform: scale(1.18);
}

/* ── Field notes ──
   The About level's language, in this level's gold: glass that rests clear
   and frosts to near-white with dark ink when it is the one in hand, a bold
   display name set tight, neutral hairlines only where they divide, and a
   bordered button that fills when hovered. Each note is a tag first — a dark
   tile holding a drawing of the feature, and its name — which opens into the
   note while it is read (revealBlock clips it open from the tag) and closes
   back to the tag, in clear glass, once the next note is taken. Its key
   words carry a gold highlighter stroke, as in a field notebook. */
#context {
  --fn-ink:      #15191c;                   /* written on the frosted glass */
  --fn-cream:    #f3eee2;                   /* on the clear glass */
  --fn-gold:     #e8b84b;                   /* the level's one bright mark */
  --fn-radius:   5px;
  --fn-ease:     cubic-bezier(0.16, 1, 0.3, 1);
}
/* The glass, as the 3D viewer's panels and Level 11's are: a lit edge
   and a soft glow, here in the level's gold. Both, and the drop shadow, are
   drop-shadows on the note as a whole, so they follow the note and the chip
   out of its side as one shape; the note itself draws no edge. No backdrop
   blur: a blur over a photo the camera moves is redrawn every frame. */
.reveal-block {
  --c-ink: var(--fn-cream);
  position: relative;
  width: 300px;
  white-space: normal;
  border-radius: var(--fn-radius);
  /* resting, a tag: clear white glass over the photo, lit at the edge */
  background: linear-gradient(165deg, rgba(255, 252, 244, 0.3), rgba(255, 252, 244, 0.14) 70%);
  background-color: rgba(255, 255, 255, 0);
  border: 1px solid transparent;
  filter: drop-shadow(0 0 0.6px rgba(255, 232, 186, 0.75))
          drop-shadow(0 0 8px rgba(232, 184, 75, 0.18))
          drop-shadow(0 8px 14px rgba(0, 0, 0, 0.3));
  color: var(--c-ink);
  opacity: 0;
  pointer-events: none; /* hidden notes must not swallow clicks */
  transition: width 0.5s var(--fn-ease),
              background-color 0.45s ease, color 0.45s ease, filter 0.45s ease;
  contain: layout style;
}
/* The open note's frost (initContextReveal's placeFrost): the photo as it
   stands behind a note, greyed, darkened and blurred, baked
   (images/Level3/frost.webp) and laid exactly over the part of the photo
   the note covers; the note's fill over it. Under the note's content (a
   negative layer in the note's own stacking context), over its box. */
.rb-frost {
  position: absolute;
  inset: -1px;                     /* the note's border box */
  z-index: -1;
  border-radius: var(--fn-radius);
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
}
.reveal-block.is-current .rb-frost { opacity: 1; }
.rb-frost-img {
  position: absolute;
  left: 0;
  top: 0;
  background: url("images/Level3/frost.webp") center / cover no-repeat;
  transform-origin: 0 0;
}
.rb-frost::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 2px) no-repeat,
              rgba(244, 242, 236, 0.82);
}
/* the chip's: the same, without the note's top sheen */
.rb-tab .rb-frost { inset: 0; border-radius: inherit; opacity: 1; }
.rb-tab .rb-frost::after { background: rgba(244, 242, 236, 0.82); }

/* the tag's name over the photo: a soft shade under the cream */
.reveal-block:not(.is-current) .rb-title { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 1px 10px rgba(0, 0, 0, 0.5); }
.reveal-block.is-visible { pointer-events: auto; }
/* in hand: bright frosted glass for reading (the frost is .rb-frost, a
   baked blur laid under the fill, not a live one), its edge lit and
   glowing, a sheen along its top */
.reveal-block.is-current {
  --c-ink: var(--fn-ink);
  background: transparent;
  filter: drop-shadow(0 0 0.8px rgba(255, 226, 160, 0.95))
          drop-shadow(0 0 10px rgba(232, 184, 75, 0.4))
          drop-shadow(0 0 34px rgba(232, 184, 75, 0.16))
          drop-shadow(0 16px 22px rgba(0, 0, 0, 0.38));
}
/* the last note, larger: it closes the level and leads on */
.reveal-block--segue { width: 440px; max-width: calc(100vw - 32px); }
.reveal-block--segue .rb-head { padding: 16px 22px 15px 18px; gap: 12px; }
.reveal-block--segue .rb-glyph svg { width: 28px; height: 28px; }
.reveal-block--segue .rb-title { font-size: 1.9rem; }
/* The chip the line's latch sits in: a half-pill of the note's own fill
   standing out of the edge the line leaves by (data-side, at --tab-at
   along it; placeLeader). Both are solid and edgeless, and the chip runs a
   pixel into the note, so the two are one shape. It comes out with the line
   and goes with it. */
.rb-tab {
  --tab-d: 26px;               /* how far it stands out (TAB_D in main.js) */
  --tab-w: 34px;               /* its length along the edge */
  position: absolute;
  box-sizing: border-box;
  /* the open note's frost and fill (its own .rb-frost, laid over the same
     part of the photo as the note's), so it overlaps the note by a pixel
     with nothing to show where */
  background: none;
  /* the eyelet's hole, through to the photo, at the chip's centre where the
     latch sits (just inside the latch's gold ring) */
  -webkit-mask: radial-gradient(circle at center, transparent 6px, #000 6.5px);
          mask: radial-gradient(circle at center, transparent 6px, #000 6.5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.rb-tab[data-side="right"],
.rb-tab[data-side="left"] {
  top: var(--tab-at, 50%);
  width: var(--tab-d);
  height: var(--tab-w);
  margin-top: calc(var(--tab-w) / -2);
}
.rb-tab[data-side="top"],
.rb-tab[data-side="bottom"] {
  left: var(--tab-at, 50%);
  width: var(--tab-w);
  height: var(--tab-d);
  margin-left: calc(var(--tab-w) / -2);
}
.rb-tab[data-side="right"]  { left: calc(100% - 1px);   border-radius: 0 999px 999px 0; transform-origin: left center;   transform: scaleX(0.3); }
.rb-tab[data-side="left"]   { right: calc(100% - 1px);  border-radius: 999px 0 0 999px; transform-origin: right center;  transform: scaleX(0.3); }
.rb-tab[data-side="bottom"] { top: calc(100% - 1px);    border-radius: 0 0 999px 999px; transform-origin: center top;    transform: scaleY(0.3); }
.rb-tab[data-side="top"]    { bottom: calc(100% - 1px); border-radius: 999px 999px 0 0; transform-origin: center bottom; transform: scaleY(0.3); }
.reveal-block.is-current .rb-tab.is-on {
  opacity: 1;
  transform: none;
  transition: opacity 0.25s ease 0.18s, transform 0.4s cubic-bezier(0.34, 1.4, 0.5, 1) 0.18s;
}

/* The last note leads on: it belongs to no feature (no line, no pin), it is
   edged in gold, and its button is the level's one filled one — the way on
   to the timeline. */
/* its edge burns brighter, the way on */
.reveal-block--segue.is-current {
  filter: drop-shadow(0 0 1px rgba(255, 214, 130, 1))
          drop-shadow(0 0 12px rgba(232, 184, 75, 0.55))
          drop-shadow(0 0 40px rgba(232, 184, 75, 0.22))
          drop-shadow(0 16px 22px rgba(0, 0, 0, 0.38));
}
/* (.rb-next.rb-next--go: above the general .rb-next rules that follow) */
/* its button: the level's one solid, lit button, larger — the gold fill
   glowing at its edge as the site's calls to go on do (Level 11's) — and
   on hover the ink, its glow gone gold-hot */
.rb-next.rb-next--go {
  float: none;
  display: flex;
  justify-content: center;
  gap: 0.75em;
  width: calc(100% - 44px);
  margin: 24px 22px 20px;
  padding: 0.8em 1.2em;
  border: 1px solid rgba(255, 226, 160, 0.9);
  border-radius: 3px;
  background: linear-gradient(165deg, #f2c95c, #e3ad3c);
  color: var(--fn-ink);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 0 6px rgba(255, 214, 140, 0.55),
              0 0 22px rgba(232, 184, 75, 0.35),
              inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: opacity 0.35s ease, background 0.25s ease, color 0.25s ease,
              border-color 0.25s ease, box-shadow 0.3s ease;
}
.rb-next.rb-next--go svg { width: 11px; height: 15px; color: var(--fn-ink); }
.rb-next.rb-next--go:hover,
.rb-next.rb-next--go:focus-visible {
  background: var(--fn-ink);
  border-color: var(--fn-gold);
  color: var(--fn-gold);
  box-shadow: 0 0 8px rgba(255, 214, 140, 0.7),
              0 0 28px rgba(232, 184, 75, 0.5);
}
.rb-next.rb-next--go:hover svg,
.rb-next.rb-next--go:focus-visible svg { color: var(--fn-gold); transform: translateY(3px); }

/* The tag: the feature's drawing in gold and its name, on the glass
   itself. Opened, a hairline the note's full width divides it from the
   note; closed, it is all that is left. */
.rb-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 14px;
}
.rb-glyph {
  flex: none;
  display: grid;
  place-items: center;
  color: var(--fn-gold);
  transition: color 0.45s ease;
}
.reveal-block.is-current .rb-glyph { color: #a87a1c; }   /* gold that holds on the frost */
.rb-glyph svg { width: 24px; height: 24px; }
.rb-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 0.95;
  letter-spacing: -0.005em;
  color: var(--c-ink);
  white-space: nowrap;
  transition: color 0.45s ease;
}

/* the note: under a hairline the card's full width, the line and the button
   (folds away, rows 1fr → 0fr, as the note closes to its tag) */
.rb-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.5s var(--fn-ease), opacity 0.25s ease;
}
.rb-body > div {
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid rgba(168, 122, 28, 0.35);
}
.reveal-block p {
  margin: 0;
  padding: 14px 18px 0;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 400;
  line-height: 1.62;
  color: var(--c-ink);
  transition: color 0.45s ease;
}
.reveal-block--segue p { font-size: 1.14rem; padding: 18px 22px 0; }
/* the key words: the ink at its heaviest (not the site's ochre) */
.reveal-block strong { font-weight: 600; color: inherit; }

/* the button, About's: a hairline box that fills with the ink when hovered,
   its arrow in gold; only on the note in hand */
.rb-next {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin: 14px 18px 16px auto;
  float: right;
  padding: 0.55em 0.95em 0.55em 1.05em;
  border: 1px solid rgba(21, 25, 28, 0.24);
  border-radius: 3px;
  background: transparent;
  color: var(--fn-ink);
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, background-color 0.25s ease, border-color 0.25s ease,
              color 0.25s ease;
}
.rb-body > div::after { content: ''; display: block; clear: both; }
.rb-next svg {
  width: 10px;
  height: 14px;
  color: #b8871f;
  transition: transform 0.35s var(--fn-ease), color 0.25s ease;
}
.reveal-block.is-current .rb-next { opacity: 1; pointer-events: auto; }
.rb-next:hover,
.rb-next:focus-visible {
  outline: none;
  background: var(--fn-ink);
  border-color: var(--fn-ink);
  color: var(--fn-cream);
}
.rb-next:hover svg,
.rb-next:focus-visible svg { color: var(--fn-gold); transform: translateY(2px); }
/* the feature notes' Next points on to the next note, across */
.rb-next svg.rb-next-right { width: 14px; height: 10px; }
.rb-next:hover svg.rb-next-right,
.rb-next:focus-visible svg.rb-next-right { transform: translateX(3px); }

/* closed to its tag: the note folded away, the tag as it was — only the
   width and the note's rows move */
.reveal-block.is-folded .rb-body { grid-template-rows: 0fr; opacity: 0; }
.reveal-block.is-folded { width: var(--tag-w, max-content); }
/* a tag is a way back to its note (initContextReveal) */
.reveal-block.is-folded.is-visible { cursor: pointer; }
.reveal-block.is-folded.is-visible:hover {
  background-color: rgba(255, 255, 255, 0.12);
  filter: drop-shadow(0 0 0.8px rgba(255, 232, 186, 0.95))
          drop-shadow(0 0 12px rgba(232, 184, 75, 0.35))
          drop-shadow(0 8px 14px rgba(0, 0, 0, 0.3));
}
.reveal-block.is-folded.is-visible:hover .rb-glyph { color: #fff1cf; }

/* the step orbs' bead and trail, in gold (initContextReveal's shootOrb,
   as the introduction's and Level 3's) */
.ctx-progress-dots { position: relative; }
.ctx-orb-comet {
  position: absolute;
  left: 50%;
  width: clamp(9px, 0.78vw, 12px);
  height: clamp(9px, 0.78vw, 12px);
  border-radius: 50%;
  background: #fff1cf;
  box-shadow: 0 0 12px rgba(232, 184, 75, 0.9), 0 0 4px var(--fn-gold);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.ctx-orb-trail {
  position: absolute;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  box-shadow: 0 0 6px rgba(232, 184, 75, 0.6);
  pointer-events: none;
}

.ctx-step {
  height: 120vh;
}

.ctx-pause {
  height: 140vh;
}

/* ══════════════════════════════════════
   LEVEL 2.5: TIMELINE
   As Level 3: a near-black ground with a splash of colour, here the era's
   (--tl-accent and .era-layer, set by initTimeline); the era's sketch on the
   left, the heading and one note per stop on the right; the track and its
   stops along the foot of the screen.
══════════════════════════════════════ */
#timeline {
  position: relative;
  height: 700vh;                              /* a screen per stop, and one to leave by */
}

#timeline-stage {
  --tl-accent: #e0855a;
  --tl-track-l: 10%;
  --tl-track-w: 80%;
  --tl-foot: clamp(7.5rem, 17vh, 10rem);    /* the band the track sits in */
  --tl-lift: clamp(2.5rem, 9vh, 6.5rem);    /* the band's rise off the foot */
  --tl-top: max(4vh, 4.75rem);              /* clear of the contents menu */
  --tl-head: clamp(2.464rem, 4.928vw, 4.48rem);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(168deg, #0c1013 0%, #080a0d 52%, #040506 100%);
}
/* the text levels' grain, over the splash */
#timeline-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#timeline-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse 75% 75% at 50% 45%, transparent 55%, rgba(7, 8, 10, 0.62) 100%);
}

/* the era's splash, one layer each, crossfaded */
/* the era's splash: one light that travels with the comet (initTimeline) */
#era-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.era-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
}
/* the drifting light, neutral: the colour is the era's */
#timeline .text-level-light {
  background:
    radial-gradient(ellipse 42% 30% at 30% 26%, rgba(240, 234, 216, 0.05), transparent 70%),
    radial-gradient(ellipse 38% 28% at 72% 74%, rgba(240, 234, 216, 0.03), transparent 70%);
}

/* the title, centred across the top */
#timeline .tl-title {
  position: absolute;
  z-index: 2;
  top: var(--tl-top);
  left: 0;
  right: 0;
  margin: 0;
  font-size: var(--tl-head);
  text-align: center;
}

/* two columns, between the title and the track */
.tl-grid {
  position: absolute;
  z-index: 2;
  left: 4vw;
  right: 4vw;
  top: calc(var(--tl-top) + var(--tl-head) * 1.06 + clamp(1rem, 3vh, 2rem));
  bottom: calc(var(--tl-foot) + var(--tl-lift));
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 6rem);
  align-items: center;
}

/* the era's sketch: the files are dark lines on clear, so lit to read on the
   dark ground */
.tl-sketch { height: 100%; min-height: 0; }   /* the entrance's handle (initTimeline) */
#watermark {
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  user-select: none;
  pointer-events: none;
}
#watermark img { opacity: 0.62; filter: brightness(0) invert(1); }   /* only if a sketch can't be read */
/* the sketch's halo comes up once it's drawn: repainting it under every
   frame of the drawing would be a heavy way to get it */
#watermark canvas {
  filter: drop-shadow(0 0 0 rgba(240, 234, 216, 0));
  transition: filter 0.9s ease;
}
#watermark canvas.is-drawn { filter: drop-shadow(0 0 14px rgba(240, 234, 216, 0.14)); }
#watermark img,
#watermark canvas {
  max-width: 100%;
  max-height: 90%;
  object-fit: contain;
  /* some are cropped hard at their edges: let those fade out */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent), linear-gradient(180deg, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent), linear-gradient(180deg, transparent, #000 7%, #000 93%, transparent);
  mask-composite: intersect;
}

#timeline .tl-copy { width: auto; max-width: clamp(26rem, 32vw, 40rem); }

/* The note: three slots (the era, its date, its text), each a stack of five
   plates, one per stop, grid-stacked so the slot sizes to its tallest. Only
   the plate being read, and one flipping away, are shown; the flips are
   flipNotes' (initTimeline), each plate hung from its top edge. */
.tl-notes { display: flex; flex-direction: column; width: 100%; }
.tl-slot {
  display: grid;
  perspective: 900px;
}
.tl-face {
  grid-area: 1 / 1;
  visibility: hidden;
  transform-origin: 50% 0;
  backface-visibility: hidden;
}
.tl-face.is-active,
.tl-face.is-leaving { visibility: visible; }
.tl-note-date {
  display: block;
  font-family: var(--font-body);
  font-size: clamp(0.84rem, 0.95vw, 1rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  margin-bottom: 1.7em;
  color: var(--pt-accent);
}
.tl-note-era {
  margin: 0 0 0.55em;
  font-size: clamp(1.85rem, 2.65vw, 2.65rem);
  line-height: 1.15;
  color: var(--cream);
}
#timeline .tl-note-body { margin: 0; font-size: clamp(1.06rem, 1.35vw, 1.42rem); line-height: 1.7; }

/* on the last stop, the way on (.splat-launch-cta's look), right under the
   body's right edge; it pops up after a rest (initTimeline), its room kept */
#timeline .tl-continue {
  display: flex;
  width: max-content;
  margin: clamp(2rem, 4.5vh, 3rem) 0 0 auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.94);
  transition: opacity 0.35s ease, visibility 0s linear 0.35s,
              transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
#timeline .tl-continue.is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}
#timeline .tl-continue.is-shown:hover,
#timeline .tl-continue.is-shown:focus-visible { transform: translateY(-2px); }
.tl-continue .splat-launch-arrow { display: inline-flex; }
.tl-continue svg { width: 7px; height: 12px; }
/* (#timeline: over .splat-launch-cta's own downward nudge, below) */
#timeline .tl-continue:hover .splat-launch-arrow,
#timeline .tl-continue:focus-visible .splat-launch-arrow { transform: translateX(3px); }

/* The track, along the foot */
#track-wrap {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: var(--tl-lift);
  height: var(--tl-foot);
}
/* the line, its scale, the comet and its sparks (initTimeline), under the
   stops; it fills the band so the sparks have room to fall */
#track-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* A stop: its marker on the line, its era and date under it. Hollow ahead,
   filled behind, filled and lit for the one being read (.xp-orb). */
.tl-point {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: clamp(120px, 15vw, 210px);
  padding: calc(2.1rem - 1.4rem) 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: 0;
  color: inherit;
  font-family: var(--font-body);
  text-align: center;
  cursor: pointer;
}
.tl-point .dot-wrap {
  position: relative;
  z-index: 1;
  width: 2.8rem;
  height: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tl-point .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(240, 234, 216, 0.5);
  background: #080a0d;
  transition: background 0.55s ease, border-color 0.55s ease,
              box-shadow 0.55s ease, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.tl-point:hover .dot,
.tl-point:focus-visible .dot { border-color: var(--cream); }
.tl-point.past .dot {
  background: var(--tl-accent);
  border-color: var(--tl-accent);
}
.tl-point.active .dot {
  background: var(--tl-accent);
  border-color: var(--tl-accent);
  transform: scale(1.35);
  box-shadow: 0 0 12px var(--tl-accent), 0 0 3px var(--tl-accent);
}
.tl-point .ring {
  position: absolute;
  inset: 0.5rem;
  border-radius: 50%;
  border: 1px solid var(--tl-accent);
  opacity: 0;
}
.tl-point.active .ring { animation: tl-ripple 1.1s ease-out 1; }
.tl-point.active .ring:nth-child(2) { animation-delay: 0.22s; }
@keyframes tl-ripple {
  0%   { transform: scale(0.7); opacity: 0.75; }
  100% { transform: scale(3.4); opacity: 0; }
}
/* the stop being read breathes, once the comet has reached it */
.tl-point.active .dot { animation: tl-dot-breathe 2.8s ease-in-out 0.6s infinite; }
@keyframes tl-dot-breathe {
  0%, 100% { box-shadow: 0 0 12px var(--tl-accent), 0 0 3px var(--tl-accent); }
  50%      { box-shadow: 0 0 22px 3px var(--tl-accent), 0 0 5px var(--tl-accent); }
}
/* and its label lifts to meet it */
.tl-point .era, .tl-point .date { transition: color 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.tl-point.active .era, .tl-point.active .date { transform: translateY(-2px); }
.tl-point .era {
  font-size: clamp(0.86rem, 0.98vw, 1.04rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(240, 234, 216, 0.5);
  white-space: nowrap;
  transition: color 0.4s ease;
}
.tl-point .date {
  font-size: clamp(0.8rem, 0.9vw, 0.96rem);
  letter-spacing: 0.04em;
  color: rgba(240, 234, 216, 0.42);
  white-space: nowrap;
  transition: color 0.4s ease;
}
.tl-point:hover .era,
.tl-point:focus-visible .era,
.tl-point.past .era { color: rgba(240, 234, 216, 0.72); }
.tl-point.past .date { color: rgba(240, 234, 216, 0.5); }
.tl-point.active .era { color: var(--cream); }
.tl-point.active .date { color: var(--tl-accent); }
.tl-point:focus-visible { outline: none; }
.tl-point:focus-visible .dot-wrap { outline: 1.5px solid var(--cream); outline-offset: -2px; border-radius: 50%; }
/* narrower: each label keeps to its own share of the track (80% over five
   spans), its era wrapping onto two lines */
@media (max-width: 1180px) {
  .tl-point { width: calc(16vw - 6px); }
  .tl-point .era {
    font-size: clamp(0.7rem, 1.25vw, 0.86rem);
    letter-spacing: 0.1em;
    line-height: 1.3;
    white-space: normal;
  }
  .tl-point .date { font-size: clamp(0.66rem, 1.15vw, 0.8rem); letter-spacing: 0.02em; }
}
/* a phone: the dots alone, as the note above them already gives the era and
   its date; the sketch over the note, not beside it, and the note smaller,
   so it all keeps above the track */
@media (max-width: 720px) {
  .tl-point .era, .tl-point .date { display: none; }
  .tl-grid {
    left: 6vw;
    right: 6vw;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: stretch;
  }
  #timeline .tl-copy { max-width: none; }
  .tl-note-era { font-size: 1.6rem; }
  .tl-note-date { margin-bottom: 0.9em; }
  #timeline .tl-note-body { font-size: 0.98rem; line-height: 1.6; }
}
/* a short phone: the track lower and the note tighter, to keep room for the sketch */
@media (max-width: 720px) and (max-height: 720px) {
  #timeline-stage { --tl-lift: 0.5rem; --tl-foot: 5.5rem; }
  .tl-note-era { font-size: 1.4rem; }
  .tl-note-date { margin-bottom: 0.6em; }
  #timeline .tl-note-body { font-size: 0.9rem; line-height: 1.5; }
}

/* After 5s with nothing done, the next stop asks to be clicked (initTimeline),
   in its own era's colour (--pt-accent):
   it swells and fills, rings break off it, and its label lifts and lights */
.tl-point.is-hint .dot {
  border-color: var(--pt-accent);
  animation: tl-hint-dot 1.8s ease-in-out infinite;
}
.tl-point.is-hint .ring {
  border-width: 1.5px;
  border-color: var(--pt-accent);
  animation: tl-hint-ripple 1.8s ease-out infinite;
}
.tl-point.is-hint .ring:nth-child(2) { animation-delay: 0.35s; }
.tl-point.is-hint .era,
.tl-point.is-hint .date { animation: tl-hint-label 1.8s ease-in-out infinite; }
.tl-point.is-hint .era  { color: var(--cream); }
.tl-point.is-hint .date { color: var(--pt-accent); }
@keyframes tl-hint-dot {
  0%, 100% { transform: scale(1);    background: #080a0d;          box-shadow: 0 0 0 0 transparent; }
  45%      { transform: scale(1.7);  background: var(--pt-accent); box-shadow: 0 0 20px 4px var(--pt-accent), 0 0 4px var(--pt-accent); }
}
@keyframes tl-hint-ripple {
  0%   { transform: scale(0.8); opacity: 0.95; }
  70%  { transform: scale(4);   opacity: 0; }
  100% { transform: scale(4);   opacity: 0; }
}
@keyframes tl-hint-label {
  0%, 100% { transform: translateY(0); }
  45%      { transform: translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
  .tl-point.active .ring, .tl-point.active .dot,
  .tl-point.is-hint .ring, .tl-point.is-hint .dot,
  .tl-point.is-hint .era, .tl-point.is-hint .date { animation: none; }
  .tl-point.is-hint .dot { background: var(--pt-accent); box-shadow: 0 0 14px var(--pt-accent); }
  #timeline .tl-continue { transition: opacity 0.3s ease, visibility 0s linear 0.3s; transform: none; }
}

/* ══════════════════════════════════════
   LEVEL 6: ROCHE ROCK IN 3D — launch gate
   Flat neutral charcoal, matched in brightness to the preview's dark
   sky so its feathered edges disappear. A centred reading column sits
   in that sky; the preview spans the width beneath it.
   Reading order: text → preview → launch.
══════════════════════════════════════ */
#hotspots {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: #071425;
}

.splat-launch {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* 3D viewport motif — perspective floor grid covering the whole level,
   its vanishing point just above the top edge. Neutral white, low opacity. */
.splat-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  fill: none;
  stroke: #ffffff;
  stroke-opacity: 0.08;
  stroke-width: 1;
  /* Fades out going up, fully transparent 75% of the way up the page */
  -webkit-mask-image: linear-gradient(to top, #000 40%, transparent 75%);
          mask-image: linear-gradient(to top, #000 40%, transparent 75%);
}

.splat-grid path { vector-effect: non-scaling-stroke; }

/* Axis gizmo — bottom-left, like a modelling app's orientation widget */
.splat-gizmo {
  position: absolute;
  left: clamp(2rem, 3.5vw, 3.5rem);
  bottom: clamp(2rem, 4.5vh, 3.5rem);
  width: 168px;
  height: 168px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  overflow: visible;
}

.splat-gizmo line { stroke-width: 2; stroke-linecap: round; }
.splat-gizmo circle { stroke: none; }
.splat-gizmo .gz-x { stroke: #d9604c; fill: #d9604c; }
.splat-gizmo .gz-y { stroke: #86b852; fill: #86b852; }
.splat-gizmo .gz-z { stroke: #5a8fd8; fill: #5a8fd8; }
.splat-gizmo .gz-origin { fill: #e8e8e8; }
.splat-gizmo text {
  font-family: var(--font-body);
  font-size: 8px;
  font-weight: 600;
  fill: #19191a;
  text-anchor: middle;
  dominant-baseline: central;
}

/* Reading column — above the preview */
.splat-launch-overlay {
  position: relative;
  z-index: 1;
  width: min(760px, 88vw);
  margin: 0 auto;
  padding-top: clamp(3rem, 6vh, 5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.splat-launch-eyebrow {
  font-family: var(--font-body);
  font-size: clamp(0.65rem, 0.8vw, 0.78rem);
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ochre-lt);
  margin-bottom: 1.1rem;
}

.splat-launch-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2.688rem, 4.928vw, 4.704rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--cream);
  margin-bottom: clamp(1.25rem, 2.6vh, 2rem);
}

/* Same voice and size as the text levels' copy */
.splat-launch-desc {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(1.05rem, 1.4vw, 1.45rem);
  line-height: 1.75;
  color: var(--parchment);
  max-width: 44ch;
}

.splat-launch-note {
  display: flex;
  align-items: baseline;
  gap: 0.75em;
  margin-top: clamp(1rem, 2.2vh, 1.5rem);
  font-family: var(--font-body);
  font-size: clamp(0.8rem, 0.85vw, 0.9rem);
  font-weight: 300;
  color: var(--stone-lt);
}

.splat-launch-note-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ochre);
}

/* Buttons flank the rock — one either side, centred on the page's
   halfway line. They stay in the flex flow under the text: margin-top: auto
   drops them to that line, but on a short screen they can never ride up
   over the copy (the top padding is the minimum gap). The bottom margin is
   half the viewport less half a button's height. */
.splat-launch-actions {
  position: relative;
  z-index: 1;
  margin-top: auto;
  margin-bottom: calc(50vh - 1.75rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem clamp(1.5rem, 12vw, 14rem) 0;
  pointer-events: none;
}

.splat-launch-actions .splat-launch-cta { pointer-events: auto; }

/* The hand-off into the narrative map (initZoomOut handOff): the credit
   leaves (the 3D's canvas mask can't reach it), and the map's own CSS
   animations, hidden under the 3D meanwhile, pause. */
.zoom-out.is-handing .zo-credit { opacity: 0 !important; }
/* the stage's own ground would show through the masked canvas instead of
   the map: the canvas paints the ground itself meanwhile */
.zoom-out.is-handing .zo-layer--stage { background: transparent; }
#map-container.zo-handing * { animation-play-state: paused !important; }

/* Live 3D: the grid is a plane in the 3D scene, behind the model, seen
   through its camera (zoom-out.js buildFloorGrid) */
.zoom-out.is-live .splat-grid { visibility: hidden; }

/* Preview flythrough — 88% width, centred on the bottom edge. The 4:3 frame
   is cropped top and bottom (object-position keeps the rock and chapel in
   view); the mask feathers the top and both sides into the background. */
.splat-launch-video {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 0;
  z-index: 0;
  height: 64vh;
  opacity: 0;
  pointer-events: none;
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 0%, #000 38%),
    linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask-image:
    linear-gradient(to bottom, transparent 0%, #000 38%),
    linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%);
          mask-composite: intersect;
}

.splat-preview-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 65%;
  display: block;
}

/* Buttons — the site's CTA (Level 10 "Explore map", .text-level-cta) at a
   larger size: primary is solid ochre, Keep Exploring its outlined twin. */
.splat-launch-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.8em;
  padding: 1.15em 2.5em;
  font-family: var(--font-body);
  font-size: clamp(0.85rem, 0.95vw, 1rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ochre-lt);
  background: transparent;
  border: 1px solid var(--ochre);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease,
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.splat-launch-cta:hover,
.splat-launch-cta:focus-visible {
  border-color: var(--ochre-lt);
  background: rgba(200, 150, 42, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -12px rgba(232, 184, 75, 0.45);
}

/* in the 3D viewer's accent (splat-viewer.html --accent), so the button
   reads as the way into it */
.splat-launch-cta--primary {
  color: #061420;
  background: #5ccfe6;
  border-color: #5ccfe6;
}

.splat-launch-cta--primary:hover,
.splat-launch-cta--primary:focus-visible {
  color: #061420;
  background: #8ddff0;
  border-color: #8ddff0;
  box-shadow: 0 10px 30px -12px rgba(92, 207, 230, 0.6);
}

.splat-launch-cta.splat-launch-cta--primary:focus-visible { outline-color: #8ddff0; }

.splat-launch-cta:focus-visible {
  outline: 2px solid var(--ochre-lt);
  outline-offset: 3px;
}

.splat-launch-arrow {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.splat-launch-cta--primary:hover .splat-launch-arrow {
  transform: translate(2px, -2px);
}

.splat-launch-cta:not(.splat-launch-cta--primary):hover .splat-launch-arrow {
  transform: translateY(2px);
}

/* ── Section navigation arrows ── */
#section-nav {
  position: fixed;
  bottom: clamp(1rem, 2.5vh, 2rem);
  right: clamp(1rem, 1.5vw, 2rem);
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.5vh, 8px);
}

.section-nav-btn {
  width:  clamp(40px, 3.2vw, 56px);
  height: clamp(40px, 3.2vw, 56px);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(200, 150, 42, 0.28);
  color: var(--ochre-lt);
  font-size: clamp(1rem, 1.2vw, 1.4rem);
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.section-nav-btn:hover {
  background: rgba(200, 150, 42, 0.18);
  border-color: var(--ochre);
  color: var(--ochre);
}

.section-nav-btn:disabled {
  opacity: 0.25;
  pointer-events: none;
}

/* ── Splat modal overlay ── */
#splat-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #050b16;
  display: flex;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#splat-modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: all;
}

/* Styled as the viewer's own buttons (splat-viewer.html .tour-btn), 30% smaller:
   the shared frosted glass, a lit edge with a faint glow, Golos uppercase;
   on hover the fill lightens and the edge brightens with its glow. */
#splat-modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 10;
  background: linear-gradient(165deg, rgba(148, 178, 196, 0.22), rgba(8, 18, 36, 0.42));
  border: 1px solid rgba(205, 225, 255, 0.42);
  border-radius: 3px;
  box-shadow:
    0 0 3px rgba(200, 225, 255, 0.14),
    0 0 12px rgba(110, 170, 255, 0.08),
    inset 0 0 10px rgba(150, 195, 255, 0.04);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  color: #eef3fb;
  font-family: 'Golos Body', 'Golos Text', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 8px 15px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s, opacity 0.6s ease;
}

/* held back until the viewer's intro finishes (main.js initHotspots) */
#splat-modal-close.is-waiting {
  opacity: 0;
  pointer-events: none;
}

#splat-modal-close:hover,
#splat-modal-close:focus-visible {
  background: linear-gradient(165deg, rgba(168, 198, 216, 0.28), rgba(8, 18, 36, 0.46));
  border-color: rgba(220, 235, 255, 0.7);
  color: #fff;
  box-shadow:
    0 0 5px rgba(200, 225, 255, 0.34),
    0 0 18px rgba(110, 170, 255, 0.22),
    0 0 44px rgba(80, 140, 255, 0.12),
    inset 0 0 14px rgba(150, 195, 255, 0.08);
}

#splat-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ══════════════════════════════════════
   LEVEL 4: NARRATIVE + STICKY MAP
══════════════════════════════════════ */
#narrative-map {
  position: relative;
  /* Steps 0–5 trigger at 0–150vh; sectBot sits at 165vh.
     After step 5 the user has ~15vh (~120px on a 800px screen) before
     the section exits and snaps directly to Level 5 (MC). */
  height: 265vh;
}

/* ── Level 4 → 5 transition: green scan line sweeps upward, revealing MC map ── */
#level-wipe {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 2000;
  pointer-events: none;
  background: linear-gradient(to right,
    transparent 0%,
    rgba(111, 196, 138, 0.7) 15%,
    rgba(226, 250, 234, 1) 50%,
    rgba(111, 196, 138, 0.7) 85%,
    transparent 100%);
  box-shadow:
    0 0 14px 4px rgba(111, 196, 138, 0.5),
    0 0 40px 10px rgba(111, 196, 138, 0.18);
  transform: translateY(calc(100vh + 4px));
  opacity: 0;
  will-change: transform;
}
#level-wipe.wipe-active {
  opacity: 1;
  animation: level-wipe-line 0.85s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}
@keyframes level-wipe-line {
  from { transform: translateY(calc(100vh + 4px)); }
  to   { transform: translateY(-4px); }
}

/* ══════════════════════════════════════
   LEVEL 10: MONTE CARLO — the analysis
   One instrument in Chapter 4's green: a dark, backlit glass readout over
   a quiet map, its edges lit mint-white, in a richer emerald than the land
   so no box reads as part of the map; the findings, once in, on the same
   glass, headed Results. Gold means one thing only, Roche and
   what lies in its view: on the map, in the charts and on the pin alike.
   No backdrop blur anywhere here: the canvas under the panel redraws every
   frame while the simulation runs, and a blur would be redrawn with it.
══════════════════════════════════════ */
#monte-carlo {
  --mc-ground: #020a06;
  --mc-green:  #6fc48a;                       /* Chapter 4's contour ink */
  --mc-mint:   #c6efd3;
  --mc-white:  #eef7f1;
  --mc-ink:    #0b1a11;                       /* written on the frost */
  --mc-gold:   #ecc964;                       /* Roche, and its view */
  --mc-red:    #f0624f;                       /* the land lost to mining */
  --mc-edge:   rgba(206, 242, 218, 0.4);
  --mc-hair:   rgba(198, 239, 211, 0.14);     /* structural dividers */
  --mc-dim:    rgba(198, 239, 211, 0.6);      /* labels on the glass */
  --mc-glass:  rgba(4, 17, 10, 0.82);
  /* the panels' glass: a richer, brighter emerald than the land under it,
     so a box never reads as part of the map */
  --mc-panel-bg: linear-gradient(160deg, rgba(22, 64, 42, 0.95), rgba(10, 36, 23, 0.95) 70%);
  --mc-panel-glow:
    0 0 6px rgba(200, 240, 215, 0.25),
    0 0 26px rgba(111, 196, 138, 0.18),
    0 0 70px rgba(111, 196, 138, 0.08),
    0 18px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(230, 255, 238, 0.12);
  --mc-strong: #9de6b4;                       /* key words on the glass */
  --mc-ease:   cubic-bezier(0.16, 1, 0.3, 1);
  /* the panel once the analysis is done: wide enough for the two periods
     side by side with their figures, so it stays short on any screen. While
     it runs, the panel keeps the intro's width, the periods stacked, so it
     covers no more of the map than the intro did */
  --mc-wide-w: clamp(620px, 58vw, 1040px);
  position: relative;
  min-height: 100vh;
}

/* MC map reveals bottom-to-top as the scan line sweeps up — synchronized */
#mc-map.mc-map-entering {
  visibility: visible;
  opacity: 1;
  transition: none;
  animation: mc-clip-reveal 0.85s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}
@keyframes mc-clip-reveal {
  from { clip-path: inset(100% 0 0 0); }
  to   { clip-path: inset(0% 0 0 0); }
}

/* MC map: full-viewport fixed overlay, visible only during #monte-carlo.
   Mirrors the Level 4 #map-container pattern. */
#mc-map {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  /* Same guard as #map-container: Leaflet re-enables pointer events on its
     interactive layers, which an ancestor's `none` does not stop. */
  visibility: hidden;
  transition: opacity 0.3s, visibility 0s linear 0.3s;
  background: var(--mc-ground);
}
#mc-map.mc-map-visible {
  visibility: visible;
  transition: opacity 0.3s, visibility 0s linear 0s;
  opacity: 1;
}

/* The base tiles a near-neutral dark with only a breath of green — the
   land a shade above the sea, the roads faint — so the panels, the dots and
   the viewshed carry the colour */
#mc-map .leaflet-tile-pane {
  filter: grayscale(1) sepia(0.4) hue-rotate(90deg) saturate(1.1) brightness(0.62) contrast(1.05);
  transition: filter 0.6s ease;
}

/* Vignette — slow entry, fast exit */
#mc-map::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 85% 70% at 55% 48%,
    transparent 30%, rgba(1, 7, 4, 0.72) 100%);
  pointer-events: none;
  z-index: 550;
  opacity: 0;
  transform: translateY(80px);
  transition: opacity 0.3s ease, transform 0.3s ease; /* exit fast */
}
#mc-map.mc-map-visible::before {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 2s ease 0.5s, transform 2s cubic-bezier(0.16, 1, 0.3, 1) 0.5s;
}

/* A faint survey grid, 160px — slow entry, fast exit. Kept well back,
   and thinning towards the edges of the screen: the map is the subject. */
#mc-map::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(166, 232, 192, 0.04) 1px, transparent 1px) 0 0 / 160px 160px,
    linear-gradient(rgba(166, 232, 192, 0.04) 1px, transparent 1px) 0 0 / 160px 160px;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 55% 50%, #000 30%, transparent 100%);
          mask-image: radial-gradient(ellipse 75% 70% at 55% 50%, #000 30%, transparent 100%);
  pointer-events: none;
  z-index: 551;
  opacity: 0;
  transform: scale(2);
  transition: opacity 0.3s ease, transform 0.3s ease; /* exit fast */
}
#mc-map.mc-map-visible::after {
  opacity: 1;
  transform: scale(1);
  transition: opacity 1.6s ease 0.5s, transform 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s;
}

/* Scan — a broad, soft band of green light drifting slowly down the map,
   no edge to it (injected via JS into #mc-map) */
.mc-map-scan {
  position: absolute;
  left: 0; right: 0;
  height: 50vh;
  background: linear-gradient(to bottom,
    transparent,
    rgba(111, 196, 138, 0.035) 50%,
    transparent);
  pointer-events: none;
  z-index: 560;
  opacity: 0;
  transition: opacity 0.3s;
  animation: mc-scan 16s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
#mc-map.mc-map-visible .mc-map-scan { opacity: 1; }
@keyframes mc-scan {
  0%   { transform: translateY(-50vh); }
  100% { transform: translateY(100vh); }
}

/* Leaflet container reset for the MC map — mirrors the Level 4 #map rule */
#mc-map .leaflet-container {
  width: 100%;
  height: 100%;
  background: var(--mc-ground);
}

/* ── Roche Rock final-frame pin (HTML overlay above the canvas) ──
   A gold point ringed in light, a slow ping going out from it, and its
   name on a chip of the panel's glass. The pin box stays 12px square:
   initMonteCarlo centres it on Roche by that size. */
.roche-mc-pin {
  position: absolute;
  z-index: 700;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.roche-mc-pin.visible { opacity: 1; }
.roche-mc-pin__dot {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--mc-gold);
  box-shadow:
    0 0 0 2px rgba(2, 10, 6, 0.9),
    0 0 0 3px rgba(255, 242, 205, 0.85),
    0 0 16px 3px rgba(236, 201, 100, 0.55);
}
.roche-mc-pin__dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid rgba(236, 201, 100, 0.9);
  animation: mc-pin-ping 2.6s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
}
@keyframes mc-pin-ping {
  0%   { transform: scale(1);   opacity: 0.9; }
  100% { transform: scale(3.4); opacity: 0; }
}
.roche-mc-pin__label {
  position: absolute;
  top: calc(100% + 9px);
  left: 10px;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: clamp(10px, 0.7vw, 12px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1;
  color: var(--mc-white);
  background: rgba(10, 36, 23, 0.92);
  border: 1px solid rgba(236, 201, 100, 0.55);
  border-radius: 2px;
  padding: 5px 8px 5px 9px;
  box-shadow: 0 0 12px rgba(236, 201, 100, 0.2);
}

/* ── Note 2 obscured-area label: the same chip, edged in the red ── */
.mc-obscured-label {
  position: absolute;
  z-index: 710;
  pointer-events: none;
  transform: translate(-50%, -50%);
  background: rgba(6, 9, 8, 0.88);
  border: 1px solid rgba(240, 98, 79, 0.65);
  border-radius: 2px;
  box-shadow: 0 0 14px rgba(240, 98, 79, 0.25);
  color: var(--mc-white);
  font-family: var(--font-body);
  font-size: clamp(10px, 0.8vw, 12px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1.45;
  text-align: center;
  padding: clamp(5px, 0.7vh, 8px) clamp(8px, 1vw, 12px);
  max-width: clamp(110px, 16vw, 180px);
  white-space: normal;
  opacity: 0;
  transition: opacity 0.5s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
/* up for the whole of the mining step; hovering the area lights it */
.mc-obscured-label.visible { opacity: 1; }
.mc-obscured-label.is-hot {
  border-color: rgba(255, 150, 132, 1);
  box-shadow: 0 0 6px rgba(255, 130, 110, 0.7), 0 0 22px rgba(240, 98, 79, 0.55), 0 0 48px rgba(240, 98, 79, 0.25);
}

/* ── Centred title — fixed at top of viewport, transitions with map overlays ── */
#mc-title {
  position: fixed;
  top: 5vh;
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 800;
  pointer-events: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.25s ease, transform 0.25s ease; /* exit fast */
}
#mc-title.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 1.6s ease 0.5s, transform 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s;
}
#mc-title .step-label {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--mc-green);
}
#mc-title .mc-heading {
  margin: 0 auto;
  max-width: 760px;
}
.mc-heading {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.3vw, 4.1rem);
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--mc-white);
  line-height: 1.02;
  margin: 0;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.7);
}
.mc-heading em { font-style: italic; color: var(--mc-mint); }

/* ── MC panel: the readout — dark glass, backlit at the edge ── */
#mc-panel {
  position: fixed;
  top: 20.5vh;                /* a clear gap under the title (which ends ~13vh down) */
  left: 7rem;
  width: clamp(320px, 40vw, 700px);
  min-height: 18vh;
  z-index: 800;
  pointer-events: none;
  overflow: hidden;

  padding: 2.1rem 2.3rem 1.9rem;
  background: var(--mc-panel-bg);
  border: 1px solid var(--mc-edge);
  border-radius: 3px;
  box-shadow: var(--mc-panel-glow);

  /* Wipes in from the left. The clip reaches 120px past every edge when
     open, so the glow round the panel is not cut off. Exit fast; entry
     slow (transition on target state) */
  clip-path: inset(-120px calc(100% + 120px) -120px -120px);
  transition: clip-path 0.3s ease, width 0.45s var(--mc-ease);
}
#mc-panel.visible {
  clip-path: inset(-120px -120px -120px -120px);
  pointer-events: auto;
  transition: clip-path 1s var(--mc-ease) 1.5s, width 0.45s var(--mc-ease);
}
/* running and done: tighter round the edge, the charts having the room */
#mc-panel.phase-running { padding: 1.4rem 1.7rem 1.4rem; }
#mc-panel.stats-visible { width: var(--mc-wide-w); }
#mc-panel.phase-results { width: clamp(320px, 42vw, 740px); }

/* One box through every step: a change of step eases it to the new
   content's size (mcMorphBegin/End in main.js) — held still while the new
   size is measured, then easing there; what it held fades out first and the
   new content fades in as it goes */
#mc-panel.mc-still { transition: none !important; }
#mc-panel.visible.is-morphing {
  transition: width 0.55s var(--mc-ease), height 0.55s var(--mc-ease),
              padding 0.55s var(--mc-ease);
}
.mc-phase {
  transition: opacity 0.4s ease 0.14s, transform 0.5s var(--mc-ease) 0.14s;
}
.mc-phase.is-entering { opacity: 0; transform: translateY(10px); transition: none; }
.mc-phase.is-leaving  { opacity: 0; transform: none; transition: opacity 0.16s ease; }

.mc-phase { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.mc-phase[hidden] { display: none; }

#mc-panel .mc-phase p {
  font-size: clamp(0.92rem, 1.05vw, 1.1rem);
  line-height: 1.78;
  margin-bottom: 0.85rem;
  color: rgba(232, 244, 236, 0.88);
}
#mc-panel strong { font-weight: 600; color: var(--mc-strong); }
#mc-panel em { font-style: italic; color: var(--mc-white); }

/* ── Buttons ──
   The level's call to act is a lit button: a mint-white fill glowing at its
   edge (as the context level's and Level 11's ways on are), turning to the
   ink with a mint edge on hover. Its arrow is drawn, not a glyph. */
.mc-arrow {
  display: inline-flex;
  flex: none;
  transition: transform 0.35s var(--mc-ease);
}
.mc-arrow svg {
  width: 14px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mc-cta {
  position: relative;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.8rem;
  padding: 1em 1.4em 1em 1.6em;
  background: linear-gradient(165deg, #e6f9ec, #b2e3c2);
  color: var(--mc-ink);
  border: 1px solid rgba(236, 255, 242, 0.95);
  border-radius: 3px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 0 6px rgba(206, 242, 218, 0.5),
    0 0 22px rgba(111, 196, 138, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  animation: mc-cta-breathe 3.2s ease-in-out infinite;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease,
              box-shadow 0.3s ease, transform 0.3s var(--mc-ease);
}
@keyframes mc-cta-breathe {
  0%, 100% { box-shadow: 0 0 6px rgba(206, 242, 218, 0.45), 0 0 18px rgba(111, 196, 138, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
  50%      { box-shadow: 0 0 9px rgba(206, 242, 218, 0.7),  0 0 34px rgba(111, 196, 138, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
}
.mc-cta:hover,
.mc-cta:focus-visible {
  outline: none;
  background: var(--mc-ink);
  color: var(--mc-mint);
  border-color: var(--mc-mint);
  box-shadow: 0 0 8px rgba(206, 242, 218, 0.6), 0 0 30px rgba(111, 196, 138, 0.5);
  animation: none;
  transform: translateY(-1px);
}
.mc-cta:hover .mc-arrow,
.mc-cta:focus-visible .mc-arrow { transform: translateX(4px); }

@media (prefers-reduced-motion: reduce) {
  .mc-cta, .roche-mc-pin__dot::after, .mc-map-scan { animation: none; }
}

/* The run, under a hairline dividing it from the text */
.mc-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.8rem;
  margin-top: 0.6rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--mc-hair);
}
.mc-cta-row .mc-cta { margin-top: 0; }
/* ── Running: the counter, the progress, the charts ── */
/* the counter and, filling the rest of its line, the progress bar */
.mc-counter-row {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-bottom: 0.8rem;
}
.mc-counter { flex: none; }
.mc-counter {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mc-dim);
  font-variant-numeric: tabular-nums;
}
.mc-counter span {
  margin: 0 0.15em 0 0.35em;
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--mc-white);
}

.mc-progress-row {
  flex: 1;
  min-width: 60px;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.mc-progress-track {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(198, 239, 211, 0.1);
  position: relative;
  overflow: hidden;
}
.mc-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(111, 196, 138, 0.45), var(--mc-mint));
  box-shadow: 0 0 8px rgba(111, 196, 138, 0.7);
  transition: width 0.12s linear;
}
.mc-progress-pct {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--mc-dim);
  min-width: 3em;
  text-align: right;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

/* Chart area — fades in when histograms are injected (no height animation) */
#mc-chart-area {
  opacity: 0;
  transition: opacity 0.4s ease;
}
#mc-chart-area.expanded { opacity: 1; }

/* The two periods side by side, each in a box of its own: a darker well set
   into the panel, its name over a hairline, the chart sitting on the box's
   floor and, once the run is over, what it shows folding open beneath it. */
.mc-periods {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}
#mc-panel.stats-visible .mc-periods {
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}
.mc-period {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.6rem 0.85rem 0.55rem;
  background: rgba(2, 14, 8, 0.5);
  border: 1px solid rgba(198, 239, 211, 0.12);
  border-radius: 3px;
}
.mc-period-head {
  padding-bottom: 0.4rem;
  margin-bottom: 0.15rem;
  border-bottom: 1px solid rgba(198, 239, 211, 0.1);
}
.mc-chart { margin-top: auto; }
.mc-chart svg { overflow: visible; }

.mc-chart-era {
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 1.2vw, 1.3rem);
  font-weight: 600;
  line-height: 1;
  color: var(--mc-white);
}
/* the chart's own text (initLiveChart): ticks, axis titles, the markers */
.mc-chart text {
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
}
.mc-chart .mc-tick text { font-size: 10px; fill: rgba(220, 240, 228, 0.55); }
.mc-chart .mc-tick line,
.mc-chart .mc-tick .domain { stroke: rgba(220, 240, 228, 0.2); }
.mc-chart .mc-tick--y line { stroke: rgba(220, 240, 228, 0.07); }
.mc-chart .mc-tick--y .domain { display: none; }
.mc-chart .mc-axis-title {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  fill: rgba(198, 239, 211, 0.5);
}
.mc-chart .mc-mark-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
}
.mc-chart .mc-mark-value { font-size: 12.5px; font-weight: 600; }

/* What the chart shows, folded away (rows 0fr) until the run is over */
.mc-stat-aside {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.5s var(--mc-ease), opacity 0.35s ease 0.2s;
}
.mc-stat-aside.visible {
  grid-template-rows: 1fr;
  opacity: 1;
}
.mc-stat-inner {
  min-height: 0;
  overflow: hidden;
}
/* read top to bottom: the finding, the two counts behind it, how sure */
.mc-stat-headline {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.8rem;
}
.mc-stat-aside__mult {
  flex: none;
  font-family: var(--font-heading);
  font-size: clamp(1.9rem, 2.3vw, 2.4rem);
  font-weight: 600;
  line-height: 0.9;
  color: var(--mc-strong);
  font-variant-numeric: lining-nums;
}
.mc-stat-headline-text {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.35;
  color: rgba(232, 244, 236, 0.85);
}
.mc-stat-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-top: 0.65rem;
}
.mc-tile {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.55rem 0.7rem 0.5rem;
  background: rgba(198, 239, 211, 0.05);
  border: 1px solid rgba(198, 239, 211, 0.13);
  border-radius: 3px;
}
.mc-tile--roche { border-color: rgba(236, 201, 100, 0.4); background: rgba(236, 201, 100, 0.07); }
.mc-tile-num {
  font-family: var(--font-heading);
  font-size: clamp(1.45rem, 1.7vw, 1.85rem);
  font-weight: 600;
  line-height: 0.95;
  color: var(--mc-white);
  font-variant-numeric: lining-nums tabular-nums;
}
.mc-tile--roche .mc-tile-num  { color: var(--mc-gold); }
.mc-tile-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--mc-dim);
}
/* the chart's legend, kept in the tiles that read its markers out */
.mc-key {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 1px;
}
.mc-key--roche  { background: var(--mc-gold); box-shadow: 0 0 6px rgba(236, 201, 100, 0.6); }
.mc-key--chance { background: rgba(214, 244, 224, 0.92); }
.mc-stat-note {
  margin-top: 0.6rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--mc-dim);
  font-variant-numeric: tabular-nums;
}
#mc-panel .mc-stat-note strong { font-weight: 600; color: var(--mc-white); }
/* The fine print under both periods: how the p-values were reckoned and that
   each site is counted once. Folds open with the figures above it. */
#mc-panel .mc-stat-fine .mc-stat-inner {   /* #mc-panel: over #mc-panel .mc-phase p */
  margin: 0.55rem 0 0;
  font-family: var(--font-body);
  font-size: 0.66rem;
  line-height: 1.45;
  color: var(--mc-dim);
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}
.mc-stat-aside__p { white-space: nowrap; color: rgba(198, 239, 211, 0.45); }

/* The button under the charts: Skip while the analysis plays (the scroll
   is held meanwhile), a framed button that fills mint on hover; unlit and
   quiet once pressed; lit as the level's call to act, View results, once
   the analysis is done */
.mc-cta--results {
  margin-top: 0.7rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease, background 0.4s ease,
              color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  animation: none;
  pointer-events: none;
  cursor: default;
}
.mc-cta--results:not(.complete) {
  background: transparent;
  color: var(--mc-dim);
  border-color: rgba(198, 239, 211, 0.28);
  box-shadow: none;
}
.mc-cta--results.visible {
  opacity: 1;
  transform: none;
}
.mc-cta--results.is-skip {
  pointer-events: auto;
  cursor: pointer;
  color: var(--mc-mint);
  border-color: rgba(198, 239, 211, 0.5);
}
.mc-cta--results.is-skip:hover,
.mc-cta--results.is-skip:focus-visible {
  background: var(--mc-mint);
  border-color: var(--mc-mint);
  color: var(--mc-ink);
  box-shadow: 0 0 8px rgba(206, 242, 218, 0.5), 0 0 24px rgba(111, 196, 138, 0.35);
}
.mc-cta--results.complete {
  pointer-events: auto;
  cursor: pointer;
  animation: mc-cta-breathe 3.2s ease-in-out infinite;
}
.mc-cta--results.complete:hover,
.mc-cta--results.complete:focus-visible { animation: none; }

/* ── Results: the findings, one card at a time ── */
.mc-carousel {
  display: flex;
  flex-direction: column;
}
/* Viewport: its height set by JS to the current step's text (fitCarousel),
   easing as the steps change; what is moving in or out is clipped to it */
.mc-carousel__viewport {
  position: relative;
  overflow: hidden;
  transition: height 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}
/* All cards absolutely stacked; JS drives opacity + transform */
.mc-carousel__card {
  position: absolute;
  top: 0; left: 0; right: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0);
  transition: opacity 0.35s ease, transform 0.38s var(--mc-ease);
}
.mc-carousel__card.active {
  opacity: 1;
  pointer-events: auto;
}

/* The card: the readout's own glass, headed Results, a hairline the card's
   full width under the heading. The card and its heading stay put; only the
   body text inside (.mc-carousel__card) moves from step to step. */
/* the results sit in the panel's own glass, as step 1 does */
.mc-result-panel { position: relative; }
/* A box's header (step 1's and the results'): a band of its own across
   the top of the box, edge to edge, lit a shade brighter than the glass
   from the left and closed off by the box's mint edge. The title starts on
   the text's own left edge, so the band reads straight down into the box;
   the box's drawing sits at the band's far end, a counterweight to the
   title, centred on the title's capitals rather than its line box. */
.mc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  margin: -2.1rem -2.3rem 1.15rem;
  padding: 1.15rem 2.3rem 1.05rem;
  background: linear-gradient(100deg, rgba(198, 239, 211, 0.14), rgba(198, 239, 211, 0.035) 75%);
  border-bottom: 1px solid rgba(198, 239, 211, 0.24);
  box-shadow: inset 0 1px 0 rgba(230, 255, 238, 0.12), 0 8px 18px -12px rgba(0, 0, 0, 0.6);
}
.mc-head-title {
  margin: 0;
  /* the capitals sit high in their line box: dropped a touch so
     they centre on the band and on the drawing */
  padding-top: 0.08em;
  font-family: var(--font-heading);
  font-size: clamp(1.55rem, 1.95vw, 2.1rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.005em;
  color: var(--mc-white);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.4);
}
.mc-head-glyph {
  order: 2;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--mc-mint);
  opacity: 0.9;
}
.mc-head-glyph svg {
  width: 46px;
  height: 46px;
  margin: -0.4rem 0;          /* larger without deepening the band */
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mc-head-glyph circle,
.mc-head-glyph rect { fill: currentColor; stroke: none; }
.mc-head-glyph rect { opacity: 0.8; }
/* the frame of the Monte Carlo drawing, fainter than what is in it */
.mc-head-glyph .mc-head-frame { stroke-opacity: 0.45; }
/* points that fell outside the region: rings, dimmer */
.mc-head-glyph circle.mc-head-out { fill: none; stroke: currentColor; stroke-width: 1.1; opacity: 0.6; }
/* gold: Roche's — its mark in the results' drawing, the region and the
   points counted in it in the Monte Carlo's */
.mc-head-glyph path.mc-head-mark { stroke: var(--mc-gold); }
.mc-head-glyph circle.mc-head-mark { fill: var(--mc-gold); }

#mc-panel .mc-result-panel p {
  font-size: clamp(0.98rem, 1.1vw, 1.12rem);
  line-height: 1.75;
  color: rgba(232, 244, 236, 0.9);
}
#mc-panel .mc-result-panel p:last-child { margin-bottom: 0; }

/* Card 3: what we now know, as a ruled list, then the closing question */
#mc-panel .mc-result-panel p.mc-results-list-intro {
  margin-bottom: 0.6rem;
  font-size: clamp(15px, 1.3vw, 21px);
}
.mc-results-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.1rem;
  border-top: 1px solid rgba(198, 239, 211, 0.14);
}
.mc-results-list li {
  position: relative;
  padding: 0.6rem 0 0.6rem 1.6rem;
  border-bottom: 1px solid rgba(198, 239, 211, 0.1);
  font-size: clamp(1rem, 1.15vw, 1.15rem);
  font-weight: 600;
  line-height: 1.45;
  color: var(--mc-white);
}
.mc-results-list li::before {
  content: '';
  position: absolute;
  left: 0.2rem;
  top: calc(0.6rem + 0.725em - 3.5px);
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: var(--mc-green);
  box-shadow: 0 0 6px rgba(111, 196, 138, 0.6);
}
/* Card 3 final note — the body text's styling, bold */
/* the question in the box's body style; only its last line, the em, bold */
.mc-result-panel .step-quote {
  margin-top: 0;
  font-family: var(--font-body);
  font-size: clamp(0.92rem, 1.05vw, 1.1rem);
  font-style: normal;
  font-weight: 400;
  line-height: 1.78;
  color: rgba(232, 244, 236, 0.88);
}
.mc-result-panel .step-quote em {
  font-style: normal;
  font-weight: 600;
  color: rgba(232, 244, 236, 0.9);
}
/* Extra bottom padding on step 3 so text clears the absolute-positioned button */
.mc-carousel__card[data-card="2"] { padding-bottom: 3rem; }

/* Phones: the panel had no small-screen layout, so at 390px it sat 7rem in
   at its 320px minimum and ran off the right edge and the bottom of the
   screen (it is fixed, so the cut-off text could not be scrolled to). Here
   it spans the screen less a gutter, keeps the two periods stacked, and
   scrolls inside itself when a step is taller than the screen. */
@media (max-width: 768px) {
  #mc-panel,
  #mc-panel.phase-results,
  #mc-panel.stats-visible {
    left: 1rem;
    right: 1rem;
    width: auto;
    max-height: calc(100svh - 20.5vh - 1rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.4rem 1.2rem 1.3rem;
  }
  #mc-panel .mc-head {
    margin: -1.4rem -1.2rem 1rem;
    padding: 1rem 1.2rem 0.9rem;
  }
  #mc-panel.stats-visible .mc-periods { grid-template-columns: 1fr; }
  /* the counter keeps its line; the progress bar and its % take the next */
  .mc-counter-row { flex-wrap: wrap; row-gap: 0.45rem; }
  .mc-progress-row { flex-basis: 100%; }
  /* last result: the arrow and pips on one row, Explore across the next,
     where its label fits on one line */
  .mc-carousel__nav { flex-wrap: wrap; row-gap: 1rem; }
  .mc-carousel__explore.shown { flex-basis: 100%; order: 3; margin: 0; padding: 0 1em;
                                white-space: nowrap; letter-spacing: 0.1em; }
}

/* Run again — a hairline button in mint, filling mint on hover,
   bottom-right of step 3 */
.mc-reset {
  position: absolute;
  bottom: 0;
  right: 0;
  padding: 0.5rem 0.85rem;
  background: transparent;
  border: 1px solid rgba(198, 239, 211, 0.35);
  border-radius: 3px;
  color: var(--mc-mint);
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.mc-reset:hover,
.mc-reset:focus-visible {
  outline: none;
  background: var(--mc-mint);
  border-color: var(--mc-mint);
  color: var(--mc-ink);
}

/* Nav row — under the cards, over the map: glass keys, the steps as
   segments, and on the last card the way on */
.mc-carousel__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  padding-top: 1.3rem;
  margin-top: 1.1rem;
  border-top: 1px solid rgba(198, 239, 211, 0.18);
}
.mc-carousel__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 2.5rem;
  padding: 0;
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1;
  color: var(--mc-mint);
  background: var(--mc-glass);
  border: 1px solid var(--mc-edge);
  border-radius: 3px;
  box-shadow: 0 0 4px rgba(200, 240, 215, 0.16), 0 0 16px rgba(111, 196, 138, 0.12);
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, color 0.25s, box-shadow 0.25s, opacity 0.25s;
}
.mc-carousel__arrow:hover:not(:disabled),
.mc-carousel__arrow:focus-visible:not(:disabled) {
  outline: none;
  background: var(--mc-mint);
  border-color: var(--mc-mint);
  color: var(--mc-ink);
  box-shadow: 0 0 8px rgba(206, 242, 218, 0.6), 0 0 26px rgba(111, 196, 138, 0.45);
}
.mc-carousel__arrow--next {
  width: auto;
  gap: 0.6rem;
  padding: 0 1rem 0 1.15rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.mc-carousel__arrow--next span { font-size: 1.05rem; letter-spacing: 0; }
.mc-carousel__arrow:disabled {
  opacity: 0.3;
  cursor: default;
  box-shadow: none;
}
.mc-carousel__pips {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.mc-carousel__pip {
  display: block;
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: rgba(198, 239, 211, 0.22);
  transition: background 0.3s, width 0.4s var(--mc-ease), box-shadow 0.3s;
}
.mc-carousel__pip.active {
  width: 30px;
  background: var(--mc-mint);
  box-shadow: 0 0 8px rgba(111, 196, 138, 0.8);
}
/* Explore link: hidden by default, shown only on last card via JS class —
   the lit button, a sheen crossing it now and then */
.mc-carousel__explore {
  display: none;
  align-self: center;
  margin: 0;
  padding: 1em 1.6em;
  position: relative;
  overflow: hidden;
  background: linear-gradient(165deg, #e6f9ec, #b2e3c2);
  color: var(--mc-ink);
  border: 1px solid rgba(236, 255, 242, 0.95);
  border-radius: 3px;
  box-shadow:
    0 0 6px rgba(206, 242, 218, 0.5),
    0 0 22px rgba(111, 196, 138, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.3s ease;
}
.mc-carousel__explore::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 55%;
  height: 100%;
  background: linear-gradient(105deg, transparent 15%, rgba(255, 255, 255, 0.75) 50%, transparent 85%);
  transform: skewX(-18deg);
  pointer-events: none;
}
.mc-carousel__explore.shimmer::before {
  animation: explore-shimmer 2.6s ease-in-out infinite;
}
@keyframes explore-shimmer {
  0%       { left: -120%; }
  60%, 100% { left: 160%; }
}
.mc-carousel__explore:hover,
.mc-carousel__explore:focus-visible {
  outline: none;
  background: var(--mc-ink);
  color: var(--mc-mint);
  border-color: var(--mc-mint);
  box-shadow: 0 0 8px rgba(206, 242, 218, 0.6), 0 0 30px rgba(111, 196, 138, 0.5);
}
.mc-carousel__explore:hover::before,
.mc-carousel__explore:focus-visible::before { opacity: 0; }
.mc-carousel__explore.shown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* On the last result it takes the rest of the row and stands taller than
   the arrow beside it, its overhang taken back by negative margins so the
   row, and the box, keep their size */
.mc-carousel__explore {
  flex: 1 1 auto;
  height: 3.1rem;
  margin: -0.3rem 0;
  padding: 0 1.8em;
  font-size: 0.95rem;
}

/* Map panel — fixed overlay, shown during narrative scroll section (Level 9).
   initMapVisibility switches .map-visible on at the section top rather than on
   intersection, so this fade is the arrival itself — long enough to read as a
   transition, short enough to be settled by the time the snap lands. */
#map-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  /* `pointer-events: none` here is not enough on its own. Leaflet's own
     stylesheet sets `pointer-events: auto` on `.leaflet-interactive` layers,
     and an explicit value on a descendant beats an ancestor's none — so the
     viewshed polygon and the site markers stayed hoverable, invisible, fixed
     over every level above this one, complete with their `cursor: pointer`.
     visibility IS inherited and Leaflet never overrides it, so it shuts the
     whole subtree off. The 0s delay holds it until the fade has finished. */
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}

#map-container.map-visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: opacity 0.45s ease, visibility 0s linear 0s;
}

/* The fixed overlays sit above every level even while hidden, and Leaflet's
   own CSS turns pointer events back on for its interactive layers (site
   markers, invisible hit polygons, controls), overriding the container's
   none. So while an overlay is hidden nothing inside it may take a click,
   or it swallows clicks meant for the level underneath (e.g. Keep
   Exploring on the 3D slide). */
#map-container:not(.map-visible) *,
#mc-map:not(.mc-map-visible) *,
#narrative-orbs:not(.visible) * {
  pointer-events: none !important;
}

#map {
  width: 100%;
  height: 100%;
  background: #080b10;                /* the graded sea, under unloaded tiles */
}

/* Leaflet container reset */
#map .leaflet-container {
  width: 100%;
  height: 100%;
  background: #080b10;
}

/* A vignette, as on the Monte Carlo map. The tiles' night-blue grade is baked in
   as they load (GradedTileLayer) and the survey grid is drawn on the map itself,
   so it zooms with it. Above the Leaflet panes (400), below the fog (450) and
   the FX overlay (455). Its own layer: the map moves beneath it, it never redraws. */
/* Behind the map while it is moved and scaled to meet the 3D disc on the rise
   from Zooming out: its own dark, so the page's ground never shows round it. */
#map-backing {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 499;
  background: #080b10;
  pointer-events: none;
}
#map-container.zo-handing ~ #map-backing { display: block; }

#map-container::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 440;
  pointer-events: none;
  transform: translateZ(0);
  background: radial-gradient(ellipse 85% 75% at 58% 48%,
    transparent 32%, rgba(3, 8, 15, 0.72) 100%);
}

/* Behind the text: the map falls away to the dark under the column, so the words
   never sit on the viewshed or the sites. Above the fog (450) and the FX (455),
   below Roche's dot (470), which the views keep clear of the column anyway. */
#map-container::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 460;
  pointer-events: none;
  transform: translateZ(0);
  background: linear-gradient(90deg,
    rgba(5, 9, 15, 0.86) 0%, rgba(5, 9, 15, 0.72) 28%, rgba(5, 9, 15, 0.3) 42%, transparent 52%);
}
@media (max-width: 768px) {
  .step-text p { font-size: 0.95rem; line-height: 1.6; }
  #map-container::after {
    background: linear-gradient(180deg,
      rgba(5, 9, 15, 0.9) 0%, rgba(5, 9, 15, 0.78) 34%, rgba(5, 9, 15, 0.3) 46%, transparent 56%);
  }
}

/* The credit, quiet on the dark, as the 3D scene's is */
#map .leaflet-control-attribution {
  background: transparent;
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.02em;
  color: rgba(240, 234, 216, 0.42);
}
#map .leaflet-control-attribution a { color: rgba(240, 234, 216, 0.6); }

#map-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

.map-annotation {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20,18,14,0.88);
  border: 1px solid rgba(200,150,42,0.3);
  padding: 0.6rem 1.2rem;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--ochre-lt);
  border-radius: 2px;
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.4s;
  white-space: nowrap;
  pointer-events: none;
}

.map-annotation.visible { opacity: 1; }

/* ── Narrative orb counter — fixed so z-index beats Leaflet panes ── */
#narrative-orbs {
  position: fixed;
  top: calc(15vh + 1.5rem);
  left: clamp(1.25rem, 2vw, 3rem);
  z-index: 850;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s, visibility 0s linear 0.5s;
}

/* Slots and orbs opt back in so clicks reach them */
#narrative-orbs .n-orb-slot,
#narrative-orbs .n-orb {
  pointer-events: auto;
}

#narrative-orbs.visible { opacity: 1; visibility: visible; transition: opacity 0.5s; }

.n-orb-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.n-orb-slot + .n-orb-slot::before {
  content: '';
  display: block;
  width: 1px;
  height: clamp(32px, 4.5vh, 52px);
  /* the line between two orbs, ring to ring */
  background: rgba(200, 150, 42, 0.38);
}

/* The site's step markers (as .intro-orb): hollow ahead, filled behind, filled
   and lit for the step being read. Each one jumps to its step. */
.n-orb {
  position: relative;
  display: block;
  width:  clamp(10px, 0.9vw, 14px);
  height: clamp(10px, 0.9vw, 14px);
  padding: 0;
  appearance: none;
  border-radius: 50%;
  border: 1.5px solid rgba(200, 150, 42, 0.38);
  background: transparent;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.55s ease, border-color 0.55s ease, opacity 0.55s ease,
              box-shadow 0.55s ease, transform 0.15s ease;
}
/* the bead and its trail run behind the dots */
#narrative-orbs .intro-orb-trail,
#narrative-orbs .intro-orb-comet { z-index: 1; }
.n-orb { z-index: 2; }
/* a small target: the click reaches a little past the ring */
.n-orb::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
}
.n-orb.past {
  background: var(--ochre);
  border-color: var(--ochre);
  opacity: 0.7;
}
.n-orb.current {
  background: var(--ochre);
  border-color: var(--ochre);
  box-shadow: 0 0 10px rgba(200, 150, 42, 0.65), 0 0 3px var(--ochre);
  transform: scale(1.18);
}
.n-orb:hover { border-color: var(--ochre); transform: scale(1.35); }

/* ── Narrative flash frame — fixed over the text column, above Leaflet ── */

#narrative-flash {
  position: fixed;
  top: calc(15vh - 1rem);
  left: 7rem;
  width: 520px;
  height: 260px;
  background: rgba(200, 150, 42, 0.08);
  z-index: 850;
  pointer-events: none;
  opacity: 0;
  will-change: opacity;
}

/* Scroll steps — fixed like the prototype stage; text never moves with scroll */
#scroll-steps {
  position: fixed;
  top: 15vh;
  left: 7rem;
  width: calc(55% - 7rem);
  padding: 0 2rem 0 0;
  z-index: 800;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

#scroll-steps.visible { opacity: 1; }

/* The last step's way on: .splat-launch-cta's look, as the timeline's Continue,
   under the text's right edge. It fades in a while after the sightlines land
   (initScrollama), its room kept so the step never reflows. */
.nm-continue-row { display: flex; justify-content: flex-end; margin-top: clamp(1.6rem, 3.5vh, 2.4rem); }
.nm-continue {
  display: flex;
  width: max-content;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px) scale(0.94);
  /* out quickly, with its step's text */
  transition: opacity 0.2s ease, visibility 0s linear 0.2s, transform 0.2s ease,
              background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.step.is-active .nm-continue.is-shown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  /* in slowly */
  transition: opacity 0.8s ease, visibility 0s linear 0s,
              transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.step.is-active .nm-continue.is-shown:hover,
.step.is-active .nm-continue.is-shown:focus-visible { transform: translateY(-2px); }
.nm-continue .splat-launch-arrow { display: inline-flex; }
.nm-continue svg { width: 7px; height: 12px; }
.nm-continue:hover .splat-launch-arrow,
.nm-continue:focus-visible .splat-launch-arrow { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) {
  .nm-continue { transform: none; transition: opacity 0.3s ease, visibility 0s linear 0.3s; }
}

/* When panel is hidden, steps must never intercept clicks */
#scroll-steps:not(.visible) .step { pointer-events: none !important; }

/* All steps overlap at the same position; only the active one is visible */
.step {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
}

.step.is-active {
  pointer-events: auto;
}

/* ── Step inner — layout container only ── */
.step-inner {
  max-width: 520px;
  padding: 1.5rem 1.75rem;
  /* the first line's middle (half its 1.75 line height, at .step-text p's size)
     level with the middle of the first orb, which starts at the same height */
  margin-top: calc(clamp(10px, 0.9vw, 14px) / 2 - clamp(0.8rem, 1.3vw, 1.6rem) * 0.875);
}

/* ── Eyebrow label — animates separately above the gate ── */
.step-label {
  display: block;
  font-size: clamp(11px, 0.75vw, 16px);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ochre);
  margin-bottom: clamp(10px, 1.2vh, 18px);
  line-height: 1;
  opacity: 0;
  will-change: transform, opacity;
  text-align: left;
}

/* ── Gate — clips text entering from below; negative top inset allows
      easeOutBack upward overshoot without clipping the text ── */
.step-gate {
  overflow: hidden;
  clip-path: inset(-80px 0 0 0);
  position: relative;
}

/* ── Sliding text block — JS positions this below the gate on init ── */
.step-text {
  opacity: 0; /* hidden until JS entrance animation; prevents flash on fonts.ready */
  text-shadow:
    0 1px 10px rgba(0,0,0,0.95),
    0 0 40px rgba(0,0,0,0.8);
}

/* ── Body paragraphs ── */
.step-text p {
  font-size: clamp(0.8rem, 1.3vw, 1.6rem);
  font-weight: 300;
  line-height: 1.75;
  color: var(--parchment);
  margin-bottom: 0.95rem;
}

/* ── Teaser ── */
.step-teaser {
  font-style: italic;
  color: var(--ochre-lt) !important;
  font-size: clamp(0.75rem, 1.2vw, 1.5rem) !important;
}

/* ── Blockquote ── */
.step-quote {
  margin-top: 1.25rem;
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(0.75rem, 0.95vw, 1.2rem);
  color: var(--ochre);
  line-height: 1.55;
}

.site-count-label {
  font-size: 0.8rem !important;
  color: var(--stone-lt) !important;
}

.cta-button {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.75rem 1.75rem;
  border: 1px solid var(--ochre);
  color: var(--ochre-lt);
  font-family: var(--font-body);
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 0.3s, color 0.3s;
}

.cta-button:hover {
  background: var(--ochre);
  color: var(--stone);
}

/* Steps with a CTA button: flex column so button centres naturally */

/* ══════════════════════════════════════
   LEVEL 7: EXPLORE MAP
══════════════════════════════════════ */
#explore {
  padding: 4rem 2rem 0;
  background: var(--stone-mid);
}

.explore-header {
  max-width: 900px;
  margin: 0 auto 2rem;
}

.explore-header h2 {
  font-size: clamp(2.24rem, 5.6vw, 3.92rem);
  color: var(--cream);
  margin-bottom: 0.5rem;
}

.explore-header > p {
  color: var(--parchment);
  opacity: 0.7;
  margin-bottom: 1.5rem;
}

/* Layer toggles */
.layer-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toggle-btn {
  padding: 6px 14px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--stone-lt);
  background: transparent;
  color: var(--stone-lt);
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s;
}

.toggle-btn.active {
  border-color: var(--ochre);
  color: var(--ochre-lt);
  background: rgba(200,150,42,0.1);
}

#explore-map-wrap {
  position: relative;
  height: 80vh;
  min-height: 500px;
  overflow: hidden;
}

#explore-map {
  width: 100%;
  height: 100%;
}

/* Site detail panel */
.site-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: var(--panel-w);
  height: 100%;
  background: rgba(20, 18, 14, 0.96);
  border-left: 1px solid rgba(200,150,42,0.25);
  transform: translateX(100%);
  transition: transform var(--transition);
  z-index: 10;
  overflow-y: auto;
  backdrop-filter: blur(10px);
}

.site-panel[aria-hidden="false"] {
  transform: translateX(0);
}

.site-panel-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--stone-lt);
  font-size: 1.1rem;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 1;
}
.site-panel-close:hover { color: var(--parchment); }

#site-panel-content {
  padding: 2rem 1.5rem;
}

/* Site panel inner layout */
.sp-type {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ochre);
  margin-bottom: 0.5rem;
}

.sp-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--cream);
  margin-bottom: 1rem;
  line-height: 1.1;
}

.sp-media-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--stone-mid);
  border: 1px solid var(--stone-lt);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--stone-lt);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.sp-text {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--parchment);
  margin-bottom: 1rem;
}

.sp-meta {
  font-size: 0.75rem;
  color: var(--stone-lt);
  border-top: 1px solid var(--stone-lt);
  padding-top: 0.75rem;
  margin-top: 1rem;
  display: grid;
  gap: 4px;
}

.sp-media-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 1rem 0;
}

.sp-media-btn {
  padding: 5px 12px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--stone-lt);
  background: none;
  color: var(--parchment);
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s;
}
.sp-media-btn:hover {
  border-color: var(--ochre);
  color: var(--ochre-lt);
}

/* Roche Rock marker */
.roche-marker {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #f5d060 0%, #c8962a 65%, #8a6010 100%);
  mix-blend-mode: screen;
  border: none;
  box-shadow: 0 0 14px 4px rgba(245,208,96,0.55);
  cursor: pointer;
  position: relative;
  overflow: visible;
  transition: box-shadow 0.2s;
}
.roche-marker:hover {
  box-shadow: 0 0 22px 8px rgba(245,208,96,0.7);
}

/* The narrative map's Roche Rock: a gold dot, hotter at its centre, with the
   light falling straight off its edge. Sized by --rm-zoom
   (updateNarrativeMarkerSize) and --rm-in (its arrival). */
.roche-marker--narrative {
  width: 14px; height: 14px;
  background: radial-gradient(circle, #f8e4a6 0%, #eccb6c 55%, #e0b955 100%);
  mix-blend-mode: normal;
  box-shadow:
    0 0 8px 1px rgba(236, 201, 100, 0.45),
    0 0 20px 5px rgba(236, 201, 100, 0.12);
  transform: scale(calc(var(--rm-zoom, 1) * var(--rm-in, 1)));
  transform-origin: center;
}
.roche-marker--narrative:hover {
  box-shadow:
    0 0 12px 3px rgba(236, 201, 100, 0.6),
    0 0 26px 8px rgba(236, 201, 100, 0.18);
}

/* Its ping, opening from the dot's own edge */
.roche-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(236, 201, 100, 0.55);
  opacity: 0;
  pointer-events: none;
}
.roche-ring.is-animating { animation: mc-pin-ping 3.2s cubic-bezier(0.2, 0.6, 0.3, 1) infinite; }

/* Viewshed hover glow — applied via JS mouseover/mouseout on the overlayPane */
/* Screened onto the land, so the roads and valleys show through the blue as if
   it were light falling on them, rather than a flat sheet laid on top */
#map .leaflet-overlay-pane {
  mix-blend-mode: screen;
}
/* Hovering brings the fill back to its bright state (VS_BRIGHT). !important:
   the reveal writes opacity and transition inline. */
#map .leaflet-overlay-pane.viewshed-hovered {
  opacity: 1 !important;
  transition: opacity 0.25s ease !important;
}

/* Map hover labels — "Roche Rock’s viewshed" (step 3, blue) and
   "Roche Rock" (steps 1–3, gold). Positioned by JS. */
.map-hover-label {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;   /* above Leaflet's panes (400–700) inside #map-container */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  background: rgba(7, 20, 37, 0.92);
  border: 1px solid rgba(126, 207, 234, 0.45);
  border-radius: 2px;
  box-shadow: none;
  padding: 0.45rem 0.8rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: #7ecfea;
  white-space: nowrap;
}
.map-hover-label.is-visible { opacity: 1; }

.map-hover-label--roche {
  border-color: rgba(232, 184, 75, 0.5);
  color: var(--ochre-lt);
}

.site-marker {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--rust);
  border: 2px solid var(--parchment);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}
.site-marker.neolithic { background: #4a7a8a; }
.site-marker.bronze-age { background: var(--rust); }
.site-marker:hover { transform: scale(1.4); }

/* ══════════════════════════════════════
   LEVEL 13 — REFERENCES: the bibliography
   In About's language, as the night carries on below it: the flat night
   navy ground with the survey contours drawn faintly in its orange, a cream heading with its short orange accent,
   and the parts on a pane of frosted glass. The tabs rest as glass and
   the open one fills into a field index card (cream stock, ink), as
   About's cards do. One part at a time in a single column (Text by
   default); a part longer than the pane scrolls within it.
══════════════════════════════════════ */
.refs {
  --rf-ground:   #071425;
  --rf-cream:    #f0ead8;
  --rf-card:     #f3f0e9;
  --rf-ink:      #23262b;
  --rf-muted:    #8fa0b3;
  --rf-orange:   #c9582a;
  --rf-hairline: rgba(240, 234, 216, 0.16);
  --rf-radius:   4px;
  --rf-ease:     cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(3.25rem, 8vh, 5.5rem) 5vw clamp(2rem, 6vh, 4rem);
  color: var(--rf-cream);
  background: var(--rf-ground);
}
/* the survey contours, drawn in the page's orange (the sheet used as a
   mask, so only its lines take the colour), and the grain the other
   levels carry */
.refs::before,
.refs::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.refs::before {
  background: var(--rf-orange);
  opacity: 1;                         /* the sheet's own lines are faint: this is them at their own strength */
  -webkit-mask: url("images/contours/contours_bg_4.webp") 50% 45% / cover no-repeat;
  mask: url("images/contours/contours_bg_4.webp") 50% 45% / cover no-repeat;
}
.refs::after {
  opacity: 0.35;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.refs-inner {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* the heading, on the left, with About's short orange accent under it */
.refs-head {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.refs-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 4.4vw, 4.2rem);
  line-height: 1;
  color: var(--rf-cream);
}
.refs-title::after {
  content: '';
  display: block;
  width: 2.2rem;
  height: 2px;
  margin: 0.5em 0 0;
  background: var(--rf-orange);
  transform-origin: left;
}

/* the tabs: glass at rest; the open one a whiter glass. A hairline under
   them parts them from the references */
.refs-tabs {
  display: flex;
  align-self: stretch;                 /* so the line under them runs the page's width */
  gap: 0.8rem;
  margin-top: clamp(1.4rem, 3.5vh, 2.25rem);
  padding-bottom: clamp(1.1rem, 2.6vh, 1.6rem);
  border-bottom: 1px solid var(--rf-hairline);
}
.refs-tab {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  padding: 0.95em 2.1em;
  border: 1px solid var(--rf-hairline);
  border-radius: var(--rf-radius);
  background: rgba(7, 20, 37, 0.25);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: var(--font-body);
  font-size: clamp(0.82rem, 0.9vw, 0.92rem);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(240, 234, 216, 0.72);
  cursor: pointer;
  transition: background 0.35s var(--rf-ease), color 0.35s var(--rf-ease), border-color 0.35s var(--rf-ease);
}
.refs-tab:hover { color: var(--rf-cream); border-color: rgba(240, 234, 216, 0.32); }
.refs-tab[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(255, 255, 255, 0.75);
  color: var(--rf-ink);
}
.refs-tab:focus-visible { outline: 2px solid var(--rf-orange); outline-offset: 3px; }
.refs-num {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.2em;
  letter-spacing: 0;
  text-transform: none;
  color: var(--rf-orange);
}

/* the open part: no pane of its own, its text set straight on the ground */
.refs-body {
  flex: 1;
  min-height: 0;
  margin-top: clamp(1.1rem, 2.6vh, 1.6rem);
  padding: 0.5rem clamp(1.5rem, 3.4vw, 3rem) clamp(1.5rem, 3.4vh, 2.5rem) 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(240, 234, 216, 0.25) transparent;
}
/* a fade at the foot while there is more of the part below (initReferences) */
.refs-body.has-more {
  -webkit-mask-image: linear-gradient(#000 calc(100% - 3rem), transparent);
  mask-image: linear-gradient(#000 calc(100% - 3rem), transparent);
}
.refs-part.is-active { animation: refs-in 0.45s ease; }
@keyframes refs-in {                   /* opacity only: a lift would read as more to scroll */
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* a group's name, muted, with the orange accent before it */
.refs-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
  font-family: var(--font-body);
  font-size: clamp(0.85rem, 0.95vw, 1rem);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rf-muted);
}
.refs-group::before {
  content: '';
  flex: 0 0 1.1rem;
  height: 2px;
  background: var(--rf-orange);
}
.refs-list + .refs-group {
  margin-top: 1.4rem;
  padding-top: 1.3rem;
  border-top: 1px solid rgba(140, 140, 140, 0.22);
}

/* each entry hangs from its first line, as a bibliography does */
.refs-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.refs-list li {
  padding-left: 1.6em;
  text-indent: -1.6em;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(0.96rem, 1.02vw, 1.08rem);
  line-height: 1.65;
  color: rgba(240, 234, 216, 0.88);
}
.refs-list li + li { margin-top: 1.2rem; }
.refs-list em { font-style: italic; color: var(--rf-cream); }
.refs-list a {
  color: var(--rf-cream);
  text-decoration: none;
  border-bottom: 1px solid var(--rf-orange);
  transition: color 0.25s ease;
  word-break: break-word;
}
.refs-list a:hover { color: #fff; }
.refs-note {
  display: block;
  margin-top: 0.2rem;
  margin-left: calc(-1.6em / 0.86);    /* out of the entry's hanging indent (1.6em at the entry's size), flush with its first line */
  text-indent: 0;
  font-size: 0.86em;
  font-style: italic;
  color: var(--rf-muted);
}

/* shorter laptop screens: a tighter head so the parts keep their room */
@media (min-width: 861px) and (max-height: 820px) {
  .refs { padding-top: 2.75rem; padding-bottom: 1.5rem; }
  .refs-title { font-size: clamp(2.2rem, 3.6vw, 3.2rem); }
  .refs-tabs { margin-top: 1.1rem; }
  .refs-body { margin-top: 0.9rem; }
  .refs-list li { line-height: 1.55; }
  .refs-list + .refs-group { margin-top: 1.1rem; padding-top: 1rem; }
}
@media (max-width: 860px) {
  .refs { height: auto; min-height: 100vh; padding: 10vh 5vw 8vh; }
  .refs-body { overflow: visible; }
  .refs-tabs { flex-wrap: wrap; }
  .refs-tab { padding: 0.65em 1em; }
}
@media (prefers-reduced-motion: reduce) {
  .refs-part.is-active { animation: none; }
}

/* the entrance, when the level is scrolled to (initReferences adds
   .will-animate, then .is-in on arrival): the heading rises in and its
   orange accent draws out, the tabs follow one by one, then the pane and
   its entries. Held back only once the script has taken charge, so the
   page reads without it; replays when the reader comes down to it again */
.refs.will-animate .refs-title,
.refs.will-animate .refs-tab,
.refs.will-animate .refs-body,
.refs.will-animate .refs-part.is-active .refs-group,
.refs.will-animate .refs-part.is-active .refs-list li {
  transition: opacity 0.9s var(--rf-ease), transform 0.9s var(--rf-ease);
}
.refs.will-animate .refs-title::after {
  transition: transform 0.8s var(--rf-ease) 0.35s;
}
.refs.will-animate:not(.is-in) .refs-title { opacity: 0; transform: translateY(26px); }
.refs.will-animate:not(.is-in) .refs-title::after { transform: scaleX(0); }
.refs.will-animate:not(.is-in) .refs-tab { opacity: 0; transform: translateY(14px); }
.refs.will-animate:not(.is-in) .refs-body { opacity: 0; transform: translateY(22px); }
.refs.will-animate:not(.is-in) .refs-part.is-active .refs-group,
.refs.will-animate:not(.is-in) .refs-part.is-active .refs-list li { opacity: 0; transform: translateY(10px); }

.refs.is-in .refs-tab:nth-child(1) { transition-delay: 0.45s; }
.refs.is-in .refs-tab:nth-child(2) { transition-delay: 0.53s; }
.refs.is-in .refs-tab:nth-child(3) { transition-delay: 0.61s; }
.refs.is-in .refs-body { transition-delay: 0.7s; }
/* the entries one after another, down the open part */
.refs.is-in .refs-part.is-active .refs-group,
.refs.is-in .refs-part.is-active .refs-list li { transition-delay: calc(0.85s + var(--rf-i, 0) * 0.05s); }
/* once in, the tabs' own hover and selection fades take over again */
.refs.is-settled .refs-tab:nth-child(n) {      /* :nth-child(n) to outrank the staggered delays above */
  transition: background 0.35s var(--rf-ease), color 0.35s var(--rf-ease), border-color 0.35s var(--rf-ease);
  transition-delay: 0s;
}
@media (prefers-reduced-motion: reduce) {
  .refs.will-animate .refs-title,
  .refs.will-animate .refs-title::after,
  .refs.will-animate .refs-tab,
  .refs.will-animate .refs-body,
  .refs.will-animate .refs-part.is-active .refs-group,
  .refs.will-animate .refs-part.is-active .refs-list li { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ══════════════════════════════════════
   FOOTER — a narrow strip in a near-black blue: the project's name
   and line on the left, the links and the legal line after them, over a
   hairline.
══════════════════════════════════════ */
.site-footer {
  padding: 1.5rem 5vw;
  background: #04080f;
  border-top: 1px solid rgba(240, 234, 216, 0.16);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: #8fa0b3;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 2rem;
}
.footer-title { font-weight: 600; color: #f0ead8; }
.footer-links { display: flex; gap: 1.25rem; margin-left: auto; }
.footer-links a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
.footer-links a:hover { color: #f0ead8; }
.footer-legal { flex-basis: 100%; font-size: 0.78rem; }


/* ══════════════════════════════════════
   TEXT LEVELS — standalone chapter breaks
   (Levels 3, 7, 10, 11)

   Same construction as the introduction level: a survey-contour
   field, drifting light, grain and a vignette — re-tinted from
   moorland green to the stone & ochre palette of the rest of the
   story. Serif header, body-font copy, no imagery.
══════════════════════════════════════ */
.text-level {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  overflow: hidden;
  background-color: #191510;
  background-image:
    /* Per-level survey contours — see the note on #introduction for why these
       are pre-rasterised bitmaps rather than the source SVGs. Each level sets
       --tl-contours below; the fallback keeps the stack valid if one is
       missing. Colour and opacity are baked into the files. */
    var(--tl-contours, none),
    radial-gradient(ellipse 85% 70% at 18% 14%, rgba(200, 150, 42, 0.10), transparent 58%),
    radial-gradient(ellipse 70% 70% at 84% 88%, rgba(139, 58, 42, 0.12), transparent 60%),
    linear-gradient(168deg, #241e16 0%, #1b1712 52%, #110f0b 100%);
  background-size: cover, auto, auto, auto;
  background-position: 50% 45%, center, center, center;
  background-repeat: no-repeat, repeat, repeat, repeat;
}


/* One contour sheet per text level, in page order.
   roche_small_contours_2..6.svg → contours_bg_2..6.webp */
#level-experience     { --tl-contours: none; }  /* L3: a clean, dark ground with a teal splash instead */
#level-explore-intro  { --tl-contours: none; }  /* L11: a moving wireframe terrain instead (.reins-terrain) */
#level-epilogue       { --tl-contours: none; }  /* L12: a flat ground instead (see Level 12 — About) */


/* ══════════════════════════════════════
   LEVEL 11 — "Your Turn to Explore": the hand-off to the explore map
   Dressed in the introduction's moorland palette — moss ground, an
   apricot light, lichen lines — so the finale answers the opening. Over
   a slowly moving wireframe terrain: the title rising in, the text, and
   the way into the map.
══════════════════════════════════════ */
#level-explore-intro {
  --moss-deep: #04130d;
  --apricot: #d8a86e;
  --lichen: #87998d;
  display: block;
  padding: 0;
  background: #000;
}
#level-explore-intro::after { display: none; }   /* the vignette is the screen's own */
.reins-sticky {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 8vh 5vw;
  /* a very dark, rich blue at Roche, near black by 60% of the way out —
     centred on wherever Roche lands on screen (set by initReinsTerrain) */
  background: radial-gradient(circle at var(--roche-x, 84%) var(--roche-y, 33%),
    #060b17 0%, #040810 22%, #02040a 42%, #010205 60%, #000102 100%);
}
.reins-sticky::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* the vignette */
  background: radial-gradient(ellipse 75% 75% at 50% 45%, transparent 55%, rgba(2, 4, 12, 0.6) 100%);
}
/* the text, then the way into the map floating beneath it, in a column
   on the left */
.reins-column {
  position: relative;
  z-index: 1;
  width: min(800px, 86vw);
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 3vh, 2rem);
  /* the column is centred on screen: this space under it, the two lines of
     body text taken out of the box (2 × the paragraphs' line height), keeps
     the box's top where it was before the copy was shortened */
  margin-bottom: calc(2 * 1.85 * clamp(1rem, 1.25vw, 1.3rem));
}
/* the text in a panel of its own: frosted glass, a deep night blue */
#level-explore-intro .reins-inner {
  width: 100%;
  justify-content: center;
  padding: clamp(3.25rem, 8vh, 5.75rem) clamp(2rem, 4.5vw, 4.5rem);
  /* the terrain glows faintly through, blurred out of the reading */
  background: rgba(10, 18, 38, 0.2);
  border: 1px solid rgba(205, 225, 255, 0.45);
  border-radius: 3px;
  /* backlit: blue-white light spilling out from behind the edge, as if
     from LED strips, and a little bleeding in across the glass; it
     breathes slowly */
  box-shadow:
    0 0 6px rgba(200, 225, 255, 0.35),
    0 0 22px rgba(130, 180, 255, 0.28),
    0 0 70px rgba(90, 145, 255, 0.16),
    inset 0 0 18px rgba(150, 195, 255, 0.10);
  -webkit-backdrop-filter: blur(9px) saturate(1.3);
  backdrop-filter: blur(9px) saturate(1.3);
  animation: reins-panel-glow 5s ease-in-out infinite;
}
@keyframes reins-panel-glow {
  0%, 100% {
    border-color: rgba(205, 225, 255, 0.35);
    box-shadow:
      0 0 5px rgba(200, 225, 255, 0.25),
      0 0 18px rgba(130, 180, 255, 0.18),
      0 0 55px rgba(90, 145, 255, 0.1),
      inset 0 0 14px rgba(150, 195, 255, 0.07);
  }
  50% {
    border-color: rgba(220, 235, 255, 0.6);
    box-shadow:
      0 0 8px rgba(200, 225, 255, 0.5),
      0 0 28px rgba(130, 180, 255, 0.38),
      0 0 85px rgba(90, 145, 255, 0.22),
      inset 0 0 22px rgba(150, 195, 255, 0.14);
  }
}
@media (prefers-reduced-motion: reduce) {
  #level-explore-intro .reins-inner { animation: none; }
}
#level-explore-intro .reins-inner .text-level-body { font-size: 1.12em; max-width: 66ch; }
/* the opener: larger and heavier than the paragraphs after it, same colour */
#level-explore-intro .reins-inner .text-level-body p.reins-lede {
  font-size: clamp(1.25rem, 1.6vw, 1.65rem);
  font-weight: 400;
  font-style: normal;
  line-height: 1.55;
}
/* a short rule between the opener and the text after it */
#level-explore-intro .reins-inner .text-level-body p.reins-lede::after {
  content: '';
  display: block;
  width: 4.5rem;
  height: 1px;
  margin-top: 1.1em;
  background: rgba(205, 225, 255, 0.5);
}
/* no warm light here: the dark radial on Roche is the section's only light */
#level-explore-intro .text-level-light { display: none; }

/* ── step 1: the terrain alone, and a label over Roche ── */
#level-explore-intro.is-step1 .reins-inner,
#level-explore-intro.is-step1 .reins-cta-wrap { opacity: 0; visibility: hidden; }
/* a point at Roche (moved there by initReinsSection); the label stands
   above it on a short leader line down to the point. The button is live as
   soon as Roche is down (.is-live); the label fades in 0.5 s later
   (.is-visible), or at once on hover */
.reins-prompt {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  width: 0;
  height: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  visibility: hidden;
}
.reins-prompt.is-live { visibility: visible; }
/* the hit area: a wide oval taking in the label and the ground round the
   point, so a click anywhere near Roche counts */
.reins-prompt::before {
  content: '';
  position: absolute;
  left: -150px;
  top: -200px;
  width: 300px;
  height: 320px;
  border-radius: 50%;
}
.reins-prompt-label {
  position: absolute;
  left: 0;
  bottom: 14px;                       /* clear of the dot */
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(250, 247, 240, 0.82);
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.6s ease, color 0.3s ease, letter-spacing 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              text-shadow 0.3s ease;
}
.reins-prompt.is-visible .reins-prompt-label { opacity: 1; }
.reins-prompt-label::after {
  content: '';
  width: 1px;
  height: 46px;
  background: linear-gradient(to bottom, rgba(250, 247, 240, 0.8), rgba(250, 247, 240, 0.15));
  transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
}
/* hovered: the label lifts on a longer, brighter line, opens out and
   glows (and Roche brightens on the canvas: reinsLink.hover) */
.reins-prompt:hover .reins-prompt-label,
.reins-prompt:focus-visible .reins-prompt-label {
  opacity: 1;
  color: #fff;
  letter-spacing: 0.3em;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.8), 0 0 18px rgba(255, 248, 230, 0.55);
}
.reins-prompt:hover .reins-prompt-label::after,
.reins-prompt:focus-visible .reins-prompt-label::after {
  height: 58px;
  background: linear-gradient(to bottom, #fff, rgba(250, 247, 240, 0.3));
}
.reins-prompt:focus-visible { outline: none; }

.reins-terrain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0;                         /* until its ground has loaded */
  transition: opacity 1.4s ease;
}
.reins-terrain.is-ready { opacity: 1; }

/* Into the map (initReinsSection): nothing takes a click on the way, and
   the sky under the mesh settles to explore.html's ground colour (its
   --map-bg) as the vignette over it lifts */
body.is-leaving-to-map { pointer-events: none; }
.to-map-ground {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #0F1216;
  opacity: 0;
  pointer-events: none;
}
.reins-sticky.is-to-map::after { opacity: 0; transition: opacity 1.2s ease; }
/* explore.html in its frame: loaded unseen behind Level 11, then over the
   whole page while open */
.map-frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 3000;
  background: #0F1216;
  opacity: 0;
  pointer-events: none;
}
.map-frame.is-open { opacity: 1; pointer-events: auto; }

/* ── the way into the map: a dark glass bar, floating under the text at
   its full width, its edge lit a steady gold with a soft glow round it;
   on hover the bar fills ochre ── */
/* the button and, beside it, the way on to the epilogue */
.reins-cta-wrap { width: 100%; display: flex; gap: clamp(0.75rem, 1.2vw, 1rem); }
.reins-cta-arrow {
  width: 1.2rem;
  height: 1.2rem;
  flex: none;
  fill: none;
  stroke: var(--ochre-lt);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.reins-cta {
  position: relative;
  isolation: isolate;
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1.3em 3em;
  font-family: var(--font-body);
  font-size: clamp(0.92rem, 1.05vw, 1.05rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream);
  text-decoration: none;
  background: rgba(10, 18, 38, 0.5);
  border: 1px solid rgba(255, 220, 150, 0.8);
  border-radius: 2px;
  box-shadow:
    0 0 6px rgba(255, 214, 140, 0.45),
    0 0 22px rgba(232, 184, 75, 0.3),
    0 0 50px rgba(232, 184, 75, 0.14),
    inset 0 0 14px rgba(232, 184, 75, 0.12);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
  transition: background 0.3s ease, color 0.3s ease,
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
/* the rim light running round the edge: a conic sweep shown only in a
   thin ring round the bar (from --reins-trace across --reins-span, a fixed
   length of the edge), and the same ring, thicker, blurred behind it for
   its glow (the blur on the wrapper, so it softens the ring after the ring
   is cut out). initReinsSection sets the angles each frame so the light
   travels the edge at an even speed */
.reins-cta::before,
.reins-cta-glow > span {
  content: '';
  position: absolute;
  border-radius: 2px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  background: conic-gradient(from var(--reins-trace, 0deg),
    rgba(200, 150, 42, 0) 0deg,
    rgba(232, 184, 75, 0.6) calc(var(--reins-span, 30deg) * 0.6),
    #ffe2a0 calc(var(--reins-span, 30deg) * 0.9),
    #fffaf0 var(--reins-span, 30deg),
    transparent var(--reins-span, 30deg));
}
.reins-cta::before {
  inset: 0;
  padding: 1.5px;
  pointer-events: none;
  opacity: 0;                          /* until the script places it */
  transition: opacity 0.3s ease;
}
.reins-cta-glow {
  position: absolute;
  inset: -14px;
  z-index: -1;
  pointer-events: none;
  filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.reins-cta-glow > span { inset: 11px; padding: 6px; }   /* a ring 3px either side of the edge */
.reins-cta.is-tracing::before,
.reins-cta.is-tracing .reins-cta-glow { opacity: 1; }
.reins-cta:hover::before, .reins-cta:hover .reins-cta-glow,
.reins-cta:focus-visible::before, .reins-cta:focus-visible .reins-cta-glow { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .reins-cta::before, .reins-cta-glow { display: none; }
}
.reins-cta:hover,
.reins-cta:focus-visible {
  background: var(--ochre);
  color: var(--stone);
  transform: translateY(-2px);
}
.reins-cta:hover .reins-cta-arrow,
.reins-cta:focus-visible .reins-cta-arrow { stroke: var(--stone); transform: translateX(5px); }
.reins-cta:focus-visible { outline: 2px solid var(--cream); outline-offset: 4px; }

/* ── the way on to the epilogue: a quiet glass button beside the main one,
   fading in to 80% opacity 4 s after the text box opens
   (initReinsSection); full strength on hover ── */
.reins-next {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.75rem;
  padding: 1.3em 2em;
  font-family: var(--font-body);
  font-size: clamp(0.92rem, 1.05vw, 1.05rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream);
  text-decoration: none;
  background: rgba(10, 18, 38, 0.35);
  border: 1px solid rgba(205, 225, 255, 0.5);
  border-radius: 2px;
  opacity: 0.8;
  transition: opacity 0.35s ease, background 0.3s ease, border-color 0.3s ease;
}
.reins-next:hover,
.reins-next:focus-visible {
  opacity: 1;
  background: rgba(10, 18, 38, 0.6);
  border-color: rgba(220, 235, 255, 0.8);
}
.reins-next:focus-visible { outline: 2px solid var(--cream); outline-offset: 4px; }
.reins-next-arrow {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.reins-next:hover .reins-next-arrow,
.reins-next:focus-visible .reins-next-arrow { transform: translateY(4px); }

@media (max-width: 760px) {
  .reins-sticky { padding: 10vh 4vw; }
  .reins-column { width: 100%; }
  .reins-cta { justify-content: space-between; padding: 1.15em 1.6em; }
}


/* ══════════════════════════════════════
   LEVEL 3 — "What is this experience?" layer stack
   The section is a 200vh, two-step track; its first screen is pinned
   (.xp-sticky) and carries its own charcoal ground with a cool teal
   splash. Planes are plain
   squares turned 45° and tilted 60° (an axonometric view, no perspective),
   each in a .xp-layer that initExperienceStack lifts in screen space, so a
   layer's label moves with it exactly.
══════════════════════════════════════ */
#level-experience.xp {
  display: block;
  height: 200vh;
  min-height: 0;
  padding: 0;
  overflow: clip;                 /* not hidden: that would break the sticky */
  background: #06080a;
}
#level-experience.xp::after { display: none; }   /* vignette moves to the sticky */

.xp-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  /* clear of the fixed contents menu above (its pill ends by ~3.9rem);
     the bottom, which holds the drawer and the credit line, is set by
     initExperienceStack */
  padding: max(4vh, 4.75rem) 4vw max(4vh, calc(2.2vh + 3rem));
  z-index: 1;
  /* a deep, near-black ground with the teal splash, no contours */
  background-image:
    radial-gradient(ellipse 80% 70% at 14% 16%, rgba(24, 168, 168, 0.36), transparent 60%),
    radial-gradient(ellipse 65% 65% at 88% 86%, rgba(22, 120, 136, 0.18), transparent 62%),
    linear-gradient(168deg, #0c1013 0%, #080a0d 52%, #040506 100%);
}
.xp-sticky::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse 75% 75% at 50% 45%, transparent 55%, rgba(7, 8, 10, 0.62) 100%);
}
/* the drifting light, re-tinted to the splash */
#level-experience .text-level-light {
  background:
    radial-gradient(ellipse 42% 30% at 30% 26%, rgba(40, 190, 186, 0.13), transparent 70%),
    radial-gradient(ellipse 38% 28% at 72% 74%, rgba(30, 140, 150, 0.10), transparent 70%);
}

/* two columns: the stack (left), the text (right). The drawer is laid
   under both, over the sticky's bottom padding, which initExperienceStack
   sets to make room for it and the credit line. */
.xp-grid {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 6rem);
  align-items: center;
}
#level-experience .xp-copy {
  width: auto;
  --xp-orb: clamp(9px, 0.78vw, 12px);
  --xp-orb-gutter: clamp(1.1rem, 1.6vw, 1.6rem);
}
/* this level's notes a touch larger than the other text levels' */
#level-experience .xp-notes p {
  font-size: clamp(1.06rem, 1.35vw, 1.42rem);
}
#level-experience .xp-copy .text-level-heading {
  padding-left: calc(var(--xp-orb) + var(--xp-orb-gutter));
}

/* One note per step, grid-stacked so the box sizes to the taller: the
   active one at rest, the next waiting below, the spent one lifted away —
   the introduction's notes (.intro-note), with its step markers. */
.xp-notes {
  position: relative;
  display: grid;
  padding-left: calc(var(--xp-orb) + var(--xp-orb-gutter));
}
.xp-note {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(26px);
  filter: blur(6px);
  transition: opacity 0.6s ease, transform 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.6s ease;
}
.xp-note.is-past   { transform: translateY(-26px); }
.xp-note.is-active { opacity: 1; transform: translateY(0); filter: blur(0); }

/* step markers in the notes' gutter, in this level's teal: hollow ahead,
   filled behind, filled and lit for the one being read */
.xp-orbs {
  position: absolute;
  left: 0;
  top: 0.75em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(9px, 1.3vh, 15px);
  pointer-events: none;
}
.xp-orb {
  width: var(--xp-orb);
  height: var(--xp-orb);
  border-radius: 50%;
  border: 1.5px solid rgba(110, 182, 186, 0.45);
  background: transparent;
  transition: background 0.55s ease, border-color 0.55s ease,
              box-shadow 0.55s ease, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.xp-orb.past {
  background: #6fb5b8;
  border-color: #6fb5b8;
  opacity: 0.7;
}
.xp-orb.current {
  background: #6fb5b8;
  border-color: #6fb5b8;
  box-shadow: 0 0 10px rgba(96, 178, 182, 0.65), 0 0 3px #6fb5b8;
  transform: scale(1.18);
}
/* the bead that shoots between markers on a step, and its trail
   (initExperienceStack, as the introduction's .intro-orb-comet) */
.xp-orb-comet {
  position: absolute;
  left: 50%;
  width: var(--xp-orb);
  height: var(--xp-orb);
  border-radius: 50%;
  background: #dcf2f0;
  box-shadow: 0 0 12px rgba(110, 196, 200, 0.9), 0 0 4px #6fb5b8;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.xp-orb-trail {
  position: absolute;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  box-shadow: 0 0 6px rgba(110, 196, 200, 0.6);
  pointer-events: none;
}

/* Step arrows under the active note, right-aligned to its text: the
   introduction's (.intro-nav), in this level's teal. Shown only after the
   reader has paused on a step (initExperienceStack toggles .is-visible and
   places them); the up arrow is clear on step 1. */
.xp-nav {
  position: absolute;
  top: 100%;
  left: 0;
  display: flex;
  gap: 12px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.xp-nav.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.xp-nav-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(111, 181, 184, 0.5);
  background: rgba(14, 30, 33, 0.4);
  color: rgba(226, 240, 238, 0.85);
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease,
              color 0.25s ease, box-shadow 0.25s ease, opacity 0.3s ease;
}
.xp-nav-btn:hover,
.xp-nav-btn:focus-visible {
  outline: none;
  border-color: #6fb5b8;
  background: rgba(111, 181, 184, 0.16);
  color: #dcf2f0;
  box-shadow: 0 0 14px rgba(111, 181, 184, 0.4);
}
.xp-nav-btn.is-off {
  opacity: 0;
  pointer-events: none;
}
/* the down arrow nudges downward, asking to be taken */
.xp-nav.is-visible .xp-nav-down svg {
  animation: intro-nav-nudge 1.8s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .xp-nav.is-visible .xp-nav-down svg { animation: none; }
  .xp-note { transition-duration: 0.01s; }
}

/* plane side; the gap between separated planes is set from it in JS */
.xp-stage {
  --xp-s: clamp(170px, min(20vw, 33vh), 330px);
  position: relative;
  height: 100%;
}
/* the stack's origin sits at the stage's left edge; JS centres it */
.xp-stack {
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 0;
  will-change: transform;
}
.xp-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  will-change: transform;
}
.xp-plane {
  position: absolute;
  left: calc(var(--xp-s) / -2);
  top: calc(var(--xp-s) / -2);
  width: var(--xp-s);
  height: var(--xp-s);
  /* turned 45° (rotateZ) then tilted 60° (rotateX), written as the 2D
     matrix they make without perspective: no 3D compositing, which drew
     translucent artefacts over the planes in Chrome */
  transform: matrix(0.70711, -0.35355, 0.70711, 0.35355, 0, 0);
  background: #1b1c1f;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.xp-plane::after {               /* the edge line, over the plane's content */
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(240, 234, 216, 0.22);
  pointer-events: none;
  transition: border-color 0.35s ease;
}
/* hover (initExperienceStack: .is-hover on the layer, which it also lifts):
   the plane glows and its edge and label brighten */
.xp-plane {
  transition: box-shadow 0.35s ease;
}
.xp-layer.is-hover .xp-plane {
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.45), 0 0 34px rgba(240, 234, 216, 0.30);
}
.xp-layer.is-hover .xp-plane--clear {
  box-shadow: 0 0 34px rgba(240, 234, 216, 0.22);
  background: rgba(240, 234, 216, 0.08);
}
.xp-layer.is-hover .xp-plane::after { border-color: rgba(240, 234, 216, 0.7); }
.xp-plane--clear {
  background: rgba(240, 234, 216, 0.035);
  box-shadow: none;
}
.xp-plane img,
.xp-plane canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.xp-tiles { background: #202226; }

/* Radar blips on the prehistoric-sites plane: two rings at a time expand
   from a site dot and fade, each blip on its own delay (--d). They lie on
   the plane, so they spread as flattened ellipses with the map. Paused
   while the level is off screen (initExperienceStack: .xp-stage.is-on). */
.xp-blip {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 2.4%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.xp-blip::before,
.xp-blip::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(232, 184, 75, 0.9);
  opacity: 0;
  animation: xp-blip 3.2s cubic-bezier(0.2, 0.6, 0.35, 1) infinite;
  animation-delay: var(--d);
  animation-play-state: paused;
}
.xp-blip::after { animation-delay: calc(var(--d) + 0.45s); }
.xp-stage.is-on .xp-blip::before,
.xp-stage.is-on .xp-blip::after { animation-play-state: running; }
@keyframes xp-blip {
  0%   { transform: scale(0.6); opacity: 0.95; }
  55%  { opacity: 0; }
  100% { transform: scale(5); opacity: 0; }
}

/* the splat still: its base's ellipse matches the 60° tilt, centred on
   the top plane (the disc centre sits at 49.7% / 47.9% of the image) */
.xp-rock {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--xp-s) * 0.8);
  height: auto;
  transform: translate(-49.7%, -47.9%);
  pointer-events: none;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.35));
}

/* beside the plane's right-hand corner, which sits var(--xp-s)·√2/2 out */
.xp-label {
  position: absolute;
  left: calc(var(--xp-s) * 0.7071 + 1.1rem);
  top: 0;
  transform: translateY(-50%);
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: clamp(0.76rem, 0.8vw, 0.9rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--parchment);
  opacity: 0;
  transform-origin: 0 50%;          /* counter-scaled from its left edge (initExperienceStack) */
}
.xp-layer.is-hover .xp-label { color: var(--cream); text-shadow: 0 0 12px rgba(240, 234, 216, 0.45); }

/* The media drawer, under the maps and text: a slim bar (its handle) on
   step 1, which opens upward on step 2 into a strip of tiles, one per kind
   of interactive media the site holds. initExperienceStack sets its
   bottom, the tiles' width (--xp-tile-w) and the body's height. */
.xp-media {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.xp-drawer {
  position: absolute;
  left: 4vw;
  right: 4vw;
  bottom: 0;
  /* frosted glass, backlit like Level 11's text panel but in the level's
     teal: light spilling out from behind the edge, as if from LED strips,
     and a little bleeding in across the glass; it breathes slowly */
  background:
    linear-gradient(to bottom, rgba(200, 245, 240, 0.06), transparent 45%),
    rgba(8, 24, 28, 0.38);
  border: 1px solid rgba(190, 245, 238, 0.45);
  border-radius: 10px;
  box-shadow:
    0 0 6px rgba(190, 245, 238, 0.35),
    0 0 22px rgba(80, 210, 200, 0.28),
    0 0 70px rgba(40, 180, 175, 0.16),
    inset 0 0 18px rgba(110, 220, 210, 0.10);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  animation: xp-drawer-glow 5s ease-in-out infinite;
  opacity: 0;
}
@keyframes xp-drawer-glow {
  0%, 100% {
    border-color: rgba(190, 245, 238, 0.35);
    box-shadow:
      0 0 5px rgba(190, 245, 238, 0.25),
      0 0 18px rgba(80, 210, 200, 0.18),
      0 0 55px rgba(40, 180, 175, 0.1),
      inset 0 0 14px rgba(110, 220, 210, 0.07);
  }
  50% {
    border-color: rgba(210, 250, 244, 0.6);
    box-shadow:
      0 0 8px rgba(190, 245, 238, 0.5),
      0 0 28px rgba(80, 210, 200, 0.38),
      0 0 85px rgba(40, 180, 175, 0.22),
      inset 0 0 22px rgba(110, 220, 210, 0.14);
  }
}
@media (prefers-reduced-motion: reduce) {
  .xp-drawer { animation: none; }
}
/* the drawer's head: a grab bar while it is closed; once open, a prompt to
   carry on scrolling — the tiles are a preview of what the site holds, not
   things to open here. initExperienceStack crossfades the two. */
.xp-drawer-handle {
  height: 30px;
  display: grid;
  place-items: center;
}
.xp-drawer-grip,
.xp-drawer-cta { grid-area: 1 / 1; }
.xp-drawer-grip {
  display: block;
  width: 44px;
  height: 3px;
  border-radius: 2px;
  background: rgba(200, 232, 232, 0.45);
}
.xp-drawer-cta {
  opacity: 0;
  font-family: var(--font-body);
  font-size: clamp(0.62rem, 0.66vw, 0.74rem);
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(200, 232, 232, 0.7);
}
.xp-drawer-body {
  height: 0;
  overflow: hidden;
}
.xp-drawer-row {
  display: flex;
  justify-content: center;
  gap: var(--xp-tile-gap, 24px);
  /* room round the tiles for their glow and hover lift (the body clips) */
  padding: 24px clamp(18px, 2vw, 32px) 16px;
}

.xp-card {
  flex: none;
  width: var(--xp-tile-w, 220px);
  margin: 0;
  opacity: 0;
}
/* each picture a rounded card: a glowing blue edge, a faint light catch on
   its top edge, and a soft shadow beneath */
.xp-card-frame {
  position: relative;
  aspect-ratio: 16 / 10;        /* initExperienceStack's TILE_ASPECT */
  overflow: hidden;
  border-radius: 8px;
  background: #1b1c1f;
  /* a steady blue glow round each card */
  border: 1px solid rgba(120, 196, 232, 0.65);
  box-shadow: 0 0 0 1px rgba(120, 196, 232, 0.12),
              0 0 14px rgba(96, 176, 226, 0.38),
              0 8px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.35s ease, border-color 0.35s ease;
}
/* hover, once the drawer has finished opening (.is-ready, set by
   initExperienceStack): the tile rises and glows */
.xp-drawer.is-ready { pointer-events: auto; }
.xp-drawer.is-ready .xp-card:hover .xp-card-frame {
  transform: translateY(-8px) scale(1.04);
  border-color: rgba(176, 226, 250, 0.95);
  box-shadow: 0 0 0 1px rgba(150, 214, 244, 0.35),
              0 0 30px rgba(96, 176, 226, 0.75),
              0 16px 30px rgba(0, 0, 0, 0.5);
}
/* the caption lifts and glows with its tile */
.xp-drawer.is-ready .xp-card:hover figcaption {
  transform: translateY(-6px);
  color: var(--cream);
  text-shadow: 0 0 12px rgba(120, 196, 232, 0.75);
}
.xp-card-frame::before {          /* the light catch, over the picture */
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: linear-gradient(to bottom, rgba(220, 242, 240, 0.10), transparent 28%);
  box-shadow: inset 0 1px 0 rgba(220, 242, 240, 0.18);
  pointer-events: none;
}
.xp-card-frame img,
.xp-card-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 3D models: the ground grid behind the model (an SVG, not a 3D-transformed
   element), fading out towards its far edge */
.xp-model-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: rgb(120, 196, 232);
  stroke-opacity: 0.3;
  stroke-width: 1;
  -webkit-mask-image: linear-gradient(to bottom, transparent 8%, #000 55%);
          mask-image: linear-gradient(to bottom, transparent 8%, #000 55%);
}
.xp-model-grid path { vector-effect: non-scaling-stroke; }
.xp-card--model img { position: relative; }          /* over the grid */
.xp-card--recon img { object-position: 50% 75%; }    /* low enough for the people */


/* 360: the equirectangular panorama turning across the whole frame, at a
   longer focal length — about 100° of it across the frame — so it reads
   with little distortion. Each copy of the 2:1 panorama is then 3.6 frame
   widths across and 2.88 frame heights tall (the frame is 16:10), centred
   on the horizon; the strip holds two copies side by side and slides one
   copy's width before it repeats. The image is rolled so the chapel is in
   view at the start. */
.xp-pano-strip {
  position: absolute;
  left: 0;
  top: -94%;
  width: 720%;
  height: 288%;
  background: url("images/experience/xp-media-360.webp") 0 0 / 50% 100% repeat-x;
  animation: xp-pano-turn 90s linear infinite;
  animation-play-state: paused;
}
.xp-media.is-live .xp-pano-strip { animation-play-state: running; }
@keyframes xp-pano-turn {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

.xp-card figcaption {
  margin-top: 0.6rem;
  text-align: center;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: clamp(0.68rem, 0.72vw, 0.82rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(240, 234, 216, 0.85);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
              color 0.35s ease, text-shadow 0.35s ease;
}

.xp-credit {
  position: absolute;
  left: 4vw;
  bottom: 2.2vh;
  z-index: 1;
  max-width: 60vw;
  font-family: var(--font-body);
  font-size: 0.62rem;
  line-height: 1.5;
  color: var(--parchment);
  opacity: 0;
}
.xp-credit a { color: inherit; }

@media (max-width: 760px) {
  .xp-sticky { padding: 6vh 6vw; }
  .xp-grid {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 2vh;
  }
  .xp-stage { --xp-s: clamp(120px, min(40vw, 19vh), 240px); }
  .xp-stack { left: 38%; }
  .xp-label { font-size: 0.62rem; letter-spacing: 0.14em; }
  .xp-credit { max-width: 88vw; font-size: 0.55rem; }
}

/* drifting light — the same slow cloud-shadow as the introduction */
.text-level-light {
  position: absolute;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 42% 30% at 32% 26%, rgba(232, 184, 75, 0.10), transparent 70%),
    radial-gradient(ellipse 38% 28% at 70% 74%, rgba(139, 58, 42, 0.10), transparent 70%);
  animation: intro-light-drift 38s ease-in-out infinite alternate;
  will-change: transform;
}

/* grain / paper texture */
.text-level::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* vignette to settle the edges */
.text-level::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse 75% 75% at 50% 45%, transparent 55%, rgba(10, 8, 6, 0.62) 100%);
}

.text-level-inner {
  position: relative;
  z-index: 1;
  width: min(760px, 88vw);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  will-change: transform;
}

.text-level-heading {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.464rem, 4.928vw, 4.48rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  color: var(--cream);
  margin-bottom: clamp(1.5rem, 3vh, 2.5rem);
}

.text-level-heading em {
  font-style: italic;
  color: var(--ochre-lt);
}

.text-level-body p {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(1rem, 1.25vw, 1.3rem);
  line-height: 1.85;
  color: var(--parchment);
  opacity: 0.86;
  max-width: 62ch;
}

.text-level-body p + p { margin-top: 1.6em; }

/* ── CTA (Level 11 → explore map overlay) ── */
.text-level-cta {
  margin-top: clamp(2rem, 4vh, 3rem);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.95em 2em;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
  background: var(--ochre);
  border: 1px solid var(--ochre);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.text-level-cta:hover {
  background: var(--ochre-lt);
  border-color: var(--ochre-lt);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -12px rgba(232, 184, 75, 0.55);
}

.text-level-cta-arrow { transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.text-level-cta:hover .text-level-cta-arrow { transform: translate(2px, -2px); }


/* ── Level 12 — About ──
   The ground is Roche Rock and the moor in silhouette against a dawn
   sky with stars, coming up from the night navy of the earlier levels
   (initAboutGround). Everything sits up top, in the sky: the title and
   intro on a pane of frosted glass; the photo, kept small, in a thick
   card-stock mat with the two bio cards under it and the contributor's
   card under those. At rest the photo is in full colour. Hovering a person or
   their card (which also runs a light round their outline, initAboutRim)
   sets .has-active on the section and .is-on on their cutout and card:
   the photo greys, they stay in colour, and their card opens — down,
   and leftward across the text as it needs, never over the photo — to
   the whole bio
   (initAboutSection, with GSAP); the cards sit closed in
   slots of one height (--ab-card-h), so opening one moves nothing. The
   text's pane and the cards rest as frosted glass and, when hovered,
   fill into field index cards: the name with a short orange accent, then
   the bio, and the links over a hairline. The separators stay as they
   are either way. The level makes an entrance when it's scrolled to (initAboutEntrance):
   .is-pre holds everything back until then. Weights and strokes are
   heavy, ready for a heavier display face. */
#level-epilogue {
  /* the night navy of the earlier levels, with the orange as its light */
  --ab-ground:    #071425;
  --ab-cream:     #f0ead8;                  /* parchment: text on the ground */
  /* the cards and the photo's mat: field index cards */
  --ab-card:      #f3f0e9;                  /* the card stock */
  --ab-ink:       #23262b;                  /* written on it */
  --ab-redline:   #b4564a;                  /* its link underlines */
  --ab-muted:     #8fa0b3;
  --ab-orange:    #c9582a;
  --ab-hairline:  rgba(140, 140, 140, 0.32); /* the dividers: neutral, reading on glass and card alike */
  --ab-shadow:    rgba(0, 0, 0, 0.5);
  --ab-radius: 4px;
  --ab-mat:    10px;                        /* the frame's cream border */
  --ab-card-h: 128px;                       /* a closed card, at least: it takes the height the left column gives it */
  --ab-open:   170px;                       /* what an opened card grows by, downward (and the contributor's card, opened, fits in) */
  --ab-row-gap: 1.75rem;
  /* the photo kept small, up in the sky: the moor shows under the cards.
     Its height leaves room under it for the cards opened, on any screen */
  --ab-lower: 326px;                        /* the room kept under the photo: larger, a smaller photo on short screens */
  --ab-photo-w: min(42vw, (84vh - var(--ab-lower) - 2 * var(--ab-mat)) * 1.5 + 2 * var(--ab-mat));
  --ab-ease: cubic-bezier(0.16, 1, 0.3, 1);
  /* exactly one screen: whatever opens (a card, the contributor) overlaps
     rather than growing the level, so the ground drawn to it never moves */
  height: 100vh;
  padding: 8vh 5vw;
  align-items: flex-start;                   /* everything up top, in the sky */
  background: var(--ab-ground);
}
/* the ground is drawn by initAboutGround's canvas; the grain sits over it */
#level-epilogue::before { z-index: 1; }
.about-ground {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

#level-epilogue .about-inner {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--ab-photo-w);
  grid-template-rows: auto auto;             /* the photo; the form, and .about-lower beside it */
  column-gap: clamp(2.5rem, 4.5vw, 5rem);
  row-gap: var(--ab-row-gap);
  align-items: start;
}

/* ── the text: on a pane of frosted glass (as Level 11's text is; see
   the cards' rule below for the glass and its hover), level with the top
   of the photo — a light frost, so Roche still stands clear through it.
   Its type and padding follow the screen's height as well as its width,
   so the pane always fits ── */
/* the pane hangs from the top of a slot running down the left column, so
   opening it moves nothing: at rest its intro is cut to whole lines, the
   pane ending level with the photo's foot (initAboutSection sets the
   height), the last line fading and a chevron saying there's more;
   hovered or focused, it opens down and across, over the photo, as far
   as the whole text needs (in two columns once one would run too long a
   line) — and if even that's more than the screen has room for, it stops
   at the screen's bottom margin and the text scrolls inside it */
.about-text-slot {
  grid-row: 1 / -1;
  grid-column: 1;
  position: relative;
}
.about-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;                               /* opened, initAboutSection widens it */
  z-index: 3;
  outline: none;
  --ab-pane-pad: clamp(1.25rem, min(3.2vw, 4.5vh), 2.75rem);
  padding: var(--ab-pane-pad);
}
/* opened (and while it closes), over the photo and the cards, the photo
   raised for its entrance (4) included */
.about-text.is-raised { z-index: 5; }
/* the text opened wide: two columns (initAboutSection sets the count) */
.about-intro-flow,
.about-bio-flow { column-gap: 2.5em; }
/* the intro reaches into the pane's right padding, so its scrollbar runs
   down the pane's edge, clear of the text */
.about-intro {
  overflow: hidden;
  margin-right: calc(-1 * var(--ab-pane-pad) + 6px);
  padding-right: calc(var(--ab-pane-pad) - 6px);
}
/* the foot of the text fades while there's more below it (the scrollbar's
   strip on the right kept clear of the fade) */
.about-text:not(.is-short):not(.is-open) .about-intro,
.about-text.is-open.is-scrolling:not(.is-at-end) .about-intro {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 5em), transparent), linear-gradient(#000, #000);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 5em), transparent), linear-gradient(#000, #000);
  -webkit-mask-size: 100% 100%, 12px 100%;
          mask-size: 100% 100%, 12px 100%;
  -webkit-mask-position: 0 0, 100% 0;
          mask-position: 0 0, 100% 0;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
}
.about-text.is-open.is-scrolling .about-intro {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--ab-hairline) transparent;
}
/* the hint: a small chevron in the pane's foot, gone once it's open */
.about-more {
  position: absolute;
  right: clamp(1.25rem, min(3.2vw, 4.5vh), 2.75rem);
  bottom: clamp(0.5rem, 1.6vh, 1rem);
  width: 18px;
  height: 18px;
  color: var(--c-ink);
  opacity: 0.75;
  transition: opacity 0.25s ease, transform 0.35s var(--ab-ease), color 0.45s ease;
}
.about-text.is-open .about-more { opacity: 0; transform: translateY(4px); }
.about-text.is-short .about-more { display: none; }
/* the X: in the pane's top right corner while it's open, closing it;
   its outline goes orange when hovered */
.about-close {
  position: absolute;
  top: calc(var(--ab-pane-pad) * 0.5);
  right: calc(var(--ab-pane-pad) * 0.5);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--ab-hairline);
  border-radius: var(--ab-radius);
  background: transparent;
  color: var(--c-ink);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s,
              border-color 0.25s ease, color 0.45s ease;
}
.about-close svg { width: 18px; height: 18px; }
.about-text.is-open .about-close {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease 0.1s, visibility 0s,
              border-color 0.25s ease, color 0.45s ease;
}
.about-close:hover,
.about-close:focus-visible { border-color: var(--ab-orange); outline: none; }

/* the title, with a short orange accent under it, as the names have */
#level-epilogue .text-level-heading {
  padding-bottom: clamp(0.7rem, 1.8vh, 1.1rem);
  color: var(--c-ink);
  transition: color 0.45s ease;
  font-weight: 600;
  /* sized to stay on one line in the left column, however wide the screen */
  font-size: clamp(2.2rem, min(4vw, 9.5vh), 6rem);
  white-space: nowrap;
  line-height: 0.9;
  margin: -0.08em 0 clamp(1.1rem, 3.5vh, 2.5rem);
}
/* the text's size set on the intro too, so its fade's em is the text's;
   scaled down (--ab-intro-scale, initAboutSection) as far as the whole
   text needs to fit the pane opened, so it never scrolls */
#level-epilogue .about-intro { font-size: calc(clamp(0.95rem, min(1.25vw, 2.05vh), 1.3rem) * var(--ab-intro-scale, 1)); }
#level-epilogue .about-intro p {
  color: var(--c-ink);
  transition: color 0.45s ease;
  font-weight: 400;
  font-size: calc(clamp(0.95rem, min(1.25vw, 2.05vh), 1.3rem) * var(--ab-intro-scale, 1));
  line-height: 1.75;
  opacity: 1;
  max-width: none;
}

/* the contributor: a card of their own under the bio cards, in the room
   kept below them (so an opened bio card covers it). At rest, a line of
   thanks; hovered or focused, it opens as the bio cards do (it takes
   their classes and their wide layout, .is-side), to the info column and
   their bio in one column, widening leftward only as far as it needs to
   fit the screen (initAboutSection) */
.about-thanks {
  grid-row: 3;
  grid-column: 2;
  position: relative;
  outline: none;
}
.about-thanks.is-raised { z-index: 3; }       /* opened (and closing), over the bio cards and the text */
.about-thanks-rest {
  padding: 12px 18px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--c-ink);
  transition: color 0.45s ease;
}
.about-thanks strong,
.about-intro strong { font-weight: 600; color: inherit; }       /* not the site's ochre */
/* at rest only the line of thanks; opened, all but it */
.about-thanks-card:not(.is-side) > :not(.about-thanks-rest),
.about-thanks-card.is-side > .about-thanks-rest { display: none; }
/* opened, a smaller card than the bios', as a contributor's: a smaller
   portrait and name, an info column of its own width (its tinted panel's
   edge set to it, initAboutSection), and the links side by side in one
   row, so the column is no taller than his short bio */
.about-thanks .about-thanks-card.is-side {
  grid-template-columns: max-content var(--ab-bio-text, minmax(0, 1fr));
}
.about-thanks .about-thanks-card.is-side .about-bio-head { padding-top: 12px; }
.about-thanks .about-thanks-card .about-bio-name { font-size: 1.35rem; }
.about-thanks .about-thanks-card.is-portrait .about-bio-portrait {
  width: 48px;
  height: 48px;
  margin-right: 12px;
}
.about-thanks .about-thanks-card.is-side .about-bio-main { padding: 14px 20px 14px 24px; }
.about-thanks .about-thanks-card.is-side .about-bio-foot { margin-top: 12px; }
.about-thanks .about-thanks-card.is-side .about-bio-foot > .about-bio-label { margin-bottom: 0.5rem; }
.about-thanks .about-thanks-card.is-side .about-links {
  flex-direction: row;
  gap: 0.5rem;
  padding-bottom: 14px;
  font-size: 0.85rem;
}
.about-thanks .about-thanks-card.is-side .about-links a { padding: 0.45em 0.75em; }

/* The text's pane and the cards — the bios and the contributor's — all
   rest as frosted glass and frost to a whiter glass when hovered
   (a bio card also when its person is). Each sets its ink as --c-ink for
   its contents to use; the separators stay as they are. */
.about-text,
.about-bio-card,
.about-contact-card,
.about-survey {
  --c-ink:  var(--ab-cream);
  border: 1px solid rgba(240, 234, 216, 0.16);
  border-radius: var(--ab-radius);
  background-color: rgba(7, 20, 37, 0.12);
  -webkit-backdrop-filter: blur(6px) saturate(1.15);
          backdrop-filter: blur(6px) saturate(1.15);
  color: var(--c-ink);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0),
              0 14px 28px -12px rgba(0, 0, 0, 0);
  transition: background-color 0.45s ease, border-color 0.45s ease, color 0.45s ease,
              box-shadow 0.6s var(--ab-ease), opacity 0.45s ease,
              -webkit-backdrop-filter 0.45s ease, backdrop-filter 0.45s ease;
}
.about-text:hover,
.about-bio.is-on .about-bio-card,
.about-thanks.is-on .about-bio-card,
.about-contact-card:hover,
.about-contact-card:focus-within,
.about-contact.is-open .about-contact-card,
.about-survey:hover,
.about-survey:focus-within {
  --c-ink:  #000;
  border-color: rgba(255, 255, 255, 0.28);
  background-color: rgba(255, 255, 255, 0.75);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
          backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18),
              0 14px 28px -12px var(--ab-shadow);
}

/* ── under the text, its top level with the bio cards': the contact box and the
   survey. The box hangs in a slot of its closed height (--ab-contact-h,
   initAboutContact), so opening it moves nothing: the box rests as its heading, a line
   and a button, as tall as they need, on the same glass as the pane above it, and
   opens over everything into the form, up from the slot if the screen's foot needs it. ── */
.about-contact {
  grid-row: 2;
  grid-column: 1;
  position: relative;
  min-width: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;                              /* as between the bio cards */
}
.about-contact.is-open { z-index: 6; }       /* over the text, the photo and the cards */
.about-contact-slot {
  position: relative;
  /* holds the survey where it is, whatever height the box needs at rest */
  height: max(var(--ab-contact-h, 0px), 180px);
}
.about-contact.is-open .about-contact-slot { z-index: 1; }   /* over the survey's glass */
.about-contact-card {
  --ab-field-line: rgba(240, 234, 216, 0.3);
  --ab-field-bg:   rgba(7, 20, 37, 0.22);
  --ab-field-text: rgba(240, 234, 216, 0.72);
  --ab-field-bad:  #ec9a8c;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 4px 22px 18px;
  overflow: hidden;
}
.about-contact-card:hover,
.about-contact-card:focus-within,
.about-contact.is-open .about-contact-card {
  --ab-field-line: rgba(35, 38, 43, 0.28);
  --ab-field-bg:   rgba(255, 255, 255, 0.55);
  --ab-field-text: rgba(0, 0, 0, 0.62);
  --ab-field-bad:  var(--ab-redline);
}
.about-contact.is-open .about-contact-card { padding: 8px 32px 28px; }
.about-contact-intro,
.about-survey p {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--c-ink);
  transition: color 0.45s ease;
}
.about-contact-intro { margin-top: 10px; }
/* resting, the heading across the box, then the line with the button beside it on
   the right, the line narrowed to make room; open, the form in the button's place */
.about-contact:not(.is-open) .about-contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 24px;
  align-content: start;
}
.about-contact:not(.is-open) .about-contact-head { display: contents; }
.about-contact:not(.is-open) .about-bio-name { grid-column: 1 / -1; }
.about-contact-open { align-self: center; margin-top: 10px; }
.about-contact-head { padding-bottom: 12px; }
.about-contact-body { display: none; }
.about-contact.is-open .about-contact-open { display: none; }
.about-contact.is-open .about-contact-head { padding-bottom: 22px; }
.about-contact.is-open .about-contact-body {
  display: block;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.about-contact-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--ab-hairline);
  border-radius: var(--ab-radius);
  background: transparent;
  color: var(--c-ink);
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.45s ease;
}
.about-contact-close svg { width: 18px; height: 18px; }
.about-contact-close:hover,
.about-contact-close:focus-visible { border-color: var(--ab-orange); outline: none; }
.about-contact.is-open .about-contact-close { display: flex; }
.about-contact-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.about-contact-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px 28px; }
.about-contact-main { display: flex; flex-direction: column; min-width: 0; }
/* the right column under the photo: the contributor at the foot, level with the
   survey's, and the bio cards taking the height above it, each in a slot that opening
   it can't change. A plain wrapper: no stacking context of its own, so opened cards
   still rise over everything. */
.about-lower {
  grid-row: 2;
  grid-column: 2;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;                              /* as between the bio cards */
  min-width: 0;
}
.about-lower > * { flex: none; }
/* the contributor's slot: its closed height (--ab-thanks-h, initAboutSection) */
.about-thanks { height: var(--ab-thanks-h, auto); }
/* a closed card fills its slot, its bio running to the card's foot
   (--ab-bio-h, initAboutSection) */
@media (min-width: 769px) {
  /* height 0: as tall as the column leaves them and no taller, whatever's in them, so
     a card opening inside can't push the level's row taller */
  .about-lower > .about-bios {
    flex: 1 0 auto;
    height: 0;
    min-height: var(--ab-card-h);
    grid-template-rows: minmax(0, 1fr);
  }
  .about-bios > .about-bio { height: auto; }
  .about-bio > .about-bio-card { min-height: 100%; }
  .about-contact > .about-survey { margin-top: auto; }  /* if the right column's the taller */
}
/* the survey: on the same glass, its note and its button side by side */
.about-survey {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 22px;
}
.about-survey-link {
  flex: none;
  padding: 6.4px 17.6px;
  border: 1px solid var(--c-ink);
  border-radius: var(--ab-radius);
  background: transparent;
  color: var(--c-ink);
  font-family: var(--font-heading);          /* as the level's other buttons */
  font-size: 0.85rem;
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-tracking);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.45s ease;
}
/* the box has frosted by now, so its ink is black */
.about-survey-link:hover,
.about-survey-link:focus-visible { background: var(--c-ink); color: #fff; outline: none; }
.about-field { display: block; min-width: 0; }
.about-field--message { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.about-field-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ab-field-text);
  transition: color 0.45s ease;
}
.about-field input,
.about-field textarea {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--ab-field-line);
  border-radius: var(--ab-radius);
  background: var(--ab-field-bg);
  color: var(--c-ink);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.45s ease;
}
.about-field textarea { flex: 1; min-height: 120px; resize: none; overscroll-behavior: contain; }
.about-field input:focus,
.about-field textarea:focus {
  outline: none;
  border-color: var(--ab-orange);
  background: rgba(255, 255, 255, 0.9);
}
.about-field.is-bad input,
.about-field.is-bad textarea { border-color: var(--ab-field-bad); }
.about-field.is-bad .about-field-label { color: var(--ab-field-bad); }
/* out of sight for people, not for a bot reading the markup */
.about-field-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
/* the status beside the button, or on a line above it if the column's too narrow */
.about-contact-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 1rem;
  margin-top: 18px;
}
.about-contact-status:empty { display: none; }
.about-contact-status {
  flex: 1 1 9em;
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--c-ink);
  transition: color 0.45s ease;
}
.about-contact-status.is-bad { color: var(--ab-field-bad); font-weight: 500; }
.about-contact-send,
.about-contact-open {
  flex: none;
  padding: 6.4px 17.6px;
  border: 1px solid var(--ab-orange);
  border-radius: var(--ab-radius);
  background: var(--ab-orange);
  color: #fff;
  font-family: var(--font-heading);          /* the level's headings' face */
  font-size: 0.85rem;
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-tracking);
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}
.about-contact-send:hover,
.about-contact-send:focus-visible,
.about-contact-open:hover,
.about-contact-open:focus-visible { background: #a9461f; border-color: #a9461f; outline: none; }
.about-contact-send:disabled { opacity: 0.55; cursor: default; }
.about-contact-link { cursor: pointer; }
/* a phone: the left column is narrow, so it takes a row of its own, across the
   level, under the contributor, the name and email side by side to fit the
   screen, at 16px so that a phone doesn't zoom in on a field when it's tapped */
@media (max-width: 768px) {
  .about-contact { grid-row: 4; grid-column: 1 / -1; }
  .about-lower { display: contents; }
  .about-contact-card { padding: 4px 16px 14px; }
  .about-contact.is-open .about-contact-card { padding: 4px 16px 16px; }
  .about-contact-side { gap: 8px 12px; }
  .about-survey { padding: 12px 16px; flex-wrap: wrap; }
  #level-epilogue .text-level-heading { white-space: normal; }
  .about-field input,
  .about-field textarea { font-size: 16px; }
  .about-field textarea { min-height: 3.2em; }
}

/* the text's pane, hovered: less white than the cards and much more
   blurred, so it reads over the photo it opens across, and it frosts
   over more slowly, so the change from the dark glass is gentle */
.about-text {
  transition: background-color 0.75s ease, border-color 0.75s ease, color 0.45s ease,
              box-shadow 0.6s var(--ab-ease), opacity 0.45s ease,
              -webkit-backdrop-filter 0.75s ease, backdrop-filter 0.75s ease;
}
.about-text:hover {
  background-color: rgba(255, 255, 255, 0.66);
  -webkit-backdrop-filter: blur(32px) saturate(1.2);
          backdrop-filter: blur(32px) saturate(1.2);
}

/* ── the photo: a thick card-stock mat, a soft shadow, and the stage inside ── */
.about-photo {
  grid-row: 1;
  grid-column: 2;
  box-sizing: border-box;
  padding: var(--ab-mat);
  background: var(--ab-card);
  border-radius: var(--ab-radius);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3),
              0 22px 44px -14px var(--ab-shadow);
}
.about-stage {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 1px;
}
.about-stage.is-pointing { cursor: pointer; }

.about-layers {
  position: absolute;
  inset: 0;
}

.about-bg,
.about-person,
.about-rim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
/* lit: everything else greys and settles back */
.about-bg { transition: filter 0.9s var(--ab-ease); }
#level-epilogue.has-active .about-bg { filter: grayscale(1) brightness(0.62) contrast(1.08); }

/* the person lit stays in colour, with a soft shadow off them onto the
   greyed ground */
.about-person {
  opacity: 0;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.5));
  transition: opacity 0.6s var(--ab-ease);
}
.about-person.is-on { opacity: 1; }

/* the rim light (initAboutRim): a light running round the outline of
   whoever is lit, drawn by its own shader and added onto the photo (no
   blend mode here: one on the page stops the frosted panes drawing) */

/* ── the bio cards ── */
.about-bios {
  grid-row: 2;
  grid-column: 2;
  position: relative;
  z-index: 3;                                /* opened cards over the photo */
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
}
.about-bio {
  position: relative;
  height: var(--ab-card-h);
  outline: none;
}
/* the card hangs from the top of its slot; opened, it widens across both
   slots and grows down into the room kept under it (--ab-open) and on
   to the screen's bottom margin, widening on leftward, across the text,
   for whatever doesn't fit there (initAboutSection) */
.about-bio-card {
  position: relative;
  overflow: hidden;
}
#level-epilogue.has-active .about-bio:not(.is-on) .about-bio-card { opacity: 0.55; }

/* the name, with a short orange accent under it, and their portrait
   before it — shut (no width) until the card opens wide */
.about-bio-head {
  display: flex;
  align-items: center;
  margin: 0 22px;
}
.about-bio-portrait {
  flex: none;
  box-sizing: border-box;
  width: 0;
  height: 0;
  margin-right: 0;
  overflow: hidden;
  border: 0 solid var(--ab-orange);
  border-radius: 50%;
  opacity: 0;
  transition: width 0.35s var(--ab-ease), height 0.35s var(--ab-ease),
              margin-right 0.35s var(--ab-ease), border-width 0.35s var(--ab-ease), opacity 0.3s ease;
}
.about-bio-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-bio-card.is-portrait .about-bio-portrait {
  width: 64px;
  height: 64px;
  margin-right: 16px;
  border-width: 2px;
  opacity: 1;
}
.about-bio-card.is-measuring .about-bio-portrait { transition: none; }
.about-bio-name {
  margin: 0;
  padding: 14px 0 11px;
  transition: color 0.45s ease;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 2vw, 1.9rem);
  line-height: 1.05;
  color: var(--c-ink);
}

/* The separators: a short orange accent under each name and the title
   (the level's one bright mark, kept small), and neutral hairlines over
   the links. Neither changes with the card's hover. */
#level-epilogue .text-level-heading,
.about-bio-name { position: relative; }
#level-epilogue .text-level-heading::after,
.about-bio-name::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 28px;
  height: 2px;
  border-radius: 1px;
  background: var(--ab-orange);
}
#level-epilogue .text-level-heading::after { width: 40px; height: 3px; border-radius: 1.5px; }

/* the bio: closed, two lines (the body's height); open, its timeline
   takes it to its full height */
.about-bio-main { padding: 10px 22px 14px; }
.about-bio-body {
  /* closed, down to the card's own bottom edge, through the padding under it, so the
     fade always ends exactly there (--ab-bio-h, initAboutSection). The padding comes
     back as it opens. */
  height: var(--ab-bio-h, calc(2 * 1.6em));
  margin-bottom: -14px;
  overflow: hidden;
  font-size: 0.92rem;
  line-height: 1.6;
}
.about-bio-text {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--c-ink);
  transition: color 0.45s ease;
}
.about-bio-text + .about-bio-text { margin-top: 0.9em; }
/* closed, the text fades out at the foot of the card, as the text's pane does (lifted
   while it opens) */
.about-bio-body.is-unclamped { height: calc(var(--ab-bio-h, calc(2 * 1.6em) + 14px) - 14px); margin-bottom: 0; }
.about-bio-body:not(.is-unclamped) {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 3.2em), transparent);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 3.2em), transparent);
}

/* opened wide, in two columns (.is-side, initAboutSection): the card
   reads as an info column and the text's. On the left, the name where it
   sits closed, with their portrait before it (as the contributor's card
   has; .is-portrait, set while it's open, so it eases in and out), and
   the links at the column's foot, level with the foot of the text, as
   buttons of one width (shrinking on shorter screens), on a faintly
   tinted panel the card's full height with a crisp edge against the text
   (in place of the accent under the name); and the bio in its two columns, under a small
   heading (Bio), as the links are (Links). The
   text's column is fixed at its open width while the card opens
   (--ab-bio-text), so nothing reflows; the info column is one width for
   both cards (--ab-info-w, the wider of the two). */
.about-bio-card.is-side {
  /* the info column, a faintly tinted panel the card's full height, edged
     where it meets the text by a single crisp line */
  --ab-side-edge: var(--ab-info-w, 0px);
  background-image: linear-gradient(to right,
    rgba(20, 28, 40, 0.05) var(--ab-side-edge),
    rgba(20, 28, 40, 0.14) var(--ab-side-edge), rgba(20, 28, 40, 0.14) calc(var(--ab-side-edge) + 1px),
    transparent calc(var(--ab-side-edge) + 1px));
  display: grid;
  grid-template-columns: var(--ab-info-w, max-content) var(--ab-bio-text, minmax(0, 1fr));
  grid-template-rows: auto 1fr auto;
}
.about-bio-card.is-side .about-bio-head { grid-column: 1; grid-row: 1; padding-top: 14px; }
.about-bio-card.is-side .about-bio-name { padding: 0; }
.about-bio-card.is-side .about-bio-name::after { display: none; }
.about-bio-card.is-side .about-bio-foot {
  grid-column: 1;
  grid-row: 3;
  align-self: end;
  height: auto;
  margin-top: 18px;                            /* clear of the name, however short the text */
}
/* the two bios (not the contributor's card): the portrait larger, over the
   name, and the links straight under it rather than at the column's foot,
   so the column reads top down with no gap in the middle */
.about-bio .about-bio-card.is-side .about-bio-head {
  flex-direction: column;
  align-items: flex-start;
}
.about-bio .about-bio-portrait {
  transition: width 0.35s var(--ab-ease), height 0.35s var(--ab-ease),
              margin-right 0.35s var(--ab-ease), margin-bottom 0.35s var(--ab-ease),
              border-width 0.35s var(--ab-ease), opacity 0.3s ease;
}
.about-bio .about-bio-card.is-measuring .about-bio-portrait { transition: none; }
.about-bio .about-bio-card.is-side.is-portrait .about-bio-portrait {
  width: 104px;
  height: 104px;
  margin-right: 0;
  margin-bottom: 12px;
}
.about-bio .about-bio-card.is-side .about-bio-foot {
  grid-row: 2;
  align-self: start;
  margin-top: 22px;
}
.about-bio-card.is-side .about-links {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0 0 16px;
  font-size: clamp(0.85rem, 1.9vh, 1.05rem);   /* the buttons shrink on shorter screens */
}
/* one left edge for the column (the portrait, the heading, the buttons)
   and one right (the buttons): each button a row, its label set left
   and its open-in-new-tab mark right */
.about-bio-card.is-side .about-links a {
  justify-content: space-between;
  padding: 0.55em 0.85em 0.55em 0.9em;
}
.about-bio-card.is-side .about-bio-main {
  position: relative;
  grid-column: 2;
  grid-row: 1 / -1;
  padding: 17px 22px 16px 28px;
}
.about-bio-card.is-side .about-bio-body { height: auto; }
/* the small headings: Links always (it opens with the links), Bio only
   opened wide */
.about-bio-label {
  margin: 0 0 0.6rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-ink);
  opacity: 0.55;
  transition: color 0.45s ease;
}
.about-bio-main > .about-bio-label { display: none; }
.about-bio-card.is-side .about-bio-main > .about-bio-label { display: block; }
/* over the links, the hairline runs above their heading */
.about-bio-foot > .about-bio-label {
  margin: 0 22px;
  padding-top: 14px;
  border-top: 1px solid var(--ab-hairline);
}
.about-bio-card.is-side .about-bio-foot > .about-bio-label {
  margin-bottom: 0.6rem;
  padding-top: 0;
  border-top: none;
}

/* the links, over a hairline — shut until the card opens */
.about-bio-foot { height: 0; overflow: hidden; }
.about-links {
  display: flex;
  gap: 1.25rem;
  margin: 0 22px;
  padding: 10px 0 14px;
  border-top: 1px solid var(--ab-hairline);
  font-family: var(--font-body);
  font-size: 0.92rem;
}

.about-intro a {
  color: inherit;
  text-decoration-color: var(--ab-redline);
  text-underline-offset: 3px;
  transition: color 0.25s ease;
}
.about-intro a:hover { color: var(--ab-orange); }

/* every outward link: an open-in-new-tab mark after it, in its ink */
.about-intro a::after,
.about-links a::after {
  content: '';
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-left: 0.35em;
  vertical-align: -0.05em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6'/%3E%3Cpath d='M20 4l-9 9'/%3E%3Cpath d='M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 4h6v6'/%3E%3Cpath d='M20 4l-9 9'/%3E%3Cpath d='M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* the cards' links: buttons, the whole box live, orange when hovered */
.about-bio .about-links { gap: 0.75rem; padding: 10px 0 16px; border-top: none; font-size: 1.05rem; }
.about-thanks .about-links { gap: 0.75rem; padding: 10px 0 16px; border-top: none; font-size: 1.05rem; }
.about-bio .about-links a,
.about-thanks .about-links a {
  display: inline-flex;
  align-items: center;
  padding: 0.6em 1.3em;
  border: 1px solid var(--ab-hairline);
  border-radius: var(--ab-radius);
  text-decoration: none;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.about-bio .about-links a:hover,
.about-thanks .about-links a:hover {
  background-color: var(--ab-orange);
  border-color: var(--ab-orange);
  color: #fff;
  opacity: 1;
}

.about-bio a,
.about-thanks a {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  transition: opacity 0.25s;
}
.about-bio a,
.about-thanks a { color: var(--c-ink); text-decoration-color: var(--ab-redline); }
.about-bio a:hover,
.about-thanks a:hover { opacity: 0.7; }

/* ── the entrance (initAboutEntrance) ──
   Held back until the level is scrolled to: the pane unfrosted and its
   text unset, the print not yet there (and then blank paper), the cards
   tucked up behind it, the contributor's card undrawn. Until the cards
   are in (.is-entering) the photo sits over them and nothing takes the
   pointer. */
#level-epilogue.is-pre .text-level-heading,
#level-epilogue.is-pre .about-intro p { visibility: hidden; }
#level-epilogue.is-pre .about-text   { clip-path: inset(0% 0% 100% 0%);
                                        background-color: rgba(7, 20, 37, 0); border-color: rgba(240, 234, 216, 0);
                                        -webkit-backdrop-filter: blur(0px) saturate(1); backdrop-filter: blur(0px) saturate(1); }
#level-epilogue.is-pre .about-photo  { opacity: 0; }
#level-epilogue.is-pre .about-stage  { filter: contrast(0.15) brightness(1.9) saturate(0); }
#level-epilogue.is-pre .about-bio    { transform: translateY(calc(-1 * (var(--ab-card-h) + var(--ab-row-gap)))); visibility: hidden; }
#level-epilogue.is-pre .about-thanks,
#level-epilogue.is-pre .about-contact { clip-path: inset(0% 100% 0% 0%); }
#level-epilogue.is-pre .about-photo,
#level-epilogue.is-entering .about-photo { position: relative; z-index: 4; }
#level-epilogue.is-entering .about-stage,
#level-epilogue.is-entering .about-bios,
#level-epilogue.is-entering .about-thanks,
#level-epilogue.is-entering .about-contact,
#level-epilogue.is-entering .about-text:not(.is-in) { pointer-events: none; }
/* the pane's colours are GSAP's while it frosts over: no transitions to drag them */
#level-epilogue.is-entering .about-text:not(.is-in) { transition: none; }


/* ── Explore map overlay — same pattern as the splat modal ── */
#explore-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--stone-mid);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#explore-modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: all;
}

#explore-modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 20;
  background: rgba(20,17,14,0.85);
  border: 1px solid rgba(200,150,42,0.35);
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 18px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

#explore-modal-close:hover {
  border-color: var(--ochre);
  color: var(--ochre-lt);
}

/* Inside the overlay the map fills whatever height the header leaves */
#explore-modal #explore {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 4rem 2rem 0;
}

#explore-modal #explore-map-wrap {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 768px) {

  /* Text levels — tighter gutters, smaller type */
  .text-level { padding: 8vh 6vw; }
  .text-level-inner { width: 100%; }
  .text-level-heading { font-size: clamp(2.128rem, 8.96vw, 2.912rem); }
  .text-level-body p { font-size: 1rem; }
  .text-level-cta { width: 100%; justify-content: center; }

  .about-cards { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  #level-epilogue .text-level-inner { width: 100%; }
  #explore-modal #explore { padding: 4rem 1rem 0; }

  /* Hero — stack title lines, shrink text, lift content higher */
  .hero-content {
    padding: 3vh 1.5rem 0;
  }

  .hero-eyebrow {
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
    letter-spacing: 0.18em;
  }

  .hero-title {
    font-size: clamp(1.8rem, 10vw, 3rem);
    flex-direction: column;
    gap: 0;
    white-space: normal;
  }

  .hero-subtitle {
    font-size: clamp(1rem, 4.5vw, 1.8rem);
    margin-top: 0.5rem;
  }

  .hero-scroll-cue {
    margin-top: 1.25rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.75rem;
  }

  .hero-scroll-line {
    height: 36px;
    margin-top: 0.75rem;
  }

  #scroll-steps {
    left: 3.5rem;
    width: calc(100% - 3.5rem);
    padding: 0 1.5rem 0 0;
  }

  #narrative-flash {
    left: 3.5rem;
    width: calc(100% - 3.5rem);
    height: 200px;
  }

  #narrative-orbs { left: 1.25rem; }

  .step-inner {
    max-width: 100%;
    padding: 0.5rem 0.75rem;
  }

  .step-label {
    font-size: 11px;
    margin-bottom: 8px;
  }

  .step-text p {
    font-size: 0.82rem;
    line-height: 1.55;
    margin-bottom: 0.65rem;
  }

  .step-teaser { font-size: 0.78rem !important; }

  .step-quote {
    font-size: 0.78rem;
    margin-top: 0.75rem;
  }

  .cta-button {
    font-size: 0.75rem;
    padding: 0.5rem 1.25rem;
    margin-top: 0.75rem;
  }

  .map-annotation {
    white-space: normal;
    max-width: calc(100vw - 3rem);
    text-align: center;
    font-size: 0.7rem;
  }

  .context-floats {
    grid-template-columns: 1fr;
  }

  .float-tr, .float-bl { justify-self: start; margin-top: 0; margin-left: 0; }

  .site-panel { width: 100%; height: 50vh; top: auto; bottom: 0; transform: translateY(100%); border-left: none; border-top: 1px solid rgba(200,150,42,0.25); }
  .site-panel[aria-hidden="false"] { transform: translateY(0); }
}

/* ══════════════════════════════════════
   DESKTOP / LAPTOP (≥ 1024px)
══════════════════════════════════════ */
@media (min-width: 1024px) {

  /* Hero — scale text for mid-size laptops, lift content slightly */
  .hero-content {
    padding: 5vh 3rem 0;
  }

  .hero-title {
    font-size: clamp(2.5rem, 5.5vw, 5rem);
  }

  .hero-subtitle {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
  }

  .hero-scroll-cue {
    margin-top: 2rem;
  }

  /* Narrative steps — tighten width on mid-size laptops */
  #scroll-steps {
    width: calc(48% - 5rem);
    left: 5rem;
  }

  #narrative-flash {
    left: 5rem;
    width: calc(48% - 5rem);
  }

  /* MC panel — match scroll-steps offset at this breakpoint */
  #mc-panel {
    left: 5rem;
  }
}

/* ══════════════════════════════════════
   LARGE DESKTOP (≥ 1440px)
   Splat section: centred layout.
   Narrative steps: restore original offsets.
══════════════════════════════════════ */
@media (min-width: 1440px) {

  /* Hero — restore comfortable spacing on large screens */
  .hero-content {
    padding: 6vh 2rem 0;
  }

  .hero-title {
    font-size: clamp(3rem, 7.5vw, 6rem);
  }

  .hero-subtitle {
    font-size: clamp(2rem, 4vw, 3rem);
  }

  .hero-scroll-cue {
    margin-top: 2.5rem;
  }

  /* Narrative steps */
  #scroll-steps {
    left: 7rem;
    width: calc(50% - 7rem);
  }

  #narrative-flash {
    left: 7rem;
    width: calc(50% - 7rem);
  }

  /* MC panel — restore 7rem offset to match scroll-steps on large screens */
  #mc-panel {
    left: 7rem;
  }

}

/* ══════════════════════════════════════
   HIDPI / RETINA LARGE SCREEN (≥ 1440px logical + 2× pixel ratio)
   Targets 16" MacBook Pro and similar Retina displays.
   MDPI monitors at the same width are unaffected.
══════════════════════════════════════ */
@media (min-width: 1440px) and (min-resolution: 2dppx) {

  #mc-panel .mc-phase p {
    font-size: 1.2rem;
    line-height: 1.8;
  }

  #mc-panel .mc-results-intro {
    font-size: 1.1rem !important;
  }

  #mc-panel .step-quote {
    font-size: 1.1rem;
  }

  #mc-panel .mc-phase-label {
    font-size: 0.95rem !important;
  }

}

/* ══════════════════════════════════════
   FLOATING LEVEL NAV
   Collapsed pill top-left; expands into a table of
   contents grouped by chapter. Sits above all level UI (≤900)
   and below the splat modal (1000) so the modal still covers it.
   Frosted glass: a smoky graphite tint with a breath of sage over a
   blur of the level behind, a white hairline edge and a soft top
   highlight; off-white type, the chapter headings in each chapter's
   own accent (as its page's eyebrow), a Piazzolla title over a
   hairline rule.
══════════════════════════════════════ */
#level-nav {
  /* lit from the top left, deepening to the foot, so it reads as a pane
     rather than a flat tint */
  --ln-glass: linear-gradient(160deg, rgba(64, 72, 68, 0.55), rgba(24, 28, 27, 0.62));
  --ln-glass-hi: linear-gradient(160deg, rgba(64, 72, 68, 0.6), rgba(20, 24, 23, 0.74));
  --ln-frost: blur(20px) saturate(1.5);
  --ln-hairline: rgba(255, 255, 255, 0.16);
  --ln-sheen: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --ln-ink: #f5f2ea;
  --ln-gold: var(--ochre-lt);
  position: fixed;
  top: clamp(0.9rem, 2vh, 1.5rem);
  left: clamp(0.9rem, 1.5vw, 1.75rem);
  z-index: 950;
  width: max-content;
  font-family: var(--font-body);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hidden on the hero until the "Scroll to explore" cue arrives */
#level-nav.ln-hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

#level-nav-toggle {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1.15rem 0.7rem 1rem;
  background: var(--ln-glass);
  border: 1px solid var(--ln-hairline);
  border-radius: 4px;
  box-shadow: var(--ln-sheen);
  color: var(--ln-ink);
  cursor: pointer;
  opacity: 0.78;
  transition: border-color 0.3s ease, background 0.3s ease, opacity 0.3s ease;
}

#level-nav-toggle:hover,
#level-nav-toggle:focus-visible,
#level-nav.open #level-nav-toggle {
  opacity: 1;
  border-color: rgba(232, 184, 75, 0.5);
  background: var(--ln-glass-hi);
}
/* Frosted everywhere but the top of the page: there a blur layer forces a
   full-page backdrop re-composite that visibly darkens the hero video as
   the pill appears (initLevelNav sets .ln-at-home). */
#level-nav:not(.ln-at-home) #level-nav-toggle {
  -webkit-backdrop-filter: var(--ln-frost);
          backdrop-filter: var(--ln-frost);
}

/* three-bar icon — morphs to a cross when open */
.ln-burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 16px;
}
.ln-burger span {
  display: block;
  height: 1px;
  width: 100%;
  background: var(--ln-gold);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}
.ln-burger span:nth-child(2) { width: 70%; }
#level-nav.open .ln-burger span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
#level-nav.open .ln-burger span:nth-child(2) { opacity: 0; }
#level-nav.open .ln-burger span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

.ln-toggle-label {
  font-family: 'Roboto Mono', monospace;
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  line-height: 1;
}

.ln-counter {
  font-family: 'Roboto Mono', monospace;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--ln-gold);
  padding-left: 0.8rem;
  border-left: 1px solid var(--ln-hairline);
}
.ln-counter-sep { opacity: 0.5; margin: 0 2px; }

/* ── Dropdown menu ── */
#level-nav-menu {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 0;
  width: min(380px, calc(100vw - 2rem));
  /* the toggle, the gap and a margin at the foot: on a short screen the
     list scrolls within itself */
  max-height: calc(100vh - 6.5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  padding: 1.15rem 0.6rem 0.9rem;
  background: var(--ln-glass-hi);
  border: 1px solid var(--ln-hairline);
  border-radius: 4px;
  box-shadow: var(--ln-sheen), 0 24px 60px rgba(0, 0, 0, 0.38);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
#level-nav.open #level-nav-menu {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  /* frosted only while open: nothing to composite while it's hidden */
  -webkit-backdrop-filter: var(--ln-frost);
          backdrop-filter: var(--ln-frost);
}

/* the title: home */
.ln-link.ln-home {
  padding: 0.2rem 0.75rem 0.15rem;
}
.ln-home .ln-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: var(--heading-tracking);
  line-height: 1.15;
  color: var(--ln-ink);
}
.ln-link.ln-home.is-active .ln-name { color: var(--ln-ink); font-weight: 600; }

/* the chapter pages' hairline, a glint along it */
.ln-rule {
  height: 1px;
  margin: 0.8rem 0.75rem 0.5rem;
  background: rgba(232, 184, 75, 0.3);
}
.ln-rule i {
  display: block;
  height: 100%;
  background: linear-gradient(to right, rgba(255, 236, 190, 1), rgba(232, 184, 75, 0.5) 45%, transparent 85%);
}

/* ── Chapters ── */
.ln-group { --ln-accent: #9db3a4; padding-top: 0.8rem; }
#ln-ch1       { --ln-accent: #d8c49c; }
#ln-ch2       { --ln-accent: #a6b9d4; }
#ln-ch3       { --ln-accent: #9ccaa8; }
#ln-epilogue  { --ln-accent: #ecd5c8; }

.ln-chapter {
  display: block;
  width: 100%;
  padding: 0.45rem 0.75rem 0.4rem;
  background: none;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  text-align: left;
  font-family: 'Roboto Mono', monospace;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--ln-accent);
  opacity: 0.8;
  transition: opacity 0.2s ease;
}
.ln-chapter:hover,
.ln-group.is-current .ln-chapter { opacity: 1; }

/* the levels, indented under their chapter */
.ln-link {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  width: 100%;
  position: relative;
  padding: 0.42rem 0.75rem 0.42rem 2rem;
  background: none;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease;
}
.ln-link:hover { background: rgba(255, 255, 255, 0.06); }

.ln-num {
  font-family: 'Roboto Mono', monospace;
  font-size: 12px;
  color: rgba(245, 242, 234, 0.5);
  transition: color 0.2s ease;
}

.ln-name {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.35;
  color: rgba(245, 242, 234, 0.88);
  transition: color 0.2s ease;
}

.ln-link:hover .ln-name { color: var(--ln-gold); }

/* the level you're on: gold, on a faint gold wash, with a short gold bar
   in the indent */
.ln-link.is-active { background: rgba(232, 184, 75, 0.1); }
.ln-link:not(.ln-home).is-active::before {
  content: '';
  position: absolute;
  left: 0.85rem;
  top: 50%;
  width: 2px;
  height: 1.05em;
  transform: translateY(-50%);
  border-radius: 1px;
  background: var(--ln-gold);
  box-shadow: 0 0 8px rgba(232, 184, 75, 0.55);
}
.ln-link.is-active .ln-num  { color: var(--ln-gold); }
.ln-link.is-active .ln-name { color: var(--ln-gold); font-weight: 500; }
.ln-link.ln-home.is-active { background: none; }

#level-nav-toggle:focus-visible,
.ln-chapter:focus-visible,
.ln-link:focus-visible {
  outline: 1px solid var(--ln-gold);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .ln-toggle-label { display: none; }
}

/* ══════════════════════════════════════
   LEVELS 6 + 8: ONE 3D SCENE (#zo-scene)
   Two pinned layers cover the whole scene — the 3D stage behind
   "Roche Rock in 3D" and "Zooming out", and Zooming out's copy above
   them — so scrolling between the levels is one continuous camera move
   (initZoomOut / zoom-out.js). Level 6 is 200vh with a pinned inner;
   Level 8 is a bare 500vh track pulled up to overlap Level 6's second
   screen; its last screen rises to the narrative map's first view. Opacities driven by scroll arrive as CSS variables:
     --zo-copy   Zooming out copy + its scrim (0 on Level 6, 1 from Level 8)
     --zo-start  low-end fallback still (1 at Level 8's top, fading on)
══════════════════════════════════════ */
.zoom-out { position: relative; }

.zo-layer {
  position: sticky;
  top: 0;
  height: 100vh;
  margin-bottom: -100vh;          /* layers overlay what follows */
  overflow: hidden;
}
.zo-layer--stage { z-index: 0; background: #071425; }
.zo-layer--copy  { z-index: 3; pointer-events: none; opacity: var(--zo-copy, 0); }

/* Level 6 sits between the layers. Its second screen keeps its content
   pinned while that content fades (style set by initZoomOut). */
#hotspots { height: 200vh; overflow: clip; z-index: 2; }
#hotspots .splat-launch { position: sticky; top: 0; height: 100vh; }

/* three beats + the rise to the narrative map */
#level-viewshed-intro { height: 500vh; margin-top: -100vh; }
/* The narrative map starts where the 3D reaches its first view: pulled up
   one screen so its fixed map fades in while the scene is still pinned (the
   scene's last screen then scrolls away unseen beneath the opaque map). */
#narrative-map { margin-top: -100vh; }

/* Live 3D: Level 6 shows the shared canvas instead of its video. */
.zoom-out.is-live #hotspots { background: transparent; }
.zoom-out.is-live .splat-launch-video { opacity: 0 !important; transition: opacity 0.8s ease; }

.zo-stage,
.zo-canvas,
.zo-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.zo-stage { z-index: 0; }
.zo-canvas { display: block; opacity: 0; transition: opacity 0.9s ease; }
.zo-fallback { object-fit: cover; object-position: 68% 50%; opacity: 0; transition: opacity 0.9s ease; }

/* 3D running: canvas in. Fallback: image only. */
.zoom-out.is-3d .zo-canvas { opacity: 1; }
.zoom-out.is-fallback .zo-fallback { opacity: calc(1 - var(--zo-start, 1)); transition: none; }
.zoom-out.is-fallback .zo-canvas { display: none; }

.zo-loading {
  position: absolute;
  left: 50%;
  bottom: 9vh;
  width: min(220px, 40vw);
  height: 1px;
  transform: translateX(-50%);
  background: rgba(232, 184, 75, 0.14);
  opacity: 0;
  transition: opacity 0.6s ease;
}
.zoom-out.is-loading:not(.at-start) .zo-loading { opacity: 1; }
.zo-loading-bar {
  display: block;
  height: 100%;
  width: calc(var(--zo-load, 0) * 100%);
  background: var(--ochre-lt);
  transition: width 0.3s ease;
}

/* Left-hand scrim so the copy reads over the aerial imagery; only once the
   ground has gone dark (--zo-band, initZoomOut). On the blue ground the
   3D backdrop's own radial glow and vignette (zoom-out.js) do the job. */
.zo-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: calc(var(--zo-copy, 0) * var(--zo-band, 0));
  background:
    linear-gradient(100deg, rgba(var(--zo-scrim, 5, 6, 7), 0.88) 0%, rgba(var(--zo-scrim, 5, 6, 7), 0.62) 26%, rgba(var(--zo-scrim, 5, 6, 7), 0) 52%);
}

.zo-copy {
  position: relative;
  height: 100%;
  width: min(560px, 40vw);
  margin-left: 6vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Notes are grid-stacked like the introduction's: the active one sits at
   rest, upcoming ones wait below, spent ones lift away. */
.zo-notes { display: grid; }
/* .zo-notes prefix: .text-level-body p would otherwise win and show spent notes */
.zo-notes .zo-note {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(26px);
  /* no blur filter here: re-rasterising blurred text every frame next to the
     WebGL canvas was a visible source of jank */
  transition: opacity 0.6s ease, transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}
.zo-notes .zo-note.is-past { transform: translateY(-26px); }
.zo-notes .zo-note.is-active { opacity: 1; transform: none; }
/* the last note sits beside the full 5 km disc: keep it narrow enough to clear it */
@media (min-width: 901px) { .zo-notes .zo-note[data-beats="3"] { max-width: 32ch; } }

@media (max-width: 900px) {
  .zo-copy {
    width: auto;
    margin: 0 6vw;
    justify-content: flex-end;
    padding-bottom: 10vh;
  }
  .zo-scrim {
    background: linear-gradient(0deg, rgba(var(--zo-scrim, 7, 21, 42), 0.92) 0%, rgba(var(--zo-scrim, 7, 21, 42), 0.7) 34%, rgba(var(--zo-scrim, 7, 21, 42), 0) 62%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .zo-note { transition-duration: 0.01s; }
}

/* Imagery/terrain credit — only once the draped terrain is on screen */
.zo-credit {
  position: absolute;
  right: 14px;
  bottom: 10px;
  z-index: 2;
  margin: 0;
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.02em;
  color: rgba(240, 234, 216, 0.42);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.zoom-out.has-imagery.is-3d[data-beat="2"] .zo-credit,
.zoom-out.has-imagery.is-3d[data-beat="3"] .zo-credit { opacity: 1; }

/* Low-end fallback only: the preview video's final frame, in the same box,
   crop and feathering as .splat-launch-video, sits under Level 6 so the
   video's picture carries on as that level scrolls away, then fades. */
.zo-still {
  position: absolute;
  inset: 0;
  background: #071425;            /* #hotspots ground */
  opacity: var(--zo-start, 1);
  pointer-events: none;
}
.zoom-out.is-live .zo-still,
.zoom-out.is-3d .zo-still { display: none; }

.zo-still-frame {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 0;
  height: 64vh;
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 0%, #000 38%),
    linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask-image:
    linear-gradient(to bottom, transparent 0%, #000 38%),
    linear-gradient(to right, transparent 0%, #000 14%, #000 86%, transparent 100%);
          mask-composite: intersect;
}
.zo-still-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 65%;
  display: block;
}

/* A level well off screen (initOffscreenPause): every animation in it holds
   where it is until the level comes back, so its loops cost nothing meanwhile. */
.is-offscreen,
.is-offscreen *,
.is-offscreen *::before,
.is-offscreen *::after {
  animation-play-state: paused !important;
}
