:root {
  color-scheme: dark;
  --space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px; --space-3xl: 96px; --space-4xl: 144px;
  --text-xs: 0.8125rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.25rem; --text-xl: 1.5625rem; --text-2xl: 1.953rem; --text-3xl: 2.441rem;
  /* Reading sizes. Newsreader has a modest x-height, so prose is set at 20px. Heads are kept calm: the words do the work. */
  --text-body: 1.25rem; --text-label: 0.9375rem;
  --text-lead: clamp(1.4375rem, 0.6vw + 1.2rem, 1.75rem);
  --text-name: clamp(2.25rem, 2.2vw + 1.5rem, 3.5rem);
  --text-chapter: clamp(1.75rem, 1.2vw + 1.3rem, 2.5rem);
  --text-ledger: clamp(1rem, 4.2vw, 1.5rem);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-in: cubic-bezier(0.7, 0, 0.84, 0); --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-micro: 120ms; --dur-short: 220ms; --dur-long: 420ms;
  --color-error: oklch(72% 0.15 27); --color-success: oklch(76% 0.13 150);
  --container: 1440px; --gutter: 64px; --gap-columns: 32px; --section-gap-s: 120px; --section-gap: 144px; --section-gap-l: 176px;
  --z-base: 1; --z-raised: 10; --z-dropdown: 100; --z-sticky: 200; --z-sticky-nav: 300; --z-modal: 400; --z-toast: 500; --z-tooltip: 600;
  --color-paper: oklch(17% 0.008 250); --color-paper-2: oklch(21% 0.009 250); --color-paper-3: oklch(13.5% 0.007 250); --color-paper-4: oklch(25% 0.01 250);
  --color-ink: oklch(95% 0.005 250); --color-ink-2: oklch(87% 0.008 250); --color-muted: oklch(72% 0.01 250);
  --color-rule: oklch(31% 0.01 250); --color-rule-2: oklch(42% 0.012 250);
  --color-accent: oklch(82% 0.15 80); --color-accent-2: oklch(87% 0.14 82); --color-accent-ink: oklch(18% 0.04 75); --color-focus: oklch(82% 0.15 80);
  --fig-hi: oklch(93% 0.006 250); --fig-edge: oklch(68% 0.01 250); --fig-mid: oklch(47% 0.012 250); --fig-lo: oklch(31% 0.01 250);
  /* Two families. The serif is for everything a person reads. The sans is for what labels it. */
  --font-display: "Newsreader", ui-serif, Georgia, serif; --font-body: var(--font-display);
  --font-label: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --radius-card: 10px; --radius-pill: 6px; --rule-hair: 1px;
  --shadow-card: none;
  --tracking-display: -0.02em; --display-weight: 400;
}

/* ── base: what the Floor already decided ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scrollbar-color: var(--color-muted) var(--color-paper); scroll-padding-top: var(--space-xl); }
body { margin: 0; background: var(--color-paper); color: var(--color-ink); font-family: var(--font-body); font-size: var(--text-body); font-optical-sizing: auto; font-variant-numeric: lining-nums; line-height: 1.6; -webkit-font-smoothing: antialiased; caret-color: var(--color-accent); }
::selection { background: color-mix(in oklab, var(--color-accent) 25%, transparent); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
h1, h2 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight, 400); font-synthesis: none; letter-spacing: var(--tracking-display); line-height: 1.1; overflow-wrap: break-word; min-width: 0; text-wrap: balance; }
h1 { font-size: var(--text-name); } h2 { font-size: var(--text-chapter); }
p { margin: 0; color: var(--color-ink-2); text-wrap: pretty; }
p:not([class]) { max-width: 34em; }
svg { display: block; }
[hidden] { display: none !important; }
dl, dd { margin: 0; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); box-sizing: border-box; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 60rem) { :root { --gutter: 24px; --section-gap-s: 80px; --section-gap: 96px; --section-gap-l: 120px; } }
@media (max-width: 40rem) { :root { --gutter: 16px; --section-gap-s: 56px; --section-gap: 72px; --section-gap-l: 96px; --gap-columns: 16px; --text-body: 1.1875rem; } }
@media (prefers-reduced-motion: reduce) { *:not(.keep-motion), *:not(.keep-motion)::before, *:not(.keep-motion)::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } }

/* ── shared parts ─────────────────────────────────────────────────────── */
.skip { position: absolute; left: var(--space-md); top: calc(-1 * var(--space-3xl)); z-index: var(--z-toast); padding: var(--space-xs) var(--space-md); border-radius: var(--radius-pill); background: var(--color-ink); color: var(--color-paper); }
.skip:focus-visible { top: var(--space-md); }

