/* Peel Back the Map. All numbers are starting values to tune by eye. */

/* Fonts: two families, bundled with the site (SIL Open Font License; licences in fonts/).
   Fraunces is the voice (title, headings, bridges); Inter is everything else. */
@font-face {
  font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/fraunces-latin-full-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url("../fonts/fraunces-latin-full-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-opsz-normal.woff2") format("woff2");
}

:root {
  --sky-top: #a9d3ea;
  --sky-bottom: #86bcdc;
  --ink: #13222e;          /* body text, 15:1 on white */
  --ink-dim: #4a5d6a;      /* 6.6:1 on white */
  --orange: #f68c1e;       /* drawing only, never text */
  --orange-text: #a84600;  /* 6.2:1 on white */
  --accent: #b34a00;       /* buttons, links, underlines */
  --navy: #0e2533;         /* selected chips, dark panels */
  --card-bg: rgba(255, 255, 255, 0.94);

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: var(--sans);   /* small labels: Inter, in spaced capitals */
  --serif: "Fraunces", Charter, Georgia, serif;
  --display: "Fraunces", Charter, Georgia, serif;

  --screen: 100vh;          /* one screen of scroll track */
  --gutter: 16px;
}
@supports (height: 100svh) {
  :root { --screen: 100svh; }
}

* { box-sizing: border-box; }

html { background: var(--sky-bottom); }

body {
  margin: 0;
  background: linear-gradient(var(--sky-top), var(--sky-bottom)) fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(16px, 0.35vw + 13px, 18px);
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--orange-text); text-underline-offset: 3px; }
a:focus-visible { outline: 3px solid var(--orange-text); outline-offset: 3px; border-radius: 3px; }

/* ---------- Top bar: plain-text link ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  padding: 14px var(--gutter);
  font-family: var(--sans);
  font-size: 14px;
  pointer-events: none;
}
.topbar a {
  pointer-events: auto;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 6px 4px;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.4s;
}
.topbar a:hover, .topbar a:focus-visible { opacity: 1; }
.topbar a:hover { text-decoration: underline; }

/* ---------- Finding your way ---------- */
.skip {
  position: fixed; left: var(--gutter); top: 10px; z-index: 30;
  padding: 8px 14px; border-radius: 10px; background: var(--navy); color: #fff;
  font-family: var(--sans); font-size: 14px; text-decoration: none;
  transform: translateY(-150%); transition: transform 0.2s;
}
.skip:focus { transform: none; }
.topbar { justify-content: space-between; align-items: center; }
.toc-button {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 12px rgba(16, 50, 80, 0.1);
  font: 600 13px var(--sans); color: var(--ink); cursor: pointer;
}
.toc-button::before { content: ""; width: 14px; height: 9px; background: linear-gradient(currentColor 0 0) top/100% 1.5px no-repeat, linear-gradient(currentColor 0 0) center/100% 1.5px no-repeat, linear-gradient(currentColor 0 0) bottom/100% 1.5px no-repeat; }
.toc-button:focus-visible, .toc a:focus-visible, .to-top:focus-visible { outline: 3px solid var(--orange-text); outline-offset: 2px; }
.toc {
  position: fixed; top: 56px; left: var(--gutter); z-index: 20;
  width: min(22rem, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100vh - 80px); overflow: auto;
  padding: 10px; border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 70px rgba(16, 50, 80, 0.2);
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: flex; gap: 12px; align-items: baseline;
  padding: 9px 12px; border-radius: 10px;
  color: var(--ink); text-decoration: none; font-family: var(--sans); font-size: 15px;
}
.toc a:hover { background: #f1f5f8; }
.toc a[aria-current] { background: #fdf0e3; }
.toc a[aria-current] .toc-name { font-weight: 700; }
.toc-num { font: 500 12px var(--sans); color: var(--ink-dim); letter-spacing: 0.08em; min-width: 1.6em; }
.toc-name { font-family: var(--display); font-size: 17px; }
.to-top {
  display: inline-block; margin-top: 1rem; padding: 8px 16px; border-radius: 999px;
  background: var(--navy); color: #fff; font: 600 14px var(--sans); text-decoration: none;
}
.scene:focus { outline: none; }

/* ---------- Interactive blocks ---------- */
/* the scroll track lets clicks through to the stage, except on the cards themselves */
html.animated .hold { pointer-events: none; }
html.animated .card { pointer-events: auto; }
html.animated #stage.grab { pointer-events: auto; cursor: grab; }
html.animated #stage.grabbing { cursor: grabbing; }
.hint { font-size: 13px !important; color: var(--ink-dim) !important; font-style: italic; }
.hint::before { content: "↔  "; font-style: normal; }
@media (hover: none) { .hint { display: none; } }
html.plain .stage-only { display: none; }
.quiz, .picker, .slider { margin: 0.9rem 0 0.4rem; }
.quiz-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--navy) 18%, transparent);
  background: #fff; color: var(--ink); font: 600 14px var(--sans); cursor: pointer;
  transition: background 0.25s, border-color 0.25s, transform 0.2s;
}
.chip:hover { border-color: color-mix(in srgb, var(--navy) 45%, transparent); transform: translateY(-1px); }
.chip:focus-visible, .casemap input:focus-visible, .casemap textarea:focus-visible, .slider input:focus-visible { outline: 3px solid var(--orange-text); outline-offset: 2px; }
.chip.picked { background: var(--navy); color: #fff; border-color: var(--navy); }
.quiz.done .chip.right { background: var(--accent); color: #fff; border-color: var(--accent); }
.quiz-reveal { margin: 0.7rem 0 0 !important; font-family: var(--display) !important; font-size: 1.1em !important; color: var(--ink) !important; min-height: 1.4em; }
.slider-label { display: block; margin: 0 0 6px; font: 600 12px var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.slider input[type="range"] { width: 100%; accent-color: var(--accent); }
.casemap { display: grid; gap: 0.8rem; margin-top: 0.6rem; }
.cm-field { display: grid; gap: 4px; font: 600 12px var(--sans); color: var(--ink-dim); }
.cm-field input, .cm-field textarea {
  width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--navy) 20%, transparent);
  font: 400 15px var(--sans); color: var(--ink); background: #fff; resize: vertical;
}
.cm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.cm-col { border: 0; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.cm-col legend { font-family: var(--display); font-size: 1.1em; color: var(--ink); margin-bottom: 0.3rem; }
@media (max-width: 600px) { .cm-cols { grid-template-columns: 1fr; } }

/* Making interactive parts obvious */
.try-tag {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0 0 0.6rem; padding: 4px 10px 4px 8px; border-radius: 999px;
  background: #fdeedd; color: color-mix(in srgb, var(--accent) 78%, black);
  font: 700 11px var(--sans); letter-spacing: 0.14em; text-transform: uppercase;
}
.try-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #e2700a; animation: breathe-dot 1.6s ease-in-out 3; }
@keyframes breathe-dot { 50% { transform: scale(1.6); opacity: 0.5; } }
html.plain .try-tag { display: none; }
.act {
  display: inline-flex; align-items: center; gap: 8px; margin: 0.9rem 0 0.2rem;
  padding: 11px 20px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: #fff; font: 700 15px var(--sans);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 30%, transparent);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.act::after { content: "→"; }
.act:hover { transform: translateY(-2px); box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 36%, transparent); }
.act:disabled { background: #6b7c88; box-shadow: none; cursor: default; transform: none; }
.act:disabled::after { content: "✓"; }
.act:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.nudge { animation: nudge 2.2s ease-in-out 2; }
@keyframes nudge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(226, 112, 10, 0.0); }
  50% { box-shadow: 0 0 0 6px rgba(226, 112, 10, 0.22); }
}
.act.nudge { animation-name: nudge-act; }
@keyframes nudge-act {
  0%, 100% { box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 30%, transparent), 0 0 0 0 rgba(226, 112, 10, 0); }
  50% { box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 30%, transparent), 0 0 0 8px rgba(226, 112, 10, 0.2); }
}
.slider input[type="range"] { height: 28px; cursor: pointer; }
.slider input[type="range"]::-webkit-slider-thumb { width: 22px; height: 22px; }
.drag-hint {
  position: fixed; z-index: 2; transform: translate(-50%, 0); pointer-events: none;
  padding: 7px 14px 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 20px rgba(16, 50, 80, 0.15);
  font: italic 400 15px var(--display); color: var(--ink);
  opacity: 0; transition: opacity 0.6s;
}
.drag-hint::before { content: "←  "; font-style: normal; display: inline-block; animation: sway-hint 1.8s ease-in-out infinite; }
.drag-hint::after { content: "  →"; font-style: normal; display: inline-block; animation: sway-hint 1.8s ease-in-out infinite reverse; }
@keyframes sway-hint { 50% { transform: translateX(-4px); } }
.drag-hint.show { opacity: 1; }
html.plain .drag-hint { display: none; }
@media (hover: none) { .drag-hint { display: none; } }

/* Click-to-play video */
.yt { margin: 0.8rem 0 0.4rem; }
.yt-play, .yt iframe {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  border: 0; border-radius: 12px; overflow: hidden; background: var(--navy); padding: 0; cursor: pointer;
}
.yt-play img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.85; transition: opacity 0.3s, transform 0.6s; }
.yt-play:hover img { opacity: 1; transform: scale(1.02); }
.yt-icon {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; transform: translate(-50%, -50%);
  border-radius: 50%; background: rgba(255, 255, 255, 0.92); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}
.yt-icon::after { content: ""; position: absolute; left: 26px; top: 20px; border-left: 20px solid var(--navy); border-top: 12px solid transparent; border-bottom: 12px solid transparent; }
.yt-note { position: absolute; left: 12px; bottom: 10px; font: 600 12px var(--sans); color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.6); }
.yt-play:focus-visible { outline: 3px solid var(--orange-text); outline-offset: 3px; }

/* ---------- Canvas behind the scroll track ---------- */
#stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  display: block;
  /* a calmer, more natural palette for everything drawn on the stage */
  filter: saturate(0.86);
}

/* ---------- Scroll track ---------- */
#story { position: relative; z-index: 1; }

.scene { display: flex; flex-direction: column; } /* height set per scene in JS */
.hold { flex: 1 1 0; min-height: 0; }
/* A firm resting place for every card: the page always settles with one card
   centred, and even a hard flick stops at the very next card. Native scroll. */
html.animated { scroll-snap-type: y mandatory; }
html.animated .hold { scroll-snap-align: center; scroll-snap-stop: always; }
/* A long card plays its animation as you scroll through it, and rests only at its end. */
html.animated .hold.long { scroll-snap-align: end; }
/* The title's card starts in the middle of the first screen, not hanging off the top. */
.scene:first-child .hold:first-child { padding-top: calc(var(--screen) * 0.5); }

.card {
  position: sticky;
  top: 50%;
  width: min(34rem, calc(100vw - 2 * var(--gutter)));
  max-height: calc(var(--screen) - 120px);
  overflow: auto;
  margin-left: clamp(var(--gutter), 8vw, 9rem);
  padding: 1.5rem 1.75rem 1.4rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(16, 50, 80, 0.12), 0 1px 2px rgba(16, 50, 80, 0.06);
  /* hidden until js/main.js adds .on, then it slides up into place */
  opacity: 0;
  transform: translateY(calc(-50% + 28px));
  filter: blur(8px);
  transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), filter 1s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity, filter;
}
.card.on { opacity: 1; transform: translateY(-50%); filter: blur(0); }
/* a card you've scrolled past drifts up and away, in the direction you're going */
.card.past { transform: translateY(calc(-50% - 36px)); }

/* Inside a card, each part arrives in turn: bridge, label, heading, lead, the rest. */
html.animated .card > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--i, 0) * 80ms + 160ms);
}
html.animated .card.on > * { opacity: 1; transform: none; }
html.animated .card.past > * { transition-delay: 0ms; }

/* A thin thread down the card's left edge fills as you read through it. */
html.animated .card:not(.title)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22px;
  bottom: 22px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(#e2700a, var(--accent));
  transform-origin: top;
  transform: scaleY(var(--read, 0));
  transition: transform 0.35s ease-out;
  opacity: 0.85;
}

.card:focus-within { opacity: 1; }

.card > :first-child { margin-top: 0; }

