/* Palette taken from the LinkedIn banner: a dark study at dusk, lit by one warm sunbeam. */
:root {
  --ink-950: #0b0908;
  --ink-900: #12100e;
  --espresso: #1c1714;
  --stone: #3b322b;
  --amber: #e3a35a;
  --brass: #c19a62;
  --brass-deep: #9c7a46;
  --parchment: #ebe1d0;
  --parchment-dim: rgba(235, 225, 208, .64);
  --parchment-faint: rgba(235, 225, 208, .54); /* the faintest text that still meets WCAG AA (4.5:1) */
  --line: rgba(193, 154, 98, .26);

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --gutter: clamp(16px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--ink-950);
  color: var(--parchment);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
/* Film grain: one static layer, nothing animated. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .06;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* Quiet luxury behind the dark pages: a fine linen weave, two pools of lamplight (amber top right,
   a breath of oxblood bottom left) and a soft vignette. Fixed behind all content (z-index -1), so
   sections with their own surface (landing, room, dossier, blackboard, database) cover it. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% 50%, transparent 55%, rgba(0, 0, 0, .38) 100%),
    radial-gradient(60vmax 42vmax at 88% 6%, rgba(227, 163, 90, .09), transparent 70%),
    radial-gradient(55vmax 40vmax at 8% 96%, rgba(143, 42, 34, .085), transparent 70%),
    repeating-linear-gradient(45deg, rgba(235, 225, 208, .022) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(-45deg, rgba(235, 225, 208, .022) 0 1px, transparent 1px 4px);
}
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
em { font-style: italic; color: var(--brass); }

.eyebrow {
  margin: 0 0 1.4rem;
  font: 500 .72rem/1.4 var(--mono);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--brass);
}

/* ---------- Top bar ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 18px var(--gutter);
  transition: background-color .4s, backdrop-filter .4s;
}
.topbar[data-scrolled="true"] {
  background: rgba(11, 9, 8, .6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
/* The signature as logo: hidden in the prologue, present everywhere after. */
.topbar__mark {
  width: 96px;
  aspect-ratio: 1600 / 908;
  background: linear-gradient(45deg, var(--brass-deep), #efd6a8);
  -webkit-mask: url("../assets/signature-ink.png") center / contain no-repeat;
  mask: url("../assets/signature-ink.png") center / contain no-repeat;
  opacity: 0;
  transform: translateY(-6px) scale(.9);
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out);
}
.topbar[data-logo="true"] .topbar__mark { opacity: 1; transform: none; }
.topbar__nav { display: flex; align-items: center; gap: clamp(.9rem, 2.4vw, 2rem); font-size: .84rem; }
.topbar__nav a { text-decoration: none; color: var(--parchment-dim); transition: color .2s; }
.topbar__nav a:hover { color: var(--parchment); }
.topbar__nav .topbar__cv {
  color: var(--parchment);
  padding: .45rem .95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.topbar__nav .topbar__cv:hover { border-color: var(--brass); }
/* Over the white landing page the bar turns to ink. */
.topbar[data-light="true"] { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.topbar[data-light="true"] .topbar__nav a { color: #1a1714; }
.topbar[data-light="true"] .topbar__nav .topbar__cv { border-color: #1a1714; }

/* ---------- Stage: the room ---------- */
.stage { position: relative; height: 840vh; }
.stage__viewport {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--ink-950);
}
/* Sized to the image in CSS px; main.js moves it like a camera (translate + scale). */
.scene {
  position: absolute;
  top: 0;
  left: 0;
  width: 2000px;
  height: 667px;
  transform-origin: 0 0;
  will-change: transform;
}
.scene__img {
  width: 100%;
  height: 100%;
  /* Let the top and bottom edge melt into the dark, so the banner reads as a scene, not a strip. */
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 9%, #000 88%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 9%, #000 88%, transparent 100%);
}
.scene__beam {
  position: absolute;
  inset: 0;
  background: radial-gradient(40% 60% at 62% 40%, rgba(227, 163, 90, .16), transparent 70%);
  mix-blend-mode: screen;
  pointer-events: none;
}
/* A soft "torch" that follows the pointer, plus a darker right side to carry the text. */
.stage__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(42vmax 42vmax at var(--mx, 35%) var(--my, 55%), transparent 0, rgba(11, 9, 8, .38) 70%),
    linear-gradient(90deg, transparent 45%, rgba(11, 9, 8, .55) 100%);
  opacity: var(--shade, 1);
  transition: opacity .6s;
}

/* Objects in the room that become chapters. */
.hotspot {
  position: absolute;
  z-index: 6; /* above the landing page on the laptop screen */
  left: calc(var(--x) * 100%);
  top: calc(var(--y) * 100%);
  transform: translate(-50%, -50%) scale(var(--inv, 1));
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity .6s var(--ease-out);
}
.hotspot__ring {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--amber);
  background: rgba(227, 163, 90, .25);
  box-shadow: 0 0 0 6px rgba(227, 163, 90, .12), 0 0 24px rgba(227, 163, 90, .6);
  transition: transform .5s var(--ease-out);
}
.hotspot__label {
  position: absolute;
  left: 34px;
  white-space: nowrap;
  padding: .3rem .6rem;
  border: 1px solid var(--line);
  background: rgba(11, 9, 8, .72);
  font: 500 .66rem/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--parchment);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .4s, transform .4s var(--ease-out);
}
.hotspot__label b { color: var(--amber); font-weight: 500; margin-right: .35rem; }
.hotspot.is-lit { opacity: .55; }
.hotspot.is-active, .stage[data-step="9"] .hotspot { opacity: 1; pointer-events: auto; }
.hotspot.is-active .hotspot__ring { transform: scale(1.25); animation: pulse 2.4s ease-out infinite; }
.hotspot.is-active .hotspot__label,
.stage[data-step="9"] .hotspot .hotspot__label,
.hotspot:hover .hotspot__label { opacity: 1; transform: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(227, 163, 90, .45), 0 0 24px rgba(227, 163, 90, .6); }
  100% { box-shadow: 0 0 0 18px rgba(227, 163, 90, 0), 0 0 24px rgba(227, 163, 90, .6); }
}