/* Labels, dates and controls: the sans, a step smaller, sentence case. */
.skip, .bar__links, .btn, .sub, .tech, .facts dt, .facts dd span, .index__venue, .papers__more, .ledger dt, .colophon { font-family: var(--font-label); font-size: var(--text-label); letter-spacing: 0; line-height: 1.5; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 var(--space-lg); border: var(--rule-hair) solid var(--color-accent); border-radius: var(--radius-pill); background: var(--color-accent); color: var(--color-accent-ink); font-size: var(--text-md); font-weight: 500; line-height: 1; white-space: nowrap; text-decoration: none; cursor: pointer; transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.btn:hover { background: var(--color-accent-2); border-color: var(--color-accent-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn--quiet { border-color: var(--color-rule-2); background: var(--color-paper-2); color: var(--color-ink); }
.btn--quiet:hover { border-color: var(--color-muted); background: var(--color-paper-4); }
.btn--nav { align-self: center; min-height: 44px; margin: var(--space-2xs); padding-inline: var(--space-md); font-size: var(--text-label); }
@media (prefers-reduced-motion: reduce) { .btn { transition: background-color var(--dur-short) linear; } }

/* Hairline figures: lines on the surface they sit on. The plate has to match
   that surface, because a plate hides what is drawn behind it. */
.fig { width: 100%; aspect-ratio: 5 / 4; --hairline-plate: var(--color-paper); --hairline-hi: var(--fig-hi); --hairline-edge: var(--fig-edge); --hairline-mid: var(--fig-mid); --hairline-lo: var(--fig-lo); --hairline-stroke: 1; }

/* ── nav ──────────────────────────────────────────────────────────────── */
.nav { padding-block: var(--space-md) var(--space-xs); }
.bar { display: flex; align-items: stretch; min-height: 56px; padding-left: var(--space-lg); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2); color: var(--color-ink); }
.bar__name { display: flex; align-items: center; font-size: var(--text-lg); font-weight: 500; letter-spacing: -0.01em; line-height: 1; text-decoration: none; white-space: nowrap; }
.bar__links { display: flex; align-items: center; gap: var(--space-lg); margin: 0 auto 0 var(--space-lg); padding: 0 0 0 var(--space-lg); border-left: var(--rule-hair) solid var(--color-rule); list-style: none; }
.bar__links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--color-muted); text-decoration: none; white-space: nowrap; transition: color var(--dur-short) var(--ease-out); }
.bar__links a:hover { color: var(--color-ink); }

/* ── the account: prose on the left, one figure beside each chapter ───── */
.story { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); align-items: start; }
.story__text { grid-column: 1 / span 7; }
.story > .fig { grid-column: 9 / span 4; position: sticky; top: var(--space-xl); }
.story__text > p + p, .story__text > .sub + p { margin-top: var(--space-md); }

.sub { margin-top: var(--space-xs); color: var(--color-muted); }
.lead { max-width: 30em; margin-top: var(--space-xl); font-size: var(--text-lead); line-height: 1.4; letter-spacing: -0.008em; color: var(--color-ink); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-xl); }

.intro { padding-block: var(--space-2xl) var(--space-xl); }
.intro .sub + .lead { margin-top: var(--space-xl); }
.intro .lead + p { margin-top: var(--space-lg); }
/* A figure's drawing is placed against its box, so the box must stay positioned: relative here, never static. */
.intro .story > .fig { grid-column: 8 / span 5; position: relative; top: auto; align-self: center; }

.chapter { padding-top: var(--space-2xl); }
.chapter > .container::before { content: ""; display: block; grid-column: 1 / -1; height: var(--rule-hair); margin-bottom: var(--space-2xl); background: var(--color-rule); }
.chapter .sub + p { margin-top: var(--space-lg); }
.chapter h2 + p:not(.sub) { margin-top: var(--space-lg); }