/* ---------- Three kinds of card ---------- */
/* Notes: the white panel, stepping slightly in and out down the page. */
/* The part number, large and faint in the corner of each part's first card. */
.card[data-num]::after {
  content: attr(data-num);
  position: absolute;
  top: 0.4rem;
  right: 1.1rem;
  font-family: var(--display);
  font-size: 5.5rem;
  font-weight: 300;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  line-height: 1;
  color: color-mix(in srgb, var(--navy) 6%, transparent);
  pointer-events: none;
}
/* Prompts and statements: no box, set straight on the sky like the title. */
@media (min-width: 1100px) {
  .card.prompt, .card.statement {
    background: none;
    border: 0;
    box-shadow: none;
    padding-left: 0.1rem;
    overflow: visible;
  }
  .card.prompt::before, .card.statement::before { display: none; }
  .card.prompt[data-num]::after, .card.statement[data-num]::after { display: none; }
}
.card.prompt h3 {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange-text);
  margin-bottom: 0.9rem;
}
.card.prompt p.lead {
  font-size: clamp(28px, min(2.7vw, 5vh), 44px);
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}
.card.statement h3 {
  font-size: clamp(32px, min(3vw, 5.5vh), 50px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.card.statement p.lead { font-size: 1.3em; }
.card.prompt .bridge, .card.statement .bridge { border-bottom-color: color-mix(in srgb, var(--navy) 18%, transparent); }
html.plain .card.prompt p.lead { font-size: clamp(30px, 3.4vw, 52px); }
html.plain .card.statement h3 { font-size: clamp(34px, 3.8vw, 58px); }
.card > :last-child { margin-bottom: 0; }
.card p, .card ul { max-width: 62ch; }

/* ---------- One pattern for every card ----------
   bridge (serif italic) → section label (sans caps) → heading (serif)
   → lead paragraph (serif) → supporting text (sans). */
.card p, .card li { font-size: 0.95em; color: var(--body-ink, #2b3c48); }
.card p.lead {
  font-family: var(--display);
  font-size: 1.2em;
  font-weight: 400;
  font-variation-settings: "opsz" 24;
  line-height: 1.42;
  color: var(--ink);
  letter-spacing: -0.003em;
}
.card p.lead + p { margin-top: 0.4rem; }

.bridge {
  margin: 0 0 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid color-mix(in srgb, var(--navy) 12%, transparent);
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "opsz" 36;
  font-size: 1.15em;
  line-height: 1.4;
  color: var(--ink-dim);
}
.bridge .sample-tag { font-style: normal; }
.part {
  margin: 0 0 0.4rem;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange-text);
}
.card h3 {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-size: 1.45em;
  line-height: 1.15;
  font-weight: 600;
  font-variation-settings: "opsz" 72, "SOFT" 50;
  letter-spacing: -0.01em;
}

/* Title card: big type straight on the sky */
.card.title {
  background: none;
  border: 0;
  box-shadow: none;
  padding-left: 0.1em;
  /* never clip the title: no inner scroll, no cut-off glyphs or shadow */
  overflow: visible;
  max-height: none;
}
/* Sized to fit both the card's width and the screen's height, so all three
   lines always show in full. */
.card.title h1 {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-weight: 650;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  font-size: clamp(40px, min(5vw, 8.5vh), 76px);
  letter-spacing: -0.025em;
  line-height: 1;
  animation: title-in 1.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* One title at one size: "Peel back" in the peel's deep orange, "the map." in ink. */
.card.title h1 .title-line,
.card.title h1 .title-last { display: block; }
.card.title h1 .title-last { color: color-mix(in srgb, var(--accent) 78%, black); }
@keyframes title-in {
  from { opacity: 0; transform: translateY(0.25em); }
  to { opacity: 1; transform: none; }
}
.kicker {
  margin: 0 0 0.9rem;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navy);
}
.subtitle {
  margin: 0 0 1rem;
  max-width: 30rem;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "opsz" 36;
  font-size: clamp(18px, min(1.5vw, 2.8vh), 24px);
  line-height: 1.35;
  color: var(--ink);
}
.byline { font-family: var(--sans); font-size: 12px; color: var(--ink); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.question { font-family: var(--sans); font-size: 0.95em; color: var(--body-ink, #2b3c48); max-width: 30rem; }

/* Mock text is tagged on the page */
.sample-tag {
  display: inline-block;
  margin-right: 0.35em;
  padding: 0 0.45em;
  border-radius: 4px;
  background: #fde8d4;
  color: #8a3a00;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 0.15em;
}

/* Images from the deck, with credits */
.pic { margin: 0.6rem 0 0.9rem; }
.pic img {
  display: block;
  width: 100%;
  max-height: 34vh;
  object-fit: contain;
  border-radius: 10px;
  background: #eef3f6;
}
.pic-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 6px; }
.pic-row img { max-height: 26vh; }
.credit {
  margin-top: 0.35rem;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-dim);
}
.credit.placeholder { padding-left: 0.5rem; }
@media (max-width: 1099px) {
  .pic img { max-height: 18vh; }
  .pic-row img { max-height: 14vh; }
}
html.plain .pic img { max-height: 60vh; }
/* On the animated page, a card whose pictures play on the stage shows only the
   credit line; the images stay in the page for screen readers. */
html.animated .card.staged .pic-one,
html.animated .card.staged .pic-row {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
html.animated .card.staged .pic { margin: 0.2rem 0 0.6rem; }

/* Facts and tables (from the mock-ups) */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 0.6rem 1rem; margin: 0.6rem 0 0.9rem; padding-top: 0.6rem; border-top: 1px solid #d5dee4; }
.facts dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.facts dd { margin: 0.15rem 0 0; font-family: var(--display); font-size: 1.15em; font-weight: 500; line-height: 1.25; color: var(--ink); }
.table-wrap { overflow-x: auto; margin: 0.5rem 0 0.9rem; }
.table-wrap table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 14px; line-height: 1.35; }
.table-wrap thead th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; text-align: left; color: var(--ink-dim); padding: 0 0.5rem 0.4rem 0; border-bottom: 1px solid #b9c6cf; }
.table-wrap thead th:nth-child(2) { color: var(--orange-text); }
.table-wrap tbody th, .table-wrap td { text-align: left; vertical-align: top; padding: 0.5rem 0.5rem 0.5rem 0; border-bottom: 1px solid #e1e8ec; }
.table-wrap tbody th { font-family: var(--display); font-size: 1.05em; font-weight: 600; }
.table-wrap .sample, .table-wrap .placeholder { color: var(--ink-dim); }

/* Video: plays on the stage in the animated page; inline with controls in plain. */
.stage-video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.clip:not(.stage-video) { display: block; width: 100%; border-radius: 10px; margin: 0.6rem 0; background: #000; }
.sound {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin: 0.2rem 0 0.6rem; padding: 6px 14px;
  border: 0; border-radius: 999px;
  background: var(--navy); color: #fff;
  font-family: var(--sans); font-size: 13px; font-weight: 700; cursor: pointer;
}
.sound::before { content: "♪"; }
.sound:focus-visible { outline: 3px solid var(--orange-text); outline-offset: 3px; }
.card.no-video .sound { display: none; }

/* Bar charts (plain HTML) */
.bars { margin: 0.4rem 0 1rem; }
.bars ul { list-style: none; padding: 0; margin: 0.3rem 0; }
.bars li {
  display: grid;
  grid-template-columns: minmax(6rem, 38%) 1fr auto;
  align-items: center;
  gap: 0.6rem;
  margin: 0.35rem 0;
  font-family: var(--sans);
  font-size: 14px;
}
.bars-track { height: 14px; border-radius: 7px; background: #eef2f4; overflow: hidden; }
.bars-fill {
  display: block;
  will-change: width;
  height: 100%;
  width: 0;
  border-radius: 7px;
  background: linear-gradient(90deg, #f7a23c, #e2700a);
  transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.25s;
}
.card.on .bars-fill, html.plain .bars-fill { width: var(--w); }
.bars-value { font-family: var(--display); font-size: 1.1em; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 2.2em; text-align: right; }
.bars-unit, .bars figcaption { margin: 0; font-family: var(--sans); font-size: 13px; color: var(--ink-dim); }

/* Missing text is marked on the page */
.placeholder {
  color: var(--ink-dim);
  border-left: 3px dashed var(--orange-text);
  padding-left: 0.7rem;
}

.notice { padding: 6rem var(--gutter); max-width: 40rem; margin: 0 auto; }

/* ---------- Arc of inquiry ----------
   Eight small dots on a hairline. When you reach a new step, the bar drifts into
   focus, a thread of warm light grows along it to where you are, the current dot
   breathes, and the step's name comes out of a soft blur. Then it all fades. */
.arc {
  --p: 0;                       /* 0 to 1: how far along the steps you are (set in js/main.js) */
  position: fixed;
  top: 22px;
  left: 50%;
  z-index: 9;
  display: flex;
  margin: 0;
  padding: 0 17px;
  list-style: none;
  pointer-events: none;
  opacity: 0;
  filter: blur(6px);
  transform: translate(-50%, -6px);
  transition: opacity 1.4s cubic-bezier(0.22, 1, 0.36, 1), filter 1.4s cubic-bezier(0.22, 1, 0.36, 1), transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.arc.show { opacity: 1; filter: blur(0); transform: translate(-50%, 0); }
/* the hairline, and the thread of light along it */
.arc::before, .arc::after {
  content: ""; position: absolute; top: 3.5px; left: 34px; height: 1px;
}
.arc::before { right: 34px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--navy) 25%, transparent) 8%, color-mix(in srgb, var(--navy) 25%, transparent) 92%, transparent); }
.arc::after {
  width: calc((100% - 68px) * var(--p));
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 40%, #fff);
  box-shadow: 0 0 8px 1px rgba(255, 240, 210, 0.9);
  transition: width 1.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.arc li { position: relative; width: 34px; display: flex; justify-content: center; }
.arc-dot {
  position: relative; z-index: 1;
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--navy) 30%, transparent);
  transition: background 1s, box-shadow 1s, transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.arc li.past .arc-dot { background: #fff; box-shadow: 0 0 6px rgba(255, 240, 210, 0.9); }
.arc li.now .arc-dot {
  background: #fff; transform: scale(1.5);
  animation: breathe 2.8s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--navy) 55%, transparent), 0 0 8px 2px rgba(255, 244, 220, 0.7); }
  50%      { box-shadow: 0 0 0 1px color-mix(in srgb, var(--navy) 55%, transparent), 0 0 18px 6px rgba(255, 244, 220, 1); }
}
.arc-name {
  position: absolute; top: 18px; left: 50%;
  transform: translate(-50%, 3px);
  white-space: nowrap;
  font-family: var(--display);
  font-style: italic;
  font-size: 15px;
  font-weight: 400;
  font-variation-settings: "opsz" 24;
  letter-spacing: 0.02em;
  color: var(--navy);
  opacity: 0;
  filter: blur(5px);
  transition: opacity 1.2s ease 0.35s, filter 1.2s ease 0.35s, transform 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.35s;
}
.arc li.now .arc-name { opacity: 1; filter: blur(0); transform: translate(-50%, 0); }
.part-step { color: var(--ink); }
html.plain .arc { display: none; }

/* ---------- Progress rail (as in the mock-ups) ---------- */
.rail {
  position: fixed;
  right: 22px;
  top: 34vh;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500; opacity: 0.65; letter-spacing: 0.06em;
  color: var(--ink);
  pointer-events: none;
}
.rail-track { position: relative; width: 1px; height: 26vh; background: color-mix(in srgb, var(--navy) 16%, transparent); overflow: hidden; }
.rail-fill { position: absolute; inset: 0; background: color-mix(in srgb, var(--navy) 70%, transparent); transform-origin: top; transform: scaleY(var(--done, 0)); }
html.plain .rail { display: none; }

/* ---------- Scroll cue ---------- */
.cue {
  position: fixed;
  left: 0; right: 0;
  bottom: 26px;
  z-index: 2;
  text-align: center;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  pointer-events: none;
}
.cue span::after {
  content: "";
  display: block;
  width: 2px;
  height: 30px;
  margin: 8px auto 0;
  border-radius: 2px;
  background: linear-gradient(var(--ink), transparent);
  animation: cue 1.8s ease-in-out infinite;
}
@keyframes cue {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(8px); opacity: 0.4; }
}

.debug {
  position: fixed;
  left: var(--gutter);
  bottom: 12px;
  z-index: 3;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
  color: var(--ink-dim);
}

/* ---------- Narrow screens ----------
   Below 1100 px the cards run along the bottom and the drawing sits above them.
   Keep this breakpoint in step with layout() in js/geo.js. */
@media (max-width: 1099px) {
  .hold { display: flex; flex-direction: column; justify-content: flex-end; }
  .card {
    margin-left: auto;
    margin-right: auto;
    top: auto;
    bottom: 16px;
    max-height: calc(var(--screen) * 0.42);
    padding: 1.1rem 1.25rem;
    transform: translateY(28px);
  }
  .card.on { transform: none; }
  .card.past { transform: translateY(-28px); }
  .card.title { background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(255, 255, 255, 0.8); box-shadow: 0 24px 70px rgba(16, 50, 80, 0.12), 0 1px 2px rgba(16, 50, 80, 0.06); padding-left: 1.25rem; max-height: none; overflow: visible; }
  .card.title h1 { font-size: clamp(34px, min(10vw, 6.5vh), 52px); }
  .cue { bottom: auto; top: 64px; }
  .cue span::after { display: none; }
  .rail { display: none; }
}

/* ---------- Plain text version (also the reduced-motion version) ----------
   A full-screen, static reading: each part is a full-height panel, alternating
   sky and white; cards with pictures sit text-left, picture-right. */
html.plain body { background: #fff; }
html.plain #stage,
html.plain .cue,
html.plain .debug { display: none; }

html.plain #story { padding: 0; }
html.plain .hold { display: block; height: auto !important; padding: 0 !important; }
html.plain .scene {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(2.5rem, 6vh, 5rem);
  height: auto !important;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(5rem, 12vh, 8rem) max(var(--gutter), calc((100vw - 74rem) / 2));
}
html.plain .scene:nth-child(even) { background: linear-gradient(180deg, #eef7fd, #e1f0fa); }

html.plain .card {
  position: static;
  transform: none;
  width: auto;
  max-width: none;
  max-height: none;
  overflow: visible;
  margin: 0;
  padding: 0;
  background: none;
  box-shadow: none;
  opacity: 1;
  transition: none;
}
html.plain .card p, html.plain .card ul { max-width: 40rem; }
html.plain .card h3 { font-size: clamp(1.4rem, 1rem + 1.2vw, 2rem); letter-spacing: -0.01em; }
html.plain .part {
  margin: 0 0 1.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid color-mix(in srgb, var(--navy) 15%, transparent);
  font-size: 13px;
}
html.plain .bridge { font-size: clamp(1.2rem, 1rem + 0.6vw, 1.5rem); max-width: 36rem; }

/* text left, pictures right */
html.plain .media { display: grid; gap: 1.5rem; margin-top: 1rem; }
@media (min-width: 900px) {
  html.plain .card:has(> .media) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    column-gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
  }
  html.plain .card:has(> .media) > * { grid-column: 1; }
  html.plain .card > .media { grid-column: 2; grid-row: 1 / span 30; margin-top: 0; }
}
html.plain .pic img { max-height: 70vh; border-radius: 14px; box-shadow: 0 18px 50px rgba(20, 60, 90, 0.16); }
html.plain .pic-row img { max-height: 42vh; }

/* the title: a full-screen opening with the peel spiral */
html.plain .scene:first-child {
  background:
    url("../images/photos/photo-peel-spiral.png") no-repeat right max(var(--gutter), calc((100vw - 74rem) / 2)) center / auto min(78vh, 46vw),
    linear-gradient(180deg, var(--sky-top), var(--sky-bottom));
}
html.plain .card.title { max-width: min(40rem, 55vw); margin-bottom: 1rem; }
html.plain .card.title h1 { font-size: clamp(40px, min(6vw, 10vh), 96px); }
html.plain .card.title h1 { animation: none; }
@media (max-width: 899px) {
  html.plain .scene:first-child { background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom)); }
  html.plain .card.title { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Restraint: the rail is a single quiet hairline; small labels sit back. */
.rail-num { display: none; }
.card .credit { opacity: 0.8; }
.card p + p { margin-top: 0.5rem; }


/* ===================== One type system =====================
   Fraunces (upright) for the title, card headings and the big prompts only.
   Inter for everything else: reading text, labels, captions, buttons. No italics. */
.bridge, .subtitle, .quiz-reveal, .quiz-note, .guess-echo, .drag-hint, .arc-name, .toc-name, .cm-col legend,
.card p.lead, .facts dd, .table-wrap tbody th, .bars-value {
  font-family: var(--sans) !important;
  font-style: normal !important;
  font-variation-settings: normal !important;
}
.bridge { font-size: 0.95em; font-weight: 500; color: var(--ink-dim); }
.subtitle { font-size: clamp(17px, min(1.3vw, 2.4vh), 21px); font-weight: 500; }
.card p.lead { font-size: 1.08em; font-weight: 500; line-height: 1.5; letter-spacing: -0.005em; }
.facts dd, .table-wrap tbody th, .bars-value { font-weight: 650; font-size: 1em; }
.arc-name { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; }
.toc-name { font-size: 15px; font-weight: 500; }
.drag-hint { font-size: 13px; font-weight: 600; }
.cm-col legend { font-weight: 700; font-size: 1em; }
.drag-hint::before, .drag-hint::after { font-style: normal; }

/* ===================== Moments =====================
   A prompt that takes over the screen, in front of the orange. */
#story { z-index: 2; }
.veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, rgba(236, 244, 250, 0.82), rgba(214, 230, 242, 0.55) 70%);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity;   /* keep the blur layer ready, so the first question does not hitch */
}
.veil.on { opacity: 1; }
html.plain .veil { display: none; }
html.in-moment .rail, html.in-moment .cue { opacity: 0 !important; }

html.animated .card.moment {
  width: min(64rem, calc(100vw - 2 * var(--gutter)));
  margin-left: auto; margin-right: auto;
  background: none; border: 0; box-shadow: none; overflow: visible; max-height: none;
  text-align: center; padding: 0;
  transform: translateY(-50%) scale(0.92);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.34, 1.4, 0.5, 1), filter 0.7s;
}
html.animated .card.moment.on { transform: translateY(-50%) scale(1); }
html.animated .card.moment.past { transform: translateY(calc(-50% - 40px)) scale(1.04); }
html.animated .card.moment::before, html.animated .card.moment::after { display: none; }
/* no reading text during a moment: only the prompt and its control */
.card.moment h3, .card.moment .part, .card.moment .try-tag, .card.moment .bridge,
.card.control h3, .card.control .part, .card.control .try-tag, .card.control .bridge {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.card.moment p.lead {
  font-family: var(--display) !important;
  font-size: clamp(40px, min(6.4vw, 10vh), 104px) !important;
  font-weight: 650 !important;
  font-variation-settings: "opsz" 144, "SOFT" 50 !important;
  line-height: 1.02 !important;
  letter-spacing: -0.03em;
  color: var(--ink) !important;
  max-width: none !important;
  margin: 0 auto 1.6rem;
  text-wrap: balance;
}
.card.moment .quiz-row { justify-content: center; }
.card.moment .quiz, .card.moment .act { margin-left: auto; margin-right: auto; }
.card.moment .quiz { display: grid; justify-items: center; gap: 1rem; }
.chip.big { padding: 14px 28px; font-size: 18px; border-width: 2px; }
.chip.big.picked { transform: scale(1.06); }
.quiz.locked .chip:not(.picked) { opacity: 0.35; }
.quiz-note { font-size: 15px !important; color: var(--ink-dim) !important; min-height: 1.4em; }
.guess-echo { font-size: 1.15em !important; font-weight: 700 !important; color: color-mix(in srgb, var(--accent) 78%, black) !important; margin: 0 0 0.3rem; }

/* a card that holds only its control */
html.animated .card.control { background: none; border: 0; box-shadow: none; overflow: visible; }
html.animated .card.control::before, html.animated .card.control::after { display: none; }
.card.control .slider { padding: 1.2rem 1.4rem; border-radius: 20px; background: rgba(255, 255, 255, 0.9); box-shadow: 0 24px 70px rgba(16, 50, 80, 0.14); }
.card.control .slider-label { font-size: 13px; color: var(--ink); }
.card.control input[type="range"] { height: 40px; }

/* The note shown when the journey is waiting for an activity */
.gate-note {
  position: fixed; left: 50%; bottom: 28px; z-index: 12;
  transform: translate(-50%, 16px);
  padding: 12px 20px; border-radius: 999px;
  background: var(--navy); color: #fff; font: 600 15px var(--sans);
  box-shadow: 0 14px 40px rgba(16, 50, 80, 0.25);
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s, transform 0.5s cubic-bezier(0.34, 1.4, 0.5, 1);
}
.gate-note::before { content: "↑  "; color: #f2a65a; }
.gate-note.show { opacity: 1; transform: translate(-50%, 0); }
.gate-note.bump { transform: translate(-50%, -6px); }
html.plain .gate-note { display: none; }


/* ===================== Round 2 polish ===================== */
/* Mission prompt at the top of the screen, so the orange stays in full view */
html.animated .card.moment.top { top: 14%; transform: translateY(0) scale(0.94); }
html.animated .card.moment.top.on { transform: translateY(0) scale(1); }
html.animated .card.moment.top.past { transform: translateY(-40px); }
.card.moment.top p.lead { font-size: clamp(30px, min(3.6vw, 6vh), 60px) !important; margin-bottom: 1rem; }
.card.moment.top .hint { display: block; text-align: center; }
html.animated #stage.tap { pointer-events: auto; cursor: pointer; }

/* The slider: one clean control */
.slider { display: block; }
html.animated .card.control { width: min(30rem, calc(100vw - 2 * var(--gutter))); padding: 0; }
.card.control .slider {
  display: grid; gap: 14px; padding: 22px 24px 20px; border-radius: 22px;
  background: rgba(255, 255, 255, 0.94); box-shadow: 0 24px 70px rgba(16, 50, 80, 0.14);
}
.card.control .slider-label { margin: 0; font: 600 15px var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink); }
.slider input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 34px; background: transparent; }
.slider input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) var(--fill, 0%), #e3ebf0 var(--fill, 0%)); }
.slider input[type="range"]::-moz-range-track { height: 8px; border-radius: 4px; background: #e3ebf0; }
.slider input[type="range"]::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--accent); }
.slider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 4px 12px rgba(16, 50, 80, 0.25); }
.slider input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); }

/* The instant answer when Greenland lands */
.reveal {
  position: fixed; left: 50%; top: 50%; z-index: 15; pointer-events: none;
  transform: translate(-50%, -50%) scale(0.8); opacity: 0;
  padding: 26px 40px; border-radius: 28px;
  background: rgba(255, 255, 255, 0.96); box-shadow: 0 40px 120px rgba(16, 50, 80, 0.3);
  font: 650 clamp(30px, 4.4vw, 68px)/1.05 var(--display); letter-spacing: -0.02em; color: var(--navy);
  text-align: center; width: max-content; max-width: calc(100vw - 32px);
  transition: opacity 0.35s, transform 0.6s cubic-bezier(0.34, 1.56, 0.5, 1);
}
.reveal.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
html.plain .reveal { display: none; }

/* Later cards: quieter, more consistent */
.part { font-size: 12px; letter-spacing: 0.14em; margin-bottom: 0.5rem; }
.sample-tag { font-size: 9.5px; padding: 1px 6px; opacity: 0.75; vertical-align: 0.2em; }
.card ul { padding-left: 1.1rem; }
.card li { margin: 0.35rem 0; }
.card li::marker { color: var(--accent); }
.table-wrap table { font-size: 13.5px; }
.table-wrap tbody th, .table-wrap td { padding: 0.55rem 0.6rem 0.55rem 0; }
.bars li { font-size: 13.5px; }
.bars-track { height: 10px; }
.credit { font-size: 11.5px; }
.card h3 { font-size: 1.35em; margin-bottom: 0.5rem; }
.card .facts { border-top-color: color-mix(in srgb, var(--navy) 10%, transparent); }

/* Cards always fit on screen: compact forms, and long cards scroll inside themselves */
html.animated .card:not(.moment) { overflow: visible; }
.casemap { gap: 0.6rem; }
.cm-field input { padding: 7px 10px; }
.cm-col { gap: 0.4rem; }


/* ===================== Simple cards =====================
   On the animated page a card is only its heading, its text and its control. */
.sr-only-anim { }
html.animated .card .bridge,
html.animated .card .try-tag,
html.animated .picker > .slider-label { display: none !important; }
html.animated .card .part,
html.animated .card.prompt h3 {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
html.animated .card[data-num]::after,
html.animated .card:not(.title)::before { display: none !important; }
html.animated .sample-tag { display: none; }
.draft-note {
  position: fixed; left: var(--gutter); bottom: 14px; z-index: 3; pointer-events: none;
  font: 500 11px var(--sans); letter-spacing: 0.04em; color: var(--ink-dim); opacity: 0.7;
}
html.plain .draft-note { display: none; }


/* ===================== Centered composition =====================
   At every width the stage sits in the upper part of the screen and each card is
   centered beneath it (js/geo.js layout() matches this). */
html.animated .hold { display: flex; flex-direction: column; justify-content: flex-end; }
html.animated .card:not(.moment) {
  top: auto; bottom: 22px;
  margin-left: auto; margin-right: auto;
  width: min(38rem, calc(100vw - 2 * var(--gutter)));
  max-height: calc(var(--screen) * 0.34);
  text-align: center;
  transform: translateY(28px);
}
html.animated .card:not(.moment).on { transform: none; }
html.animated .card:not(.moment).past { transform: translateY(-28px); }
html.animated .card:not(.moment) p, html.animated .card:not(.moment) ul { margin-left: auto; margin-right: auto; }
html.animated .card ul { text-align: left; }
html.animated .card .quiz-row { justify-content: center; }
html.animated .card .bars li { text-align: left; }
html.animated .card.moment { top: 50%; bottom: auto; }
/* the title opens centered, straight on the sky, beneath the orange */
html.animated .card.title { background: none !important; border: 0 !important; box-shadow: none !important; max-height: none; overflow: visible; }
html.animated .card.title h1 .title-line, html.animated .card.title h1 .title-last { display: inline; }
html.animated .card.title h1 { font-size: clamp(36px, min(5vw, 7vh), 76px); }
html.animated .card.title .subtitle { margin-left: auto; margin-right: auto; }
/* blocks that belong only to the plain version */
html.animated .plain-only { display: none !important; }
/* the stage takes the reader's hand on the orange */
html.animated #stage.tap { touch-action: none; cursor: grab; }
html.animated #stage.tap:active { cursor: grabbing; }
.kbd-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.kbd-only:focus { position: static; width: auto; height: auto; clip: auto; }
/* the answer, big and plain */
.reveal { white-space: normal; line-height: 1.08; }
.reveal .big { display: block; font-size: 1.7em; color: var(--accent); letter-spacing: -0.03em; }
/* the mission prompt sits under the orange, so the orange stays clear to touch */
html.animated .card.moment.top { top: auto; bottom: 26px; transform: translateY(20px); }
html.animated .card.moment.top.on { transform: none; }
html.animated .card.moment.top.past { transform: translateY(-20px); }
html.animated .card.moment.top p.lead { font-size: clamp(26px, min(3vw, 5vh), 48px) !important; margin-bottom: 0.5rem; }
.drag-hint.down::before { content: "↓  "; }
.drag-hint.down::after { content: ""; }

/* The title page: a large title under the orange, with room around it */
html.animated .card.title { bottom: 7vh; width: min(60rem, calc(100vw - 2 * var(--gutter))); }
html.animated .card.title h1 { font-size: clamp(44px, min(6.4vw, 9.5vh), 112px); line-height: 1; margin-bottom: 1rem; }
html.animated .card.title .subtitle { font-size: clamp(17px, min(1.5vw, 2.6vh), 24px); max-width: 34rem; }

/* The title page shows only the orange, the title, the subtitle and the name */
html.at-title .draft-note, html.at-title .rail { opacity: 0; transition: opacity 0.6s; }
html.animated .card.title { bottom: 11vh; }
html.animated .card.title .byline { margin-top: 0.4rem; }
.cue { bottom: 18px; font-size: 11px; letter-spacing: 0.22em; opacity: 0.8; }
.cue span::after { height: 18px; margin-top: 6px; }
@media (max-width: 1099px) { .cue { top: auto; bottom: 14px; } }

/* Title page, final: a lighter title with real space around it */
html.animated .card.title { bottom: 13vh; width: min(46rem, calc(100vw - 2 * var(--gutter))); }
html.animated .card.title h1 {
  font-size: clamp(36px, min(5.4vw, 7vh), 72px);
  font-weight: 560;
  font-variation-settings: "opsz" 144, "SOFT" 0;
  letter-spacing: -0.025em;
  margin-bottom: 1.1rem;
}
html.animated .card.title .subtitle { font-size: clamp(16px, min(1.3vw, 2.2vh), 19px); font-weight: 450; color: var(--ink-dim); max-width: 30rem; margin-bottom: 1.2rem; }
html.animated .card.title .byline { font-size: 11px; letter-spacing: 0.22em; color: var(--ink-dim); }

/* Question and guess on one screen */
.card.moment.ask p.lead { font-size: clamp(32px, min(4.6vw, 7.5vh), 76px) !important; margin-bottom: 1.4rem; }

/* ===================== Title, grand =====================
   One line of large ink type across the top, the orange beneath it, the name at the foot. */
html.animated .card.title { top: 9vh; bottom: auto; width: min(80rem, calc(100vw - 2 * var(--gutter))); transform: none !important; }
html.animated .card.title h1 {
  font-size: clamp(48px, min(8.4vw, 13vh), 156px);
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 0;
  letter-spacing: -0.035em;
  line-height: 0.95;
  margin: 0 0 0.9rem;
}
html.animated .card.title h1 .title-last { color: var(--ink); }
html.animated .card.title h1 .title-last::after { content: " "; }
html.animated .card.title .subtitle { font-size: clamp(15px, min(1.2vw, 2vh), 18px); margin: 0 auto; }
html.animated .card.title .byline { position: fixed; left: 0; right: 0; bottom: 9vh; margin: 0; font-size: 11px; letter-spacing: 0.3em; }


/* ===================== Tabs ===================== */
.topbar { padding: 12px var(--gutter); }
.tabs {
  pointer-events: auto;
  display: flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 2px 14px rgba(16, 50, 80, 0.1);
  overflow-x: auto; max-width: calc(100vw - 2 * var(--gutter) - 140px);
}
.tabs button {
  border: 0; background: none; cursor: pointer; white-space: nowrap;
  padding: 7px 14px; border-radius: 999px;
  font: 600 13.5px var(--sans); color: var(--ink-dim);
  transition: background 0.25s, color 0.25s;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--navy); color: #fff; }
.tabs button:focus-visible { outline: 3px solid var(--orange-text); outline-offset: 2px; }
html.plain .tabs { display: none; }
@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: stretch; gap: 6px; }
  .tabs { max-width: none; }
  #mode-link { align-self: flex-end; font-size: 12px; }
}
/* the scroll layer must not catch the reader's hand on the orange */
html.animated #story, html.animated .scene { pointer-events: none; }