/* Prologue: just the motto on the wall. */
.prologue {
  position: absolute;
  top: 50%;
  right: 7vw;
  width: min(36vw, 30rem);
  text-align: center;
  transform: translateY(-50%);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
.stage:not([data-step="1"]) .prologue { opacity: 0; transform: translateY(calc(-50% - 16px)); pointer-events: none; }
/* ---------- The landing page (white, Lando-style face reveal) ---------- */
@property --lens {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}
.landing {
  --paper-white: #f4f3ef; /* matches the paper behind David */
  --ink: #1a1714;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  /* full screen before main.js sizes it exactly, so nothing jumps on first paint */
  width: 100vw;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  transform-origin: 0 0;
  background-color: var(--paper-white);
  /* the northern sky: the Dippers, Polaris, Cassiopeia and the Pleiades (scripts/build-sky.mjs) */
  background-image: url("../assets/landing-sky.svg");
  background-position: 0 0;
  background-size: cover;
  color: var(--ink);
  font-family: "Archivo", var(--sans);
  will-change: transform;
  perspective: 1600px;
}
/* The type drifts a touch the other way, for depth. */
.landing__claim, .landing__title, .landing__name { translate: var(--dx, 0px) var(--dy, 0px); }
/* While the landing page fills the screen, the room's shading and instruments stay out of the way. */
.stage__shade, .stage .hud { transition: opacity .5s; }
.stage[data-step="0"] .stage__shade, .stage[data-step="0"] .hud { opacity: 0; }
/* Once it's a screen in the dark room, dim it a little, like a real display at dusk. */
.stage:not([data-step="0"]) .landing { pointer-events: none; filter: brightness(.8) saturate(.9); }
.landing__name {
  position: absolute;
  top: 18px;
  left: var(--gutter);
  z-index: 2;
  margin: 0;
  font: 800 clamp(1.4rem, 2.5vw, 2.6rem)/.92 "Archivo", var(--sans);
  font-stretch: 125%;
  letter-spacing: -.01em;
  text-transform: uppercase;
}
.landing__face {
  position: absolute;
  left: 50%;
  /* runs a little past the bottom edge, so the suit always continues off-screen (also while it leans) */
  bottom: -18px;
  /* gentle parallax from js/landing.js (--tx/--ty/--ry/--rx), like the hero on landonorris.com */
  transform: translate3d(var(--tx, 0px), var(--ty, 0px), 0) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-origin: 50% 100%;
  height: min(84%, 60vw);
  aspect-ratio: 872 / 759;
  margin: 0;
  translate: -50% 0;
}
.landing__me { position: absolute; inset: 0; width: 100%; height: 100%; }
.landing__david {
  position: absolute;
  inset: 0;
  /* the lens: a soft-edged circle around the cursor */
  -webkit-mask-image: radial-gradient(circle var(--lens) at var(--lx, 50%) var(--ly, 40%), #000 82%, transparent 100%);
  mask-image: radial-gradient(circle var(--lens) at var(--lx, 50%) var(--ly, 40%), #000 82%, transparent 100%);
  transition: --lens .5s cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
}
.landing__david img { width: 100%; height: 100%; display: block; }
.landing__face.is-revealing .landing__david { --lens: clamp(90px, 13vw, 170px); }
.landing__lens {
  position: absolute;
  left: var(--fx, 50%);
  top: var(--fy, 40%);
  width: calc(var(--lens-ring, 0px) * 2);
  aspect-ratio: 1;
  border: 1px solid rgba(26, 23, 20, .35);
  border-radius: 50%;
  translate: -50% -50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
}
.landing__face.is-revealing .landing__lens { opacity: 1; --lens-ring: clamp(90px, 13vw, 170px); }
.landing__hint {
  position: absolute;
  left: 50%;
  top: 6%;
  translate: -50% 0;
  padding: .45rem .8rem;
  border: 1px solid rgba(26, 23, 20, .25);
  border-radius: 999px;
  background: rgba(243, 241, 236, .85);
  font: 600 .62rem/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity .4s;
}
.landing__face.is-revealing .landing__hint, .landing__face.has-revealed .landing__hint { opacity: 0; }

.landing__claim {
  position: absolute;
  left: var(--gutter);
  top: 44%;
  z-index: 2;
  width: min(30vw, 30rem);
  font: 500 clamp(.9rem, 1.35vw, 1.3rem)/1.3 "Archivo", var(--sans);
  text-transform: uppercase;
}
.landing__claim p { margin: 0 0 1.4em; }
.landing__claim em { font: italic 400 1.25em/1.2 var(--serif); text-transform: none; }
.landing__title {
  position: absolute;
  right: var(--gutter);
  top: 30%;
  z-index: 2;
  margin: 0;
  text-align: right;
  text-transform: uppercase;
}
.landing__small { display: block; margin-bottom: .2em; font: 400 clamp(1rem, 2vw, 2.1rem)/1.05 "Archivo", var(--sans); font-stretch: 100%; }
.landing__big { display: block; font: 900 clamp(2.2rem, 5.2vw, 5.8rem)/.86 "Archivo", var(--sans); font-stretch: 62%; letter-spacing: -.01em; }
.landing__scroll {
  position: absolute;
  left: var(--gutter);
  bottom: 24px;
  z-index: 2;
  margin: 0;
  font: 600 .64rem/1 var(--mono);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.landing__scroll span { display: inline-block; animation: nudge 1.8s ease-in-out infinite; }

.prologue__motto {
  margin: 0;
  font: 300 clamp(1.05rem, 1.9vw, 1.9rem)/1.3 var(--serif);
  letter-spacing: .42em;
  text-transform: uppercase;
  /* letter-spacing adds space after the last letter too; nudge it back to centre */
  margin-right: -.42em;
}
.prologue__rule { display: block; width: 72px; height: 1px; margin: 1.3rem auto; background: var(--brass); opacity: .7; }
.prologue__by { margin: 0; font: italic 300 clamp(1rem, 1.3vw, 1.25rem)/1 var(--serif); letter-spacing: .08em; color: var(--parchment-dim); }

/* Narration: one line of the story per step. */
.narration {
  position: absolute;
  top: 50%;
  right: 7vw;
  width: min(36vw, 30rem);
  margin: 0;
  padding: 0;
  list-style: none;
  transform: translateY(-50%);
}
.narration li {
  position: absolute;
  inset: auto 0 auto 0;
  top: 0;
  transform: translateY(calc(-50% + 14px));
  opacity: 0;
  visibility: hidden;
  transition: opacity .55s var(--ease-out), transform .55s var(--ease-out), visibility 0s .55s;
}
.narration li.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%);
  transition: opacity .7s var(--ease-out) .1s, transform .7s var(--ease-out) .1s, visibility 0s;
}
.narration__kicker {
  margin: 0 0 1rem;
  font: 500 .7rem/1.4 var(--mono);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--amber);
}
.narration__line { margin: 0 0 1rem; font: 300 clamp(1.7rem, 2.7vw, 2.8rem)/1.12 var(--serif); }
.narration__sub { margin: 0; color: var(--parchment-dim); font-size: clamp(.92rem, 1.05vw, 1.02rem); }
.narration__sub strong { color: var(--parchment); font-weight: 600; }

/* The overview, as a row of chapters under the scene. */
.index {
  position: absolute;
  left: 50%;
  bottom: 30px;
  display: flex;
  gap: clamp(1rem, 2vw, 2rem);
  transform: translateX(-50%);
  font: 500 .66rem/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .6s;
}
.stage:not([data-step="0"]):not([data-step="1"]) .index { opacity: 1; pointer-events: auto; }
.index a { text-decoration: none; color: var(--parchment-faint); transition: color .3s; }
.index a b { font-weight: 500; margin-right: .45rem; color: inherit; }
.index a.is-done { color: var(--parchment-dim); }
.index a.is-active, .index a:hover { color: var(--amber); }

/* Cockpit-style instruments in the corners. */
.hud {
  position: absolute;
  left: var(--gutter);
  bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font: 400 .66rem/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--parchment-faint);
}
.hud__clock { color: var(--amber); }
.hud--right { left: auto; right: var(--gutter); align-items: flex-end; }
.hud__cue { color: var(--parchment-dim); transition: opacity .5s; }
.hud__cue i { font-style: normal; display: inline-block; animation: nudge 1.8s ease-in-out infinite; }
.stage:not([data-step="0"]) .hud__cue { opacity: 0; }
.hud__count b { color: var(--parchment); font-weight: 500; }
.hud__bar { width: 96px; height: 1px; background: var(--line); overflow: hidden; }
.hud__bar i { display: block; height: 100%; background: var(--amber); transform-origin: 0 0; transform: scaleX(var(--progress, 0)); }
@keyframes nudge { 50% { transform: translateY(3px); } }

/* ---------- Chapters (placeholders) ---------- */
.chapter {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16vh var(--gutter);
  border-top: 1px solid var(--line);
}
.chapter__num, .chapter__soon {
  margin: 0 0 1rem;
  font: 500 .7rem/1.4 var(--mono);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--amber);
}
.chapter h2 { margin: 0 0 1rem; font: 300 clamp(2.6rem, 6vw, 5.2rem)/1 var(--serif); }
.chapter__lede { max-width: 38rem; margin: 0 0 1.6rem; font-size: 1.05rem; color: var(--parchment-dim); }
.chapter__soon { color: var(--parchment-faint); }