/* The specifics behind a chapter, set apart and smaller: a short list, not a paragraph. */
.tech { max-width: 40em; margin-top: var(--space-lg); padding-left: var(--space-md); border-left: var(--rule-hair) solid var(--color-rule-2); color: var(--color-muted); }
.tech h3 { margin: 0; font: inherit; font-weight: 500; color: var(--color-ink-2); }
.tech ul { display: grid; gap: var(--space-2xs); margin: var(--space-xs) 0 0; padding: 0; list-style: none; }

/* The dates and titles behind the paragraph beside them. */
.facts { grid-column: 9 / span 4; display: grid; border-top: var(--rule-hair) solid var(--color-rule-2); }
.facts > div { display: grid; gap: var(--space-2xs); padding-block: var(--space-md); border-bottom: var(--rule-hair) solid var(--color-rule); }
.facts dt { font-variant-numeric: lining-nums tabular-nums; color: var(--color-muted); }
.facts dd { font-size: var(--text-md); line-height: 1.4; color: var(--color-ink); }
.facts dd span { display: block; color: var(--color-muted); }

.index { margin: var(--space-xl) 0 0; padding: 0; border-top: var(--rule-hair) solid var(--color-rule-2); list-style: none; }
.index li { display: grid; gap: var(--space-2xs); padding-block: var(--space-md); border-bottom: var(--rule-hair) solid var(--color-rule); }
.index__title { justify-self: start; color: var(--color-ink); text-decoration-color: var(--color-rule-2); transition: text-decoration-color var(--dur-short) var(--ease-out); }
.index__title:hover { text-decoration-color: var(--color-accent); }
.index__venue { color: var(--color-muted); }
.papers__more a { color: var(--color-ink-2); text-decoration-color: var(--color-rule-2); transition: text-decoration-color var(--dur-short) var(--ease-out); }
.papers__more a:hover { text-decoration-color: var(--color-accent); }
.papers__more { margin-top: var(--space-lg); color: var(--color-muted); }

/* ── close ────────────────────────────────────────────────────────────── */
.close { margin-top: var(--section-gap-s); padding-block: var(--space-3xl); border-top: var(--rule-hair) solid var(--color-rule); background: var(--color-paper-2); color: var(--color-ink); }
.close__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); align-items: start; }
.close__grid > h2 { grid-column: 1 / span 4; }
.ledger { grid-column: 5 / span 8; border-top: var(--rule-hair) solid var(--color-rule-2); }
.ledger > div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 6fr); column-gap: var(--gap-columns); align-items: baseline; padding-block: var(--space-md); border-bottom: var(--rule-hair) solid var(--color-rule); }
.ledger dt { color: var(--color-muted); }
.ledger dd { display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-lg); font-size: var(--text-ledger); letter-spacing: 0; line-height: 1.3; }
.ledger a { white-space: nowrap; color: var(--color-ink); text-decoration-color: var(--color-rule-2); transition: text-decoration-color var(--dur-short) var(--ease-out); }
.ledger a:hover, .colophon a:hover { text-decoration-color: var(--color-accent); }
.colophon a { color: var(--color-ink-2); text-decoration-color: var(--color-rule-2); transition: text-decoration-color var(--dur-short) var(--ease-out); }

.colophon { padding-block: var(--space-lg); border-top: var(--rule-hair) solid var(--color-rule); background: var(--color-paper-2); color: var(--color-ink); font-size: var(--text-sm); }
.colophon__grid { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-xs) var(--space-xl); }
.colophon p { max-width: none; color: var(--color-muted); }

/* ── under 60rem: one column, the figure after its chapter ────────────── */
@media (max-width: 60rem) {
  .story, .close__grid { row-gap: var(--space-xl); }
  .story__text, .story > .fig, .intro .story > .fig, .facts, .close__grid > h2, .ledger { grid-column: 1 / -1; }
  .story > .fig { position: relative; top: auto; max-width: 420px; }
  .intro { padding-block: var(--space-2xl) var(--space-xl); }
}
@media (max-width: 40rem) {
  .bar { padding-left: var(--space-md); }
  .bar__links { display: none; }
  .bar__name { margin-right: auto; }
  .ledger > div { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-2xs); }
  .actions .btn { flex: 1 1 auto; }
}