/* Panels: simple, centered reading */
#panels { position: relative; z-index: 3; }
.panel { max-width: 44rem; margin: 0 auto; padding: 96px var(--gutter) 80px; display: grid; gap: 18px; }
.panel-head { text-align: center; margin-bottom: 8px; }
.panel-head h2 { margin: 0 0 0.5rem; font: 600 clamp(30px, 4vw, 48px)/1.08 var(--display); letter-spacing: -0.02em; color: var(--ink); }
.panel-intro { margin: 0 auto; max-width: 34rem; color: var(--ink-dim); }
.panel .card {
  position: static; opacity: 1; transform: none; filter: none; max-height: none; overflow: visible;
  width: auto; margin: 0; text-align: left; pointer-events: auto;
}
.panel .card > * { opacity: 1 !important; transform: none !important; }
.panel .stage-only { display: none !important; }
.panel .pic img { max-height: 52vh; }
.panel .sample-tag { display: inline-block; }
html.in-panel #stage, html.in-panel .cue, html.in-panel .rail, html.in-panel .veil, html.in-panel .arc,
html.in-panel .drag-hint, html.in-panel .gate-note, html.in-panel .reveal { display: none !important; }
html.in-panel body { background: linear-gradient(var(--sky-top), var(--sky-bottom)) fixed; }
html.in-panel { scroll-snap-type: none !important; }
.tabs-nav { margin-top: 0.9rem; }
[hidden] { display: none !important; }
/* the title card sits at the top of its stretch, on screen from the first moment */
html.animated .scene:first-child .hold:first-child { padding-top: 0; justify-content: flex-start; }
/* gentle snapping: the per-card hold (js/main.js) does the pausing */
html.animated { scroll-snap-type: y proximity; }

.card.moment.top .hint { text-align: center; margin: 0 auto; }
.card.moment.top .hint::before { content: ""; }

/* ===================== Real-browser fixes ===================== */
/* panels are plain reading: none of the story's card behaviour applies */
html.animated .panel .card {
  position: static !important; top: auto !important; bottom: auto !important;
  max-height: none !important; overflow: visible !important;
  opacity: 1 !important; transform: none !important; filter: none !important;
  width: auto !important; margin: 0 !important; text-align: left !important;
  padding: 1.5rem 1.75rem !important;
}
html.animated .panel .card p, html.animated .panel .card ul { margin-left: 0; margin-right: 0; }
html.animated .panel .card .quiz-row { justify-content: flex-start; }
.panel .pic img { max-height: 38vh !important; width: auto; max-width: 100%; margin: 0 auto; }
.panel .pic-row img { max-height: 30vh !important; }
.panel .media { margin-top: 0.8rem; }
/* the tabs replace the old inquiry steps */
.arc { display: none !important; }
/* title: name sits under the subtitle */
html.animated .card.title .byline { position: static; margin-top: 1rem; }
/* the answer replaces the slider, in the same place, once Greenland lands */
.reveal { top: auto; bottom: 22px; transform: translate(-50%, 0) scale(0.85); }
.reveal.show { transform: translate(-50%, 0) scale(1); }
html.slid .card.control { opacity: 0 !important; pointer-events: none; }
html.animated .card.title .byline { display: block; text-align: center; margin-left: auto; margin-right: auto; }

/* ===================== Integrated top bar =====================
   Site name on the left, the tabs as plain text in the middle, plain-text link on
   the right. No pill: it sits on the sky, and a soft frosted band fades in behind
   it only once the page has scrolled. */
.topbar {
  display: grid !important; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 14px clamp(16px, 3vw, 36px) !important;
  flex-direction: row !important;
  transition: background 0.5s, box-shadow 0.5s, backdrop-filter 0.5s;
}
html.scrolled .topbar {
  background: linear-gradient(rgba(236, 244, 250, 0.78), rgba(236, 244, 250, 0.55));
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--navy) 8%, transparent);
}
.brand { pointer-events: auto; justify-self: start; display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #ffc98a 0%, #e8781c 48%, #a94b06 100%); box-shadow: 0 1px 3px rgba(120, 50, 0, 0.3); }
.brand-name { font: 600 17px/1 var(--display); letter-spacing: -0.01em; }
.tabs {
  justify-self: center; background: none !important; box-shadow: none !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  padding: 0 !important; gap: clamp(10px, 2vw, 26px) !important; border-radius: 0 !important; max-width: none !important;
}
.tabs button {
  position: relative; padding: 8px 2px !important; border-radius: 0 !important;
  background: none !important; color: var(--ink-dim) !important; font: 500 14px var(--sans) !important;
}
.tabs button::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.tabs button:hover { color: var(--ink) !important; }
.tabs button[aria-selected="true"] { color: var(--ink) !important; font-weight: 650 !important; }
.tabs button[aria-selected="true"]::after { transform: scaleX(1); }
#mode-link { justify-self: end; }
html.at-title:not(.scrolled) .brand { opacity: 0; pointer-events: none; }
.brand { transition: opacity 0.5s; }
@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr auto !important; row-gap: 4px; }
  .brand-name { display: none; }
  .tabs { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; overflow-x: auto; gap: 18px !important; }
  #mode-link { grid-column: 2; grid-row: 1; }
}
html.plain .brand { display: none; }
@media (max-width: 760px) { html.animated .card.title { top: 118px; } html.animated .card.title h1 { font-size: clamp(38px, 11vw, 56px); } }


/* ===================== A fuller, editorial site ===================== */
/* Story: text set on the page, not in boxes */
html.animated #story .card:not(.moment):not(.title):not(.control) {
  background: none !important; border: 0 !important; box-shadow: none !important;
  padding: 0 !important; width: min(46rem, calc(100vw - 2 * var(--gutter))); bottom: 5vh;
}
html.animated #story .card:not(.moment):not(.title) h3 {
  font: 600 clamp(28px, min(3vw, 5vh), 44px)/1.06 var(--display); letter-spacing: -0.02em; margin-bottom: 0.7rem;
}
html.animated #story .card:not(.moment):not(.title) p.lead { font-size: clamp(17px, 1.25vw, 20px); color: var(--ink); max-width: 40rem; }
html.animated #story .card:not(.moment):not(.title) p:not(.lead) { color: var(--ink-dim); }
html.animated #story .card .picker, html.animated #story .card .casemap {
  padding: 14px 18px; border-radius: 18px; background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); display: inline-block;
}
/* a soft light at the foot of the screen keeps the words clear of the stage */
html.animated:not(.in-panel) body::before {
  content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 44vh; z-index: 1; pointer-events: none;
  background: linear-gradient(rgba(214, 231, 243, 0), rgba(214, 231, 243, 0.82) 55%, rgba(214, 231, 243, 0.94));
}
html.at-title body::before { opacity: 0; }

/* Tab pages: full-width sections, heading left, content right */
.panel { max-width: none !important; padding: 0 !important; display: block !important; }
.panel-head { padding: clamp(120px, 18vh, 180px) var(--gutter) clamp(48px, 8vh, 80px); text-align: center; }
.panel-head h2 { font-size: clamp(40px, 6vw, 84px) !important; font-weight: 600 !important; max-width: 16ch; margin: 0 auto 1rem !important; }
.panel-intro { font-size: clamp(16px, 1.3vw, 19px); max-width: 38rem !important; }
html.animated .panel .card {
  display: grid !important; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.6fr); column-gap: clamp(28px, 5vw, 80px);
  align-items: start;
  border-radius: 0 !important; box-shadow: none !important; border: 0 !important;
  border-top: 1px solid color-mix(in srgb, var(--navy) 10%, transparent) !important;
  background: rgba(255, 255, 255, 0.0) !important;
  padding: clamp(48px, 8vh, 96px) max(var(--gutter), calc((100vw - 72rem) / 2)) !important;
}
html.animated .panel .card:nth-of-type(odd) { background: rgba(255, 255, 255, 0.5) !important; }
html.animated .panel .card > * { grid-column: 2; }
html.animated .panel .card > h3 {
  grid-column: 1; grid-row: 1 / span 30; position: sticky; top: 96px;
  font: 600 clamp(26px, 2.6vw, 40px)/1.08 var(--display) !important; letter-spacing: -0.02em; margin: 0;
}
html.animated .panel .card p.lead { font-size: clamp(18px, 1.4vw, 22px); line-height: 1.5; color: var(--ink); }
html.animated .panel .card p, html.animated .panel .card ul { max-width: 44rem; }
.panel .pic img { max-height: 62vh !important; border-radius: 14px; box-shadow: 0 18px 50px rgba(16, 50, 80, 0.14); margin: 0; }
.panel .pic-row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.panel .pic-row img { max-height: 44vh !important; }
.panel .yt { max-width: 46rem; }
@media (max-width: 860px) {
  html.animated .panel .card { grid-template-columns: 1fr; }
  html.animated .panel .card > h3 { grid-column: 1; grid-row: auto; position: static; margin-bottom: 0.8rem; }
  html.animated .panel .card > * { grid-column: 1; }
}