/* ---------- Chapter I: the blackboard ---------- */
.lesson {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  margin-top: 3rem;
}
.blackboard {
  position: relative;
  padding: clamp(1.6rem, 3.5vw, 2.8rem);
  border: 12px solid #4a3524;
  border-radius: 4px;
  background:
    radial-gradient(120% 90% at 30% 20%, rgba(255, 255, 255, .06), transparent 60%),
    linear-gradient(160deg, #26302a, #1b221e);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .55), 0 30px 60px -30px rgba(0, 0, 0, .9);
  font-family: "Caveat", cursive;
  color: rgba(244, 241, 232, .92);
}
.blackboard__date { margin: 0; text-align: right; font-size: 1.15rem; opacity: .7; }
.blackboard__title { margin: .2rem 0 1rem; font-size: clamp(2rem, 3.4vw, 2.8rem); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.blackboard__list { margin: 0; padding-left: 1.6rem; font-size: clamp(1.5rem, 2.4vw, 2.05rem); line-height: 1.5; }
/* Chalk "writes" each line: a left-to-right reveal, one after the other. */
.blackboard__list li { clip-path: inset(0 100% 0 0); transition: clip-path 1.1s cubic-bezier(.6, .1, .3, 1) calc(var(--i) * 900ms + 300ms); }
.lesson.is-visible .blackboard__list li { clip-path: inset(0 0 0 0); }
.blackboard__canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; touch-action: auto; }
.blackboard.is-drawing .blackboard__canvas {
  pointer-events: auto;
  touch-action: none;
  /* a stick of chalk as the cursor; hotspot at its tip */
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Crect x='6' y='-2' width='9' height='30' rx='3' fill='%23f1ede2' stroke='%23999' transform='rotate(40 4 28)'/%3E%3C/svg%3E") 3 29, crosshair;
}
/* The tray along the bottom of the frame: hint, sponge and the chalk itself. */
.blackboard__tray {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: -12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .8rem;
  padding: 0 16px;
  height: 22px;
  translate: 0 50%;
  font: 500 .6rem/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.blackboard__hint { margin-right: auto; color: rgba(235, 225, 208, .55); }
.blackboard__wipe {
  padding: .3rem .6rem;
  border: 1px solid rgba(235, 225, 208, .2);
  border-radius: 2px;
  background: #6b5a45;
  color: var(--parchment);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.blackboard__chalk {
  width: 46px;
  height: 11px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: #f1ede2;
  box-shadow: 0 2px 3px rgba(0, 0, 0, .5);
  cursor: pointer;
  transition: transform .3s var(--ease-out), opacity .3s;
}
.blackboard__chalk:hover { transform: translateY(-3px) rotate(-6deg); }
.blackboard__chalk[aria-pressed="true"] { opacity: .15; transform: none; }
.blackboard__chalk:focus-visible, .blackboard__wipe:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

.translate { font-size: .98rem; }
.translate__head, .translate li { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.translate__head {
  margin: 0;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--line);
  font: 500 .66rem/1.4 var(--mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--amber);
}
.translate ul { margin: 0; padding: 0; list-style: none; }
.translate li { padding: 1rem 0; border-bottom: 1px solid rgba(193, 154, 98, .14); }
.translate li span:first-child { color: var(--parchment-dim); }
.translate li span:last-child { position: relative; color: var(--parchment); }
.translate li span:last-child::before { content: "→"; position: absolute; left: -1.15rem; color: var(--amber); }

.credentials { display: flex; flex-wrap: wrap; gap: 1rem 3rem; margin: 3rem 0 0; padding: 0; list-style: none; font-size: .92rem; color: var(--parchment-dim); }
.credentials b { display: block; color: var(--parchment); font-weight: 600; }

/* ---------- Chapter II: the flight ---------- */
.flight { position: relative; height: 720vh; margin-top: 2.5rem; }
.flight__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  margin: 0 calc(-1 * var(--gutter));
  background: #0d0b09;
}
.flight__map { position: absolute; inset: 0; width: 100%; height: 100%; }
.flight__ghost path { fill: none; stroke: var(--parchment); stroke-opacity: .16; }
.flight__trail path {
  fill: none;
  stroke: #f4e7d0;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgba(227, 163, 90, .8));
}
.flight__cities circle { fill: var(--ink-950); stroke: var(--brass); stroke-width: 1.5; transition: fill .4s; }
.flight__cities .is-reached circle { fill: var(--amber); stroke: var(--amber); }
.flight__cities text {
  font: 500 11px var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  fill: var(--parchment-faint);
  paint-order: stroke;
  stroke: #0d0b09;
  stroke-width: 3px;
  transition: fill .4s;
}
.flight__cities .is-reached text { fill: var(--parchment); }
.flight__cities .is-current text { fill: var(--amber); }
.flight__jet path { fill: #e9e2d4; stroke: #0d0b09; stroke-width: 1; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .7)); }
.flight__aurora { opacity: 0; transition: opacity 1.4s; mix-blend-mode: screen; }
.flight[data-arrived="true"] .flight__aurora { opacity: 1; }

.flight__panel {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(24px, 6vh, 64px);
  width: min(26rem, calc(100% - 2 * var(--gutter)));
  padding: 1.3rem 1.4rem;
  border: 1px solid var(--line);
  background: rgba(11, 9, 8, .78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.flight__act { margin: 0 0 .9rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); font: 500 .66rem/1.3 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--amber); }
.flight__count { margin: 0 0 .5rem; font: 400 .66rem/1 var(--mono); letter-spacing: .16em; color: var(--parchment-faint); }
.flight__count b { color: var(--amber); font-weight: 500; }
.flight__name { margin: 0; font: 300 clamp(2rem, 3.4vw, 3rem)/1 var(--serif); }
.flight__country { margin: .35rem 0 0; font: 400 .7rem/1.4 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--brass); }
.flight__caption { margin: .8rem 0 0; color: var(--parchment-dim); font-size: .95rem; }
.flight__caption:empty { display: none; }
.flight__photo { margin: 1rem 0 0; }
.flight__photo img { width: 100%; max-height: 32vh; object-fit: cover; }
.flight__hud {
  position: absolute;
  top: 84px;
  right: var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .4rem;
  font: 400 .66rem/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--parchment-faint);
}
.flight__hud b { color: var(--amber); font-weight: 500; }
.flight__bar { width: 120px; height: 1px; background: var(--line); }
.flight__bar i { display: block; height: 100%; background: var(--amber); transform-origin: 0 0; transform: scaleX(var(--progress, 0)); }

.oulu {
  max-width: 46rem;
  margin: 0 auto;
  padding: 14vh 0 2vh;
  text-align: center;
}
.oulu__title {
  margin: 0 0 1.2rem;
  font: 300 clamp(3rem, 8vw, 6.5rem)/1 var(--serif);
  background: linear-gradient(100deg, var(--parchment) 30%, #8fe3c2 50%, var(--parchment) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.oulu__lede { margin: 0 0 1.2rem; font: italic 400 1.3rem/1.4 var(--serif); color: var(--brass); }
.oulu__text { margin: 0 0 2rem; font-size: 1.08rem; color: var(--parchment-dim); }
.oulu__soon { margin: 0; font: 500 .68rem/1.4 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--parchment-faint); }

/* ---------- Chapter IV: the library ---------- */
.library {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  align-items: end;
  gap: clamp(1rem, 3vw, 2.5rem);
  margin-top: 3rem;
}
.bust { position: relative; margin: 0; aspect-ratio: 3 / 4; }
.bust__canvas { width: 100%; height: 100%; display: block; }
.bust::after {
  /* plinth */
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 2.6rem;
  height: 14px;
  background: linear-gradient(180deg, #4a3d33, #2a221c);
  box-shadow: 0 10px 20px rgba(0, 0, 0, .6);
  z-index: -1;
}
.bust__caption { text-align: center; font: italic 400 1.05rem/1.3 var(--serif); }
.bust__caption span { display: block; font: 400 .62rem/1.6 var(--mono); font-style: normal; letter-spacing: .14em; text-transform: uppercase; color: var(--parchment-faint); }
.bust__credit { display: block; margin-top: .5rem; font: 400 .66rem/1.45 var(--sans); font-style: normal; color: var(--parchment-faint); }
.bust__credit a { color: var(--parchment-dim); text-decoration-color: var(--line); text-underline-offset: 2px; }
.bust__credit a:hover { color: var(--amber); }

.shelf { position: relative; padding: 0 12px; }
.shelf__books {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: clamp(260px, 30vw, 360px);
  overflow-x: auto;
  overflow-y: visible;
  padding-top: 24px;
  scrollbar-width: none;
}
.shelf__books::-webkit-scrollbar { display: none; }
.shelf__plank {
  height: 18px;
  margin: 0 -12px;
  background: linear-gradient(180deg, #5a4331, #3b2b1f 60%, #23190f);
  box-shadow: 0 18px 30px -8px rgba(0, 0, 0, .8);
}
.spine {
  flex: none;
  position: relative;
  width: var(--w);
  height: var(--h);
  padding: 0;
  border: 0;
  border-radius: 2px 2px 0 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .35), transparent 18%, rgba(255, 255, 255, .08) 45%, transparent 60%, rgba(0, 0, 0, .3)),
    var(--c);
  color: var(--ink, var(--parchment));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25);
  cursor: pointer;
  transform-origin: 50% 100%;
  transition: transform .45s var(--ease-out), filter .3s;
}
.spine:hover { transform: translateY(-10px); }
/* The pulled book leaves a gap: only a ghost of its spine stays on the shelf. */
.spine[aria-pressed="true"] { opacity: .14; transform: none; }
.spine:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.spine__title {
  position: absolute;
  inset: 10% 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font: 500 clamp(.62rem, .9vw, .74rem)/1.1 var(--sans);
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.spine::before, .spine::after {
  /* gilt bands */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(214, 178, 110, .55);
}
.spine::before { top: 5%; }
.spine::after { bottom: 5%; }

.reading {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  margin-top: 2.5rem;
}
.reading__stage {
  position: relative;
  display: grid;
  place-items: center;
  height: 400px;
  perspective: 1100px;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}
.reading__stage.is-dragging { cursor: grabbing; }
.reading__stage::after {
  /* the book's shadow on the desk */
  content: "";
  position: absolute;
  bottom: 22px;
  width: 60%;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .65), transparent);
  pointer-events: none;
}
.reading__hint { position: absolute; bottom: 0; margin: 0; font: 400 .6rem/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--parchment-faint); }

