/* ==========================================================================
   From the Abacus to AI
   Chrome is constant, material varies. JS rewrites the colour tokens and
   Fraunces axes on :root as the year changes. CSS defaults = mainframe era.
   ========================================================================== */

:root {
  --bg: #030d08;
  --surface: #07170f;
  --ink: #b8ffcc;
  --ink-muted: #5fbf7f;
  --accent: #4dff88;
  --accent-2: #1f9a52;
  --glow: rgba(77, 255, 136, .22);
  --line: rgba(77, 255, 136, .18);

  --f-wght: 600; --f-soft: 0; --f-wonk: 0; --f-opsz: 96; --f-style: normal;

  --radius: 0.375rem;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --fs-h2: clamp(20px, 1.2vw + 8px, 25px);
  --fs-title: 18px;
  --fs-body: 15px;
  --fs-label: 12px;
  --fs-mono: 13px;

  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --ease-inout: cubic-bezier(.65, 0, .35, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur-1: 120ms; --dur-2: 180ms; --dur-3: 280ms; --dur-4: 420ms;

  --topbar-h: 56px;
  --gutter: 24px;
  --gap-y: clamp(10px, 2.2vh, 24px);
  --thumb: 20px;

  --panel: color-mix(in oklab, var(--surface) 82%, transparent);
  color-scheme: dark;
}

@media (max-width: 1199px) { :root { --gutter: 20px; } }
@media (max-width: 767px) {
  :root {
    --fs-title: 16px; --fs-body: 14px; --fs-h2: 19px;
    --topbar-h: 48px; --gutter: 16px;
  }
}

*, *::before, *::after { box-sizing: border-box; }
/* One screen: the document never scrolls. The app shell is a 100dvh grid; panels size to fit. */
html { height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body {
  margin: 0; height: 100%; overflow: hidden;
  font: 400 var(--fs-body)/1.55 var(--font-ui);
  font-feature-settings: "cv11", "ss01";
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
h1, h2, h3, p, ol, dl, dd { margin: 0; padding: 0; }
.mono, kbd { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--accent); color: var(--bg); padding: 8px 12px; border-radius: var(--radius); font-weight: 600; text-decoration: none; }
.skip:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1440px; margin: 0 auto; padding-inline: var(--gutter); }

.h2 {
  font-family: var(--font-display); font-size: var(--fs-h2); line-height: 1.2;
  font-weight: var(--f-wght); font-style: var(--f-style);
  font-variation-settings: "SOFT" var(--f-soft), "WONK" var(--f-wonk), "opsz" var(--f-opsz);
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   Ambient material layers
   -------------------------------------------------------------------------- */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; contain: strict; }
.ambient::before { /* vignette */
  content: ""; position: absolute; inset: 0; z-index: 3;
  background: radial-gradient(ellipse at 50% 40%, transparent 40%, rgba(0, 0, 0, .55));
}
.ambient::after { /* static grain, rasterised once */
  content: ""; position: absolute; inset: 0; z-index: 4; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.4 -.2'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}
.amb { position: absolute; inset: 0; opacity: 0; visibility: hidden; will-change: opacity; }
.amb > * { position: absolute; }

/* counting: candle-lit parchment */
.amb[data-m="counting"] .pool { inset: -10%; background: radial-gradient(60vmax 60vmax at 18% 14%, rgba(255, 170, 90, .20), transparent 70%); animation: breathe 6s ease-in-out infinite alternate; }
.amb[data-m="counting"] .ruled { inset: 0; background: repeating-linear-gradient(to bottom, transparent 0 27px, rgba(234, 220, 192, .035) 27px 28px); }
.amb[data-m="counting"] .tally { inset: 0; opacity: .045; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='170'%3E%3Cg fill='none' stroke='%23eadcc0' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M30 30v34M40 29v35M50 31v33M60 30v34M24 58l44-22'/%3E%3Cpath d='M150 104v30M159 103v31M168 105v29'/%3E%3Cpath d='M186 30v28M195 29v30M204 31v27M213 30v28M180 52l40-18'/%3E%3Cpath d='M70 120v30M79 119v31'/%3E%3C/g%3E%3C/svg%3E"); }
@keyframes breathe { from { opacity: .92; } to { opacity: 1; transform: scale(1.02); } }

/* mechanical: machined brass */
.amb[data-m="mechanical"] .hatch { inset: 0; background: repeating-linear-gradient(45deg, rgba(239, 226, 196, .03) 0 1px, transparent 1px 4px); }
.amb[data-m="mechanical"] .gear-wrap { color: #d4aa4f; opacity: .06; }
.amb[data-m="mechanical"] .g1 { width: 60vmax; height: 60vmax; right: -18vmax; bottom: -22vmax; animation: spin 180s linear infinite; }
.amb[data-m="mechanical"] .g2 { width: 38vmax; height: 38vmax; right: 30vmax; bottom: -20vmax; animation: spin 115s linear infinite reverse; }
.gear-vel, .gear { width: 100%; height: 100%; display: block; }
.gear path { fill: currentColor; fill-rule: evenodd; }
@keyframes spin { to { transform: rotate(360deg); } }

/* tabulating: card stock */
.amb[data-m="tabulating"] .holes { inset: -12%; transform: rotate(-4deg); opacity: .05; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='12'%3E%3Crect x='2.5' y='3' width='2' height='5' fill='%23efe6cf'/%3E%3C/svg%3E"); }
.amb[data-m="tabulating"] .card-edge { left: -4vw; top: 16vh; width: 18vw; height: 62vh; background: #efe6cf; opacity: .06; clip-path: polygon(0 0, 88% 0, 100% 7%, 100% 100%, 0 100%);
  /* a card sliding in from off-screen: feathered so it reads as atmosphere, not a stray panel */
  -webkit-mask-image: linear-gradient(to right, #000 30%, transparent 96%), linear-gradient(to bottom, transparent, #000 18%, #000 70%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(to right, #000 30%, transparent 96%), linear-gradient(to bottom, transparent, #000 18%, #000 70%, transparent); mask-composite: intersect; }
.amb[data-m="tabulating"]::before { content: ""; position: absolute; inset: 0; background: radial-gradient(70vmax 50vmax at 70% 0%, rgba(239, 230, 207, .07), transparent 70%); }

/* vacuum: iron and amber */
.amb[data-m="vacuum"] .mesh { inset: 0; opacity: .5; background:
  repeating-linear-gradient(0deg, rgba(255, 226, 184, .04) 0 1px, transparent 1px 6px),
  repeating-linear-gradient(90deg, rgba(255, 226, 184, .04) 0 1px, transparent 1px 6px); }
.amb[data-m="vacuum"] .tglow { width: 44vmax; height: 44vmax; bottom: -20vmax; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 150, 50, .30), rgba(255, 106, 26, .08) 55%, transparent); animation: flicker 5s ease-in-out infinite alternate; }
.amb[data-m="vacuum"] .tglow:nth-of-type(1) { left: -12vmax; animation-duration: 3.4s; }
.amb[data-m="vacuum"] .tglow:nth-of-type(2) { left: 14vw; bottom: -26vmax; animation-duration: 6.1s; }
.amb[data-m="vacuum"] .tglow:nth-of-type(3) { left: 40vw; animation-duration: 4.3s; }
.amb[data-m="vacuum"] .tglow:nth-of-type(4) { left: 64vw; bottom: -24vmax; animation-duration: 6.8s; }
.amb[data-m="vacuum"] .tglow:nth-of-type(5) { right: -14vmax; animation-duration: 3.9s; }
@keyframes flicker { 0% { opacity: .85; } 40% { opacity: 1; } 55% { opacity: .9; } 100% { opacity: .98; } }

/* mainframe: phosphor CRT */
.amb[data-m="mainframe"] .bloom { left: -10vw; top: 10vh; width: 70vw; height: 80vh; background: radial-gradient(closest-side, rgba(77, 255, 136, .14), transparent); }
.amb[data-m="mainframe"] .scan { inset: -6px 0; background: repeating-linear-gradient(transparent 0 2px, rgba(0, 0, 0, .28) 2px 3px); animation: roll 8s linear infinite; }
.amb[data-m="mainframe"] .band { left: 0; right: 0; top: 0; height: 18vh; background: linear-gradient(transparent, rgba(184, 255, 204, .05), transparent); transform: translateY(-20vh); animation: refresh 9s linear infinite; }
.amb[data-m="mainframe"] .curve { inset: 0; background: radial-gradient(ellipse 120% 110% at 50% 50%, transparent 60%, rgba(0, 0, 0, .6)); }
@keyframes roll { to { transform: translateY(3px); } }
@keyframes refresh { 0% { transform: translateY(-20vh); } 9% { transform: translateY(110vh); } 100% { transform: translateY(110vh); } }

/* personal: beige plastic and dithering */
.amb[data-m="personal"] .lamp { inset: 0; background: radial-gradient(80vmax 50vmax at 50% -10%, rgba(226, 210, 170, .12), transparent 70%); }
.amb[data-m="personal"] .dither { inset: 0; opacity: .05; image-rendering: pixelated; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' shape-rendering='crispEdges'%3E%3Cg fill='%23ece5d3'%3E%3Crect x='0' y='0' width='2' height='2'/%3E%3Crect x='4' y='4' width='2' height='2'/%3E%3Crect x='4' y='0' width='2' height='2' opacity='.5'/%3E%3Crect x='0' y='4' width='2' height='2' opacity='.5'/%3E%3Crect x='2' y='2' width='2' height='2' opacity='.25'/%3E%3Crect x='6' y='6' width='2' height='2' opacity='.25'/%3E%3C/g%3E%3C/svg%3E"); }
.amb[data-m="personal"] .vga { left: 0; right: 0; top: var(--topbar-h); height: 2px; opacity: .7; background: linear-gradient(90deg, #000 0 12.5%, #0000aa 0 25%, #00aa00 0 37.5%, #00aaaa 0 50%, #aa0000 0 62.5%, #aa00aa 0 75%, #aa5500 0 87.5%, #aaaaaa 0); }

/* web: glossy gel */
.amb[data-m="web"] .stripes { inset: 0; background: repeating-linear-gradient(135deg, rgba(232, 244, 255, .03) 0 1px, transparent 1px 7px); }
.amb[data-m="web"] .gel { left: 0; right: 0; top: 0; height: 45vh; background: linear-gradient(rgba(255, 255, 255, .075), rgba(255, 255, 255, .02) 70%, transparent); }
.amb[data-m="web"] .bokeh { border-radius: 50%; animation: drift 40s ease-in-out infinite alternate; }
.amb[data-m="web"] .bokeh:nth-of-type(1) { width: 34vmax; height: 34vmax; left: -6vmax; top: 30vh; background: radial-gradient(closest-side, rgba(79, 184, 255, .10), transparent); }
.amb[data-m="web"] .bokeh:nth-of-type(2) { width: 22vmax; height: 22vmax; left: 38vw; top: 58vh; background: radial-gradient(closest-side, rgba(143, 212, 0, .08), transparent); animation-delay: -12s; }
.amb[data-m="web"] .bokeh:nth-of-type(3) { width: 40vmax; height: 40vmax; right: -10vmax; top: 6vh; background: radial-gradient(closest-side, rgba(79, 184, 255, .09), transparent); animation-delay: -24s; }
.amb[data-m="web"] .bokeh:nth-of-type(4) { width: 14vmax; height: 14vmax; left: 20vw; top: 12vh; background: radial-gradient(closest-side, rgba(143, 212, 0, .07), transparent); animation-delay: -6s; }
.amb[data-m="web"] .bokeh:nth-of-type(5) { width: 18vmax; height: 18vmax; right: 18vw; bottom: 4vh; background: radial-gradient(closest-side, rgba(79, 184, 255, .08), transparent); animation-delay: -30s; }
@keyframes drift { to { transform: translate(24px, -18px); } }

/* ai: neon mesh */
.amb[data-m="ai"] .dots { inset: 0; background: radial-gradient(circle, rgba(236, 235, 255, .09) 1px, transparent 1.6px) 0 0 / 24px 24px; }
.amb[data-m="ai"] .blobs { inset: 0; animation: orbit 60s linear infinite; transform-origin: 50% 50%; }
.amb[data-m="ai"] .blobs i { position: absolute; border-radius: 50%; }
.amb[data-m="ai"] .blobs i:nth-child(1) { width: 70vmax; height: 70vmax; left: -20vmax; top: -30vmax; background: radial-gradient(closest-side, rgba(167, 139, 250, .16), transparent); }
.amb[data-m="ai"] .blobs i:nth-child(2) { width: 60vmax; height: 60vmax; right: -24vmax; top: 10vh; background: radial-gradient(closest-side, rgba(34, 227, 240, .10), transparent); }
.amb[data-m="ai"] .blobs i:nth-child(3) { width: 50vmax; height: 50vmax; left: 20vw; bottom: -30vmax; background: radial-gradient(closest-side, rgba(167, 139, 250, .10), transparent); }
.amb[data-m="ai"] .net { inset: 0; width: 100%; height: 100%; opacity: .5;
  /* Knock the network out behind the era heading + year numeral (rect set from JS, feathered 48px).
     Two linear masks add: visible wherever either one is opaque, i.e. everywhere outside the rect. */
  --mL: -999px; --mR: -999px; --mT: -999px; --mB: -999px;
  -webkit-mask-image:
    linear-gradient(to right, #000 calc(var(--mL) - 48px), transparent var(--mL), transparent var(--mR), #000 calc(var(--mR) + 48px)),
    linear-gradient(to bottom, #000 calc(var(--mT) - 48px), transparent var(--mT), transparent var(--mB), #000 calc(var(--mB) + 48px));
  mask-image:
    linear-gradient(to right, #000 calc(var(--mL) - 48px), transparent var(--mL), transparent var(--mR), #000 calc(var(--mR) + 48px)),
    linear-gradient(to bottom, #000 calc(var(--mT) - 48px), transparent var(--mT), transparent var(--mB), #000 calc(var(--mB) + 48px));
}
.amb[data-m="ai"] .net line { stroke: rgba(236, 235, 255, .10); stroke-width: 1; }
.amb[data-m="ai"] .net line.pulse { animation: activate 2s ease-in-out infinite; }
.amb[data-m="ai"] .net circle { fill: rgba(236, 235, 255, .22); }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes activate { 0%, 100% { stroke: rgba(236, 235, 255, .10); } 45% { stroke: rgba(34, 227, 240, .75); stroke-width: 1.5; } }


/* --------------------------------------------------------------------------
   App shell: topbar / stage / dock in one 100dvh grid. Nothing below the fold.
   -------------------------------------------------------------------------- */
.app {
  position: relative; z-index: 1;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  height: 100vh; height: 100dvh; overflow: hidden;
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */
.topbar { position: relative; z-index: 20; height: var(--topbar-h); background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-inner { height: 100%; display: flex; align-items: center; gap: 16px; }
.brand {
  font-family: var(--font-display); font-size: 19px; line-height: 1; letter-spacing: -0.01em;
  font-weight: var(--f-wght); font-style: var(--f-style);
  font-variation-settings: "SOFT" var(--f-soft), "WONK" var(--f-wonk), "opsz" 36;
  white-space: nowrap;
}
.brand-short { display: none; }
.era-chip {
  display: inline-flex; align-items: center; gap: 8px; margin-inline: auto;
  height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); font-size: var(--fs-label); font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-muted); white-space: nowrap; min-width: 0;
}
.era-dot { width: 8px; height: 8px; background: var(--accent); box-shadow: 0 0 10px var(--accent); flex: none; }
.era-chip-name { color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.era-chip-short { display: none; color: var(--ink); }
.era-chip-range { letter-spacing: 0; text-transform: none; font-weight: 500; }
.controls { display: flex; align-items: center; gap: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; min-width: 36px; padding: 0 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--ink);
  font-size: 13px; font-weight: 600; letter-spacing: .01em;
  transition: background var(--dur-1), border-color var(--dur-1), transform 180ms var(--spring);
}
.btn.icon { padding: 0; width: 36px; }
.btn svg, .pager-btn svg, .expand-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; }
.btn:hover { border-color: color-mix(in oklab, var(--accent) 55%, transparent); background: color-mix(in oklab, var(--surface) 70%, var(--accent) 8%); }
.btn:active { transform: scale(.97); transition-duration: 80ms; }
.btn.play { border-color: color-mix(in oklab, var(--accent) 50%, transparent); color: var(--accent); min-width: 88px; }
.btn.play svg path { fill: currentColor; stroke: none; }
.btn.play .i-pause { display: none; }
.is-playing .btn.play .i-play { display: none; }
.is-playing .btn.play .i-pause { display: inline; }
.btn.speed { font-family: var(--font-mono); width: 44px; padding: 0; }
.btn.help { font-size: 14px; }
.mob-only { display: none; }
@media (pointer: coarse) { .btn { height: 44px; min-width: 44px; } .btn.icon { width: 44px; } }

/* --------------------------------------------------------------------------
   Stage: hero | curves | events
   -------------------------------------------------------------------------- */
.stage {
  display: grid; min-height: 0; height: 100%;
  grid-template-columns: minmax(0, 5fr) minmax(170px, 2fr) minmax(0, 5fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "hero vitals events";
  column-gap: var(--gutter); row-gap: 12px;
  padding-top: var(--gap-y); padding-bottom: calc(var(--gap-y) * .75);
}
.hero { grid-area: hero; position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; container: hero / size; }
.vitals { grid-area: vitals; }
.events-panel { grid-area: events; }
.seg { display: none; grid-area: seg; }

.hero-head { flex: none; }
.kicker { font-size: 12px; color: var(--ink-muted); letter-spacing: .06em; margin-bottom: 4px; }
.era-name {
  font-family: var(--font-display); font-size: clamp(22px, min(7.4cqw, 6.2cqh), 44px); line-height: 1.05; letter-spacing: -0.02em;
  font-weight: var(--f-wght); font-style: var(--f-style);
  font-variation-settings: "SOFT" var(--f-soft), "WONK" var(--f-wonk), "opsz" var(--f-opsz);
  text-wrap: balance;
}
.era-tagline {
  margin-top: 6px; color: var(--ink-muted); max-width: 52ch; font-size: 14px; line-height: 1.5; min-height: 3em;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
@container hero (max-height: 470px) { .era-tagline { display: none; } }

.year-display {
  --fs-year: clamp(52px, min(30cqw, 19cqh), 168px);
  position: relative; z-index: 2; flex: none; display: flex; align-items: flex-end; gap: 14px;
  margin-top: clamp(4px, 1.6cqh, 14px); margin-bottom: calc(var(--fs-year) * -.13); pointer-events: none;
}
/* One continuous, feathered glow behind the whole numeral. */
.year-display::before {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: -18%; bottom: -18%;
  background: radial-gradient(closest-side, var(--glow), transparent);
  opacity: .9; pointer-events: none;
}
.suffix { text-shadow: 0 0 24px var(--glow); }
.numeral {
  display: inline-flex; font-family: var(--font-mono); font-weight: 700; font-size: var(--fs-year);
  line-height: .9; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--ink);
}
.digit { display: inline-block; height: .9em; overflow: hidden; position: relative; width: .62em; }
.digit-strip { display: flex; flex-direction: column; transform: translateY(calc(var(--d, 0) * -.9em)); transition: transform var(--dur-2) var(--ease-out); }
.digit-strip span { height: .9em; line-height: .9; display: block; }
.is-dragging .digit-strip, .reduce-motion .digit-strip { transition: none; }
.suffix { font-size: clamp(16px, calc(var(--fs-year) * .2), 30px); font-weight: 700; color: var(--accent); padding-bottom: .4em; letter-spacing: .04em; }

/* The artifact takes whatever height is left and scales inside it (viewBox, meet). */
.artifact-frame { position: relative; z-index: 1; flex: 1 1 0; min-height: 0; width: 100%; color: var(--ink); }
.spotlight { position: absolute; inset: 4% 0 -6%; background: radial-gradient(ellipse 50% 48% at 50% 58%, var(--glow), transparent 72%); }
.art { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; display: none; }
.art.on { display: block; }
.art-inner { transform-origin: 50% 55%; transform-box: fill-box; }
.art-in-fwd { animation: artInFwd var(--dur-4) var(--ease-out) 80ms both; }
.art-in-back { animation: artInBack var(--dur-4) var(--ease-out) 80ms both; }
@keyframes artInFwd { from { opacity: 0; transform: scale(1.04); clip-path: inset(0 100% 0 0); } to { opacity: 1; transform: none; clip-path: inset(0 0 0 0); } }
@keyframes artInBack { from { opacity: 0; transform: scale(1.04); clip-path: inset(0 0 0 100%); } to { opacity: 1; transform: none; clip-path: inset(0 0 0 0); } }
.reduce-motion .art-in-fwd, .reduce-motion .art-in-back, .art-in-fade { animation: artFade 120ms linear both; }
@keyframes artFade { from { opacity: 0; } to { opacity: 1; } }

/* Artifact detail styles */
.art text { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.art .odo { transition: transform 240ms var(--ease-out); }
.art .bead { transition: transform 160ms var(--ease-out); }
.art .peb { transition: opacity 160ms var(--ease-out); }
.is-dragging .art .peb, .reduce-motion .art .peb { transition: none; }
.is-dragging .art .odo, .reduce-motion .art .odo { transition: none; }
.art .fil { transition: opacity 400ms var(--ease-out); }
.art .lamp { transition: fill 90ms linear, opacity 90ms linear; }
.art .blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.art .flick { animation: flicker 4.2s ease-in-out infinite alternate; }
.art .morph-fade { transition: opacity 300ms var(--ease-out); }
.is-dragging .art .morph-fade, .is-dragging .art .fil { transition: none; }

/* --------------------------------------------------------------------------
   Curves, compact: four live sparklines. Click one (or Expand) for full charts.
   -------------------------------------------------------------------------- */
.vitals { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding-top: 4px; container: vitals / inline-size; }
@container vitals (max-width: 230px) { .expand-btn span { display: none; } .expand-btn { padding: 0 6px; margin-right: -6px; } }
@container vitals (max-width: 190px) { .vitals-title span { display: none; } }
.vitals-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 6px; }
.vitals-title { min-width: 0; overflow: hidden; display: flex; align-items: baseline; gap: 8px; font-size: var(--fs-label); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.vitals-title span { font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-muted); }
.expand-btn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 8px; margin-right: -8px; border: 1px solid transparent; border-radius: var(--radius);
  background: none; color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer; transition: border-color var(--dur-1), background var(--dur-1); }
.expand-btn svg { width: 13px; height: 13px; stroke-width: 1.8; }
.expand-btn:hover { border-color: var(--line); background: var(--panel); }
.vitals-list { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.vital { position: relative; flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; width: 100%; padding: 8px 0 7px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; cursor: zoom-in; color: var(--ink); }
.vital-title { flex: none; display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); transition: color var(--dur-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vital:hover .vital-title { color: var(--ink); }
.vital-val { flex: none; display: flex; align-items: baseline; gap: 5px; margin-top: 1px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.vital-val b { font-size: clamp(16px, 2.4vh, 20px); font-weight: 700; letter-spacing: -0.02em; }
.vital-val i { font-style: normal; font-size: 12px; color: var(--ink-muted); }
.spark { flex: 1 1 0; min-height: 12px; max-height: 64px; display: block; width: 100%; margin-top: 4px; overflow: visible; }
.spark .ghost { fill: none; stroke: var(--accent); stroke-width: 1.25; opacity: .28; stroke-dasharray: 2 3; }
.spark .past { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; }
.spark .base { stroke: var(--line); }
.spark .dot { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
/* caption = label (may ellipsize) + year (never truncated) */
.cap-line { display: flex; min-width: 0; white-space: nowrap; }
.cap-l { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cap-y { flex: none; font-variant-numeric: tabular-nums; }
/* the 4-up tablet strip is too narrow for qualifiers; the full caption stays in the title tooltip */
@media (min-width: 768px) and (max-width: 1199px) { .vital .cap-q { display: none; } }
.vital-sub { flex: none; margin-top: 3px; font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.vital.pre .vital-val b { font-size: 17px; color: var(--ink-muted); }
.vital.pre .spark .dot { display: none; }
.vital.pre .spark .ghost { opacity: .4; }
/* Before 1956 no series exists yet: the panel folds into one compact countdown card */
.vitals-lede { display: none; }
.vitals.dormant .vitals-lede { display: block; flex: none; margin: 2px 0 10px; font-size: 13px; line-height: 1.45; color: var(--ink-muted); }
.vitals.dormant .vitals-list { flex: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 2px 14px; }
.vitals.dormant .vital { flex: none; padding: 9px 0 8px; }
.vitals.dormant .vital:first-child { border-top: 0; }
.vitals.dormant .spark { display: none; }

/* --------------------------------------------------------------------------
   Events: paged, fixed-height cards so a page always fits exactly
   -------------------------------------------------------------------------- */
.events-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.events-head { flex: none; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; min-height: 32px; }
.events-head .h2 { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pager { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.pager.single { visibility: hidden; }
.pager-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); cursor: pointer;
  transition: border-color var(--dur-1), background var(--dur-1), opacity var(--dur-1); }
.pager-btn:hover:not(:disabled) { border-color: color-mix(in oklab, var(--accent) 55%, transparent); }
.pager-btn:disabled { opacity: .35; cursor: default; }
.pager-count { min-width: 44px; text-align: center; font-size: 12px; color: var(--ink-muted); }
@media (pointer: coarse) { .pager-btn { width: 40px; height: 40px; } }

.events {
  --card-gap: 8px; --card-pad: 11px; --card-lh: 20px; --blurb-lines: 2;
  flex: 1 1 0; min-height: 0; list-style: none; display: flex; flex-direction: column; gap: var(--card-gap);
  overflow: hidden; touch-action: none; outline: none; position: relative;
  /* keep the focus glow of cards visible at the column edges */
  padding: 2px; margin: -2px;
}
.events > li { flex: none; transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out); }
.events > li.entering { animation: cardIn var(--dur-2) var(--ease-out) both; }
.events > li.leaving { display: none; }
.events > li.measure { position: absolute; left: 2px; right: 2px; top: 0; visibility: hidden; pointer-events: none; }
.events > li.measure .card { max-height: none; }
.events > li.measure .card-blurb { display: block; -webkit-line-clamp: unset; line-clamp: none; }
.events.page-fwd > li { animation: pageFwd 260ms var(--ease-out) both; }
.events.page-back > li { animation: pageBack 260ms var(--ease-out) both; }
.events.page-fwd > li:nth-child(2), .events.page-back > li:nth-child(2) { animation-delay: 30ms; }
.events.page-fwd > li:nth-child(3), .events.page-back > li:nth-child(3) { animation-delay: 60ms; }
.events.page-fwd > li:nth-child(n+4), .events.page-back > li:nth-child(n+4) { animation-delay: 90ms; }
.is-dragging .events > li, .is-dragging .events > li.entering { transition: none; animation: none; }
@keyframes cardIn { from { opacity: 0; } }
@keyframes pageFwd { from { opacity: 0; transform: translateX(18px); } }
@keyframes pageBack { from { opacity: 0; transform: translateX(-18px); } }

.card {
  position: relative; display: flex; flex-direction: column; width: 100%; max-height: var(--card-h, none); overflow: hidden; text-align: left; cursor: pointer;
  padding: var(--card-pad) 16px var(--card-pad) 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--ink);
  transition: border-color var(--dur-1), box-shadow var(--dur-1), background var(--dur-1);
}
.card::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 2px; background: var(--accent); opacity: 0; transition: opacity var(--dur-1); }
.card:hover { border-color: color-mix(in oklab, var(--accent) 45%, transparent); }
.focus > .card { box-shadow: 0 0 24px var(--glow); border-color: color-mix(in oklab, var(--accent) 35%, var(--line)); }
.focus > .card::before { opacity: 1; }
.card-meta { flex: none; display: flex; align-items: center; gap: 8px; height: 18px; margin-bottom: 5px; font-size: var(--fs-mono); color: var(--ink-muted); white-space: nowrap; }
.card-year { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.focus .card-year { color: var(--accent); }
.tag { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 2px 6px; border-radius: 3px; line-height: 1.3;
  color: color-mix(in oklab, var(--cat) 60%, var(--ink)); background: color-mix(in oklab, var(--cat) 20%, transparent); }
.this-year { font-size: 11px; font-weight: 600; letter-spacing: .06em; padding: 2px 6px; border-radius: 3px; background: var(--accent); color: var(--bg); line-height: 1.3; }
.sig { margin-left: auto; display: inline-flex; gap: 2px; }
.sig i { width: 3px; height: 10px; background: var(--ink-muted); opacity: .25; }
.sig i.on { opacity: 1; background: var(--accent); }
.card-title { flex: none; font-size: var(--fs-title); line-height: 22px; height: 22px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-blurb { flex: none; margin-top: 3px; color: var(--ink-muted); font-size: var(--fs-body); line-height: var(--card-lh);
  display: -webkit-box; -webkit-line-clamp: var(--blurb-lines); line-clamp: var(--blurb-lines); -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { flex: none; margin-top: 0; padding-top: 6px; height: 24px; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-muted); white-space: nowrap; min-width: 0; }
.card-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.stat { flex: none; font-family: var(--font-mono); font-size: 12px; color: var(--accent-2); border: 1px solid color-mix(in oklab, var(--accent-2) 40%, transparent); padding: 0 6px; line-height: 16px; border-radius: 3px; }
.cat-hardware { --cat: #e0a458; } .cat-software { --cat: #6fc3df; } .cat-ai { --cat: #b69cff; }
.cat-networking { --cat: #5fd39a; } .cat-milestone { --cat: #f07a6a; } .cat-people { --cat: #e6d27a; }

/* Neighbours pulled in to fill a sparse stretch */
.near-chip { font-size: 11px; font-weight: 600; letter-spacing: .04em; padding: 1px 6px; border-radius: 3px; line-height: 1.3; color: var(--ink-muted); border: 1px dashed color-mix(in oklab, var(--ink-muted) 55%, transparent); }
.near > .card { border-style: dashed; background: color-mix(in oklab, var(--panel) 60%, transparent); }
.near > .card .card-title, .near > .card .card-blurb { opacity: .78; }

/* Expanded in place: the whole card floats over the list; the list itself never grows */
.events > li.expanded { position: relative; z-index: 6; }
.expanded > .card {
  position: absolute; left: 0; right: 0; top: 0; overflow: auto; overscroll-behavior: contain;
  background: var(--surface); border-color: color-mix(in oklab, var(--accent) 60%, var(--line));
  box-shadow: 0 18px 44px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .3), 0 0 30px var(--glow);
}
.expanded > .card .card-title { white-space: normal; height: auto; }
.expanded > .card .card-blurb { display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; color: var(--ink); }
.expanded > .card .card-foot { height: auto; flex-wrap: wrap; white-space: normal; row-gap: 6px; }
.expanded > .card .card-who { flex: 1 1 100%; overflow: visible; white-space: normal; }
.card-hint { display: none; flex: none; margin-top: 8px; font-size: 11.5px; color: var(--accent); }
.expanded > .card .card-hint { display: block; }
.card.xp-in { animation: xpIn 220ms var(--ease-out); }
@keyframes xpIn {
  from { clip-path: inset(var(--xp-top, 0px) 0 calc(var(--xp-h, 100%) - var(--xp-top, 0px) - var(--card-h, 100%)) 0 round var(--radius)); }
  to { clip-path: inset(0 0 0 0 round var(--radius)); }
}

/* while one card is open in place, the others step back so no loose fragment reads through */
.events.has-xp > li:not(.expanded):not(.more-row) { opacity: .18 !important; filter: blur(1.5px); transition: opacity var(--dur-1), filter var(--dur-1); }
.reduce-motion .events.has-xp > li:not(.expanded) { filter: none; }
/* phones: a plain card may trade its byline row for one more blurb line (back when expanded) */
.nofoot:not(.expanded) > .card .card-foot { display: none; }
.tonly:not(.expanded) > .card .card-blurb { display: none; }
.tonly:not(.expanded) > .card { padding-top: calc(var(--card-pad) - 4px); padding-bottom: calc(var(--card-pad) - 4px); }

/* Foot row: this year's exhibits on other pages + next-page link */
.events > li.more-row { flex: none; margin-top: 0; height: 32px; display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 12px; color: var(--ink-muted); }
.more-lbl { flex: none; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-right: 2px; }
.more-chip, .more-next { display: inline-flex; align-items: center; gap: 6px; height: 28px; min-width: 0; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--ink); font: 500 12px var(--font-ui); cursor: pointer; transition: border-color var(--dur-1), color var(--dur-1); }
.more-chip { flex: 0 1 auto; border-color: color-mix(in oklab, var(--accent) 45%, var(--line)); color: var(--accent); }
.more-chip span { overflow: hidden; text-overflow: ellipsis; }
.more-chip svg { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.more-next { flex: 0 0 auto; margin-left: auto; border-style: dashed; color: var(--ink-muted); }
.more-chip:hover, .more-next:hover, .more-chip:focus-visible, .more-next:focus-visible { border-color: var(--accent); color: var(--accent); }
.more-next .arr { font-family: var(--font-mono); }
@container events (max-width: 420px) { .more-lbl { display: none; } }

/* Cards that open an interactive exhibit: dog-eared corner + CTA chip */
.card.has-ix { border-color: color-mix(in oklab, var(--accent) 30%, var(--line)); }
.card.has-ix::after {
  content: ""; position: absolute; top: -1px; right: -1px; width: 14px; height: 14px;
  background: linear-gradient(225deg, var(--bg) 0 50%, color-mix(in oklab, var(--accent) 70%, var(--surface)) 50% 100%);
  border-bottom-left-radius: 2px; transition: width 180ms var(--spring), height 180ms var(--spring);
}
.card.has-ix:hover::after, .card.has-ix:focus-visible::after { width: 20px; height: 20px; }
.card.has-ix { transition: border-color var(--dur-1), box-shadow var(--dur-1), background var(--dur-1), transform 180ms var(--spring); }
.card.has-ix:hover, .card.has-ix:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in oklab, var(--accent) 75%, var(--line));
  background: color-mix(in oklab, var(--panel) 80%, var(--accent) 6%);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 35%, transparent), 0 0 26px var(--glow);
}
.card.has-ix:hover .ix-cta, .card.has-ix:focus-visible .ix-cta { box-shadow: 0 0 20px var(--glow), 0 0 0 1px color-mix(in oklab, var(--accent) 50%, #fff 20%); }
.reduce-motion .card.has-ix:hover, .reduce-motion .card.has-ix:focus-visible { transform: none; }
.card.has-ix .sig { margin-right: 10px; }
.ix-cta {
  flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 20px; padding: 0 8px 0 6px;
  border-radius: 3px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; color: var(--bg); background: var(--accent);
  box-shadow: 0 0 14px var(--glow);
}
.ix-cta svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: square; }
.ix-cta .arr { display: inline-block; transition: transform 180ms var(--spring); }
.card.has-ix:hover .ix-cta .arr, .card.has-ix:focus-visible .ix-cta .arr { transform: translateX(3px); }
.card.has-ix .stat { display: none; }
@container events (min-width: 520px) { .card.has-ix .stat { display: inline; } }
/* narrow columns: an exhibit card's byline gets its own row above the CTA (foot2), or waits for the expanded view (no-who) */
.foot2 > .card .card-foot { height: 44px; flex-wrap: wrap; align-content: center; row-gap: 2px; }
.foot2 > .card .card-who { flex: 1 1 100%; }
.foot2 > .card .ix-cta, .no-who > .card .ix-cta { margin-left: 0; }
.no-who:not(.expanded) > .card .card-who { display: none; }
/* busy mid-width page: the exhibit CTA rides in the meta row so the blurb gets the foot row's height */
.ctatop > .card .card-meta .sig { display: none; }
.ctatop > .card .card-meta .ix-cta { margin-left: auto; margin-right: 12px; min-width: 0; flex: 0 1 auto; height: 18px; }
.ctatop > .card .card-meta .ix-cta > span:not(.arr) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.quiet { padding: 16px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--panel); }
.quiet h3 { font-family: var(--font-display); font-size: 22px; font-weight: var(--f-wght); font-style: var(--f-style); font-variation-settings: "SOFT" var(--f-soft), "WONK" var(--f-wonk), "opsz" var(--f-opsz); }
.quiet p { color: var(--ink-muted); margin: 6px 0 12px; font-size: 14px; }
.quiet .row { display: flex; flex-direction: column; gap: 8px; }
.quiet .btn { justify-content: flex-start; height: auto; min-height: 40px; padding: 8px 12px; text-align: left; font-weight: 500; }
.error-card { border-style: solid; border-color: color-mix(in oklab, #ff5a4e 50%, transparent); }

.skeleton { flex: none; height: 116px; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(100deg, var(--panel) 30%, color-mix(in oklab, var(--surface) 70%, var(--ink) 8%) 50%, var(--panel) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.text-btn { background: none; border: 0; padding: 10px 0; min-height: 44px; color: var(--accent); font-weight: 600; font-size: 14px; cursor: pointer; }
.text-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.events-panel { container: events / inline-size; }

/* --------------------------------------------------------------------------
   Curves, full size (overlay)
   -------------------------------------------------------------------------- */
.sheet.curves-sheet { width: min(1180px, 100%); height: min(760px, 100%); max-height: none; display: flex; flex-direction: column; overflow: hidden; }
.curves-sheet .sheet-head { gap: 16px; }
.curves-sheet .sheet-head .h2 { flex: none; }
.curves-note { flex: 1; min-width: 0; color: var(--ink-muted); font-size: 14px; transition: opacity var(--dur-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.curves-note.off { opacity: 0; }
.tiles { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tiles[data-solo] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.tiles[data-solo] .tile:not(.expanded) { display: none; }
.tile { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 12px 14px 10px; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.tile-head { flex: none; display: flex; align-items: center; gap: 8px; min-height: 22px; }
.tile-title { font-size: var(--fs-label); line-height: 1.3; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); flex: 1; min-width: 0; }
.tile-expand { width: 28px; height: 28px; min-width: 28px; margin: -4px -6px -4px 0; }
.tile-expand svg { width: 14px; height: 14px; }
.readout { flex: none; display: flex; align-items: baseline; gap: 6px; margin-top: 6px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.readout .val { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.readout .unit { font-size: 13px; color: var(--ink-muted); }
.subline { flex: none; display: flex; column-gap: 10px; align-items: baseline; min-height: 18px; margin-top: 2px; font-size: 12px; line-height: 18px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; }
.subline .machine { flex: 0 1 auto; min-width: 0; }
.delta { flex: 0 1000 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--accent-2); white-space: nowrap; }
.chart { position: relative; flex: 1 1 0; min-height: 60px; margin-top: 8px; cursor: crosshair; touch-action: pan-y; }
.chart svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid line { stroke: var(--line); }
.chart .axis text { fill: var(--ink-muted); font: 500 11px var(--font-mono); font-variant-numeric: tabular-nums; }
.chart .axis tspan.exp { font-size: 9px; }
.chart .area { fill: var(--accent); opacity: .12; }
.chart.falling .area { display: none; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; }
.chart .ghost-line { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: .3; stroke-dasharray: 3 3; }
.chart .pts circle { fill: var(--accent); opacity: .5; }
.chart .cursor line { stroke: var(--ink); stroke-width: 1; }
.chart .cursor circle { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.chart .hover { opacity: 0; pointer-events: none; }
.chart .hover line { stroke: var(--ink-muted); stroke-dasharray: 2 3; }
.chart.hovering .hover { opacity: 1; }
.chart-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font: 500 12px var(--font-mono); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity var(--dur-1); z-index: 3; }
.chart.hovering .chart-tip { opacity: 1; }
.caption { flex: none; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; width: 100%; margin-top: 8px; padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
  font-size: 11px; line-height: 1.4; color: var(--ink-muted); white-space: normal; overflow: hidden; }
.caption:hover { color: var(--ink); }
.caption.open, .tile.expanded .caption { -webkit-line-clamp: 6; line-clamp: 6; }
.tile.pre .chart svg, .tile.pre .readout { opacity: .55; }
.tile .future { position: absolute; inset: 0 8px 16px 36px; display: none; align-items: center; justify-content: center; pointer-events: none;
  font: 600 11px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); text-align: center; }
.tile.pre .future { display: flex; }
.tile .future span { padding: 3px 8px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--bg); }
.tile.pre .cursor { opacity: .4; }
.tile.pre .ghost-line { opacity: .5; }
.tile.flash { animation: tileFlash 1.2s var(--ease-out); }
@keyframes tileFlash { 0%, 30% { box-shadow: 0 0 0 1px var(--accent), 0 0 28px var(--glow); } 100% { box-shadow: none; } }

kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; font-size: 12px; text-align: center; color: var(--ink); background: var(--surface); }

/* --------------------------------------------------------------------------
   Dock / scrubber (in flow: the last row of the shell)
   -------------------------------------------------------------------------- */
.dock {
  position: relative; z-index: 20;
  padding: 6px 0 calc(8px + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--line);
}
.play-progress { position: absolute; left: 0; top: -1px; height: 2px; width: 0; background: var(--accent); opacity: 0; transition: opacity var(--dur-2); }
.is-playing .play-progress { opacity: 1; }
.dock-inner { display: flex; align-items: center; gap: 12px; }
.track-col { position: relative; flex: 1; min-width: 0; padding-inline: calc(var(--thumb) / 2); }
.era-labels { position: relative; height: 15px; }
.era-labels span { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); white-space: nowrap; line-height: 15px; transition: opacity 120ms var(--ease-out); }
.era-labels span.under-flag { opacity: 0; }
/* exhibit markers: rings just under the era colour bar */
.ix-marks { position: absolute; left: calc(var(--thumb) / 2); right: calc(var(--thumb) / 2); top: 3px; height: 6px; pointer-events: none; }
.ix-marks i, .ring-demo { position: absolute; top: 0; left: calc(var(--p) * 100%); width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; border: 1.5px solid var(--accent-2); opacity: .85; }
.ring-demo { position: relative; display: inline-block; left: 0; margin: 0 2px; vertical-align: 1px; }
.tip-ix { color: var(--accent); font-weight: 600; }
.sheet-tip { margin: -4px 0 12px; font-size: 13px; line-height: 1.5; color: var(--ink-muted); }
.sheet-tip .demo-chip { display: inline-flex; height: 18px; margin-right: 4px; vertical-align: 1px; }
.minimap { display: block; width: 100%; height: 32px; }
.minimap .bin { fill: var(--ink); opacity: .35; }
.minimap .bin.hot { fill: var(--accent); opacity: .9; }
.slider-row { position: relative; height: 40px; margin-inline: calc(var(--thumb) / -2); }
.track-line { position: absolute; left: calc(var(--thumb) / 2); right: calc(var(--thumb) / 2); top: 50%; height: 2px; margin-top: -1px; background: var(--line); }
.track-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: color-mix(in oklab, var(--accent) 60%, transparent); }
.slider { -webkit-appearance: none; appearance: none; position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: transparent; cursor: grab; z-index: 2; touch-action: none; }
.slider:active { cursor: grabbing; }
.slider:focus { outline: none; }
.slider::-webkit-slider-runnable-track { height: 40px; background: transparent; }
.slider::-moz-range-track { height: 40px; background: transparent; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: var(--thumb); height: 40px; background: transparent; border: 0; }
.slider::-moz-range-thumb { width: var(--thumb); height: 40px; background: transparent; border: 0; }
.needle { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none; z-index: 1; will-change: transform; }
.needle .cap { position: absolute; left: 50%; top: -1px; width: 10px; height: 10px; margin-left: -5px; background: var(--accent); transition: width 150ms var(--spring), height 150ms var(--spring), margin 150ms var(--spring); }
.is-dragging .needle .cap { width: 14px; height: 14px; margin-left: -7px; top: -3px; }
.slider:focus-visible ~ #needle .flag { outline: 2px solid var(--accent); outline-offset: 2px; }
.needle .flag { position: absolute; bottom: calc(100% + 4px); left: 0; transform: translateX(calc(-50% + var(--flag-shift, 0px))); padding: 2px 7px; font-size: 13px; font-weight: 700; line-height: 1.35; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius); color: var(--ink); }
.needle.ghost { opacity: 0; background: var(--ink); transition: opacity var(--dur-1); }
.needle.ghost .flag { border-color: var(--line); color: var(--ink-muted); font-weight: 500; }
.needle.ghost.on { opacity: .3; }
.ticks { position: relative; height: 15px; font-size: 11px; line-height: 15px; color: var(--ink-muted); }
.ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.ticks span:first-child { transform: none; }
.ticks span:last-child { transform: translateX(-100%); }
.bin-tip { position: absolute; bottom: calc(100% - 10px); transform: translateX(-50%); z-index: 5; max-width: 280px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 12px; line-height: 1.4; pointer-events: none; }
.bin-tip b { font-family: var(--font-mono); font-weight: 500; color: var(--accent); margin-right: 6px; }
.bin-tip div + div { margin-top: 2px; }

/* --------------------------------------------------------------------------
   Overlays: shortcuts, curves, exhibit stage
   -------------------------------------------------------------------------- */
.overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .6); animation: fadeIn var(--dur-2) var(--ease-out); }
.overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.sheet { width: min(540px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 0 40px var(--glow); animation: sheetIn var(--dur-3) var(--ease-out); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.keys div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); align-items: center; }
.keys dt { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--ink-muted); }
.keys dd { font-size: 14px; }
.toggle { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); min-height: 44px; cursor: pointer; font-weight: 600; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.colophon { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--ink-muted); font-size: 12px; line-height: 1.5; }

/* Exhibit stage */
.ix-overlay { padding: clamp(0px, 3vmin, 32px); }
.ix-sheet {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  width: min(1180px, 100%); height: min(820px, 100%);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, var(--line)); border-radius: var(--radius);
  background: var(--bg); box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 30px 80px rgba(0, 0, 0, .55), 0 0 60px var(--glow);
  animation: stageIn 320ms var(--ease-out);
}
@keyframes stageIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.reduce-motion .ix-sheet, .reduce-motion .sheet, .reduce-motion .overlay { animation: none; }
.ix-head { flex: none; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 10px 8px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ix-kind { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 3px; background: color-mix(in oklab, var(--accent) 18%, transparent); color: var(--accent);
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ix-kind svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: square; }
.ix-title { flex: 1; min-width: 0; font-family: var(--font-display); font-size: clamp(17px, 1.6vw, 22px); line-height: 1.2; font-weight: var(--f-wght); font-style: var(--f-style);
  font-variation-settings: "SOFT" var(--f-soft), "WONK" var(--f-wonk), "opsz" var(--f-opsz); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ix-year { flex: none; font-size: 13px; color: var(--ink-muted); }
.ix-body { position: relative; flex: 1 1 0; min-height: 0; overflow: auto; overscroll-behavior: contain; container: ix / size; }
.ix-mount { position: absolute; inset: 0; container: ix-mount / size; }
.ix-status { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; color: var(--ink-muted); }
.ix-status h3 { font-family: var(--font-display); font-size: 22px; color: var(--ink); font-weight: var(--f-wght); }
.ix-status p { max-width: 46ch; font-size: 14px; }
.ix-status code { font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted); padding: 2px 6px; border: 1px solid var(--line); border-radius: 3px; max-width: 60ch; overflow-wrap: anywhere; }
.ix-status .row { display: flex; gap: 8px; }
.ix-loader { width: 180px; height: 2px; background: var(--line); overflow: hidden; border-radius: 1px; }
.ix-loader i { display: block; width: 40%; height: 100%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: ixLoad 1.1s var(--ease-inout) infinite; }
@keyframes ixLoad { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.ix-status.loading { opacity: 0; animation: fadeIn 200ms var(--ease-out) 150ms forwards; }
.reduce-motion .ix-loader i { animation-duration: 3s; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
/* Short desktop screens: tighten the dock */
@media (max-height: 800px) and (min-width: 768px) {
  .minimap { height: 24px; }
  .era-labels { height: 13px; }
  .era-labels span { font-size: 10px; line-height: 13px; }
}

/* Tall desktops: the artifact keeps its own 4:3 box and the free height is shared out
   (above the numeral, between numeral and artifact, below it), so no single dead band forms. */
@media (min-width: 1200px) {
  .artifact-frame { flex: 0 1 auto; aspect-ratio: 4 / 3; margin-block: auto; }
  .year-display { margin-top: max(clamp(4px, 1.6cqh, 14px), calc((100cqh - 100cqw * .75 - 330px) / 4)); }
}
/* Big, tall screens: a 1440px column leaves the hero's artifact width-bound with a dead band
   above and below it; the wider column scales the artifact (and numeral) up into that band. */
@media (min-width: 1600px) and (min-height: 960px) {
  .wrap { max-width: min(2240px, calc(100vh * 1.65)); }
  .year-display { --fs-year: clamp(52px, min(30cqw, 19cqh), 200px); }
  .stage { grid-template-columns: minmax(0, 6fr) minmax(170px, 2fr) minmax(0, 5fr); }
}

/* Tablet: hero | events, the curves become a 4-up strip along the bottom */
@media (max-width: 1199px) {
  .stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas: "hero events" "vitals vitals";
  }
  .vitals { padding-top: 0; }
  .vitals-list { flex: none; flex-direction: row; border-top: 1px solid var(--line); }
  .vital { flex: 1 1 0; min-width: 0; padding: 8px 12px 6px; border-top: 0; border-left: 1px solid var(--line); }
  .vital:first-child { border-left: 0; padding-left: 0; }
  .spark { flex: none; height: 24px; }
  .vitals.dormant .vitals-list { flex-direction: row; padding: 2px 0; }
  .vitals.dormant .vital { flex: 1 1 0; min-width: 0; padding: 8px 12px; border-top: 0; }
  .vitals.dormant .vital:first-child { padding-left: 14px; }
  .vitals.dormant .vitals-lede { display: none; }
  .era-chip-range { display: none; }
}
@media (max-width: 899px) { .era-chip-name { display: none; } .era-chip-short { display: inline; } }
@media (max-width: 1199px) and (orientation: portrait) {
  /* tall tablets: the hero on top, events and curves beneath */
  .stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, .85fr) auto minmax(0, 1.25fr);
    grid-template-areas: "hero" "vitals" "events";
  }
  /* hero splits: era + numeral on the left, the artifact beside it */
  .hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "head art" "year art"; column-gap: var(--gutter); }
  .hero-head { grid-area: head; }
  .year-display { grid-area: year; align-self: end; margin-bottom: 0; --fs-year: clamp(52px, min(12cqw, 30cqh), 130px); }
  .artifact-frame { grid-area: art; height: 100%; }
  .era-name { font-size: clamp(22px, min(4.6cqw, 10cqh), 40px); }
}

/* Phone: compact hero, Events / Curves switch, slider at the bottom */
@media (max-width: 767px) {
  .brand-full { display: none; }
  .brand-short { display: inline; font-size: 17px; }
  .desk-only { display: none; }
  .mob-only { display: inline-flex; }
  .topbar-inner { gap: 8px; }
  .era-chip { height: 26px; padding: 0 8px; gap: 6px; font-size: 11px; margin-inline: auto 0; }
  .era-chip-name { display: none; }
  .era-chip-short { display: inline; }
  .btn.play { min-width: 44px; padding: 0 10px; }
  .play-label { display: none; }

  .stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, .8fr) auto minmax(0, 1.5fr);
    grid-template-areas: "hero" "seg" "panel";
    row-gap: 10px; padding-top: 12px; padding-bottom: 10px;
  }
  .hero { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "year head" "art art"; column-gap: 14px; align-items: end; }
  .hero-head { grid-area: head; align-self: center; padding-bottom: 2px; }
  .kicker { font-size: 11px; margin-bottom: 2px; }
  .era-name { font-size: clamp(18px, 5.4cqw, 24px); line-height: 1.1; }
  .era-tagline { display: none; }
  .year-display { grid-area: year; --fs-year: clamp(44px, min(17cqw, 24cqh), 76px); margin: 0; gap: 6px; }
  .suffix { font-size: 14px; }
  .artifact-frame { grid-area: art; height: 100%; margin-top: 6px; }

  .seg { display: grid; grid-template-columns: 1fr 1fr; position: relative; height: 36px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
  .seg-btn { position: relative; z-index: 1; border: 0; background: none; font-size: 13px; font-weight: 600; color: var(--ink-muted); cursor: pointer; border-radius: 3px; transition: color var(--dur-2); }
  .seg-btn[aria-pressed="true"] { color: var(--bg); }
  .seg-n { font-size: 11px; opacity: .75; margin-left: 2px; }
  .seg-thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 3px; background: var(--accent); box-shadow: 0 0 14px var(--glow); transition: transform 260ms var(--spring); }
  .show-curves .seg-thumb { transform: translateX(100%); }
  .reduce-motion .seg-thumb { transition: none; }
  .events-panel, .vitals { grid-area: panel; }
  .show-curves .events-panel, :not(.show-curves) > .vitals { display: none; }
  .events-head { margin-bottom: 8px; min-height: 28px; }
  .events-head .h2 { font-size: 17px; }
  .events { --card-gap: 8px; --card-pad: 10px; }
  .card { padding-inline: 12px 12px; }
  .card-meta .tag { padding: 1px 5px; }

  .vitals { padding: 0; }
  .vitals-head { padding-bottom: 6px; }
  .vitals-list { flex: 1 1 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; border: 0; }
  .vital { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
  .vital:first-child { padding-left: 10px; border-left: 1px solid var(--line); }
  .spark { flex: 1 1 0; height: auto; max-height: none; }
  .vitals.dormant .vitals-list { display: grid; padding: 0; border: 0; background: none; }
  .vitals.dormant .vital { border: 1px solid var(--line); padding: 8px 10px; }
  .vitals.dormant .vitals-lede { display: none; }

  .dock { padding-top: 4px; }
  .dock-inner { gap: 4px; padding-inline: 4px; }
  .era-labels { display: none; }
  .minimap { height: 20px; }
  .needle .flag { font-size: 12px; padding: 1px 6px; }
  .bin-tip { display: none; }

  .sheet.curves-sheet { padding: 14px; height: 100%; }
  .curves-note { display: none; }
  .tiles { gap: 8px; }
  .tile { padding: 9px 10px 8px; }
  .tile-title { font-size: 10.5px; letter-spacing: .06em; }
  .readout .val { font-size: 18px; }
  .readout .unit-count { display: none; }
  .tile.expanded .readout .unit-count { display: inline; }
  .subline .delta { display: none; }
  .tile.expanded .subline .delta { display: inline; }
  .caption { display: none; }
  .tile.expanded .caption { display: -webkit-box; }
  .tile .future { inset: 0 6px 16px 28px; font-size: 10px; }
  .keys div { grid-template-columns: 110px 1fr; }
  .overlay:not(.ix-overlay) { padding: 10px; }
  .ix-overlay { padding: 0; }
  .ix-sheet { border-radius: 0; border-inline: 0; height: 100%; }
  .ix-head { padding-left: 14px; gap: 8px; }
  .ix-year { display: none; }
}

/* --------------------------------------------------------------------------
   Reduced motion (media query or the in-app toggle, which sets the class)
   -------------------------------------------------------------------------- */
.reduce-motion .ambient *, .reduce-motion .art .blink, .reduce-motion .art .flick, .reduce-motion .skeleton { animation: none !important; }
.reduce-motion .events > li.entering, .reduce-motion .events.page-fwd > li, .reduce-motion .events.page-back > li { animation: none; }
.reduce-motion .art .bead, .reduce-motion .art .fil { transition: none; }

/* Phones: artifact text renders at about half its viewBox size, so anything under ~20 units
   would read as 5-10px smudges. Hide the small print; keep a few words, set large. */
@media (max-width: 767px) {
  .art .sm { display: none; }
  .art .ph-h { font-size: 34px; transform: translateY(14px); }
  .art .ph-link { font-size: 22px; transform: translateY(calc(var(--i) * 15px - 44px)); }
  .art .ph-t { font-size: 24px; }
}