/* Site footer */
.site-foot { position: relative; z-index: 3; background: var(--navy); color: #c9d6df; }
.foot-inner {
  max-width: 72rem; margin: 0 auto; padding: 48px var(--gutter) 40px;
  display: grid; grid-template-columns: 1fr auto; gap: 18px 32px; align-items: center;
}
.foot-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; }
.foot-brand .brand-name { font: 600 20px/1 var(--display); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: flex-end; }
.foot-nav a { color: #e6eef3; text-decoration: none; font: 500 14px var(--sans); }
.foot-nav a:hover { text-decoration: underline; }
.foot-note { grid-column: 1 / -1; margin: 0; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.12); font: 400 12.5px var(--sans); color: #93a7b5; }
@media (max-width: 640px) { .foot-inner { grid-template-columns: 1fr; } .foot-nav { justify-content: flex-start; } }
html.plain .site-foot { display: none; }
.panel[hidden] { display: none !important; }
.panel .bars-fill { width: var(--w) !important; }

/* ===================== Panel interactions ===================== */
/* Widen the frame: the picture is always whole; outside a central frame it is
   dimmed, the way a clip shows only part of the story. Widening lifts the dim. */
.framed .pic-one, .framed .pic-row { position: relative; overflow: hidden; border-radius: 14px; }
.framed .pic-one::after, .framed .pic-row::after {
  content: ""; position: absolute; inset: 22% 26%; border-radius: 10px; pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 200vmax color-mix(in srgb, var(--navy) 68%, transparent);
  transition: inset 0.9s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s 0.3s;
}
.framed.open .pic-one::after, .framed.open .pic-row::after { inset: -4px; opacity: 0; }
/* one size for every picture; a second picture sits smaller beside the first */
.panel .pic img { width: 100%; height: auto; max-height: 52vh !important; object-fit: contain; background: #f4f7f9; }
.panel .pic-row img { max-height: 40vh !important; object-fit: cover; }
html.animated .panel .card.two-pics .pic + .pic { max-width: 48%; display: inline-block; vertical-align: top; }
.panel .pic { margin: 1rem 0 0.4rem; }
.widen {
  margin-top: 12px; padding: 9px 16px 9px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--navy) 20%, transparent); background: #fff; color: var(--ink);
  font: 600 14px var(--sans); display: inline-flex; gap: 8px; align-items: center;
  transition: background 0.25s, color 0.25s;
}
.widen::before { content: "⤢"; font-size: 15px; }
.framed.open .widen { background: var(--navy); color: #fff; border-color: var(--navy); }
.widen:focus-visible, .practice textarea:focus-visible { outline: 3px solid var(--orange-text); outline-offset: 2px; }
.guess { margin: 0.8rem 0; padding: 18px 20px; border-radius: 16px; background: rgba(255, 255, 255, 0.75); }
.guess-q { margin: 0 0 12px !important; font: 600 16px var(--sans); color: var(--ink); }
.guess .chip.right { background: var(--accent); color: #fff; border-color: var(--accent); }
.guess .chip.picked:not(.right) { background: var(--navy); color: #fff; }
.guess .chip:disabled { cursor: default; }
.guess-out { margin: 10px 0 0 !important; font: 600 15px var(--sans); color: color-mix(in srgb, var(--accent) 78%, black); min-height: 1.2em; }
.guess-chart .bars-fill { width: 0 !important; transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1) !important; }
.guess-chart.grow .bars-fill { width: var(--w) !important; }
.practice { margin-top: 1rem; display: grid; gap: 10px; padding: 18px 20px; border-radius: 16px; background: rgba(255, 255, 255, 0.75); }
.practice-clock { font: 600 54px/1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.practice.running .practice-clock { color: var(--accent); }
.practice.done .practice-clock { color: #c0322f; }
.practice textarea { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--navy) 20%, transparent); font: 400 16px var(--sans); resize: vertical; }
.practice .act { justify-self: start; margin: 0; }

/* no plain-text link in the bar (the plain version still opens with ?plain and for reduced motion) */
#mode-link { display: none !important; }
.topbar { grid-template-columns: 1fr auto 1fr; }
.panel .card:has(.guess):not(.answered) .bars:not(.guess-chart) { display: none; }

/* Civic life: each example plays in its own stage */
.mini-stage {
  position: relative; width: 100%; height: clamp(300px, 46vh, 460px); margin: 1.2rem 0 0.6rem;
  border-radius: 20px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.12) 70%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.mini-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.replay {
  position: absolute; right: 12px; bottom: 12px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--navy) 15%, transparent); background: rgba(255, 255, 255, 0.9); font: 600 12.5px var(--sans); color: var(--ink);
}
.replay::before { content: "↺ "; }
.replay:focus-visible { outline: 3px solid var(--orange-text); outline-offset: 2px; }
.has-stage .pic-one, .has-stage .pic-row { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.has-stage .pic { margin: 0 !important; }

/* ---------- Map lab tab ---------- */
.lab-wrap { max-width: 1220px; margin: 0 auto; padding: 0 0 clamp(40px, 8vh, 90px); }
.lab-frame { display: block; width: 100%; height: 900px; border: 0; background: transparent; color-scheme: light; }

/* ---------- Cleaner pass ---------- */
/* the 14x answer carries its one-line reason */
.reveal .why { display: block; margin-top: 0.7rem; font: 500 clamp(14px, 1.2vw, 17px)/1.45 var(--sans); letter-spacing: 0; color: var(--ink-dim); }
/* tabs: one calm surface, hairlines between sections instead of alternating bands */
html.animated .panel .card:nth-of-type(odd), html.animated .panel .card { background: transparent !important; }
html.animated .panel .card:first-of-type { border-top: 0 !important; }
.panel { background: linear-gradient(rgba(255, 255, 255, 0.0), rgba(255, 255, 255, 0.28) 30vh); }
/* facts read as a tidy three-column list */
.panel .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem 1.4rem; }
@media (max-width: 640px) { .panel .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* the crest stays a crest, not a poster */
#tab-about .card:first-of-type .pic img { max-height: 180px !important; box-shadow: none !important; }
/* back to the top: a quiet text link */
.to-top { background: none; color: var(--ink-dim); padding: 6px 2px; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; display: block; margin: 0.9rem auto 0; width: max-content; }
.to-top:hover { color: var(--ink); }
.card .act + .to-top { margin-top: 0.6rem; }
/* Why care: the question sits just under the orbit, at reading size */
html.animated .card.prompt { bottom: max(12vh, 60px) !important; }
html.animated .card.prompt p:not(.bridge):not(.credit) {
  font: 500 clamp(24px, 2.4vw, 36px)/1.2 var(--display) !important; letter-spacing: -0.015em; color: var(--ink); max-width: 22ch; margin: 0 auto;
}

/* ---------- Theme lab (only with ?themes) ---------- */
html.themed h1, html.themed h2, html.themed h3, html.themed .reveal, html.themed .panel-head h2 { font-weight: var(--head-weight, 600) !important; }
.tl-open {
  position: fixed; right: 16px; bottom: 16px; z-index: 60; border: 0; cursor: pointer;
  padding: 10px 16px; border-radius: 999px; background: var(--navy); color: #fff; font: 600 13px var(--sans);
  box-shadow: 0 10px 30px rgba(16, 50, 80, 0.25);
}
.tl-panel {
  position: fixed; right: 16px; bottom: 16px; z-index: 60; width: min(320px, calc(100vw - 32px));
  max-height: calc(100vh - 96px); overflow: auto; overscroll-behavior: contain;
  background: rgba(255, 255, 255, 0.97); color: #13222e; border-radius: 18px; padding: 14px 16px 16px;
  box-shadow: 0 24px 70px rgba(16, 50, 80, 0.28); font: 400 13px/1.45 "Inter", system-ui, sans-serif;
}
.tl-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.tl-head strong { font: 600 16px "Inter", system-ui, sans-serif; }
.tl-x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: #4a5d6a; padding: 4px 6px; }
.tl-sec { padding: 10px 0; border-top: 1px solid rgba(19, 34, 46, 0.1); }
.tl-sec h4 { margin: 0 0 8px; font: 600 10.5px "Inter", system-ui, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: #4a5d6a; }
.tl-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tl-preset { display: grid; justify-items: center; gap: 4px; border: 1.5px solid transparent; background: none; border-radius: 12px; padding: 6px 2px; cursor: pointer; font: 500 11.5px "Inter", system-ui, sans-serif; color: #13222e; }
.tl-preset:hover { background: #f1f5f8; }
.tl-preset.on { border-color: #13222e; }
.tl-sw { position: relative; width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.tl-sw i { position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #fff; }
.tl-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tl-color { display: grid; justify-items: center; gap: 4px; font-size: 11px; color: #4a5d6a; text-align: center; cursor: pointer; }
.tl-color input { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.tl-color input::-webkit-color-swatch-wrapper { padding: 0; }
.tl-color input::-webkit-color-swatch { border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 50%; }
.tl-color input::-moz-color-swatch { border: 1px solid rgba(0, 0, 0, 0.15); border-radius: 50%; }
.tl-fonts { display: grid; gap: 10px; }
.tl-field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 8px; font-weight: 500; }
.tl-field > span { grid-column: 1 / -1; font-size: 12px; color: #4a5d6a; }
.tl-field select { grid-column: 1 / -1; width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(19, 34, 46, 0.18); background: #fff; font: 500 13px "Inter", system-ui, sans-serif; color: #13222e; }
.tl-field input[type="range"] { width: 100%; accent-color: #13222e; }
.tl-wv { font: 600 12px "Inter", system-ui, sans-serif; min-width: 2.5em; text-align: right; }
.tl-actions { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid rgba(19, 34, 46, 0.1); }
.tl-btn { flex: 1; border: 0; border-radius: 999px; padding: 9px 12px; cursor: pointer; background: #13222e; color: #fff; font: 600 13px "Inter", system-ui, sans-serif; }
.tl-btn.quiet { flex: 0 0 auto; background: #eef2f5; color: #13222e; }
.tl-note { margin: 10px 0 0; font-size: 11.5px; color: #4a5d6a; }
html.plain .tl-open, html.plain .tl-panel { display: none; }
@media (max-width: 600px) {
  .tl-panel { left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 48vh; padding: 10px 14px 12px; }
  .tl-presets { grid-template-columns: repeat(7, 1fr); gap: 2px; }
  .tl-preset span:last-child { font-size: 10px; }
  .tl-sw { width: 28px; height: 28px; }
}

/* ===================== Design editor options (only in the editor's preview) ===================== */
/* header */
html[data-header="centered"] .topbar { grid-template-columns: 1fr !important; justify-items: center; row-gap: 4px; }
html[data-header="centered"] .brand { justify-self: center; }
html[data-header="split"] .topbar { grid-template-columns: auto 1fr !important; }
html[data-header="split"] .tabs { justify-self: end; }
html[data-tabs="pill"] .tabs button { padding: 7px 14px !important; border-radius: 999px !important; transition: background 0.25s, color 0.25s; }
html[data-tabs="pill"] .tabs button::after { display: none; }
html[data-tabs="pill"] .tabs button[aria-selected="true"] { background: var(--navy) !important; color: #fff !important; }

/* story orientation: text beside the orange (wide screens; phones stay stacked) */
@media (min-width: 900px) {
  html[data-story="left"].animated .card:not(.moment):not(.title),
  html[data-story="right"].animated .card:not(.moment):not(.title) {
    top: 50%; bottom: auto; width: min(30rem, 38vw); max-height: 76vh;
    text-align: left; transform: translateY(calc(-50% + 24px));
  }
  html[data-story="left"].animated .card:not(.moment):not(.title) { margin-left: max(var(--gutter), 6vw); margin-right: auto; }
  html[data-story="right"].animated .card:not(.moment):not(.title) { margin-left: auto; margin-right: max(var(--gutter), 6vw); }
  html[data-story="left"].animated .card:not(.moment):not(.title).on,
  html[data-story="right"].animated .card:not(.moment):not(.title).on { transform: translateY(-50%); }
  html[data-story="left"].animated .card:not(.moment):not(.title).past,
  html[data-story="right"].animated .card:not(.moment):not(.title).past { transform: translateY(calc(-50% - 24px)); }
  html[data-story="left"].animated .card:not(.moment):not(.title) :is(p, ul),
  html[data-story="right"].animated .card:not(.moment):not(.title) :is(p, ul) { margin-left: 0; margin-right: 0; }
  html[data-story="left"].animated .card:not(.moment):not(.title) .quiz-row,
  html[data-story="right"].animated .card:not(.moment):not(.title) .quiz-row { justify-content: flex-start; }
  html[data-story="left"].animated .card.prompt, html[data-story="right"].animated .card.prompt { bottom: auto !important; }
  html[data-story="left"].animated .card.prompt p:not(.bridge):not(.credit),
  html[data-story="right"].animated .card.prompt p:not(.bridge):not(.credit) { margin: 0 !important; }
  html[data-story="left"] .to-top, html[data-story="right"] .to-top { margin-left: 0; }
}

/* sections in the tabs */
html[data-sections="column"].animated .panel .card,
html[data-sections="cards"].animated .panel .card,
html[data-sections="magazine"].animated .panel .card { grid-template-columns: minmax(0, 1fr) !important; }
html[data-sections="column"].animated .panel .card > *,
html[data-sections="cards"].animated .panel .card > *,
html[data-sections="magazine"].animated .panel .card > * { grid-column: 1 !important; }
html[data-sections="column"].animated .panel .card > h3,
html[data-sections="cards"].animated .panel .card > h3,
html[data-sections="magazine"].animated .panel .card > h3 { grid-row: auto !important; position: static !important; margin-bottom: 0.9rem !important; }
html[data-sections="column"].animated .panel .card { max-width: 46rem; margin: 0 auto !important; padding-left: var(--gutter) !important; padding-right: var(--gutter) !important; }
html[data-sections="column"].animated .panel .card > h3 { text-align: center; }
html[data-sections="cards"].animated .panel .card {
  max-width: 50rem; margin: 0 auto 28px !important; padding: clamp(28px, 4vw, 44px) !important;
  background: rgba(255, 255, 255, 0.82) !important; border-top: 0 !important;
  border-radius: var(--radius, 20px) !important; box-shadow: 0 18px 50px rgba(16, 50, 80, 0.1) !important;
}
html[data-sections="magazine"] .panel:not([hidden]) {
  display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px;
  padding: 0 max(var(--gutter), calc((100vw - 76rem) / 2)) 60px !important; align-items: start;
}
html[data-sections="magazine"] .panel > .panel-head, html[data-sections="magazine"] .panel > .lab-wrap { grid-column: 1 / -1; }
html[data-sections="magazine"].animated .panel .card {
  margin: 0 !important; padding: 28px !important; background: rgba(255, 255, 255, 0.82) !important; border-top: 0 !important;
  border-radius: var(--radius, 20px) !important; box-shadow: 0 14px 40px rgba(16, 50, 80, 0.09) !important;
}
@media (max-width: 760px) { html[data-sections="magazine"] .panel:not([hidden]) { grid-template-columns: 1fr; } }

/* the page title of each tab */
html[data-heads="left"] .panel-head { text-align: left; padding-left: max(var(--gutter), calc((100vw - 72rem) / 2)) !important; padding-right: max(var(--gutter), calc((100vw - 72rem) / 2)) !important; }
html[data-heads="left"] .panel-head h2, html[data-heads="left"] .panel-intro { margin-left: 0 !important; }

/* headline size */
html[data-scale="small"] { --title-scale: 0.78; }
html[data-scale="large"] { --title-scale: 1.2; }
html[data-scale] .panel-head h2 { font-size: calc(clamp(40px, 6vw, 84px) * var(--title-scale)) !important; }
html[data-scale].animated .card.title h1 { font-size: calc(clamp(36px, min(5vw, 7vh), 76px) * var(--title-scale)) !important; }
html[data-scale].animated .panel .card > h3 { font-size: calc(clamp(26px, 2.6vw, 40px) * var(--title-scale)) !important; }

/* spacing */
html[data-density="compact"] { --density: 0.6; }
html[data-density="airy"] { --density: 1.5; }
html[data-density].animated .panel .card { padding-top: calc(clamp(48px, 8vh, 96px) * var(--density)) !important; padding-bottom: calc(clamp(48px, 8vh, 96px) * var(--density)) !important; }
html[data-density] .panel-head { padding-top: calc(clamp(120px, 18vh, 180px) * var(--density)) !important; padding-bottom: calc(clamp(48px, 8vh, 80px) * var(--density)) !important; }

/* corners */
html[data-corners="square"] { --radius: 3px; }
html[data-corners="round"] { --radius: 28px; }
html[data-corners] .panel .pic img, html[data-corners] .mini-stage, html[data-corners] .yt, html[data-corners] .practice,
html[data-corners] .guess, html[data-corners] .lab-frame, html[data-corners] .reveal { border-radius: var(--radius) !important; }

/* images */
html[data-images="flat"] .panel .pic img, html[data-images="flat"] .mini-stage { box-shadow: none !important; }
html[data-images="framed"] .panel .pic img, html[data-images="framed"] .mini-stage { box-shadow: 0 2px 10px rgba(16, 50, 80, 0.1) !important; border: 8px solid #fff !important; }

/* footer */
html[data-footer="light"] .site-foot { background: rgba(255, 255, 255, 0.55); color: var(--ink); border-top: 1px solid color-mix(in srgb, var(--navy) 10%, transparent); }
html[data-footer="light"] .site-foot :is(a, .brand-name) { color: var(--ink) !important; }
html[data-footer="light"] .site-foot .foot-note { color: var(--ink-dim); border-top-color: color-mix(in srgb, var(--navy) 10%, transparent); }

/* buttons */
html[data-buttons="square"] :is(.act, .chip, .replay, .tl-btn) { border-radius: 8px !important; }

/* No scroll snapping: it fought the activity lock (each card already holds the page
   until its activity is done), pulling small trackpad steps back so the screen jumped. */
html.animated, html.animated.in-panel { scroll-snap-type: none !important; }

/* ===================== More design editor options (references from Mobbin) ===================== */
/* the soft light behind story text takes the theme's own background colour */
html.themed.animated:not(.in-panel) body::before {
  background: linear-gradient(color-mix(in srgb, var(--sky-bottom) 0%, transparent), color-mix(in srgb, var(--sky-bottom) 78%, transparent) 55%, color-mix(in srgb, var(--sky-bottom) 92%, transparent));
}

/* header: floating pill nav (Frontify, T1 Energy) */
html[data-header="floating"] .tabs {
  background: color-mix(in srgb, var(--sky-top) 70%, white) !important; padding: 6px 20px !important; border-radius: 999px !important;
  box-shadow: 0 6px 24px rgba(16, 50, 80, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.6) !important;
  -webkit-backdrop-filter: blur(12px) !important; backdrop-filter: blur(12px) !important;
}
html[data-header="floating"].scrolled .topbar { background: none !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
/* header: newspaper masthead (The New Yorker) */
html[data-header="masthead"] .topbar { grid-template-columns: 1fr !important; justify-items: center; row-gap: 8px; padding-bottom: 0 !important; }
html[data-header="masthead"] .brand { justify-self: center; }
html[data-header="masthead"] .brand-dot { display: none; }
html[data-header="masthead"] .brand-name { font-size: clamp(24px, 2.6vw, 36px); letter-spacing: -0.01em; }
html[data-header="masthead"] .tabs { justify-self: stretch; justify-content: center; border-top: 1px solid color-mix(in srgb, var(--ink) 22%, transparent) !important; border-bottom: 1px solid color-mix(in srgb, var(--ink) 22%, transparent) !important; padding: 2px 0 !important; }
html[data-header="masthead"] .tabs button { font-size: 12px !important; letter-spacing: 0.12em; text-transform: uppercase; }
/* header: monospace index (Studio Freight) */
html[data-header="mono"] .topbar { padding-top: 10px !important; padding-bottom: 10px !important; }
html[data-header="mono"] .topbar :is(.brand-name, .tabs button) { font: 500 12px ui-monospace, "SF Mono", Menlo, monospace !important; letter-spacing: 0; }
html[data-header="mono"] .brand-dot { width: 9px; height: 9px; }
html[data-header="mono"] .tabs { justify-self: end; }

/* tabs: slash-separated (Studio Freight) and boxed (Dovetail) */
html[data-tabs="slash"] .tabs { gap: 0 !important; }
html[data-tabs="slash"] .tabs button::after { display: none; }
html[data-tabs="slash"] .tabs button + button::before { content: "/"; margin: 0 0.6em; color: var(--ink-dim); opacity: 0.6; }
html[data-tabs="slash"] .tabs button[aria-selected="true"] { text-decoration: underline; text-underline-offset: 4px; }
html[data-tabs="boxed"] .tabs { gap: 6px !important; }
html[data-tabs="boxed"] .tabs button { padding: 7px 13px !important; border-radius: 8px !important; background: color-mix(in srgb, var(--ink) 7%, transparent) !important; }
html[data-tabs="boxed"] .tabs button::after { display: none; }
html[data-tabs="boxed"] .tabs button[aria-selected="true"] { background: var(--navy) !important; color: var(--sky-top) !important; }

/* background texture, shown behind everything (added by js/theme-lab.js) */
.bg-pattern { position: fixed; inset: 0; z-index: 1; pointer-events: none; display: none; }
html[data-bg="grid"] .bg-pattern { display: block; background-image: linear-gradient(color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1px); background-size: 36px 36px; }
html[data-bg="dots"] .bg-pattern { display: block; background-image: radial-gradient(color-mix(in srgb, var(--ink) 16%, transparent) 1px, transparent 1.6px); background-size: 20px 20px; }
html[data-bg="grain"] .bg-pattern { display: block; opacity: 0.35; mix-blend-mode: multiply; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.2 0 0 0 0 0.2 0 0 0 0 0.2 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* story text: bare (default), a card, or frosted glass */
html[data-storybox="card"].animated .card:not(.moment):not(.title):not(.control) {
  background: color-mix(in srgb, var(--sky-top) 25%, white); border-radius: var(--radius, 20px); padding: 22px 26px;
  box-shadow: 0 18px 50px rgba(16, 50, 80, 0.14);
}
html[data-storybox="glass"].animated .card:not(.moment):not(.title):not(.control) {
  background: color-mix(in srgb, var(--sky-top) 35%, transparent); border-radius: var(--radius, 20px); padding: 22px 26px;
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, white 45%, transparent), 0 14px 40px rgba(16, 50, 80, 0.1);
}

/* headline case (SSENSE, Squarespace) */
html[data-case="caps"] :is(h1, h2, h3, .brand-name) { text-transform: uppercase; letter-spacing: 0 !important; }
html[data-case="caps"] .card.title h1 { letter-spacing: -0.01em !important; }

/* small labels */
html[data-labels="mono"] { --mono: ui-monospace, "SF Mono", Menlo, monospace; }
html[data-labels="mono"] :is(.slider-label, .credit, .part, .facts dt, .byline) { font-family: ui-monospace, "SF Mono", Menlo, monospace !important; letter-spacing: 0.02em; }
html[data-labels="serif"] :is(.slider-label, .credit, .facts dt, .byline) { font-family: var(--display) !important; font-style: italic; text-transform: none !important; letter-spacing: 0 !important; font-size: 1.05em; }

/* sections: featured + grid (Cursor, Beside) */
html[data-sections="featured"] .panel:not([hidden]) {
  display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
  padding: 0 max(var(--gutter), calc((100vw - 76rem) / 2)) 60px !important; align-items: start;
}
html[data-sections="featured"] .panel > .panel-head, html[data-sections="featured"] .panel > .lab-wrap, html[data-sections="featured"] .panel .card:first-of-type { grid-column: 1 / -1; }
html[data-sections="featured"].animated .panel .card {
  grid-template-columns: minmax(0, 1fr) !important; margin: 0 !important; padding: 24px !important;
  background: color-mix(in srgb, var(--sky-top) 25%, white) !important; border-top: 0 !important;
  border-radius: var(--radius, 18px) !important; box-shadow: 0 12px 36px rgba(16, 50, 80, 0.08) !important;
}
html[data-sections="featured"].animated .panel .card > * { grid-column: 1 !important; }
html[data-sections="featured"].animated .panel .card > h3 { grid-row: auto !important; position: static !important; margin-bottom: 0.7rem !important; font-size: clamp(20px, 1.6vw, 26px) !important; }
html[data-sections="featured"].animated .panel .card:first-of-type { padding: clamp(28px, 4vw, 48px) !important; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr) !important; column-gap: 40px; }
html[data-sections="featured"].animated .panel .card:first-of-type > * { grid-column: 2 !important; }
html[data-sections="featured"].animated .panel .card:first-of-type > h3 { grid-column: 1 !important; grid-row: 1 / span 20 !important; font-size: clamp(28px, 3vw, 44px) !important; }
@media (max-width: 900px) {
  html[data-sections="featured"] .panel:not([hidden]) { grid-template-columns: 1fr; }
  html[data-sections="featured"].animated .panel .card:first-of-type { grid-template-columns: 1fr !important; }
  html[data-sections="featured"].animated .panel .card:first-of-type > * { grid-column: 1 !important; }
  html[data-sections="featured"].animated .panel .card:first-of-type > h3 { grid-row: auto !important; }
}
/* sections: ruled ledger (In Common With, Family) */
html[data-sections="ledger"].animated .panel .card {
  grid-template-columns: minmax(0, 0.45fr) minmax(0, 1.6fr) !important; background: transparent !important;
  border-top: 1px solid color-mix(in srgb, var(--ink) 30%, transparent) !important;
  padding-top: 22px !important; padding-bottom: 40px !important; max-width: 76rem; margin: 0 auto !important;
  padding-left: var(--gutter) !important; padding-right: var(--gutter) !important;
}
html[data-sections="ledger"].animated .panel .card > h3 { font: 600 13px/1.4 var(--sans) !important; letter-spacing: 0.08em !important; text-transform: uppercase; position: static !important; }
html[data-sections="ledger"] .panel .card p.lead { font-size: clamp(17px, 1.3vw, 20px); }
/* sections: text beside media (Patreon, Anchor) */
html[data-sections="media"].animated .panel .card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; grid-auto-flow: row dense; align-items: start; }
html[data-sections="media"].animated .panel .card > * { grid-column: 1 !important; }
html[data-sections="media"].animated .panel .card > h3 { grid-row: auto !important; position: static !important; margin-bottom: 0.8rem !important; }
html[data-sections="media"].animated .panel .card > :is(.pic, .mini-stage, .yt, .media) { grid-column: 2 !important; grid-row: 1 / span 12; margin-top: 0 !important; }
html[data-sections="media"].animated .panel .card:not(:has(> :is(.pic, .mini-stage, .yt, .media))) > * { grid-column: 1 / -1 !important; }
@media (max-width: 900px) {
  html[data-sections="media"].animated .panel .card { grid-template-columns: 1fr !important; }
  html[data-sections="media"].animated .panel .card > * { grid-column: 1 !important; grid-row: auto !important; }
}

/* footer: one quiet line (Studio Freight) and a bold colour block (Fiasco) */
html[data-footer="minimal"] .site-foot { background: transparent; color: var(--ink-dim); }
html[data-footer="minimal"] .foot-nav, html[data-footer="minimal"] .foot-brand { display: none; }
html[data-footer="minimal"] .foot-note { border-top: 1px solid color-mix(in srgb, var(--ink) 15%, transparent) !important; color: var(--ink-dim) !important; text-align: center; padding-top: 16px; }
html[data-footer="accent"] .site-foot { background: var(--accent); }
html[data-footer="accent"] .site-foot :is(a, .brand-name, .foot-note) { color: #fff !important; }
html[data-footer="accent"] .foot-note { border-top-color: rgba(255, 255, 255, 0.3) !important; }

/* ---------- dark palettes (Linear, Dovetail, In Common With) ---------- */
html[data-mode="dark"] { color-scheme: dark; }
html[data-mode="dark"] .chip { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); border-color: color-mix(in srgb, var(--ink) 25%, transparent); }
html[data-mode="dark"] .chip.picked, html[data-mode="dark"] .quiz.done .chip.right { background: var(--ink); color: var(--sky-bottom); border-color: var(--ink); }
html[data-mode="dark"] .act:disabled { background: color-mix(in srgb, var(--ink) 30%, transparent); }
html[data-mode="dark"] :is(.practice, .guess) { background: color-mix(in srgb, var(--ink) 7%, transparent); }
html[data-mode="dark"] .cm-field :is(input, textarea), html[data-mode="dark"] .practice textarea { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
html[data-mode="dark"].scrolled .topbar { background: color-mix(in srgb, var(--sky-top) 82%, transparent) !important; }
html[data-mode="dark"][data-header="floating"] .tabs { background: color-mix(in srgb, var(--ink) 10%, var(--sky-top)) !important; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent) !important; }
html[data-mode="dark"] .site-foot { background: color-mix(in srgb, var(--ink) 5%, var(--sky-bottom)); }
html[data-mode="dark"] .site-foot :is(a, .brand-name) { color: var(--ink) !important; }
html[data-mode="dark"] .foot-note { color: var(--ink-dim) !important; border-top-color: color-mix(in srgb, var(--ink) 12%, transparent) !important; }
html[data-mode="dark"] .reveal { background: color-mix(in srgb, var(--sky-top) 92%, white 8%); color: var(--ink); }
html[data-mode="dark"] .mini-stage { background: rgba(255, 255, 255, 0.9); }
html[data-mode="dark"] .lab-frame { background: #f2f4f6; border-radius: var(--radius, 20px); }
html[data-mode="dark"] .gate-note { background: var(--ink); color: var(--sky-bottom); }
html[data-mode="dark"] .to-top { color: var(--ink-dim); }
html[data-mode="dark"] .tabs button[aria-selected="true"] { color: var(--ink) !important; }
html[data-mode="dark"][data-tabs="pill"] .tabs button[aria-selected="true"], html[data-mode="dark"][data-tabs="boxed"] .tabs button[aria-selected="true"] { background: var(--ink) !important; color: var(--sky-bottom) !important; }
html[data-mode="dark"] :is([data-sections="cards"], [data-sections="magazine"], [data-sections="featured"]).animated .panel .card,
html[data-mode="dark"][data-sections].animated .panel .card { background-color: transparent; }
html[data-mode="dark"]:is([data-sections="cards"], [data-sections="magazine"], [data-sections="featured"]).animated .panel .card { background: color-mix(in srgb, var(--ink) 6%, transparent) !important; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 10%, transparent) !important; }
html[data-mode="dark"][data-storybox="card"].animated .card:not(.moment):not(.title):not(.control) { background: color-mix(in srgb, var(--ink) 8%, var(--sky-top)); }
html[data-mode="dark"] .panel .pic img { box-shadow: none !important; }
html[data-mode="dark"][data-bg="grain"] .bg-pattern { mix-blend-mode: screen; opacity: 0.18; }
html[data-mode="dark"] .act { color: var(--sky-bottom); }
/* themes: body text follows the theme's text colour */
html.themed { --body-ink: color-mix(in srgb, var(--ink) 86%, var(--sky-top)); }
/* dark looks: no white film over the tabs; the play mark stays dark on its white disc */
html[data-mode="dark"] .panel { background: none !important; }
html[data-mode="dark"] .yt-icon::after { border-left-color: #14171d; }
/* floating header: a soft fade of the page colour keeps scrolled content from crowding the name */
html[data-header="floating"].scrolled .topbar { background: linear-gradient(var(--sky-top) 72%, color-mix(in srgb, var(--sky-top) 0%, transparent)) !important; }

/* ===================== Second wave of editor options (more Mobbin references) ===================== */
/* title page: split name and intro (metic) */
@media (min-width: 900px) {
  html[data-title="split"].animated .card.title { display: grid !important; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); column-gap: 48px; align-items: end; text-align: left; width: min(76rem, calc(100vw - 2 * var(--gutter))); }
  html[data-title="split"].animated .card.title h1 { grid-row: 1 / span 2; margin: 0 !important; text-align: left; }
  html[data-title="split"].animated .card.title :is(.subtitle, .byline) { grid-column: 2; text-align: left !important; margin-left: 0 !important; margin-right: 0 !important; }
  html[data-title="split"].animated .card.title .subtitle { align-self: end; }
}
/* title page: mixed type, a heavy sans word then a light serif (Freshman) */
html[data-title="mixed"].animated .card.title h1 { line-height: 0.95; }
html[data-title="mixed"].animated .card.title h1 .title-last { display: block !important; font-family: var(--sans); font-weight: 800; letter-spacing: -0.04em; text-transform: uppercase; font-size: 0.62em; }
html[data-title="mixed"].animated .card.title h1 .title-line { display: block !important; font-family: var(--display); font-weight: 300 !important; letter-spacing: -0.03em; }
html[data-title="mixed"].animated .card.title h1 .title-last::after { content: none; }
/* title page: gradient headline (Contra) */
/* one sweep across the whole headline, not one per line */
html[data-title="gradient"].animated .card.title h1 {
  background: linear-gradient(100deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #7a5cff) 55%, var(--ink));
  -webkit-background-clip: text; background-clip: text; color: transparent !important;
}
html[data-title="gradient"].animated .card.title h1 :is(.title-last, .title-line) { color: transparent !important; background: none; }

/* section titles in the tabs: numbered (Studio Freight), eyebrow pill (Ease), underlined */
html[data-heads2="numbered"] .panel { counter-reset: sec; }
html[data-heads2="numbered"] .panel .card > h3::before { counter-increment: sec; content: counter(sec, decimal-leading-zero); display: block; margin-bottom: 0.5rem; font: 500 12px var(--mono, var(--sans)); letter-spacing: 0.1em; color: var(--accent); }
html[data-heads2="eyebrow"] .panel .card > h3 { font: 600 12px/1 var(--sans) !important; letter-spacing: 0.1em !important; text-transform: uppercase; display: inline-block; justify-self: start; align-self: start; padding: 7px 11px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: color-mix(in srgb, var(--accent) 80%, var(--ink)); width: max-content; max-width: 100%; }
html[data-heads2="underlined"] .panel .card > h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.22em; text-decoration-color: var(--accent); }

/* dividers between sections */
html[data-dividers="none"].animated .panel .card { border-top-color: transparent !important; }
html[data-dividers="bold"].animated .panel .card { border-top: 3px solid var(--ink) !important; }
html[data-dividers="dotted"].animated .panel .card { border-top: 1.5px dotted color-mix(in srgb, var(--ink) 45%, transparent) !important; }
html[data-dividers="bold"] .panel .card:first-of-type, html[data-dividers="dotted"] .panel .card:first-of-type { border-top-color: transparent !important; }

/* links */
html[data-links="highlight"] .card a:not(.act):not(.to-top) { color: var(--ink); text-decoration: none; background: linear-gradient(transparent 58%, color-mix(in srgb, var(--accent) 28%, transparent) 58%); }
html[data-links="plain"] .card a:not(.act):not(.to-top) { text-decoration: none; font-weight: 600; }

/* content width */
html[data-width="narrow"]:not([data-sections="column"]):not([data-sections="cards"]):not([data-sections="sheet"]).animated .panel .card { padding-left: max(var(--gutter), calc((100vw - 52rem) / 2)) !important; padding-right: max(var(--gutter), calc((100vw - 52rem) / 2)) !important; }
html[data-width="wide"]:not([data-sections="column"]):not([data-sections="cards"]):not([data-sections="sheet"]).animated .panel .card { padding-left: max(var(--gutter), calc((100vw - 92rem) / 2)) !important; padding-right: max(var(--gutter), calc((100vw - 92rem) / 2)) !important; }

/* images: polaroid (Givingli) and black-and-white (Freshman) */
html[data-images="polaroid"] .panel .pic img { border: 10px solid #fff !important; border-bottom-width: 34px !important; border-radius: 2px !important; box-shadow: 0 14px 34px rgba(30, 20, 10, 0.18) !important; transform: rotate(-1.2deg); }
html[data-images="polaroid"] .panel .pic-row img:nth-child(even) { transform: rotate(1.4deg); }
html[data-images="mono"] .panel .pic img, html[data-images="mono"] .yt-play img { filter: grayscale(1) contrast(1.08); }
html[data-images="mono"] .panel .pic img:hover, html[data-images="mono"] .yt-play:hover img { filter: none; }

/* backgrounds: ruled lines and concentric rings (Ease) */
html[data-bg="lines"] .bg-pattern { display: block; background-image: linear-gradient(color-mix(in srgb, var(--ink) 8%, transparent) 1px, transparent 1px); background-size: 100% 30px; }
html[data-bg="rings"] .bg-pattern {
  display: block; opacity: 0.5;
  background: repeating-radial-gradient(circle at 110% 10%, transparent 0 46px, color-mix(in srgb, var(--accent) 45%, transparent) 46px 47.5px);
  -webkit-mask-image: radial-gradient(circle at 100% 0%, #000 25%, transparent 62%); mask-image: radial-gradient(circle at 100% 0%, #000 25%, transparent 62%);
}

/* sections: one paper sheet (Bento) */
html[data-sections="sheet"] #panels .panel:not([hidden]) { max-width: 50rem !important; margin: 0 auto clamp(40px, 8vh, 80px) !important; background: color-mix(in srgb, var(--sky-top) 18%, white) !important; border-radius: var(--radius, 22px); box-shadow: 0 30px 80px rgba(16, 50, 80, 0.12); padding-bottom: 40px !important; }
html[data-sections="sheet"].animated .panel .card { grid-template-columns: minmax(0, 1fr) !important; padding: 36px clamp(24px, 5vw, 64px) !important; background: transparent !important; }
html[data-sections="sheet"].animated .panel .card > * { grid-column: 1 !important; }
html[data-sections="sheet"].animated .panel .card > h3 { grid-row: auto !important; position: static !important; margin-bottom: 0.9rem !important; }
html[data-sections="sheet"] .panel-head { padding-top: clamp(56px, 9vh, 90px) !important; }
html[data-sections="sheet"] #panels { padding-top: clamp(90px, 13vh, 130px); }
html[data-mode="dark"][data-sections="sheet"] #panels .panel:not([hidden]) { background: color-mix(in srgb, var(--ink) 6%, var(--sky-top)) !important; }

/* tabs in brackets (Taste Labs) */
html[data-tabs="bracket"] .tabs { gap: 14px !important; }
html[data-tabs="bracket"] .tabs button::after { display: none; }
html[data-tabs="bracket"] .tabs button { font-family: ui-monospace, "SF Mono", Menlo, monospace !important; font-size: 12.5px !important; }
html[data-tabs="bracket"] .tabs button::before { content: "( "; opacity: 0; transition: opacity 0.2s; }
html[data-tabs="bracket"] .tabs button[aria-selected="true"]::before { opacity: 1; }
html[data-tabs="bracket"] .tabs button[aria-selected="true"] > :only-child, html[data-tabs="bracket"] .tabs button[aria-selected="true"] { }
html[data-tabs="bracket"] .tabs button { position: relative; }
html[data-tabs="bracket"] .tabs button[aria-selected="true"]::after { display: inline !important; content: " )"; position: static !important; background: none !important; transform: none !important; height: auto !important; }

/* buttons: outline */
html[data-buttons="outline"] .act { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
html[data-buttons="outline"] .act:hover { background: var(--ink); color: var(--sky-top); box-shadow: none; }

/* ===================== Third wave of editor options ===================== */
/* navigation: left sidebar (Shopify Editions) */
@media (min-width: 900px) {
  html[data-nav="side"] .topbar {
    position: fixed !important; left: 0; top: 0; bottom: 0; width: 220px; height: auto;
    display: flex !important; flex-direction: column !important; align-items: flex-start; justify-content: flex-start; gap: 28px;
    padding: 28px 24px !important; background: color-mix(in srgb, var(--sky-top) 70%, white) !important;
    border-right: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); box-shadow: none !important;
  }
  html[data-nav="side"] .brand { opacity: 1 !important; pointer-events: auto !important; }
  html[data-nav="side"] .tabs { flex-direction: column; align-items: flex-start; gap: 4px !important; justify-self: auto; border: 0 !important; background: none !important; box-shadow: none !important; padding: 0 !important; }
  html[data-nav="side"] .tabs button { padding: 6px 0 !important; text-align: left; }
  html[data-nav="side"] .tabs button + button::before { content: none !important; }
  html[data-nav="side"] :is(#story, #panels, .site-foot) { margin-left: 220px; }
  html[data-nav="side"] .rail { right: 22px; }
  html[data-mode="dark"][data-nav="side"] .topbar { background: color-mix(in srgb, var(--ink) 5%, var(--sky-top)) !important; }
}
/* navigation: bottom dock */
html[data-nav="dock"] .topbar {
  position: fixed !important; top: auto !important; bottom: 18px; left: 50%; right: auto; transform: translateX(-50%);
  display: flex !important; width: auto; padding: 8px 18px !important; border-radius: 999px;
  background: color-mix(in srgb, var(--sky-top) 75%, white) !important; box-shadow: 0 14px 40px rgba(16, 50, 80, 0.18) !important;
  -webkit-backdrop-filter: blur(14px) !important; backdrop-filter: blur(14px) !important;
}
html[data-nav="dock"] .brand { display: none !important; }
html[data-nav="dock"] .tabs { border: 0 !important; background: none !important; box-shadow: none !important; padding: 0 !important; }
html[data-nav="dock"].animated .card:not(.moment):not(.title) { bottom: 96px; }
html[data-nav="dock"] .gate-note { bottom: 96px; }
html[data-nav="dock"] .reveal { bottom: 96px; }
html[data-nav="dock"] .panel-head { padding-top: clamp(64px, 10vh, 110px) !important; }
html[data-nav="dock"] .site-foot { padding-bottom: 90px; }
html[data-mode="dark"][data-nav="dock"] .topbar { background: color-mix(in srgb, var(--ink) 12%, var(--sky-top)) !important; }

/* top bar backdrop when scrolled */
html[data-topbg="solid"].scrolled .topbar { background: var(--sky-top) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html[data-topbg="clear"].scrolled .topbar { background: none !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

/* story progress: top bar, percentage, or none */
html[data-progress="none"] .rail { display: none !important; }
html[data-progress="bar"] .rail { left: 0; right: 0; top: 0; z-index: 11; opacity: 1; display: block !important; }
html[data-progress="bar"] .rail-num { display: none; }
html[data-progress="bar"] .rail-track { width: 100%; height: 3px; background: transparent; }
html[data-progress="bar"] .rail-fill { background: var(--accent); transform-origin: left; transform: scaleX(var(--done, 0)); }
html[data-progress="percent"] .rail { top: auto; bottom: 22px; right: 24px; opacity: 0.8; font: 500 13px ui-monospace, "SF Mono", Menlo, monospace; }
html[data-progress="percent"] .rail-track { display: none; }
html[data-progress="percent"] .rail-num { display: block !important; }
html[data-progress="bar"].in-panel .rail, html[data-progress="percent"].in-panel .rail { display: none !important; }

/* story text size and alignment */
html[data-storysize="small"].animated .card:not(.moment):not(.title) { font-size: 0.88em; }
html[data-storysize="large"].animated .card:not(.moment):not(.title) { font-size: 1.14em; width: min(44rem, calc(100vw - 2 * var(--gutter))); }
html[data-storysize="large"].animated .card:not(.moment):not(.title) h3 { font-size: 1.35em; }
html[data-storyalign="left"].animated .card:not(.moment):not(.title) { text-align: left; }
html[data-storyalign="left"].animated .card:not(.moment):not(.title) :is(p, ul) { margin-left: 0; }
html[data-storyalign="left"].animated .card:not(.moment):not(.title) .quiz-row { justify-content: flex-start; }

/* section headings stop following you */
html[data-sticky="off"].animated .panel .card > h3 { position: static !important; }

/* title page: staggered lines (Studio Freight) and glitch (Unseen Studio) */
html[data-title="staggered"].animated .card.title h1 { text-align: left; line-height: 0.92; text-transform: uppercase; letter-spacing: -0.02em; }
html[data-title="staggered"].animated .card.title h1 .title-last { display: block !important; padding-left: 0; }
html[data-title="staggered"].animated .card.title h1 .title-line { display: block !important; padding-left: 22%; }
html[data-title="staggered"].animated .card.title h1 .title-last::after { content: none; }
html[data-title="glitch"].animated .card.title h1 { text-shadow: -2px 0 rgba(255, 40, 60, 0.75), 2px 0 rgba(0, 200, 255, 0.75); letter-spacing: 0.01em; }

/* section titles: big faint numerals (Pitch) and a short rule beneath (Gamma) */
html[data-heads2="bignum"] .panel { counter-reset: sec; }
html[data-heads2="bignum"] .panel .card > h3::before { counter-increment: sec; content: counter(sec, decimal-leading-zero) "."; display: block; font: 800 clamp(40px, 5vw, 64px)/1 var(--sans); letter-spacing: -0.03em; color: color-mix(in srgb, var(--ink) 12%, transparent); margin-bottom: 0.3rem; }
html[data-heads2="rule"] .panel .card > h3::after { content: ""; display: block; width: 44px; height: 3px; margin-top: 0.7rem; background: color-mix(in srgb, var(--ink) 55%, transparent); }

/* shadows */
html[data-shadows="none"] :is(.panel .pic img, .mini-stage, .act, .reveal, .yt-play, .lab-frame, .panel .card) { box-shadow: none !important; }
html[data-shadows="deep"] :is(.panel .pic img, .mini-stage, .yt-play) { box-shadow: 0 34px 80px rgba(10, 30, 50, 0.28) !important; }
html[data-shadows="hard"] :is(.panel .pic img, .mini-stage, .yt-play, .act, .chip, .practice, .guess) { box-shadow: 5px 5px 0 var(--ink) !important; }
html[data-shadows="hard"]:is([data-sections="cards"], [data-sections="magazine"], [data-sections="featured"]).animated .panel .card { box-shadow: 7px 7px 0 var(--ink) !important; }
/* outlines */
html[data-outlines="hairline"] :is(.panel .pic img, .mini-stage, .yt-play, .practice, .guess) { outline: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); outline-offset: -1px; }
html[data-outlines="hairline"]:is([data-sections="cards"], [data-sections="magazine"], [data-sections="featured"], [data-sections="sheet"]).animated .panel .card { outline: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); }
html[data-outlines="thick"] :is(.panel .pic img, .mini-stage, .yt-play, .practice, .guess, .act, .chip) { outline: 2.5px solid var(--ink); outline-offset: -2.5px; }
html[data-outlines="thick"]:is([data-sections="cards"], [data-sections="magazine"], [data-sections="featured"], [data-sections="sheet"]).animated .panel .card { outline: 2.5px solid var(--ink); }

/* reading: text size, line spacing, heading tracking */
html[data-textsize="small"] .panel .card { font-size: 0.92em; }
html[data-textsize="large"] .panel .card { font-size: 1.1em; }
html[data-leading="tight"] .panel .card :is(p, li) { line-height: 1.4; }
html[data-leading="loose"] .panel .card :is(p, li) { line-height: 1.85; }
html[data-tracking="tight"] :is(h1, h2, h3) { letter-spacing: -0.04em !important; }
html[data-tracking="wide"] :is(h1, h2, h3) { letter-spacing: 0.04em !important; }
/* drop cap on each section's first paragraph */
html[data-dropcap="on"] .panel .card > h3 + p::first-letter { float: left; font: var(--head-weight, 600) 3.4em/0.82 var(--display); margin: 0.06em 0.1em 0 0; color: var(--accent); }
/* a small accent mark before headings */
html[data-accentmark="bar"] .panel .card > h3::before { content: ""; display: block; width: 28px; height: 4px; border-radius: 2px; margin-bottom: 0.8rem; background: var(--accent); }
html[data-accentmark="dot"] .panel .card > h3::after { content: ""; display: inline-block; width: 0.32em; height: 0.32em; margin-left: 0.12em; border-radius: 50%; background: var(--accent); vertical-align: 0.1em; }

/* buttons: bevelled (retro web) and plain text links */
html[data-buttons="bevel"] .act { border-radius: 2px; background: #e4e4e4; color: #111; box-shadow: inset -2px -2px 0 #8a8a8a, inset 2px 2px 0 #fff, 0 0 0 1px #111 !important; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
html[data-buttons="link"] .act { background: none; box-shadow: none !important; padding: 4px 0; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
/* images: big rounded corners and sepia */
html[data-images="rounded"] .panel .pic img, html[data-images="rounded"] .mini-stage, html[data-images="rounded"] .yt-play { border-radius: 32px !important; }
html[data-images="sepia"] .panel .pic img, html[data-images="sepia"] .yt-play img { filter: sepia(0.55) contrast(1.05) saturate(0.85); }
/* backgrounds: pixel field (Mixpanel) and a soft accent glow */
html[data-bg="pixels"] .bg-pattern { display: block; opacity: 0.5; background-image: linear-gradient(90deg, color-mix(in srgb, var(--accent) 25%, transparent) 50%, transparent 50%), linear-gradient(color-mix(in srgb, var(--accent) 25%, transparent) 50%, transparent 50%); background-size: 12px 12px; -webkit-mask-image: linear-gradient(115deg, #000 0%, transparent 38%); mask-image: linear-gradient(115deg, #000 0%, transparent 38%); }
html[data-bg="glow"] .bg-pattern { display: block; background: radial-gradient(60vmax 50vmax at 85% 8%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), radial-gradient(50vmax 40vmax at 5% 95%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%); }
/* links in [brackets] (retro web) */
html[data-links="bracket"] .card a:not(.act):not(.to-top) { color: #1a3fd6; }
html[data-links="bracket"] .card a:not(.act):not(.to-top)::before { content: "["; }
html[data-links="bracket"] .card a:not(.act):not(.to-top)::after { content: "]"; }

/* in single-column layouts, width sets the column itself */
html[data-width="narrow"]:is([data-sections="column"], [data-sections="cards"]).animated .panel .card { max-width: 38rem; }
html[data-width="wide"]:is([data-sections="column"], [data-sections="cards"]).animated .panel .card { max-width: 62rem; }
html[data-width="narrow"][data-sections="sheet"] #panels .panel:not([hidden]) { max-width: 40rem !important; }
html[data-width="wide"][data-sections="sheet"] #panels .panel:not([hidden]) { max-width: 64rem !important; }

/* ===================== Design elements and animations (editor "Elements" tab) ===================== */
/* marquee strip */
.fx-marquee { overflow: hidden; display: flex; white-space: nowrap; pointer-events: none; z-index: 9;
  background: var(--navy); color: var(--sky-top); font: 600 12px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
html[data-fxmarquee="top"] .fx-marquee { position: fixed; left: 0; right: 0; top: 0; height: 30px; align-items: center; }
html[data-fxmarquee="top"] .topbar { top: 30px !important; }
html[data-fxmarquee="footer"] .fx-marquee { position: relative; z-index: 3; padding: 14px 0; }
.fx-marquee-run { display: flex; flex: none; gap: 22px; padding-right: 22px; animation: fxMarquee 38s linear infinite; }
.fx-marquee-run i { font-style: normal; color: var(--accent); }
@keyframes fxMarquee { to { transform: translateX(-100%); } }
html[data-mode="dark"] .fx-marquee { background: var(--ink); color: var(--sky-bottom); }

/* spinning badge */
.fx-badge { position: fixed; right: 26px; bottom: 26px; z-index: 8; width: 112px; height: 112px; pointer-events: none; }
.fx-badge svg { width: 100%; height: 100%; animation: fxSpin 18s linear infinite; }
.fx-badge text { font: 700 10px var(--sans); fill: var(--ink); }
.fx-badge-core { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ffc98a 0%, #e8781c 48%, #a94b06 100%); box-shadow: 0 4px 12px rgba(120, 50, 0, 0.3); }
@keyframes fxSpin { to { transform: rotate(360deg); } }
html[data-progress="percent"] .fx-badge { bottom: 56px; }
html[data-nav="dock"] .fx-badge { bottom: 84px; }

/* back to top */
.fx-totop { position: fixed; left: 22px; bottom: 22px; z-index: 8; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--navy); color: var(--sky-top); font: 600 18px var(--sans); box-shadow: 0 10px 26px rgba(16, 50, 80, 0.22);
  opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity 0.3s, transform 0.3s; }
.fx-totop.show { opacity: 1; transform: none; pointer-events: auto; }
html[data-mode="dark"] .fx-totop { background: var(--ink); color: var(--sky-bottom); }

/* cursor */
.fx-cursor { position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--accent); transition: width 0.25s, height 0.25s, margin 0.25s, background 0.25s; }
.fx-cursor.ring { background: transparent; border: 1.5px solid var(--ink); width: 30px; height: 30px; margin: -15px 0 0 -15px; }
.fx-cursor.over { width: 44px; height: 44px; margin: -22px 0 0 -22px; background: color-mix(in srgb, var(--accent) 25%, transparent); }
.fx-cursor.orange { width: 18px; height: 18px; margin: -9px 0 0 -9px; background: radial-gradient(circle at 34% 30%, #ffc98a 0%, #e8781c 48%, #a94b06 100%); }

/* ambient blobs */
.fx-blobs { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.fx-blobs i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(70px); opacity: 0.35; background: var(--accent); animation: fxBlob 26s ease-in-out infinite alternate; }
.fx-blobs i:nth-child(1) { left: -12vmax; top: -14vmax; }
.fx-blobs i:nth-child(2) { right: -16vmax; top: 30vh; background: color-mix(in srgb, var(--accent) 40%, #7aa7ff); animation-duration: 32s; }
.fx-blobs i:nth-child(3) { left: 30vw; bottom: -22vmax; background: color-mix(in srgb, var(--sky-bottom) 60%, var(--accent)); animation-duration: 38s; }
@keyframes fxBlob { 50% { transform: translate(6vw, 4vh) scale(1.1); } 100% { transform: translate(-4vw, 8vh) scale(0.95); } }

/* section index (tabs only, wide screens) */
.fx-toc { display: none; }
@media (min-width: 1180px) {
  html.in-panel .fx-toc:not(.empty) { display: block; position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 8; width: 180px;
    font: 500 12.5px/1.35 var(--sans); }
  .fx-toc p { margin: 0 0 8px; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); }
  .fx-toc ol { margin: 0; padding: 0 0 0 12px; border-left: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); list-style: none; display: grid; gap: 7px; }
  .fx-toc a { color: var(--ink-dim); text-decoration: none; }
  .fx-toc a:hover { color: var(--ink); }
  html[data-fxtoc].in-panel:not([data-sections="magazine"]):not([data-sections="featured"]) .panel .card { padding-right: max(220px, calc((100vw - 72rem) / 2)) !important; }
}

/* reveal on scroll: fade, rise or blur */
html[data-fxreveal].animated .panel .card > * { transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), filter 0.8s !important; }
html[data-fxreveal].animated .panel .card > *:nth-child(2) { transition-delay: 0.06s !important; }
html[data-fxreveal].animated .panel .card > *:nth-child(n+3) { transition-delay: 0.12s !important; }
html[data-fxreveal="fade"].animated .panel .card:not(.fx-in) > * { opacity: 0 !important; }
html[data-fxreveal="rise"].animated .panel .card:not(.fx-in) > * { opacity: 0 !important; transform: translateY(28px) !important; }
html[data-fxreveal="blur"].animated .panel .card:not(.fx-in) > * { opacity: 0 !important; filter: blur(10px); }
/* headings: an accent underline draws in, or the heading slides in */
html[data-fxheadline="draw"] .panel .card > h3 { background: linear-gradient(var(--accent), var(--accent)) no-repeat left 100% / 0 3px; padding-bottom: 6px; transition: background-size 0.9s 0.15s cubic-bezier(0.22, 1, 0.36, 1); }
html[data-fxheadline="draw"] .panel .card.fx-in > h3 { background-size: 2.2em 3px; }
html[data-fxheadline="slide"].animated .panel .card:not(.fx-in) > h3 { opacity: 0 !important; transform: translateX(-30px) !important; }
html[data-fxheadline="slide"].animated .panel .card > h3 { transition: opacity 0.8s, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1) !important; }
/* the lead sentence gets a highlighter sweep */
html[data-fxmarker="sweep"] .panel .card p.lead { background: linear-gradient(transparent 60%, color-mix(in srgb, var(--accent) 24%, transparent) 60%) no-repeat 0 0 / 0 100%; transition: background-size 1.4s 0.3s cubic-bezier(0.22, 1, 0.36, 1); display: inline; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
html[data-fxmarker="sweep"] .panel .card.fx-in p.lead { background-size: 100% 100%; }
/* pictures wipe open */
html[data-fximgreveal="wipe"] .panel .card .pic img, html[data-fximgreveal="wipe"] .panel .card .mini-stage { transition: clip-path 1.1s cubic-bezier(0.65, 0, 0.35, 1) 0.15s; }
html[data-fximgreveal="wipe"] .panel .card:not(.fx-in) :is(.pic img, .mini-stage) { clip-path: inset(0 100% 0 0); }
html[data-fximgreveal="zoom"] .panel .card .pic img { transition: transform 1.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 1s; }
html[data-fximgreveal="zoom"] .panel .card:not(.fx-in) .pic img { transform: scale(1.12) !important; opacity: 0; }
/* hover */
html[data-fxhover="lift"] .panel :is(.pic img, .mini-stage, .yt-play) { transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s; }
html[data-fxhover="lift"] .panel :is(.pic img, .mini-stage, .yt-play):hover { transform: translateY(-6px) !important; box-shadow: 0 26px 60px rgba(16, 50, 80, 0.22) !important; }
html[data-fxhover="zoom"] .panel .pic-one, html[data-fxhover="zoom"] .panel .pic-row > * { overflow: hidden; border-radius: inherit; }
html[data-fxhover="zoom"] .panel .pic img { transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
html[data-fxhover="zoom"] .panel .pic img:hover { transform: scale(1.045) !important; }
html[data-fxhover="tilt"] .panel .pic img { transition: transform 0.4s; }
html[data-fxhover="tilt"] .panel .pic img:hover { transform: rotate(-1.5deg) scale(1.02) !important; }
/* switching tabs */
html[data-fxtabanim="fade"] :is(.panel:not([hidden]), #story:not([hidden])) { animation: fxFade 0.55s ease both; }
html[data-fxtabanim="rise"] :is(.panel:not([hidden]), #story:not([hidden])) { animation: fxRise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes fxFade { from { opacity: 0; } }
@keyframes fxRise { from { opacity: 0; transform: translateY(36px); } }
/* title entrance */
html[data-fxentrance="rise"].animated .card.title h1 :is(.title-last, .title-line) { display: inline-block; animation: fxRise 1.1s cubic-bezier(0.22, 1, 0.36, 1) both; }
html[data-fxentrance="rise"].animated .card.title h1 .title-line { animation-delay: 0.15s; }
html[data-fxentrance="blur"].animated .card.title h1 { animation: fxBlurIn 1.4s ease both; }
@keyframes fxBlurIn { from { opacity: 0; filter: blur(18px); letter-spacing: 0.06em; } }
html[data-fxentrance="wipe"].animated .card.title h1 { animation: fxWipe 1.2s cubic-bezier(0.65, 0, 0.35, 1) both; }
@keyframes fxWipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
/* scroll cue */
html[data-fxscrollcue="bounce"] .cue { animation: fxBounce 1.8s ease-in-out infinite; }
html[data-fxscrollcue="pulse"] .cue { animation: fxPulse 2.2s ease-in-out infinite; }
@keyframes fxBounce { 50% { transform: translate(-50%, 8px); } }
@keyframes fxPulse { 50% { letter-spacing: 0.42em; } }
/* ornaments between sections (added by js/design-fx.js) */
.fx-orn { position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); z-index: 2; pointer-events: none; display: grid; place-items: center;
  width: 34px; height: 22px; background: var(--sky-top); color: var(--accent); font: 16px/1 var(--display); }
html.animated .panel .card.fx-has-orn { position: relative !important; }
.fx-orn.slice::before { content: ""; width: 18px; height: 18px; border-radius: 50%;
  background: conic-gradient(from 0deg, #f4a548 0 40deg, #fff6e6 40deg 45deg, #f4a548 45deg 85deg, #fff6e6 85deg 90deg, #f4a548 90deg 130deg, #fff6e6 130deg 135deg, #f4a548 135deg 175deg, #fff6e6 175deg 180deg, #f4a548 180deg 220deg, #fff6e6 220deg 225deg, #f4a548 225deg 265deg, #fff6e6 265deg 270deg, #f4a548 270deg 310deg, #fff6e6 310deg 315deg, #f4a548 315deg 355deg, #fff6e6 355deg);
  box-shadow: 0 0 0 2px #e8781c; }
/* giant wordmark in the footer */
html[data-fxwordmark="on"] .site-foot { overflow: hidden; }
html[data-fxwordmark="on"] .site-foot::after { content: "Peel back the map."; display: block; padding: 10px clamp(16px, 3vw, 40px) 0; margin-bottom: -0.18em;
  font: var(--head-weight, 600) clamp(56px, 13.5vw, 230px)/0.9 var(--display); letter-spacing: -0.045em; white-space: nowrap; opacity: 0.9; color: inherit; }
html[data-fxwordmark="on"][data-case="caps"] .site-foot::after { text-transform: uppercase; }
@media (prefers-reduced-motion: reduce) {
  .fx-marquee-run, .fx-badge svg, .fx-blobs i, .cue { animation: none !important; }
}

/* ===================== Feedback button (only with tools/serve.py running) ===================== */
.fb-open { position: fixed; left: 16px; bottom: 16px; z-index: 80; border: 0; cursor: pointer; padding: 9px 15px; border-radius: 999px;
  background: #16202a; color: #fff; font: 600 13px "Inter", system-ui, sans-serif; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22); }
.fb-open::before { content: "✎ "; }
html.has-feedback .fx-totop { bottom: 70px; }
.fb-box { position: fixed; left: 16px; bottom: 16px; z-index: 81; width: min(340px, calc(100vw - 32px)); display: grid; gap: 10px;
  padding: 14px 16px 16px; border-radius: 16px; background: #fff; color: #16202a; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  font: 400 13.5px/1.45 "Inter", system-ui, sans-serif; }
.fb-box[hidden], .fb-open[hidden], .fb-veil[hidden], .fb-highlight[hidden], .fb-tip[hidden] { display: none !important; }
.fb-head { display: flex; justify-content: space-between; align-items: center; }
.fb-head strong { font-size: 15px; }
.fb-x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: #5b6874; }
.fb-pin { display: grid; gap: 6px; }
.fb-point { justify-self: start; border: 1.5px dashed #b34a00; background: #fff6ee; color: #8a3500; border-radius: 10px; padding: 8px 12px; cursor: pointer; font: 600 13px "Inter", system-ui, sans-serif; }
.fb-point::before { content: "⌖ "; }
.fb-where { margin: 0; font-size: 12px; color: #5b6874; }
.fb-pin.pinned .fb-where { color: #16202a; font-weight: 600; }
.fb-box textarea { width: 100%; box-sizing: border-box; resize: vertical; padding: 9px 11px; border-radius: 10px; border: 1px solid #d6dbe0; font: 400 14px/1.45 "Inter", system-ui, sans-serif; color: #16202a; background: #fff; }
.fb-send { border: 0; border-radius: 10px; padding: 10px 12px; cursor: pointer; background: #b34a00; color: #fff; font: 600 14px "Inter", system-ui, sans-serif; }
.fb-send:disabled { opacity: 0.6; }
.fb-status { margin: 0; font-size: 12.5px; color: #3c4a55; min-height: 1em; }
.fb-veil { position: fixed; inset: 0; z-index: 90; cursor: crosshair; background: rgba(22, 32, 42, 0.06); }
.fb-highlight { position: fixed; z-index: 91; pointer-events: none; border: 2px solid #b34a00; border-radius: 6px; background: rgba(179, 74, 0, 0.08); transition: all 0.08s; }
.fb-tip { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 92; pointer-events: none; padding: 8px 14px; border-radius: 999px; background: #16202a; color: #fff; font: 600 13px "Inter", system-ui, sans-serif; }
html.plain .fb-open { display: none; }

/* ---------- spacing fixes from the audit ---------- */
/* sidebar nav: story cards fit beside the sidebar */
@media (min-width: 900px) {
  html[data-nav="side"].animated #story .card { max-width: calc(100vw - 220px - 2 * var(--gutter)); }
}
/* phones: corner add-ons stay out of the story text */
@media (max-width: 600px) {
  html:not(.in-panel) .fx-totop, html:not(.in-panel) .fx-badge { display: none; }
  .fx-badge { width: 76px; height: 76px; right: 12px; bottom: 12px; }
  .fb-open { left: auto; right: 10px; top: 10px; bottom: auto; padding: 6px 11px; font-size: 12px; }
  .fb-box { left: 8px; right: 8px; bottom: 8px; width: auto; }
}

/* ===================== One screen per tab (the default; "Long scroll" in the editor restores the long pages) ===================== */
html:not([data-format="long"]) #panels .pane-stage { min-height: 0; position: relative; }
html[data-format="long"] #panels .pane-stage { display: contents; }
html[data-format="long"] #panels :is(.pane-nav, .pane-foot) { display: none; }
html:not([data-format="long"]).in-panel .site-foot { display: none; }
html:not([data-format="long"]).animated #panels .panel:not([hidden]) {
  box-sizing: border-box; display: grid !important;
  height: calc(100svh - var(--bar, 64px) - var(--bar-bottom, 0px)); margin-top: var(--bar, 64px);
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "head head" "nav stage" "foot foot";
  column-gap: clamp(24px, 3.2vw, 56px);
  padding: clamp(12px, 2.2vh, 24px) clamp(20px, 3.4vw, 56px) 8px !important; max-width: none !important; background: none !important;
}
html:not([data-format="long"]).animated #panels .panel.pane-solo:not([hidden]) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "stage" "foot"; }
/* the title row: one line, not a hero */
html:not([data-format="long"]) #panels .panel-head { grid-area: head; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 22px; row-gap: 2px;
  padding: 0 0 clamp(10px, 2vh, 20px) !important; margin: 0 !important; text-align: left !important; border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); }
html:not([data-format="long"]) #panels .panel-head h2 { font-size: clamp(24px, 2.5vw, 38px) !important; margin: 0 !important; max-width: none !important; line-height: 1.1; }
html:not([data-format="long"]) #panels .panel-intro { margin: 0 !important; max-width: 60rem !important; font-size: clamp(13.5px, 1vw, 15.5px) !important; }
/* the list of sections */
html:not([data-format="long"]) #panels .pane-nav { grid-area: nav; display: flex; flex-direction: column; min-height: 0; padding-top: clamp(14px, 2.4vh, 26px); }
.pane-nav ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; overflow: auto; }
.pane-nav ol button { display: grid; grid-template-columns: 2.2em 1fr; align-items: baseline; width: 100%; text-align: left; cursor: pointer;
  border: 0; border-left: 2px solid color-mix(in srgb, var(--ink) 12%, transparent); background: none; padding: 9px 10px 9px 12px;
  font: 500 14.5px/1.3 var(--sans); color: var(--ink-dim); transition: color 0.2s, border-color 0.2s, background 0.2s; }
.pane-nav ol button:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, transparent); }
.pane-nav ol button[aria-current] { color: var(--ink); font-weight: 650; border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.pane-num { font: 500 11px var(--mono, var(--sans)); letter-spacing: 0.06em; opacity: 0.7; }
.pane-step { display: flex; gap: 8px; margin-top: auto; padding-top: 14px; }
.pane-step button { border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); background: color-mix(in srgb, white 55%, transparent); border-radius: 999px; padding: 8px 13px; cursor: pointer; font: 600 12.5px/1.25 var(--sans); color: var(--ink); text-align: left; }
.pane-step button:disabled { opacity: 0.35; cursor: default; }
.pane-step .pane-next { flex: 1; }
html[data-mode="dark"] .pane-step button { background: color-mix(in srgb, var(--ink) 8%, transparent); }
/* the stage: one section at a time, filling the space */
html:not([data-format="long"]) #panels .pane-stage { grid-area: stage; padding-top: clamp(14px, 2.4vh, 26px); }
html:not([data-format="long"]).animated #panels .panel .pane { display: none !important; }
html:not([data-format="long"]).animated #panels .panel .pane.is-active {
  display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) !important; grid-auto-rows: min-content;
  column-gap: clamp(28px, 3.6vw, 64px); align-content: start; height: 100%; overflow: auto !important; overscroll-behavior: contain;
  margin: 0 !important; padding: 0 6px 12px 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; outline: none !important; max-width: none !important;
  animation: paneIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes paneIn { from { opacity: 0; transform: translateY(10px); } }
html:not([data-format="long"]).animated #panels .pane > * { grid-column: 1 !important; grid-row: auto !important; }
html:not([data-format="long"]).animated #panels .pane > h3 { position: static !important; font-size: clamp(26px, 2.7vw, 42px) !important; line-height: 1.08 !important; margin: 0 0 14px !important; }
html:not([data-format="long"]).animated #panels .pane > :is(.pic, .mini-stage, .yt, .media) { grid-column: 2 !important; grid-row: 1 / span 14 !important; margin: 0 !important; align-self: start; }
html:not([data-format="long"]).animated #panels .pane:has(> :is(.pic, .mini-stage, .yt, .media)) > .credit { grid-column: 2 !important; }
html:not([data-format="long"]) #panels .pane .mini-stage { height: min(64svh, calc(100svh - var(--bar, 64px) - 190px)) !important; }
html:not([data-format="long"]) #panels .pane .pic img { max-height: calc(100svh - var(--bar, 64px) - 210px) !important; max-width: 100%; width: auto; }
html:not([data-format="long"]) #panels .pane .pic-row img { max-height: calc((100svh - var(--bar, 64px)) * 0.36) !important; }
html:not([data-format="long"]) #panels .pane .yt { max-width: none; }
/* sections with no picture use the width for reading, not one long column */
html:not([data-format="long"]).animated #panels .pane.is-active:not(:has(> :is(.pic, .mini-stage, .yt, .media))) { grid-template-columns: minmax(0, 46rem) !important; }
html:not([data-format="long"]).animated #panels .pane.is-active:has(.casemap) { grid-template-columns: minmax(0, 60rem) !important; }
/* the Map lab fills its stage */
html:not([data-format="long"]) #panels .pane-solo .lab-wrap { height: 100%; max-width: none; padding: 0; }
html:not([data-format="long"]) #panels .pane-solo .lab-frame { height: 100% !important; }
/* one quiet line of credits instead of the footer */
html:not([data-format="long"]) #panels .pane-foot { grid-area: foot; margin: 0; padding-top: 6px; font: 400 11.5px var(--sans); color: var(--ink-dim); opacity: 0.8; }
/* phones: sections as a row of chips, the section below */
@media (max-width: 899px) {
  html:not([data-format="long"]).animated #panels .panel:not([hidden]) {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "head" "nav" "stage" "foot"; padding: 10px 14px 6px !important;
  }
  html:not([data-format="long"]).animated #panels .panel.pane-solo:not([hidden]) { grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "head" "stage" "foot"; }
  html:not([data-format="long"]) #panels .panel-intro { display: none; }
  html:not([data-format="long"]) #panels .pane-nav { flex-direction: row; align-items: center; gap: 8px; padding-top: 8px; }
  .pane-nav ol { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; }
  .pane-nav ol::-webkit-scrollbar { display: none; }
  .pane-nav ol button { white-space: nowrap; border-left: 0; border-radius: 999px; padding: 7px 12px; font-size: 13px; background: color-mix(in srgb, white 50%, transparent); grid-template-columns: auto; }
  .pane-nav ol button .pane-num { display: none; }
  .pane-step { display: none; }
  html:not([data-format="long"]).animated #panels .panel .pane.is-active { grid-template-columns: minmax(0, 1fr) !important; }
  html:not([data-format="long"]).animated #panels .pane > :is(.pic, .mini-stage, .yt, .media, .credit) { grid-column: 1 !important; grid-row: auto !important; margin-top: 12px !important; }
  html:not([data-format="long"]) #panels .pane .mini-stage { height: 46svh !important; }
  html:not([data-format="long"]).animated #panels .pane:has(> :is(.pic, .mini-stage, .yt, .media)) > .credit { grid-column: 1 !important; }
  html:not([data-format="long"]) #panels .pane-stage { padding-top: 12px; }
}

/* ===================== About: a profile on one screen =====================
   Two columns: me on the left, what I've done on the right, sources underneath. */
#panels .about .panel-head { display: none !important; }
#panels .about .about-stage { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "intro list" "small small"; column-gap: clamp(32px, 5vw, 88px); row-gap: clamp(16px, 3vh, 32px);
  align-items: center; overflow: auto; padding: clamp(16px, 4vh, 48px) 24px 4px; max-width: calc(76rem + 48px); width: calc(100% + 48px); margin: 0 -24px; justify-self: center; box-sizing: border-box; }
html[data-format="long"] #panels .about .about-stage { display: grid !important; padding: clamp(110px, 16vh, 160px) var(--gutter) 60px; }
.about-intro { grid-area: intro; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.about-avatar { width: clamp(76px, 8vw, 112px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; display: grid; place-items: center; flex: none; margin-bottom: clamp(16px, 2.6vh, 26px);
  background: radial-gradient(circle at 34% 30%, #ffc98a 0%, #e8781c 52%, #a94b06 100%); box-shadow: 0 12px 30px rgba(120, 50, 0, 0.24), inset 0 -6px 16px rgba(90, 30, 0, 0.25); }
.about-avatar span { font: var(--head-weight, 600) clamp(28px, 3vw, 42px)/1 var(--display); color: #fff8ef; letter-spacing: -0.02em; text-shadow: 0 2px 8px rgba(90, 30, 0, 0.35); }
.about-avatar img { width: 100%; height: 100%; object-fit: cover; }
.about-name { margin: 0 !important; font: var(--head-weight, 600) clamp(40px, 4.6vw, 72px)/1 var(--display) !important; letter-spacing: -0.03em; color: var(--ink); }
.about-role { margin: clamp(10px, 1.6vh, 16px) 0 0; font: 600 12px/1.5 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.about-bio { margin: clamp(14px, 2.2vh, 22px) 0 0; font-size: clamp(16px, 1.2vw, 18px); line-height: 1.6; color: var(--body-ink, #2b3c48); max-width: 34rem; }
.about-contact { margin: clamp(10px, 1.6vh, 16px) 0 0; font-size: 14px; }
.about-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(18px, 3vh, 30px); }
.about-links .act { margin: 0; padding: 10px 18px; font-size: 14px; }
.about-list { grid-area: list; display: flex; flex-direction: column; min-width: 0; max-height: 100%; overflow: auto;
  border-radius: var(--radius, 18px); background: color-mix(in srgb, white 55%, transparent); box-shadow: 0 10px 30px rgba(16, 50, 80, 0.06); }
.about-tile { display: grid; grid-template-columns: minmax(0, 1fr) clamp(120px, 13vw, 190px); gap: clamp(18px, 2vw, 30px); align-items: center;
  padding: clamp(16px, 2.4vh, 26px) clamp(20px, 2.2vw, 32px); }
.about-tile + .about-tile { border-top: 1px solid color-mix(in srgb, var(--ink) 9%, transparent); }
.about-tile.no-media { grid-template-columns: minmax(0, 1fr); }
.about-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.about-label { margin: 0; font: 700 10.5px var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.about-tile h3 { margin: 0 !important; font: var(--head-weight, 600) clamp(19px, 1.5vw, 23px)/1.2 var(--display) !important; color: var(--ink); }
.about-text { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--body-ink, #2b3c48); }
.about-thumb { padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: zoom-in; background: #fff; aspect-ratio: 4 / 3; width: 100%;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 8%, transparent), 0 6px 18px rgba(16, 50, 80, 0.08); }
.about-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.about-thumb.is-badge { background: none; box-shadow: none; aspect-ratio: auto; height: clamp(70px, 9vh, 96px); }
.about-thumb.is-badge img { object-fit: contain; object-position: center; filter: drop-shadow(0 4px 10px rgba(16, 50, 80, 0.18)); }
.about-thumb:hover img { transform: scale(1.04); }
.about-more { font-size: 13px; margin-top: 2px; }
.about-more summary { cursor: pointer; color: var(--ink-dim); font-weight: 600; width: max-content; }
.about-more dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0 0; }
.about-more dt { font: 600 10.5px var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); align-self: center; }
.about-more dd { margin: 0; }
.about-tile .credit { margin: 2px 0 0; font-size: 11px; color: var(--ink-dim); }
.about-small { grid-area: small; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: clamp(20px, 2.4vw, 40px); align-self: end;
  font-size: 12px; line-height: 1.55; color: var(--ink-dim); border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); padding-top: 12px; }
.about-small h3 { margin: 0 !important; font: 700 10.5px/1.6 var(--sans) !important; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); }
.about-small-text { display: grid; gap: 3px; }
.about-small p { margin: 0; }
html[data-mode="dark"] .about-list { background: color-mix(in srgb, var(--ink) 6%, transparent); }
/* the full-size picture */
.lightbox { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 4vh 4vw; background: rgba(10, 20, 28, 0.82); cursor: zoom-out; animation: fxFade 0.25s ease both; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5); background: #fff; }
.lightbox-x { position: absolute; top: 14px; right: 18px; border: 0; background: none; color: #fff; font-size: 34px; cursor: pointer; }
@media (min-width: 900px) and (max-height: 780px) {
  .about-avatar { width: 72px; margin-bottom: 14px; }
  .about-avatar span { font-size: 27px; }
  .about-name { font-size: clamp(38px, 4vw, 56px) !important; }
  .about-bio { font-size: 15.5px; line-height: 1.5; }
  .about-tile { padding-block: 13px; }
  .about-text { font-size: 13.5px; line-height: 1.5; }
  .about-thumb { aspect-ratio: 16 / 10; }
}
@media (max-width: 899px) {
  #panels .about .about-stage { display: flex !important; flex-direction: column; align-items: stretch; gap: 26px; padding: 18px 18px 8px; margin: 0 -18px; width: auto; }
  #panels .about .about-stage > * { flex: none; }
  .about-avatar { width: 68px; margin-bottom: 14px; }
  .about-avatar span { font-size: 26px; }
  .about-name { font-size: clamp(34px, 10vw, 44px) !important; }
  .about-bio { font-size: 15.5px; }
  .about-list { overflow: visible; max-height: none; }
  .about-tile { grid-template-columns: minmax(0, 1fr) 92px; gap: 14px; align-items: start; padding: 18px; }
  .about-thumb { aspect-ratio: 1; }
  .about-thumb.is-badge { height: 72px; }
  .about-small { grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
}

/* Feedback sits bottom-right on wide screens, clear of the section list */
@media (min-width: 600px) {
  .fb-open { left: auto; right: 16px; }
  .fb-box { left: auto; right: 16px; }
  html.has-feedback .fx-badge { bottom: 70px; }
  html.has-feedback:not([data-format="long"]) #panels .pane-foot { padding-right: 130px; }
}

/* Design editor link, beside Feedback; local server only */
.fb-design { position: fixed; right: 16px; bottom: 62px; z-index: 80; padding: 8px 14px; border-radius: 999px; font: 600 13px var(--sans); text-decoration: none;
  color: var(--ink); background: color-mix(in srgb, white 82%, transparent); box-shadow: 0 6px 18px rgba(16, 50, 80, 0.14); backdrop-filter: blur(6px); }
.fb-design::before { content: "◐ "; }
.fb-design:hover { background: #fff; }
html.plain .fb-design { display: none; }
@media (max-width: 599px) { .fb-design { display: none; } }

/* ===================== The journey: motion, rewards, HUD =====================
   (js/journey.js) Every press answers back; moving on is always one press. */

/* buttons spring when pressed, and pop when they give a reward */
.act, .chip, .jr-next, .pane-nav button, .tabs button { transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s, background 0.2s, color 0.2s, border-color 0.2s; }
.act:active:not(:disabled), .chip:active, .jr-next:active, .pane-nav button:active { transform: scale(0.94); transition-duration: 0.08s; }
.jr-pop { animation: jrPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes jrPop { 0% { transform: scale(1); } 30% { transform: scale(1.12); } 60% { transform: scale(0.97); } 100% { transform: scale(1); } }
.chip.picked { box-shadow: 0 8px 22px color-mix(in srgb, var(--navy) 30%, transparent); }
.act.ready:not(:disabled) { animation: jrReady 1.4s ease-in-out infinite; }
@keyframes jrReady { 0%, 100% { box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 30%, transparent), 0 0 0 0 rgba(246, 140, 30, 0.5); } 50% { box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 30%, transparent), 0 0 0 9px rgba(246, 140, 30, 0); } }
.fx-burst { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 90; pointer-events: none; }

/* headings arrive word by word */
.jw { display: inline-block; }
html.animated #story .card .jw { opacity: 0; transform: translateY(0.55em) rotate(2deg); filter: blur(6px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s;
  transition-delay: calc(260ms + var(--i, 0) * 55ms); }
html.animated #story .card.on .jw { opacity: 1; transform: none; filter: none; }
html.animated #story .card.past .jw { transition-delay: 0ms; }
html.animated .pane.is-active .jw, html.animated .panel:not([hidden]) .about-name .jw { animation: jrWord 0.8s cubic-bezier(0.16, 1, 0.3, 1) both; animation-delay: calc(80ms + var(--i, 0) * 50ms); }
@keyframes jrWord { from { opacity: 0; transform: translateY(0.55em) rotate(2deg); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

/* a section box slides in; its parts follow in turn */
html.animated .pane.is-active > * { animation: jrRise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
html.animated .pane.is-active > :nth-child(2) { animation-delay: 60ms; }
html.animated .pane.is-active > :nth-child(3) { animation-delay: 120ms; }
html.animated .pane.is-active > :nth-child(4) { animation-delay: 180ms; }
html.animated .pane.is-active > :nth-child(n+5) { animation-delay: 240ms; }
@keyframes jrRise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
/* a new tab opens with a sweep */
html.animated.tab-enter #panels .panel:not([hidden]) { animation: jrTab 0.75s cubic-bezier(0.16, 1, 0.3, 1) both; }
html.animated.tab-enter #panels .panel:not([hidden]) .pane-nav li { animation: jrRise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
html.animated.tab-enter #panels .panel:not([hidden]) .pane-nav li:nth-child(2) { animation-delay: 50ms; }
html.animated.tab-enter #panels .panel:not([hidden]) .pane-nav li:nth-child(3) { animation-delay: 100ms; }
html.animated.tab-enter #panels .panel:not([hidden]) .pane-nav li:nth-child(4) { animation-delay: 150ms; }
html.animated.tab-enter #panels .panel:not([hidden]) .pane-nav li:nth-child(n+5) { animation-delay: 200ms; }
html.animated.tab-enter #panels .about .about-intro > *, html.animated.tab-enter #panels .about .about-tile { animation: jrRise 0.8s cubic-bezier(0.16, 1, 0.3, 1) both; }
html.animated.tab-enter #panels .about .about-intro > :nth-child(2) { animation-delay: 60ms; }
html.animated.tab-enter #panels .about .about-intro > :nth-child(3) { animation-delay: 120ms; }
html.animated.tab-enter #panels .about .about-intro > :nth-child(n+4) { animation-delay: 180ms; }
html.animated.tab-enter #panels .about .about-tile:nth-child(1) { animation-delay: 140ms; }
html.animated.tab-enter #panels .about .about-tile:nth-child(2) { animation-delay: 220ms; }
html.animated.tab-enter #panels .about .about-tile:nth-child(3) { animation-delay: 300ms; }
@keyframes jrTab { from { opacity: 0; clip-path: inset(6% 0 0 0 round 24px); transform: translateY(18px); } to { opacity: 1; clip-path: inset(0 0 0 0 round 0); transform: none; } }

/* the orange squeezes while you hold */
html.animated #stage { transform: scale(calc(1 - var(--squeeze, 0) * 0.07)); }

/* ---------- Opening: count to 100 ---------- */
.jr-intro { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; align-content: center; gap: 18px;
  background: radial-gradient(ellipse at 50% 40%, #fff4e6 0%, var(--sky-top) 70%); color: var(--ink);
  transition: clip-path 0.9s cubic-bezier(0.76, 0, 0.24, 1), opacity 0.9s; clip-path: circle(150% at 50% 50%); }
.jr-intro.out { clip-path: circle(0% at 50% 50%); pointer-events: none; }
.jr-dot { width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #ffc98a 0%, #e8781c 52%, #a94b06 100%);
  box-shadow: 0 14px 34px rgba(120, 50, 0, 0.3); transform: scale(calc(0.7 + var(--p, 0) * 0.5)); animation: jrBob 1.4s ease-in-out infinite; }
@keyframes jrBob { 50% { translate: 0 -6px; } }
.jr-count { font: 600 clamp(72px, 12vw, 150px)/0.9 var(--display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.jr-line { width: min(280px, 60vw); height: 2px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 14%, transparent); position: relative; overflow: hidden; }
.jr-line::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 0)); }
.jr-cap { font: 600 11px var(--sans); letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink-dim); }
html.plain .jr-intro { display: none; }

/* ---------- Hold to peel ---------- */
.cue { pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cue.gone { visibility: hidden; }
.cue .jr-hold { pointer-events: auto; }
.cue-or { font: 600 10.5px var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-dim); }
.cue-or::after { content: ""; display: block; width: 2px; height: 22px; margin: 6px auto 0; border-radius: 2px; background: linear-gradient(var(--ink-dim), transparent); animation: cue 1.8s ease-in-out infinite; }
.jr-hold { position: relative; display: inline-flex; align-items: center; gap: 12px; padding: 8px 20px 8px 8px; border: 0; border-radius: 999px; cursor: pointer;
  background: color-mix(in srgb, white 80%, transparent); color: var(--ink); font: 700 13px var(--sans); letter-spacing: 0.16em; text-transform: uppercase;
  box-shadow: 0 12px 34px rgba(16, 50, 80, 0.16); backdrop-filter: blur(8px); -webkit-user-select: none; user-select: none; touch-action: none;
  transform: scale(calc(1 + var(--hold, 0) * 0.08)); transition: transform 0.15s, box-shadow 0.2s; }
.jr-hold:hover { box-shadow: 0 16px 40px rgba(16, 50, 80, 0.22); }
.jr-hold svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.jr-hold-track { fill: none; stroke: color-mix(in srgb, var(--ink) 14%, transparent); stroke-width: 3; }
.jr-hold-fill { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 132; stroke-dashoffset: calc(132 * (1 - var(--hold, 0))); }
.jr-hold-dot { position: absolute; left: 21px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ffc98a, #e8781c 55%, #a94b06); transform: scale(calc(1 + var(--hold, 0) * 0.35)); }
.jr-hold:not(.holding) .jr-hold-dot { animation: jrBeat 1.6s ease-in-out infinite; }
@keyframes jrBeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.25); } 30% { transform: scale(1); } }
.jr-hold.let-go { animation: jrShake 0.35s; }
@keyframes jrShake { 25% { translate: -4px 0; } 75% { translate: 4px 0; } }
.jr-hold:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- Next: one press to move on ---------- */
.jr-next { position: fixed; left: 50%; bottom: 22px; z-index: 6; display: inline-flex; align-items: center; gap: 10px; padding: 9px 12px 9px 18px;
  border: 0; border-radius: 999px; cursor: pointer; background: var(--navy); color: #fff; font: 700 12px var(--sans); letter-spacing: 0.16em; text-transform: uppercase;
  box-shadow: 0 12px 30px rgba(14, 37, 51, 0.3); opacity: 0; translate: -50% 16px; pointer-events: none; transition: opacity 0.4s, translate 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s; }
.jr-next.show { opacity: 1; translate: -50% 0; pointer-events: auto; }
.jr-next-arrow { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--orange); color: var(--navy); animation: jrArrow 1.6s ease-in-out infinite; }
@keyframes jrArrow { 50% { translate: 0 3px; } }
.jr-next:hover { transform: translateY(-2px); }
html.in-panel .jr-next, html.plain .jr-next, html.in-moment .jr-next { opacity: 0 !important; pointer-events: none !important; }

/* ---------- HUD frame ---------- */
.hud { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.hud-c { position: absolute; width: 18px; height: 18px; border: 0 solid color-mix(in srgb, var(--ink) 35%, transparent); }
.hud-c.tl { left: 14px; top: calc(var(--bar, 62px) + 12px); border-width: 1.5px 0 0 1.5px; }
.hud-c.tr { right: 14px; top: calc(var(--bar, 62px) + 12px); border-width: 1.5px 1.5px 0 0; }
.hud-c.bl { left: 14px; bottom: 14px; border-width: 0 0 1.5px 1.5px; }
.hud-c.br { right: 14px; bottom: 14px; border-width: 0 1.5px 1.5px 0; }
.hud-chapter { position: absolute; left: 40px; top: calc(var(--bar, 62px) + 14px); display: flex; gap: 12px; align-items: baseline;
  font: 600 10.5px var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-dim); }
.hud-chapter b { color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: 0.12em; }
.hud-chapter.flip > * { animation: jrRise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
.hud-chapter.flip span { animation-delay: 80ms; }
html.in-panel .hud-chapter, html.at-title .hud-chapter { opacity: 0; }
html.in-panel .hud-c { opacity: 0.5; }
.hud-sound { position: fixed; left: 26px; bottom: 22px; z-index: 6; display: inline-flex; align-items: center; gap: 8px; padding: 6px 4px; border: 0; background: none; cursor: pointer;
  font: 600 10.5px var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-dim); }
.hud-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.hud-bars i { width: 2px; height: 100%; background: var(--accent); border-radius: 1px; transform-origin: bottom; animation: jrEq 0.9s ease-in-out infinite; }
.hud-bars i:nth-child(2) { animation-delay: -0.3s; } .hud-bars i:nth-child(3) { animation-delay: -0.6s; } .hud-bars i:nth-child(4) { animation-delay: -0.15s; }
@keyframes jrEq { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
.hud-sound.off .hud-bars i { animation: none; transform: scaleY(0.25); background: var(--ink-dim); }
.hud-sound:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html.plain .hud, html.plain .hud-sound { display: none; }
html[data-mode="dark"] .jr-hold { background: color-mix(in srgb, var(--navy) 70%, transparent); color: #fff; }
@media (max-width: 899px) {
  .hud-c, .hud-chapter { display: none; }
  .hud-sound { left: 12px; bottom: 12px; }
  .jr-next { bottom: 14px; }
  .cue { top: auto !important; bottom: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .jw, .pane.is-active > *, #panels .panel, .jr-hold-dot, .hud-bars i, .jr-next-arrow { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; filter: none !important; }
}
/* the old scroll-line belongs to the old cue text only */
.cue .jr-hold span::after { content: none; display: none; }
/* sound switch: top-right of the bar, clear of every tab's own controls */
.hud-sound { left: auto; bottom: auto; right: 26px; top: calc(var(--bar, 62px) / 2); translate: 0 -50%; z-index: 60; }
@media (max-width: 899px) {
  .hud-sound { left: auto; right: 112px; top: 15px; translate: none; padding: 6px; }
  .hud-sound span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
/* phones move on with a swipe; the floating Next button would sit on the cards */
@media (max-width: 899px) { .jr-next { display: none; } }
/* Next lives under the progress rail on the right, clear of every card */
@media (min-width: 900px) {
  .jr-next { left: auto; right: 12px; bottom: auto; top: calc(60vh + 30px); flex-direction: column; gap: 8px; padding: 12px 8px 8px; border-radius: 999px;
    font-size: 9.5px; letter-spacing: 0.2em; translate: 0 12px; }
  .jr-next.show { translate: 0 0; }
  .jr-next-arrow { width: 30px; height: 30px; }
}

/* =====================================================================
   THE MUSEUM EDITION
   A map room in an old museum: cream ledger paper with red margin rules,
   typewriter capitals for instructions, a heavy old-style serif for titles,
   exhibits in gilt frames, and a wax seal to press. Ink, vermilion and one
   museum blue. Everything moves; nothing is glossy.
   ===================================================================== */
:root {
  --sky-top: #f7f1e4; --sky-bottom: #ece2ce;
  --paper: #f7f1e4; --paper-2: #fbf7ee; --paper-3: #efe5d0;
  --ink: #1f1a14; --ink-dim: #5d5346; --body-ink: #2c251d;
  --accent: #b8321c; --orange-text: #a3401a; --vermilion: #c8361f;
  --navy: #1f1a14; --blue: #1a47b8; --gilt: #a8823a; --gilt-dark: #6f5422;
  --card-bg: var(--paper-2);
  --type: "American Typewriter", "Courier Prime", "Courier New", ui-monospace, monospace;
  --rule: color-mix(in srgb, var(--ink) 22%, transparent);
  --radius: 2px;
}
html { background: var(--paper); }
body { color: var(--body-ink); }
::selection { background: var(--vermilion); color: var(--paper-2); }

/* paper grain and the ledger's red margin rules, over the whole page */
html::after { content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 calc(var(--margin-x, 44px) - 1px), rgba(200, 54, 31, 0.28) calc(var(--margin-x, 44px) - 1px) var(--margin-x, 44px), transparent var(--margin-x, 44px) calc(100% - var(--margin-x, 44px)), rgba(200, 54, 31, 0.28) calc(100% - var(--margin-x, 44px)) calc(100% - var(--margin-x, 44px) + 1px), transparent 0); }
body::after { content: ""; position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0.5; mix-blend-mode: multiply;
  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='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.35  0 0 0 0 0.2  0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
html.plain html::after, html.plain body::after, html.plain::after { display: none; }
html.in-panel::after { opacity: 0.6; }
@media (max-width: 899px) { :root { --margin-x: 10px; } }

/* ---------- the masthead ---------- */
.topbar { background: var(--paper) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  border-bottom: 3px double color-mix(in srgb, var(--ink) 70%, transparent) !important; box-shadow: none !important; }
.brand-name { font-family: var(--display) !important; font-weight: 800 !important; font-variation-settings: "SOFT" 0, "WONK" 1, "opsz" 144;
  font-size: 19px !important; letter-spacing: 0.06em !important; text-transform: uppercase; color: var(--vermilion) !important; }
.brand-dot { background: radial-gradient(circle at 34% 30%, #ffc98a 0%, #e8781c 52%, #a94b06 100%) !important; box-shadow: 0 0 0 1.5px var(--paper), 0 0 0 2.5px var(--ink) !important; }
.tabs button { font-family: var(--type) !important; font-size: 12.5px !important; font-weight: 400 !important; letter-spacing: 0.1em !important; text-transform: uppercase;
  color: var(--ink) !important; border-radius: 0 !important; padding: 6px 12px !important; border: 1px solid transparent !important; background: none !important; }
.tabs button + button::before { content: "•"; position: absolute; margin-left: -19px; color: var(--ink-dim); pointer-events: none; }
.tabs button { position: relative; }
.tabs button[aria-selected="true"] { border-color: var(--ink) !important; background: var(--paper-2) !important; box-shadow: 2px 2px 0 var(--ink) !important; }
.tabs button[aria-selected="true"]::after, .tabs button::after { display: none !important; }
.tabs button:hover { color: var(--vermilion) !important; }

/* ---------- type ---------- */
.card h3, .panel-head h2, .about-name, .pane h3, .about-tile h3 { font-family: var(--display) !important; font-variation-settings: "SOFT" 0, "WONK" 1, "opsz" 144; color: var(--ink) !important; }
.card h3 { font-weight: 700 !important; letter-spacing: -0.012em; }
.part, .about-label, .about-role, .bars-unit, .slider-label, .rv-left, .hud-chapter, .cue-or, .credit, .pane-foot, .foot-note, .about-small h3 {
  font-family: var(--type) !important; font-weight: 400 !important; letter-spacing: 0.08em !important; }
.part { color: var(--vermilion) !important; text-transform: uppercase; font-size: 11.5px !important; }
.part::before { content: "Plate · "; color: var(--ink-dim); }
.credit { font-size: 11px !important; color: var(--ink-dim) !important; letter-spacing: 0.02em !important; }
p, li { color: var(--body-ink); }

/* ---------- the title page ---------- */
.card.title h1 { font-family: var(--display) !important; font-weight: 800 !important; font-variation-settings: "SOFT" 0, "WONK" 1, "opsz" 144 !important;
  color: var(--ink) !important; background: none !important; -webkit-text-fill-color: currentColor !important; letter-spacing: -0.025em !important; }
.card.title h1 .title-last { color: var(--vermilion) !important; font-style: italic; }
.card.title h1::before { content: "❦"; display: block; font-size: 0.28em; color: var(--gilt); margin-bottom: 0.25em; letter-spacing: 0; }
.card.title .byline, .card.title [class*="byline"] { font-family: var(--type) !important; letter-spacing: 0.3em !important; color: var(--ink) !important; }
.card.title .byline::before, .card.title .byline::after { content: " — "; color: var(--gilt); letter-spacing: 0; }

/* ---------- exhibits: the story cards ---------- */
html.animated .card:not(.moment):not(.prompt):not(.statement):not(.title):not(.control), .card.control .slider {
  background: var(--paper-2) !important; border: 1px solid var(--ink) !important; border-radius: var(--radius) !important;
  box-shadow: inset 0 0 0 5px var(--paper-2), inset 0 0 0 6px color-mix(in srgb, var(--ink) 30%, transparent), 6px 6px 0 color-mix(in srgb, var(--ink) 88%, transparent) !important; }
.card .bridge { font-family: var(--serif); font-style: italic; color: var(--ink-dim) !important; border-bottom: 1px dotted var(--rule) !important; }
.card.moment h3, .card.prompt h3, .card.statement h3 { font-weight: 800 !important; }
.card.moment p.lead, .card.prompt p.lead, .card.statement p.lead { font-family: var(--display) !important; font-weight: 700 !important; font-variation-settings: "SOFT" 0, "WONK" 1, "opsz" 144; color: var(--ink) !important; }
.card::before { background: var(--vermilion) !important; }

/* pictures hang in gilt frames */
.pic img, .about-thumb, .yt-play, .yt iframe { border-radius: 0 !important; padding: 7px; background: var(--paper-2) !important;
  border: 1px solid var(--gilt) !important; box-shadow: 0 0 0 4px #e8d9b6, 0 0 0 5px var(--gilt-dark), 0 16px 32px rgba(70, 45, 20, 0.22) !important; }
.pic img { box-sizing: border-box; }
.about-thumb.is-badge { padding: 0; border: 0 !important; box-shadow: none !important; background: none !important; }

/* ---------- things to press ---------- */
.act { border-radius: 0 !important; background: var(--ink) !important; color: var(--paper-2) !important; font-family: var(--type) !important; font-weight: 400 !important;
  font-size: 13px !important; letter-spacing: 0.1em !important; text-transform: uppercase; box-shadow: 3px 3px 0 var(--vermilion) !important; padding: 11px 18px !important; }
.act::after { content: "☞" !important; font-size: 1.25em; line-height: 0; }
.act:hover { background: var(--vermilion) !important; box-shadow: 3px 3px 0 var(--ink) !important; transform: translate(-1px, -1px); }
.act:disabled { background: color-mix(in srgb, var(--ink) 45%, var(--paper)) !important; box-shadow: none !important; }
.chip { border-radius: 0 !important; background: var(--paper-2) !important; border: 1px solid var(--ink) !important; color: var(--ink) !important;
  font-family: var(--type) !important; font-weight: 400 !important; letter-spacing: 0.06em; box-shadow: 2px 2px 0 var(--ink); }
.chip:hover { border-color: var(--vermilion) !important; color: var(--vermilion) !important; box-shadow: 3px 3px 0 var(--vermilion); }
.chip.picked, .chip.right { background: var(--ink) !important; color: var(--paper-2) !important; box-shadow: 3px 3px 0 var(--vermilion) !important; }
.chip.big { font-size: 17px !important; padding: 14px 24px !important; }
.card.moment .chip.big { font-size: clamp(16px, 1.4vw, 20px) !important; padding: 16px 28px !important; }
input[type="range"] { accent-color: var(--vermilion); }

/* ---------- the wax seal: press and hold ---------- */
.jr-hold { border-radius: 999px !important; background: var(--paper-2) !important; border: 1px solid var(--ink); box-shadow: 4px 4px 0 var(--ink) !important;
  font-family: var(--type) !important; font-weight: 400 !important; letter-spacing: 0.14em !important; color: var(--ink) !important; padding: 8px 22px 8px 8px !important; }
.jr-hold-track { stroke: color-mix(in srgb, var(--ink) 16%, transparent) !important; }
.jr-hold-fill { stroke: var(--vermilion) !important; }
.jr-hold-dot { width: 26px !important; height: 26px !important; left: 17px !important; margin-top: -13px !important;
  background: radial-gradient(circle at 40% 35%, #e0573c 0%, #b32a14 55%, #7a1708 100%) !important;
  box-shadow: inset 0 0 0 3px rgba(255, 210, 190, 0.25), inset 0 -2px 4px rgba(60, 0, 0, 0.5), 0 2px 3px rgba(60, 20, 0, 0.35); }
.jr-hold-dot::after { content: "P"; position: absolute; inset: 0; display: grid; place-items: center; font: 700 italic 13px/1 var(--display); color: rgba(255, 225, 210, 0.85); }
.jr-hold.holding { box-shadow: 1px 1px 0 var(--ink) !important; translate: 3px 3px; }
.jr-hold.done { opacity: 0.55; pointer-events: none; }
.jr-hold-wrap { display: grid; justify-items: center; gap: 12px; margin-top: 1.2rem; }
.jr-done-note { font-family: var(--display); font-style: italic; font-size: 1.4em; color: var(--vermilion) !important; margin: 0; }
.cue-or { color: var(--ink-dim) !important; }

/* ---------- the instruction placard (a moment to do) ---------- */
.gate-hud { position: fixed; left: 50%; top: calc(var(--bar, 62px) + 22px); z-index: 40; translate: -50% -14px; opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px; padding: 12px 20px 12px 14px; background: var(--paper-2); border: 1px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink); transition: opacity 0.35s, translate 0.5s cubic-bezier(0.16, 1, 0.3, 1); max-width: calc(100vw - 32px); }
.gate-hud.show { opacity: 1; translate: -50% 0; }
.gate-hud::before { content: "Your move"; flex: none; padding: 4px 8px; border: 1.5px solid var(--vermilion); color: var(--vermilion);
  font: 700 10px var(--type); letter-spacing: 0.18em; text-transform: uppercase; rotate: -4deg; }
.gh-msg { margin: 0; font: 400 14px/1.35 var(--type); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink) !important; }
.gh-caret { color: var(--vermilion); animation: ghBlink 1s steps(1) infinite; }
@keyframes ghBlink { 50% { opacity: 0; } }
.gh-c { position: absolute; width: 7px; height: 7px; border: 0 solid var(--vermilion); }
.gh-c.tl { left: -4px; top: -4px; border-width: 1.5px 0 0 1.5px; } .gh-c.tr { right: -4px; top: -4px; border-width: 1.5px 1.5px 0 0; }
.gh-c.bl { left: -4px; bottom: -4px; border-width: 0 0 1.5px 1.5px; } .gh-c.br { right: -4px; bottom: -4px; border-width: 0 1.5px 1.5px 0; }
.gate-hud.bump { animation: ghBump 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes ghBump { 15%, 55% { translate: calc(-50% - 7px) 0; } 35%, 75% { translate: calc(-50% + 7px) 0; } }
.gate-note { display: none !important; }

/* ---------- tiles to open (findings, steps) ---------- */
.rv { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; margin: 1rem 0 0.4rem; perspective: 900px; }
.rv-tile { position: relative; display: grid; align-content: start; gap: 8px; min-height: 128px; padding: 14px; text-align: left; cursor: pointer;
  background: var(--paper); border: 1px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); color: var(--ink); font: inherit;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s, background 0.3s; }
.rv-tile:hover:not(.open) { transform: translate(-2px, -2px) rotate(-0.6deg); box-shadow: 5px 5px 0 var(--vermilion); }
.rv-num { font: 800 34px/1 var(--display); font-variation-settings: "WONK" 1, "opsz" 144; color: var(--vermilion); }
.rv-open { font: 400 11px var(--type); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-dim); }
.rv-open::after { content: " ☞"; }
.rv-text { display: none; font-size: 13.5px; line-height: 1.45; }
.rv-tile.open { background: var(--paper-2); cursor: default; animation: rvFlip 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.rv-tile.open .rv-open { display: none; }
.rv-tile.open .rv-text { display: block; }
.rv-tile.open .rv-num { font-size: 20px; }
@keyframes rvFlip { 0% { transform: rotateY(-80deg); opacity: 0.3; } 100% { transform: none; opacity: 1; } }
.rv-left { grid-column: 1 / -1; margin: 2px 0 0; font-size: 11px; text-transform: uppercase; color: var(--ink-dim) !important; }
.rv.all .rv-left { color: var(--vermilion) !important; }
.rv-tile .sample-tag { display: inline-block; margin-right: 4px; }

/* ---------- charts look engraved ---------- */
.bars-track { background: var(--paper) !important; border: 1px solid var(--ink); border-radius: 0 !important; height: 16px !important; }
.bars-fill { border-radius: 0 !important; background: repeating-linear-gradient(-45deg, var(--vermilion) 0 3px, #a12a15 3px 6px) !important; }
.bars-value { font-family: var(--display) !important; font-weight: 800 !important; }

/* ---------- HUD in print ---------- */
.hud-c { border-color: var(--ink) !important; }
.hud-chapter { color: var(--ink) !important; font-size: 11px !important; text-transform: uppercase; }
.hud-chapter b { color: var(--vermilion) !important; font-family: var(--type); font-weight: 400; }
.hud-chapter b::before { content: "Plate "; color: var(--ink-dim); }
.hud-sound { font-family: var(--type) !important; font-weight: 400 !important; color: var(--ink) !important; }
.hud-bars i { background: var(--vermilion) !important; }
.jr-next { border-radius: 0 !important; background: var(--ink) !important; color: var(--paper-2) !important; font-family: var(--type) !important; font-weight: 400 !important; box-shadow: 4px 4px 0 var(--vermilion) !important; }
.jr-next-arrow { border-radius: 0 !important; background: var(--vermilion) !important; color: var(--paper-2) !important; }
.rail-track { background: var(--rule) !important; } .rail-fill { background: var(--vermilion) !important; }
.arc-dot { background: var(--paper-2) !important; border: 1px solid var(--ink) !important; box-shadow: none !important; }
.arc li.now .arc-dot { background: var(--vermilion) !important; }
.arc-name { font-family: var(--type) !important; font-weight: 400 !important; color: var(--ink) !important; }

/* ---------- the opening: an exhibition ticket ---------- */
.jr-intro { background: var(--paper) !important; }
.jr-intro::before { content: ""; position: absolute; inset: 18px; border: 1px solid var(--ink); box-shadow: inset 0 0 0 5px var(--paper), inset 0 0 0 6px color-mix(in srgb, var(--ink) 35%, transparent); pointer-events: none; }
.jr-count { font-weight: 800 !important; font-variation-settings: "WONK" 1, "opsz" 144; color: var(--ink); }
.jr-count::before { content: "N°"; font-size: 0.3em; vertical-align: 0.95em; margin-right: 0.12em; color: var(--vermilion); letter-spacing: 0; }
.jr-line { background: var(--rule) !important; height: 1px !important; }
.jr-line::after { background: var(--vermilion) !important; }
.jr-cap { font-family: var(--type) !important; font-weight: 400 !important; color: var(--ink) !important; letter-spacing: 0.3em !important; }
.jr-cap::before, .jr-cap::after { content: " ❦ "; color: var(--gilt); letter-spacing: 0; }

/* ---------- tabs: gallery rooms ---------- */
#panels .panel { background: transparent !important; }
.panel-head h2 { font-weight: 800 !important; }
.panel-head h2::after { content: ""; display: block; width: 64px; height: 3px; margin-top: 10px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.pane-nav button { font-family: var(--type) !important; font-weight: 400 !important; letter-spacing: 0.04em; border-radius: 0 !important; color: var(--ink) !important; background: none !important; }
.pane-nav button[aria-current] { background: var(--paper-2) !important; border: 1px solid var(--ink) !important; box-shadow: 3px 3px 0 var(--ink) !important; }
.pane-nav button[aria-current] .pane-num { color: var(--vermilion) !important; }
.pane-num { font-family: var(--type) !important; color: var(--ink-dim) !important; }
.pane-prev, .pane-next { border-radius: 0 !important; font-family: var(--type) !important; font-weight: 400 !important; background: var(--paper-2) !important; border: 1px solid var(--ink) !important; color: var(--ink) !important; box-shadow: 2px 2px 0 var(--ink) !important; }
.pane-next:hover, .pane-prev:hover:not(:disabled) { background: var(--ink) !important; color: var(--paper-2) !important; }
.pane.is-active, #panels .card { background: transparent !important; box-shadow: none !important; border: 0 !important; }
.about-list { background: var(--paper-2) !important; border: 1px solid var(--ink); border-radius: 0 !important; box-shadow: 6px 6px 0 var(--ink) !important; }
.about-tile + .about-tile { border-top: 1px dotted var(--rule) !important; }
.about-avatar { box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--ink), 6px 8px 0 5px var(--ink) !important; }
.about-role { color: var(--vermilion) !important; }
.lab-frame { border: 1px solid var(--ink) !important; box-shadow: 6px 6px 0 var(--ink) !important; border-radius: 0 !important; }
.site-foot { background: var(--paper-3) !important; border-top: 3px double var(--ink) !important; font-family: var(--type); }

/* the 14× moment, set like a broadside */
.reveal { font-family: var(--display) !important; color: var(--ink) !important; }
.reveal .big { color: var(--vermilion) !important; font-weight: 900 !important; font-variation-settings: "WONK" 1, "opsz" 144; }
.reveal .why { font-family: var(--type) !important; font-size: 13px !important; letter-spacing: 0.06em; }
.veil { background: color-mix(in srgb, var(--paper) 80%, transparent) !important; }
.sample-tag { border-radius: 0 !important; font-family: var(--type) !important; font-weight: 400 !important; background: var(--blue) !important; color: #fff !important; }
.placeholder { border-color: var(--blue) !important; }
.fb-open { border-radius: 0 !important; font-family: var(--type) !important; font-weight: 400 !important; box-shadow: 3px 3px 0 var(--vermilion) !important; }
.fb-design { border-radius: 0 !important; font-family: var(--type) !important; font-weight: 400 !important; background: var(--paper-2) !important; border: 1px solid var(--ink); box-shadow: 3px 3px 0 var(--ink) !important; }
.drag-hint { font-family: var(--type) !important; font-weight: 400 !important; text-transform: uppercase; letter-spacing: 0.12em; }
.practice-clock { font-family: var(--display) !important; font-weight: 800 !important; color: var(--vermilion) !important; }
.casemap input, .casemap textarea, .practice textarea { border-radius: 0 !important; border: 1px solid var(--ink) !important; background: var(--paper) !important; font-family: var(--type); }
/* title fixes: plain italic forms, the fleuron floats above without pushing the lines down */
.card.title h1 .title-last, .card.title h1 em, .card.title h1 i { font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 144 !important; }
.card.title h1 { position: relative; }
.card.title h1::before { position: absolute; left: 50%; top: -0.32em; translate: -50% 0; margin: 0; }
html.in-panel body, html body { background: var(--paper) !important; }
/* the 14× answer takes the stage: the slider card steps aside while it shows */
html.slid .card.control { opacity: 0 !important; transform: translateY(30px) !important; pointer-events: none; transition: opacity 0.4s, transform 0.5s; }

/* the soft light that keeps story text clear of the stage: paper, at the foot of the screen */
html.animated:not(.in-panel) body::before, html.themed.animated:not(.in-panel) body::before {
  top: auto !important; bottom: 0; height: 40vh;
  background: linear-gradient(color-mix(in srgb, var(--paper) 0%, transparent), color-mix(in srgb, var(--paper) 80%, transparent) 55%, color-mix(in srgb, var(--paper) 94%, transparent)) !important; }

/* ---------- QA pass 1 ---------- */
/* the 14× answer: a framed broadside, sized to fit */
.reveal { border-radius: 0 !important; background: var(--paper-2) !important; border: 1px solid var(--ink);
  box-shadow: inset 0 0 0 6px var(--paper-2), inset 0 0 0 7px color-mix(in srgb, var(--ink) 30%, transparent), 8px 8px 0 var(--ink) !important;
  font-size: clamp(26px, 3vw, 44px) !important; line-height: 1.1 !important; padding: 26px 44px 22px !important; display: grid; justify-items: center; gap: 4px; }
.reveal .big { display: block; font-size: 2.6em; line-height: 0.95; }
.reveal .why { display: block; margin-top: 12px; font-size: 12.5px !important; line-height: 1.5; color: var(--ink-dim) !important; max-width: 34ch; }
/* closing and prompt screens: the words sit on a paper placard so the orange never runs through them */
html.animated .card.statement, html.animated .card.prompt {
  background: color-mix(in srgb, var(--paper-2) 94%, transparent) !important; border: 1px solid var(--ink) !important; border-radius: 0 !important;
  box-shadow: inset 0 0 0 6px color-mix(in srgb, var(--paper-2) 94%, transparent), inset 0 0 0 7px color-mix(in srgb, var(--ink) 25%, transparent), 8px 8px 0 var(--ink) !important;
  padding: 1.6rem 2rem 1.4rem !important; width: min(40rem, calc(100vw - 2 * var(--gutter))) !important; }
html.animated .card.statement h3, html.animated .card.prompt h3 { font-size: clamp(28px, 3vw, 44px) !important; line-height: 1.05; }
/* footer links readable on paper */
.foot-nav a { color: var(--ink) !important; font-family: var(--type) !important; font-size: 12.5px !important; letter-spacing: 0.08em; text-transform: uppercase; }
.foot-nav a:hover { color: var(--vermilion) !important; }
.foot-brand .brand-name { color: var(--vermilion) !important; }
.foot-note { color: var(--ink-dim) !important; }
/* the instruction placard keeps to the left column on wide screens, clear of maps and pictures */
@media (min-width: 1100px) {
  .gate-hud { left: 40px; translate: 0 -14px; top: calc(var(--bar, 62px) + 44px); max-width: 360px; align-items: flex-start; flex-direction: column; gap: 10px; }
  .gate-hud.show { translate: 0 0; }
  @keyframes ghBump { 15%, 55% { translate: -7px 0; } 35%, 75% { translate: 7px 0; } }
}
/* practice box and old white panels: paper */
.practice, html.animated #story .card .picker, html.animated #story .card .casemap { background: var(--paper-2) !important; border: 1px solid var(--ink) !important; border-radius: 0 !important; box-shadow: 4px 4px 0 var(--ink) !important; backdrop-filter: none !important; }

/* ---------- QA pass 2 ---------- */
/* placards for the closing and prompt screens (beats the older "text on the page" rule) */
html.animated #story .card.statement:not(.moment):not(.title):not(.control):not(.qa),
html.animated #story .card.prompt:not(.moment):not(.title):not(.control):not(.qa) {
  background: color-mix(in srgb, var(--paper-2) 95%, transparent) !important; border: 1px solid var(--ink) !important;
  box-shadow: inset 0 0 0 6px color-mix(in srgb, var(--paper-2) 95%, transparent), inset 0 0 0 7px color-mix(in srgb, var(--ink) 25%, transparent), 8px 8px 0 var(--ink) !important;
  padding: 1.5rem 1.9rem 1.3rem !important; }
/* the story ends on its own last card; the site footer belongs to the tabs and the plain version */
html.animated:not(.in-panel) .site-foot { display: none; }
/* phones: the instruction placard spans the screen, stamp above the words */
@media (max-width: 899px) {
  .gate-hud { left: 12px; right: 12px; translate: 0 -14px; top: calc(var(--bar, 92px) + 10px); flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 14px; max-width: none; }
  .gate-hud.show { translate: 0 0; }
  .gh-msg { font-size: 12.5px; }
  @keyframes ghBump { 15%, 55% { translate: -6px 0; } 35%, 75% { translate: 6px 0; } }
  html.slid #story .card.control, html.slid .card.control { opacity: 0 !important; visibility: hidden; }
  .reveal { top: 46% !important; width: calc(100vw - 32px) !important; padding: 20px 18px !important; font-size: 24px !important; }
}
/* Map lab: the 3D gallery and the map tools, one switch apart */
.lab-wrap.has-switch { display: flex; flex-direction: column; gap: 10px; }
.lab-switch { display: flex; gap: 0; align-self: flex-start; border: 1px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); background: var(--paper-2); }
.lab-switch button { padding: 8px 16px; border: 0; background: none; cursor: pointer; font: 400 12px var(--type); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); }
.lab-switch button + button { border-left: 1px solid var(--ink); }
.lab-switch button[aria-selected="true"] { background: var(--ink); color: var(--paper-2); }
.lab-switch button:hover:not([aria-selected="true"]) { color: var(--vermilion); }
.gallery-frame { height: min(78vh, 820px) !important; background: #140d0a !important; }
html:not([data-format="long"]) #panels .pane-solo .lab-wrap.has-switch .lab-frame { flex: 1 1 auto; min-height: 0; height: auto !important; }
.lab-frame[hidden] { display: none !important; }