.book3d {
  position: relative;
  width: var(--bw);
  height: var(--bh);
  transform-style: preserve-3d;
  transition: transform .25s var(--ease-out);
}
.reading__stage.is-dragging .book3d { transition: none; }
.book3d__face { position: absolute; overflow: hidden; backface-visibility: hidden; }
.book3d__front, .book3d__back {
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  padding: 1.6rem 1.3rem;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .35), transparent 7%, rgba(255, 255, 255, .06) 9%, transparent 14%),
    linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(0, 0, 0, .25)),
    var(--c);
  color: var(--ink);
  text-align: center;
  border-radius: 2px 4px 4px 2px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25);
}
.book3d__front { transform: translateZ(calc(var(--bt) / 2)); }
.book3d__front img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.book3d__back { transform: rotateY(180deg) translateZ(calc(var(--bt) / 2)); }
.book3d__title { font: 400 1.65rem/1.05 var(--serif); }
.book3d__author { font: 500 .6rem/1.3 var(--mono); letter-spacing: .18em; text-transform: uppercase; opacity: .85; }
.book3d__rule { width: 38px; height: 1px; background: currentColor; opacity: .55; }
.book3d__label { font: 500 .55rem/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; opacity: .7; }
.book3d__idea { font: italic 400 1.1rem/1.35 var(--serif); }
.book3d__spine, .book3d__pages { top: 0; left: calc((var(--bw) - var(--bt)) / 2); width: var(--bt); height: var(--bh); }
.book3d__spine {
  transform: rotateY(-90deg) translateZ(calc(var(--bw) / 2));
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  background: linear-gradient(90deg, rgba(0, 0, 0, .3), rgba(255, 255, 255, .08) 50%, rgba(0, 0, 0, .3)), var(--c);
  color: var(--ink);
  font: 500 .62rem/1 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.book3d__pages {
  transform: rotateY(90deg) translateZ(calc(var(--bw) / 2));
  background: repeating-linear-gradient(90deg, #efe7d6 0 1px, #d9cfbb 1px 2px);
}
.book3d__top, .book3d__bottom { left: 0; top: calc((var(--bh) - var(--bt)) / 2); width: var(--bw); height: var(--bt); background: repeating-linear-gradient(0deg, #efe7d6 0 1px, #d9cfbb 1px 2px); }
.book3d__top { transform: rotateX(90deg) translateZ(calc(var(--bh) / 2)); }
.book3d__bottom { transform: rotateX(-90deg) translateZ(calc(var(--bh) / 2)); }

.book-card {
  padding: 1.6rem 1.8rem;
  border-left: 2px solid var(--amber);
  background: linear-gradient(90deg, rgba(193, 154, 98, .08), transparent);
}
.book-card__shelf, .book-card__label { margin: 0 0 .5rem; font: 500 .64rem/1.4 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--amber); }
.book-card__title { margin: 0; font: 400 clamp(1.8rem, 3vw, 2.6rem)/1.05 var(--serif); }
.book-card__author { margin: .3rem 0 1.4rem; font: italic 400 1.1rem var(--serif); color: var(--parchment-dim); }
.book-card__label { color: var(--parchment-faint); }
.book-card__idea { margin: 0; font-size: 1.08rem; }

/* ---------- Chapter V: the crate ---------- */
/* Two columns: the player stays in view (sticky) while you browse the crate on the right. */
.listening { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; align-items: start; gap: clamp(1.5rem, 4vw, 3.5rem); margin-top: 3rem; }
.listening__player { position: sticky; top: 96px; display: grid; gap: 1.6rem; }
.turntable {
  position: relative;
  flex: none;
  width: clamp(220px, 28vw, 320px);
  aspect-ratio: 1.15;
  border-radius: 10px;
  background: linear-gradient(145deg, #2c241e, #16110d);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.turntable__platter {
  position: absolute;
  left: 8%;
  top: 50%;
  width: 72%;
  aspect-ratio: 1;
  translate: 0 -50%;
  border-radius: 50%;
  background: #0b0908;
  box-shadow: 0 0 0 4px #3a2f27;
}
.record {
  position: absolute;
  inset: 2%;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 30%, rgba(255, 255, 255, .05) 31%, transparent 32%, transparent 45%, rgba(255, 255, 255, .04) 46%, transparent 47% 60%, rgba(255, 255, 255, .05) 61%, transparent 62%),
    conic-gradient(from 30deg, #111 0 10%, #262626 15%, #111 25% 60%, #232323 65%, #111 75%);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateX(40%) scale(.9);
  transition: opacity .5s, transform .7s var(--ease-out);
}
.turntable.is-playing .record { opacity: 1; transform: none; animation: spin 1.8s linear infinite; }
.record__label { width: 34%; aspect-ratio: 1; border-radius: 50%; background: var(--sleeve, var(--amber)); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .2); }
.turntable__arm {
  position: absolute;
  right: 9%;
  top: 12%;
  width: 6px;
  height: 58%;
  border-radius: 3px;
  background: linear-gradient(90deg, #c9c2b6, #8a8277);
  transform-origin: 50% 6%;
  transform: rotate(-4deg);
  transition: transform .8s var(--ease-out) .3s;
}
.turntable.is-playing .turntable__arm { transform: rotate(22deg); }
@keyframes spin { to { rotate: 360deg; } }

.now-playing__label, .now-playing__note { margin: 0 0 .5rem; font: 500 .64rem/1.4 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--amber); }
.now-playing__title { margin: 0; font: 300 clamp(1.8rem, 3.4vw, 3rem)/1.05 var(--serif); }
.now-playing__artist { margin: .4rem 0 1.4rem; font: italic 400 1.15rem var(--serif); color: var(--parchment-dim); }
.now-playing__note { color: var(--parchment-faint); }

/* The closed crate: a wooden box with record tops sticking out. */
.crate-box {
  position: relative;
  display: block;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--parchment);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.crate-box__tops { display: flex; justify-content: center; gap: 6px; height: 74px; padding: 0 9%; }
.crate-box__tops i {
  flex: 1;
  align-self: flex-end;
  height: 100%;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(150deg, rgba(255, 255, 255, .14), rgba(0, 0, 0, .25)), var(--c, #5a1d1b);
  transition: transform .45s var(--ease-out);
}
.crate-box__tops i:nth-child(2) { --c: #1f2a36; height: 86%; }
.crate-box__tops i:nth-child(3) { --c: #c9a227; height: 94%; }
.crate-box__tops i:nth-child(4) { --c: #23402f; height: 80%; }
.crate-box__tops i:nth-child(5) { --c: #d2601a; height: 90%; }
.crate-box__tops i:nth-child(6) { --c: #3b2f5c; height: 84%; }
.crate-box__tops i:nth-child(7) { --c: #e9e4da; height: 96%; }
.crate-box:hover .crate-box__tops i { transform: translateY(-10px); }
.crate-box:hover .crate-box__tops i:nth-child(odd) { transform: translateY(-16px) rotate(-2deg); }
.crate-box__front {
  position: relative;
  display: grid;
  gap: .3rem;
  justify-items: center;
  padding: 1.6rem 1rem 1.4rem;
  border-radius: 4px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .12) 0 2px, transparent 2px 120px),
    linear-gradient(180deg, #6a4a31, #4a3221);
  box-shadow: 0 30px 50px -24px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.crate-box__front b { font: 300 clamp(2rem, 3.6vw, 2.8rem)/1 var(--serif); }
.crate-box__front span { color: var(--parchment-dim); font-size: .9rem; }
.crate-box__front em {
  margin-top: .7rem;
  padding: .55rem 1rem;
  border-radius: 999px;
  background: var(--amber);
  color: var(--ink-950);
  font: 600 .82rem/1 var(--sans);
  font-style: normal;
}
.crate-box:focus-visible { outline: 2px solid var(--amber); outline-offset: 6px; }
.crate-box[hidden] { display: none; }

/* The opened crate: every record on a shelf, in the order they were learned. */
.shelf-records__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 1.4rem; }
.shelf-records__filters { display: flex; gap: .4rem; }
.shelf-records__filters button {
  padding: .5rem .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--parchment-dim);
  font: 500 .66rem/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}
.shelf-records__filters button[aria-pressed="true"] { border-color: var(--amber); background: rgba(227, 163, 90, .12); color: var(--amber); }
.shelf-records__axis { display: flex; align-items: center; gap: .7rem; flex: 1; min-width: 220px; margin: 0; font: 400 .6rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--parchment-faint); }
.shelf-records__axis i { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), var(--amber)); position: relative; }
.shelf-records__axis i::after { content: ""; position: absolute; right: -2px; top: -3px; border: 3.5px solid transparent; border-left: 6px solid var(--amber); }
.shelf-records__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 14px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.shelf-records__list li[hidden] { display: none; }
.shelf-records__info { min-height: 1.6rem; margin: 1.4rem 0 0; color: var(--parchment-dim); font-size: .95rem; }

/* One record: a square sleeve with its number; on hover the disc slides out of it. */
.lp {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.lp__sleeve {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 2px;
  background: linear-gradient(150deg, rgba(255, 255, 255, .14), rgba(0, 0, 0, .28)), var(--sleeve);
  color: var(--sleeve-ink);
  overflow: hidden;
  box-shadow: 0 8px 14px -8px rgba(0, 0, 0, .9);
  transition: transform .3s var(--ease-out);
}
.lp__no { position: absolute; left: 6px; top: 5px; font: 500 .56rem/1 var(--mono); letter-spacing: .08em; opacity: .85; }
.lp__mark { position: absolute; right: -8%; bottom: -22%; font: 300 2.8rem/1 var(--serif); opacity: .3; }
.lp__disc {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--sleeve) 0 15%, #0c0c0c 16% 18%, transparent 19%),
    repeating-radial-gradient(circle, #111 0 2px, #1d1d1d 2px 3px);
  transition: transform .35s var(--ease-out);
}
.lp:hover .lp__disc, .lp:focus-visible .lp__disc, .lp[aria-pressed="true"] .lp__disc { transform: translateX(34%); }
.lp:hover .lp__sleeve, .lp:focus-visible .lp__sleeve { transform: translateX(-6%); }
.lp:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
/* By heart: a gold star; still learning: a dashed edge. */
.lp--heart .lp__sleeve::after { content: "★"; position: absolute; right: 5px; top: 3px; color: #f2c46d; font-size: .7rem; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.lp--heart .lp__sleeve { box-shadow: 0 8px 14px -8px rgba(0, 0, 0, .9), inset 0 0 0 1.5px rgba(242, 196, 109, .8); }
.lp--learning .lp__sleeve { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5); outline: 1px dashed rgba(255, 255, 255, .5); outline-offset: -5px; }

/* ---------- Chapter VI: the personnel database ---------- */
.db {
  position: relative;
  margin-top: 2.5rem;
  border: 1px solid var(--line);
  background-color: #0a0908;
  background-image:
    linear-gradient(rgba(193, 154, 98, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(193, 154, 98, .045) 1px, transparent 1px);
  background-size: 24px 24px;
  font-family: var(--mono);
}
/* CRT scanlines over the whole terminal. */
.db::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px);
}
.db__banner {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 0;
  padding: .85rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(227, 163, 90, .06);
  font-size: .66rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--amber);
}
.db__led { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); animation: blink 1.6s steps(2, jump-none) infinite; }
.db__cursor { animation: blink 1s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: .15; } }
.db__tag { margin: 0; padding: .9rem 1.2rem; font-size: .6rem; letter-spacing: .22em; text-transform: uppercase; color: var(--parchment-faint); }

.db__top { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.cockpit {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 58vh;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: radial-gradient(80% 70% at 50% 45%, rgba(227, 163, 90, .07), transparent 70%);
}
.cockpit .db__tag { position: absolute; top: 0; left: 0; z-index: 1; }
/* Corner brackets of the display. */
.cockpit::before {
  content: "";
  position: absolute;
  inset: 14px;
  pointer-events: none;
  opacity: .6;
  --c: var(--amber);
  background:
    linear-gradient(var(--c), var(--c)) top left / 18px 1px,
    linear-gradient(var(--c), var(--c)) top left / 1px 18px,
    linear-gradient(var(--c), var(--c)) top right / 18px 1px,
    linear-gradient(var(--c), var(--c)) top right / 1px 18px,
    linear-gradient(var(--c), var(--c)) bottom left / 18px 1px,
    linear-gradient(var(--c), var(--c)) bottom left / 1px 18px,
    linear-gradient(var(--c), var(--c)) bottom right / 18px 1px,
    linear-gradient(var(--c), var(--c)) bottom right / 1px 18px;
  background-repeat: no-repeat;
}
.cockpit__hud { position: absolute; inset: 0; width: 100%; height: 100%; }
.cockpit__line { fill: none; stroke: var(--amber); stroke-width: 1.4; vector-effect: non-scaling-stroke; opacity: .85; }
.cockpit__line--main { opacity: .6; }
.cockpit__ladder text, .cockpit__heading text { font: 500 9px var(--mono); fill: var(--amber); opacity: .7; }
/* Text sits low, so the reticle in the middle stays clear. */
.cockpit__text { position: relative; align-self: end; max-width: 34rem; padding: 2rem var(--gutter) 2.4rem; text-align: center; text-shadow: 0 2px 20px #0b0908; }
.cockpit__line-text { margin: 0; font: 300 clamp(1.6rem, 2.8vw, 2.5rem)/1.12 var(--serif); }

.profile dl { margin: 0; padding: 0 1.2rem 1.2rem; }
.profile dl div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; padding: .7rem 0; border-top: 1px dashed rgba(193, 154, 98, .18); }
.profile dt { font-size: .6rem; letter-spacing: .18em; text-transform: uppercase; color: var(--parchment-faint); line-height: 1.9; }
.profile dd { margin: 0; font-size: .8rem; line-height: 1.6; color: var(--parchment); }
.profile__status { color: var(--amber) !important; }
.profile__status::before { content: "● "; animation: blink 1.6s steps(2, jump-none) infinite; }

.records__head, .rec {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) minmax(0, 1.7fr) 8rem;
  gap: 1.2rem;
  align-items: baseline;
  padding: .95rem 1.2rem;
}
.records__head { padding-top: 0; font-size: .58rem; letter-spacing: .2em; text-transform: uppercase; color: var(--parchment-faint); }
.records__list { margin: 0; padding: 0; list-style: none; }
.rec { border-top: 1px solid rgba(193, 154, 98, .14); transition: background-color .3s; }
.rec:hover { background: rgba(227, 163, 90, .05); }
.rec__id { font-size: .66rem; letter-spacing: .12em; color: var(--amber); }
.rec b { font: 600 .9rem/1.4 var(--sans); color: var(--parchment); }
.rec__secret { font: 400 .9rem/1.5 var(--sans); color: var(--parchment-dim); }
/* Until declassified: blacked out, like a redacted file. */
.rec:not(.is-declassified) .rec__secret {
  color: transparent;
  background: linear-gradient(transparent 18%, #2a2420 18% 82%, transparent 82%);
  user-select: none;
}
.rec__status { justify-self: end; font-size: .58rem; letter-spacing: .2em; text-transform: uppercase; color: #b4533a; }
.rec.is-declassified .rec__status { color: var(--amber); }

/* ---------- Interlude: the toolkit (a sealed envelope full of stamps) ---------- */
.toolkit { display: flex; flex-direction: column; align-items: center; margin-top: 3rem; }

/* The envelope, seen from the back: a flap held shut by a wax seal. */
.mail {
  position: relative;
  width: min(520px, 100%);
  aspect-ratio: 1.6;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 900px;
  transition: width .7s var(--ease-out);
}
.mail:focus-visible { outline: 2px solid var(--amber); outline-offset: 8px; }
.mail__inside, .mail__body, .mail__flap { position: absolute; left: 0; right: 0; }
.mail__inside { inset: 0; background: #3a2c22; border-radius: 4px; }
.mail__body {
  inset: 0;
  z-index: 2;
  border-radius: 4px;
  background:
    linear-gradient(to top right, transparent 49.6%, rgba(0, 0, 0, .1) 50%, transparent 50.4%) left bottom / 50% 100% no-repeat,
    linear-gradient(to top left, transparent 49.6%, rgba(0, 0, 0, .1) 50%, transparent 50.4%) right bottom / 50% 100% no-repeat,
    linear-gradient(170deg, #f4ecdc, #e6d9bf);
  clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
  box-shadow: 0 40px 70px -30px rgba(0, 0, 0, .9);
}
.mail__flap {
  top: 0;
  z-index: 3;
  height: 58%;
  background: linear-gradient(180deg, #ebdfc6, #dccdae);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0;
  transition: transform .6s cubic-bezier(.5, 0, .3, 1), z-index 0s .3s;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .25));
}
.mail__postmark {
  position: absolute;
  right: 6%;
  bottom: 12%;
  display: grid;
  place-items: center;
  width: 92px;
  aspect-ratio: 1;
  border: 2px solid rgba(143, 42, 34, .55);
  border-radius: 50%;
  color: rgba(143, 42, 34, .65);
  font: 600 .58rem/1.2 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  transform: rotate(-14deg);
}
.mail__to { position: absolute; left: 8%; bottom: 12%; font: 600 clamp(1.2rem, 2.6vw, 1.8rem)/1 "Caveat", cursive; color: #1b3a6b; transform: rotate(-3deg); }
.mail__seal {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 58%;
  width: clamp(54px, 9vw, 74px);
  aspect-ratio: 1;
  translate: -50% -50%;
}
.mail__seal i {
  position: absolute;
  inset: 0;
  border-radius: 48% 52% 50% 46% / 52% 46% 54% 48%;
  background: radial-gradient(circle at 35% 30%, #c0463a, #8f2a22 55%, #5e1712);
  box-shadow: 0 3px 5px rgba(0, 0, 0, .45);
  transition: transform .5s cubic-bezier(.5, 0, .7, 1), opacity .5s;
}
.mail__seal i:first-child { clip-path: polygon(0 0, 54% 0, 44% 50%, 56% 100%, 0 100%); }
.mail__seal i:last-child { clip-path: polygon(54% 0, 100% 0, 100% 100%, 56% 100%, 44% 50%); box-shadow: none; }
.mail__seal i::after {
  /* the monogram pressed into the wax */
  content: "";
  position: absolute;
  inset: 12%;
  background: rgba(0, 0, 0, .38);
  -webkit-mask: url("../assets/signature-ink.png") center / contain no-repeat;
  mask: url("../assets/signature-ink.png") center / contain no-repeat;
}
.mail__hint {
  position: absolute;
  left: 50%;
  bottom: -2.6rem;
  translate: -50% 0;
  font: 500 .66rem/1 var(--mono);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--amber);
  white-space: nowrap;
  animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: .72; } } /* never fainter than WCAG AA allows */
.mail:hover .mail__seal { animation: wiggle .5s ease-in-out; }
@keyframes wiggle { 30% { rotate: -6deg; } 70% { rotate: 5deg; } }

/* Opening: the seal splits, the flap lifts. */
.toolkit:not([data-open="false"]) .mail { cursor: default; }
.toolkit:not([data-open="false"]) .mail__flap { transform: rotateX(180deg); z-index: 1; }
.toolkit:not([data-open="false"]) .mail__seal i:first-child { transform: translate(-30px, 60px) rotate(-40deg); opacity: 0; }
.toolkit:not([data-open="false"]) .mail__seal i:last-child { transform: translate(30px, 70px) rotate(35deg); opacity: 0; }
.toolkit:not([data-open="false"]) .mail__hint { opacity: 0; animation: none; }
/* the lifted flap sticks out above the opened envelope, so leave room for it */
.toolkit[data-open="true"] .mail { width: min(300px, 70%); margin-top: 8rem; }

/* The stamps, scattered on the desk. */
.stamps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* an uneven last row stays centred */
  gap: 1.8rem 1.6rem;
  width: 100%;
  max-width: 800px; /* five to a row: fifteen stamps make three even rows */
}
.stamps[hidden] { display: none; }
.stamp {
  width: 118px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform: rotate(var(--r, 0deg));
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .55));
  transition: transform .35s var(--ease-out), filter .35s;
}
.stamp:hover, .stamp:focus-visible, .stamp.is-picked { transform: translateY(-8px) rotate(0deg) scale(1.06); filter: drop-shadow(0 16px 16px rgba(0, 0, 0, .6)); outline: none; }
.stamp:focus-visible .stamp__paper { box-shadow: inset 0 0 0 2px var(--amber); }
/* Perforated edge: a solid content-box plus a row of punched holes around the padding. */
.stamp__paper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: #f6efe0;
  color: #241c16;
  -webkit-mask: radial-gradient(circle 3.5px, #0000 96%, #000) -5.5px -5.5px / 11px 11px round, linear-gradient(#000 0 0) content-box;
  mask: radial-gradient(circle 3.5px, #0000 96%, #000) -5.5px -5.5px / 11px 11px round, linear-gradient(#000 0 0) content-box;
}
.stamp__paper::before {
  /* the printed inner frame */
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(36, 28, 22, .2);
  pointer-events: none;
}
.stamp__art {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  margin: 4px 4px 0;
  border-radius: 22%;
  background: var(--brand, #241c16);
  color: #fff;
}
.stamp__art svg { width: 52%; height: 52%; fill: currentColor; }
/* Office icons are full-colour artwork on a white tile, like their app icons. */
.stamp__art--office { background: #fff; }
.stamp__art--office svg { width: 74%; height: 74%; }
.stamp__art b { font: 700 2.4rem/1 var(--sans); }
.stamp__label { display: flex; justify-content: space-between; gap: .3rem; padding: 0 4px 2px; font: 500 .5rem/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.stamp__label span:last-child { text-align: right; font-weight: 600; }
/* Some stamps are already franked: wavy cancellation lines in red-brown ink. */
.stamp--franked .stamp__paper::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 12px;
  width: 70%;
  height: 40%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 40' fill='none' stroke='%238f2a22' stroke-width='1.6'%3E%3Cpath d='M0 8q10-6 20 0t20 0 20 0 20 0M0 18q10-6 20 0t20 0 20 0 20 0M0 28q10-6 20 0t20 0 20 0 20 0'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .5;
  transform: rotate(-12deg);
  pointer-events: none;
}
.stamp--blank .stamp__art { background: transparent; border: 1.5px dashed rgba(36, 28, 22, .35); color: var(--brass-deep); }

.stamps__caption {
  min-height: 3.2rem;
  margin: 2.2rem 0 0;
  text-align: center;
}
.stamps__caption b { display: block; font: 400 clamp(1.6rem, 2.6vw, 2.2rem)/1.1 var(--serif); }
.stamps__caption span { color: var(--parchment-dim); }

/* ---------- Chapter III: the dossier drawer ---------- */
.chapter--builder {
  --paper: #f1e8d6;
  --manila: #c9b083;
  --ink: #2a211a;
  --ink-soft: #5a4a3b;
  --rust: #8f3b22;
}
.cabinet {
  position: relative;
  max-width: 980px;
  height: 230px;
  margin: 3.5rem auto 0;
}
.cabinet__folders { position: absolute; inset: 0 3%; }
.folder {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(34px + var(--i) * 26px);
  z-index: var(--i);
  height: 150px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: linear-gradient(180deg, #d8c196, var(--manila));
  box-shadow: 0 -1px 0 rgba(255, 255, 255, .25) inset, 0 -8px 18px -10px rgba(0, 0, 0, .6);
  font: inherit;
  cursor: pointer;
  transform: translateY(90px);
  opacity: 0;
  transition:
    transform .9s var(--ease-out) calc(var(--i) * 90ms + 150ms),
    opacity .5s calc(var(--i) * 90ms + 150ms),
    filter .3s;
}
.cabinet[data-open="true"] .folder { transform: none; opacity: 1; }
.cabinet[data-open="true"] .folder[aria-selected="true"] { transform: translateY(-18px); transition-delay: 0s; }
.cabinet[data-open="true"] .folder:not([aria-selected="true"]):hover { transform: translateY(-6px); transition-delay: 0s; }
.folder:not([aria-selected="true"]) { filter: brightness(.82); }
.folder__tab {
  position: absolute;
  top: -27px;
  left: calc(4% + var(--i) * 31%);
  width: 29%;
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .8rem;
  border-radius: 6px 6px 0 0;
  background: #d8c196;
  color: var(--ink);
  font: 500 .7rem/1.2 var(--mono);
  letter-spacing: .1em;
  text-align: left;
  text-transform: uppercase;
}
.folder__tab b { color: var(--rust); font-weight: 500; }
.folder[aria-selected="true"] .folder__tab { background: var(--paper); }
.folder:focus-visible { outline: none; }
.folder:focus-visible .folder__tab { outline: 2px solid var(--amber); outline-offset: 2px; }

.cabinet__front {
  position: absolute;
  inset: auto 0 0;
  z-index: 10;
  height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .05), transparent 30%),
    linear-gradient(180deg, #2b221c, #1a1410);
  border-top: 1px solid rgba(193, 154, 98, .5);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(0, 0, 0, .6);
  transition: transform .9s var(--ease-out);
}
.cabinet[data-open="true"] .cabinet__front { transform: translateY(18px); }
.cabinet__label {
  padding: .3rem .9rem;
  border: 1px solid rgba(193, 154, 98, .55);
  background: var(--paper);
  color: var(--ink);
  font: 500 .64rem/1 var(--mono);
  letter-spacing: .2em;
  text-transform: uppercase;
}
.cabinet__handle {
  width: 130px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ecd3a2, #a07a43 60%, #6d5230);
  box-shadow: 0 4px 8px rgba(0, 0, 0, .6);
}

/* The open file: a manila folder with photos pinned left and the typed sheet right. */
.dossier {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(1.5rem, 3.5vw, 3rem);
  max-width: 1120px;
  margin: 3.2rem auto 0;
  padding: clamp(1.2rem, 3.5vw, 3rem);
  border-radius: 6px;
  background: linear-gradient(180deg, #cfb78c, #bea477);
  box-shadow: 0 50px 90px -40px rgba(0, 0, 0, .9);
  color: var(--ink);
  animation: file-in .7s var(--ease-out);
}
.dossier[hidden] { display: none; }
@keyframes file-in { from { opacity: 0; transform: translateY(24px); } }
.dossier--empty { grid-template-columns: 1fr; max-width: 720px; }

.dossier__board {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  align-content: start;
  gap: 1.6rem 1.2rem;
  padding-top: .6rem;
}
.polaroid {
  position: relative;
  margin: 0;
  padding: 10px 10px 0;
  background: #fbf8f2;
  box-shadow: 0 14px 26px -12px rgba(0, 0, 0, .55);
  transform: rotate(var(--r, 0deg));
  transition: transform .4s var(--ease-out);
}
.polaroid:hover { transform: rotate(0deg) scale(1.02); }
.polaroid::before {
  /* the pin */
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  translate: -50% 0;
  background: radial-gradient(circle at 35% 35%, #f0d39c, #a67b3a 55%, #5d4220);
  box-shadow: 0 3px 4px rgba(0, 0, 0, .45);
}
.polaroid img { width: 100%; }
.polaroid figcaption { padding: .55rem 0 .7rem; font: italic 400 1rem/1.2 var(--serif); color: var(--ink-soft); text-align: center; }
.polaroid--lead { grid-column: 1 / -1; }
.polaroid--tall img { aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 30%; }
.polaroid__blank {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border: 1px dashed rgba(42, 33, 26, .3);
  background: #efe8da;
  font: 500 .7rem/1.6 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-soft);
}

.dossier__sheet {
  position: relative;
  padding: clamp(1.4rem, 3.5vw, 2.8rem);
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .08), 0 24px 40px -24px rgba(0, 0, 0, .6);
}
.dossier__stamp {
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  margin: 0;
  padding: .3rem .7rem;
  border: 2px solid var(--rust);
  border-radius: 3px;
  color: var(--rust);
  font: 500 .66rem/1 var(--mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  transform: rotate(-7deg);
  opacity: .95;
}
.dossier__kicker { margin: 0 0 .6rem; font: 500 .68rem/1.4 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); }
.dossier__title { margin: 0 0 .6rem; font: 400 clamp(2.2rem, 4.2vw, 3.4rem)/1 var(--serif); padding-right: 7.5rem; }
.dossier__tagline { margin: 0 0 1.8rem; font: italic 400 clamp(1.15rem, 1.6vw, 1.4rem)/1.35 var(--serif); color: var(--ink-soft); }
.dossier__facts { margin: 0 0 2rem; border-top: 1px solid rgba(42, 33, 26, .2); }
.dossier__facts div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  padding: .55rem 0;
  border-bottom: 1px dashed rgba(42, 33, 26, .2);
}
.dossier__facts dt { font: 500 .64rem/1.9 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.dossier__facts dd { margin: 0; font-size: .95rem; }
.dossier__body h4 { margin: 1.6rem 0 .4rem; font: 500 .68rem/1.4 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--rust); }
.dossier__body p { margin: 0; font-size: .98rem; line-height: 1.65; color: #3a2e24; }
.dossier__steps {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: .4rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.dossier__steps li {
  counter-increment: step;
  padding: .35rem .65rem;
  border: 1px solid rgba(42, 33, 26, .25);
  border-radius: 999px;
  font-size: .82rem;
}
.dossier__steps li::before { content: counter(step, decimal-leading-zero) " "; font: 500 .66rem var(--mono); color: var(--rust); }
.dossier__quote { margin: 2rem 0; padding-left: 1.2rem; border-left: 2px solid var(--rust); }
.dossier__quote p { margin: 0 0 .5rem; font: italic 400 clamp(1.3rem, 2vw, 1.65rem)/1.3 var(--serif); }
.dossier__quote footer { font: 500 .64rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.btn--paper { margin-top: .4rem; background: var(--ink); color: var(--paper); }
.btn--paper:hover { background: #3d3026; }

/* ---------- Epilogue ---------- */
.epilogue {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 6rem);
  max-width: 1440px;
  margin: 0 auto;
  padding: 18vh var(--gutter) 22vh;
  border-top: 1px solid var(--line);
  overflow-x: clip;
}
.epilogue__text { position: relative; z-index: 2; }
.epilogue__title { margin: 0 0 1.6rem; font: 300 clamp(2.7rem, 5.6vw, 5.8rem)/1 var(--serif); letter-spacing: -.01em; }
.epilogue__lede { max-width: 34rem; margin: 0 0 2.2rem; color: var(--parchment-dim); }
.epilogue__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 2.6rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1.4rem;
  border-radius: 999px;
  font: 600 .9rem/1 var(--sans);
  text-decoration: none;
  transition: transform .25s var(--ease-out), background-color .25s, border-color .25s;
}
.btn:active { transform: scale(.97); }
.btn--solid { background: var(--amber); color: var(--ink-950); }
.btn--solid:hover { background: #ecb574; }
.btn--ghost { border: 1px solid var(--line); color: var(--parchment); }
.btn--ghost:hover { border-color: var(--brass); }
.epilogue__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 2.4rem;
  margin: 0;
  padding: 1.4rem 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
  font-size: .92rem;
}
.epilogue__facts span {
  display: block;
  font: 400 .64rem/1.6 var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--brass);
}

/* ---------- "Let's talk": an envelope that opens, with a wax seal that breaks on click ---------- */
.talk {
  --seal: #8f2a22;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  padding: .55rem 1.3rem .55rem .6rem;
  border-radius: 999px;
  background: var(--amber);
  color: var(--ink-950);
  font: 600 .95rem/1 var(--sans);
  text-decoration: none;
  /* --mx/--my: the magnetic pull towards the cursor (js/talk.js) */
  transform: translate(var(--mx, 0px), var(--my, 0px));
  transition: transform .35s var(--ease-out), background-color .3s, box-shadow .3s;
  box-shadow: 0 10px 30px -12px rgba(227, 163, 90, .6);
}
.talk:hover { background: #ecb574; box-shadow: 0 14px 40px -10px rgba(227, 163, 90, .8); }
.talk:focus-visible { outline: 2px solid var(--parchment); outline-offset: 4px; }
.talk__envelope {
  position: relative;
  width: 44px;
  height: 30px;
  perspective: 120px;
}
.talk__pocket, .talk__flap, .talk__letter { position: absolute; left: 0; right: 0; }
/* the envelope body: a paper rectangle with the two folded side seams drawn in */
.talk__pocket {
  inset: 0;
  z-index: 2;
  border-radius: 3px;
  background:
    linear-gradient(to top right, transparent 49%, rgba(0, 0, 0, .14) 50%, transparent 51%) left / 50% 100% no-repeat,
    linear-gradient(to top left, transparent 49%, rgba(0, 0, 0, .14) 50%, transparent 51%) right / 50% 100% no-repeat,
    #f1e8d6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .25);
}
.talk__flap {
  top: 0;
  z-index: 3;
  height: 17px;
  background: #e6dac2;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0;
  transition: transform .45s var(--ease-out), z-index 0s .2s;
}
.talk__letter {
  top: 3px;
  left: 4px;
  right: 4px;
  z-index: 1;
  height: 26px;
  padding: 3px 3px 0;
  border-radius: 2px;
  background: #fffaf0;
  color: var(--ink-950);
  font: 500 .42rem/1 "Caveat", cursive;
  white-space: nowrap;
  overflow: hidden;
  transition: transform .45s var(--ease-out) .08s;
}
.talk__seal {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 11px;
  width: 15px;
  height: 15px;
  translate: -50% 0;
  border-radius: 48% 52% 50% 46% / 52% 46% 54% 48%;
  background: radial-gradient(circle at 35% 30%, #c0463a, var(--seal) 55%, #5e1712);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  transition: transform .35s var(--ease-out), opacity .35s;
}
.talk__seal::after {
  /* the monogram pressed into the wax: Mauritz's signature */
  content: "";
  position: absolute;
  inset: 2px;
  background: rgba(0, 0, 0, .35);
  -webkit-mask: url("../assets/signature-ink.png") center / contain no-repeat;
  mask: url("../assets/signature-ink.png") center / contain no-repeat;
}
.talk:hover .talk__flap, .talk:focus-visible .talk__flap { transform: rotateX(180deg); z-index: 0; transition-delay: 0s, 0s; }
.talk:hover .talk__letter, .talk:focus-visible .talk__letter { transform: translateY(-15px); }
.talk:hover .talk__seal, .talk:focus-visible .talk__seal { transform: translateY(-14px) scale(.8); opacity: 0; }
.talk__arrow { transition: transform .3s var(--ease-out); }
.talk:hover .talk__arrow { transform: translateX(4px); }
/* On click the seal "breaks": two halves fly apart (see .is-breaking in js/talk.js). */
.talk.is-breaking .talk__seal { opacity: 1; transform: scale(1.6) rotate(18deg); filter: blur(1px); transition-duration: .25s; }

/* ---------- Résumé dialog: password, with a drawer that slides out "or contact me" ---------- */
.cv {
  overflow: visible; /* the drawer slides out past the edge */
  width: min(420px, calc(100vw - 2 * var(--gutter) - 48px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(170deg, #f6eedf, #ebe0cc);
  color: #241c16;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .8);
}
.cv::backdrop { background: rgba(11, 9, 8, .7); backdrop-filter: blur(6px); }
.cv__form { position: relative; z-index: 2; padding: 2rem 1.8rem 1.8rem; background: inherit; border-radius: inherit; }
.cv__close { position: absolute; top: .7rem; right: .9rem; border: 0; background: none; font-size: 1.5rem; color: #5a4a3b; cursor: pointer; }
.cv__kicker { margin: 0 0 .5rem; font: 500 .62rem/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: #8f3b22; }
.cv__title { margin: 0 0 .6rem; font: 400 1.9rem/1.1 var(--serif); }
.cv__text { margin: 0 0 1.2rem; font-size: .92rem; color: #5a4a3b; }
.cv__label { display: block; margin-bottom: .3rem; font: 500 .62rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #5a4a3b; }
.cv__input { width: 100%; padding: .7rem .8rem; border: 1px solid rgba(36, 28, 22, .25); border-radius: 4px; background: #fffaf0; font: 500 1rem var(--mono); letter-spacing: .1em; }
.cv__input:focus { outline: 2px solid #8f3b22; outline-offset: 1px; }
.cv__error { min-height: 1.3rem; margin: .4rem 0 .6rem; font-size: .82rem; color: #8f3b22; }
.cv__unlock { width: 100%; padding: .8rem; border: 0; border-radius: 999px; background: #241c16; color: #f3ead9; font: 600 .9rem var(--sans); cursor: pointer; }
.cv__unlock:disabled { opacity: .6; cursor: progress; }
/* The drawer hides behind the card; its tab sticks out on the right. */
.cv__drawer {
  position: absolute;
  z-index: 1;
  top: 1.4rem;
  right: 0;
  width: 240px;
  transform: translateX(calc(100% - 36px));
  transition: transform .5s var(--ease-out);
}
.cv.is-drawer-open .cv__drawer { transform: translateX(calc(100% + 8px)); }
.cv__tab {
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 150px;
  padding: 0;
  border: 0;
  border-radius: 0 6px 6px 0;
  background: var(--amber);
  color: var(--ink-950);
  font: 600 .66rem/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  cursor: pointer;
}
.cv.is-drawer-open .cv__tab { left: -36px; border-radius: 6px 0 0 6px; }
.cv__panel { margin-left: 36px; padding: 1rem; border-radius: 0 6px 6px 0; background: var(--ink-900); color: var(--parchment); font-size: .85rem; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .8); }
.cv.is-drawer-open .cv__panel { margin-left: 0; border-radius: 6px; }
.cv__panel p { margin: 0 0 .6rem; color: var(--parchment-dim); }
.cv__copy { display: grid; gap: .3rem; width: 100%; padding: .6rem; border: 1px solid var(--line); border-radius: 4px; background: none; color: var(--parchment); font: 500 .8rem var(--sans); text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.cv__copy span { font: 500 .6rem var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--amber); }
/* On phones there's no room beside the card: the drawer opens underneath it. */
@media (max-width: 899px) {
  .cv { width: calc(100vw - 2 * var(--gutter)); }
  .cv__drawer { position: static; width: auto; transform: none; }
  .cv__tab { position: static; width: 100%; height: auto; padding: .7rem; border-radius: 0 0 6px 6px; writing-mode: horizontal-tb; }
  .cv__panel { display: none; margin: 0; border-radius: 0 0 6px 6px; }
  .cv.is-drawer-open .cv__panel { display: block; }
  .cv.is-drawer-open .cv__drawer { transform: none; }
  .cv.is-drawer-open .cv__tab { border-radius: 0; }
}

/* The curtain that falls when leaving for another page (and lifts when one opens). */
.curtain {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--ink-950);
  pointer-events: none;
  opacity: 0;
  transition: opacity .45s var(--ease-out);
}
body.is-leaving .curtain { opacity: 1; }
/* Arriving on the contact page, the curtain lifts by itself (pure CSS, so it can never get stuck). */
.contact-page .curtain { animation: curtain-lift .5s var(--ease-out) .05s both; }
body.contact-page.is-leaving .curtain { animation: none; }
@keyframes curtain-lift { from { opacity: 1; } to { opacity: 0; } }

/* Portrait hung like a painting in the study. */
.portrait { position: relative; z-index: 1; margin: 0; justify-self: center; width: min(100%, 440px); }
.portrait__frame {
  position: relative;
  padding: 10px;
  background: linear-gradient(135deg, #6f5330, #d8bb88 30%, #8c6a3c 55%, #c9a571 80%, #5f4528);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(0, 0, 0, .5);
}
.portrait__frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .55), inset 0 0 30px rgba(0, 0, 0, .35);
  pointer-events: none;
}
.portrait__frame img { aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 20%; width: 100%; }
.plaque {
  width: max-content;
  max-width: 100%;
  margin: 1.4rem auto 0;
  padding: .7rem 1.1rem;
  background: linear-gradient(180deg, #e3d6bf, #cdbb98);
  color: #33261a;
  border-radius: 2px;
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .7);
  font: 400 .78rem/1.35 var(--sans);
  text-align: center;
}
.plaque strong { font: 600 .9rem var(--serif); letter-spacing: .06em; text-transform: uppercase; }
.plaque em { display: block; color: inherit; font: italic 400 1rem/1.3 var(--serif); }
.plaque__note { display: block; margin-top: .2rem; font-size: .7rem; opacity: .75; }

/* The signature signs off the page, across text and painting. */
.signature {
  position: absolute;
  z-index: 3;
  left: 40%;
  bottom: 8%;
  width: min(50vw, 780px);
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .5));
}
/* Hidden until main.js writes them at a steady pen speed. */
.pen path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.signature__tip { fill: url(#sig-tip); opacity: 0; transition: opacity .4s; }
.signature.is-writing .signature__tip { opacity: 1; }

/* ---------- Small screens ---------- */
@media (max-width: 899px) {
  .topbar__nav a:not(.topbar__cv) { display: none; }

  .stage__shade {
    background:
      linear-gradient(180deg, transparent 40%, rgba(11, 9, 8, .85) 66%, var(--ink-950) 100%);
  }
  /* Image up top, words underneath. */
  .landing__name { top: 16px; font-size: 1.15rem; }
  .landing__title { top: 76px; left: var(--gutter); text-align: left; }
  .landing__small { font-size: .95rem; }
  .landing__big { font-size: 2.7rem; }
  .landing__face { height: auto; width: 128%; }
  .landing__claim { display: none; }
  .landing__scroll { left: auto; right: var(--gutter); bottom: 18px; padding: .5rem .7rem; background: rgba(243, 241, 236, .85); }
  .prologue, .narration { top: auto; bottom: 120px; right: var(--gutter); left: var(--gutter); width: auto; transform: none; }
  .stage:not([data-step="1"]) .prologue { transform: translateY(-16px); }
  .narration li { top: auto; bottom: 0; transform: translateY(14px); }
  .narration li.is-active { transform: none; }
  .narration__line { font-size: 1.75rem; }
  /* The room is too wide to show every object on a phone, so the overview step adds the list. */
  .index { display: none; }
  .stage[data-step="9"] .index {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .9rem 1rem;
    left: var(--gutter);
    right: var(--gutter);
    bottom: 112px;
    transform: none;
    white-space: normal;
  }
  .narration li[data-step="9"].is-active { transform: translateY(-120px); }
  .hotspot__label { font-size: .6rem; }

  .lesson { grid-template-columns: 1fr; }
  .translate li { gap: 1.2rem; font-size: .9rem; }
  .flight__panel { bottom: 16px; padding: 1rem 1.1rem; }
  .flight__photo img { max-height: 20vh; }
  .flight__hud { top: 76px; }
  .library { grid-template-columns: 1fr; }
  .reading { grid-template-columns: 1fr; }
  .reading__stage { height: 360px; }
  .bust { width: min(70%, 260px); margin: 0 auto; }
  .listening { grid-template-columns: 1fr; }
  .listening__player { position: static; grid-template-columns: 150px 1fr; align-items: center; gap: 1rem; }
  .listening__player .turntable { width: 100%; }
  .now-playing__title { font-size: 1.5rem; }
  .shelf-records__list { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
  .db__top { grid-template-columns: 1fr; }
  .cockpit { min-height: 46vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .profile dl div { grid-template-columns: 7.5rem 1fr; }
  .records__head { display: none; }
  .rec { grid-template-columns: 4.5rem 1fr; gap: .3rem 1rem; }
  .rec__secret { grid-column: 2; }
  .rec__status { grid-column: 2; justify-self: start; }

  .stamps { gap: 1.3rem 1rem; }
  .stamp { width: 96px; }
  .stamp__art b { font-size: 1.9rem; }
  .mail__postmark { width: 70px; font-size: .5rem; }
  .cabinet { height: 210px; }
  .folder__tab { left: calc(var(--i) * 33.5%); width: 32%; padding: .35rem .5rem; font-size: .6rem; letter-spacing: .06em; }
  .dossier { grid-template-columns: 1fr; padding: 1.4rem .6rem .6rem; }
  .dossier__board { padding: 0 .6rem; }
  .dossier__stamp { position: static; display: inline-block; margin-bottom: 1.2rem; }
  .dossier__title { padding-right: 0; }
  .dossier__facts div { grid-template-columns: 6rem 1fr; }

  .epilogue { grid-template-columns: 1fr; padding-bottom: 26vh; }
  .portrait { width: min(82%, 380px); }
  .signature { left: 50%; bottom: 8vh; width: 118vw; translate: -50% 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hotspot.is-active .hotspot__ring, .hud__cue i, .dossier { animation: none; }
  .folder, .cabinet__front { transition: none; }
  .blackboard__list li { transition: none; clip-path: none; }
  .turntable.is-playing .record { animation: none; }
  .mail__hint, .mail:hover .mail__seal { animation: none; }
  .mail__flap, .mail__seal i { transition: none; }
  .pen path { animation: none; stroke-dashoffset: 0; }
}
