/* ==========================================================================
   Perennus — core system
   Tokens → surfaces → base → type → layout → line grammar → components
   ========================================================================== */

/* ---------- Fonts (self-hosted, variable) ---------- */
/* Display and text serif: Source Serif 4 (OFL), optical sizes 8–60.
   Provisional for a Signifier-type direction; the licensed face drops in via --serif. */
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-latin-standard-normal.woff2") format("woff2-variations");
  font-weight: 200 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-latin-standard-italic.woff2") format("woff2-variations");
  font-weight: 200 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Raw palette — refined from the original cream / ink / rust */
  --paper: #F5F0E7;
  --paper-2: #ECE5D8;
  --sheet: #FBF8F2;
  --ink: #1D1813;
  --ink-2: #4E463C;
  --ink-3: #6F6555;
  --rule: #DCD2C2;
  --rule-2: #BDB19E;
  --signal: #BF5B2E;
  --signal-ink: #A0461F;

  --night: #0F0D0B;
  --night-2: #1D1915;
  --night-ink: #EEE7DB;
  --night-ink-2: #B9AFA0;
  --night-ink-3: #928878;
  --night-rule: #342D25;
  --night-rule-2: #4D4438;
  --signal-night: #E0773F;

  /* Type */
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: "Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --t-display-xxl: clamp(3.1rem, 0.9rem + 8.2vw, 9.25rem);
  --t-display-xl: clamp(2.6rem, 1.1rem + 5vw, 6rem);
  --t-display-l: clamp(2.1rem, 1.25rem + 2.9vw, 4rem);
  --t-headline: clamp(1.55rem, 1.2rem + 1.2vw, 2.35rem);
  --t-deck: clamp(1.2rem, 1.06rem + 0.55vw, 1.55rem);
  --t-research: clamp(1.1rem, 1.02rem + 0.3vw, 1.3rem);
  --t-body: clamp(1rem, 0.96rem + 0.18vw, 1.1rem);
  --t-small: 0.875rem;
  --t-label: 0.75rem;
  --t-micro: 0.6875rem;

  /* Space (4px base) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;
  --section: clamp(88px, 6vw + 48px, 176px);
  --gutter: clamp(20px, 4vw, 56px);
  --max: 1440px;
  --measure: 64ch;

  /* Motion */
  --dur-1: 160ms;   /* feedback */
  --dur-2: 360ms;   /* reveal */
  --dur-3: 720ms;   /* reconfigure */
  --dur-4: 1600ms;  /* cinematic draw */
  --ease-out: cubic-bezier(.2, .7, .1, 1);
  --ease-inout: cubic-bezier(.65, 0, .25, 1);

  --head-h: 64px;

  /* Materiality: one fine SVG grain per surface, a few hundred bytes each.
     Atmosphere, not decoration: it should be felt, never noticed. */
  --grain-paper: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n' x='0' y='0' width='1' height='1'><feTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.114  0 0 0 0 0.094  0 0 0 0 0.075  .09 0 0 0 -.035'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
  --grain-night: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n' x='0' y='0' width='1' height='1'><feTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.933  0 0 0 0 0.906  0 0 0 0 0.859  .055 0 0 0 -.024'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}

/* ---------- Surfaces: every component reads these, never raw colors ---------- */
[data-surface="paper"] {
  --bg: var(--paper); --bg-2: var(--paper-2);
  --fg: var(--ink); --fg-2: var(--ink-2); --fg-3: var(--ink-3);
  --line: var(--rule); --line-2: var(--rule-2);
  --sig: var(--signal); --sig-ink: var(--signal-ink);
  --hatch: color-mix(in srgb, var(--ink) 38%, transparent);
  --btn-bg: var(--ink); --btn-fg: var(--paper);
  --texture: var(--grain-paper);
  background: var(--texture), var(--bg); color: var(--fg);
}
[data-surface="night"] {
  --bg: var(--night); --bg-2: var(--night-2);
  --fg: var(--night-ink); --fg-2: var(--night-ink-2); --fg-3: var(--night-ink-3);
  --line: var(--night-rule); --line-2: var(--night-rule-2);
  --sig: var(--signal-night); --sig-ink: var(--signal-night);
  --hatch: color-mix(in srgb, var(--night-ink) 34%, transparent);
  --btn-bg: var(--night-ink); --btn-fg: var(--night);
  /* Night: near-black with a barely perceptible tonal lift */
  --texture: radial-gradient(ellipse 85% 65% at 50% 32%, rgba(255, 238, 214, 0.026), transparent 72%), var(--grain-night);
  background: var(--texture), var(--bg); color: var(--fg);
}
/* For side-by-side review only: surfaces without materiality. */
:root[data-flat] [data-surface], [data-surface].is-flat { background-image: none; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}
img, svg, video, iframe { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
::selection { background: var(--sig); color: var(--paper); }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 1px; }

.skip {
  position: absolute; left: var(--s-4); top: -100px; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 10px 14px;
  font: 500 var(--t-small)/1 var(--sans); text-decoration: none;
}
.skip:focus { top: var(--s-4); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Type ---------- */
.display-xxl, .display-xl, .display-l, .headline, .deck {
  font-family: var(--serif);
  font-optical-sizing: auto;
  text-wrap: balance;
}
.display-xxl { font-size: var(--t-display-xxl); font-weight: 300; line-height: .94; letter-spacing: -0.028em; }
.display-xl  { font-size: var(--t-display-xl);  font-weight: 320; line-height: .98; letter-spacing: -0.024em; }
.display-l   { font-size: var(--t-display-l);   font-weight: 350; line-height: 1.04; letter-spacing: -0.018em; }
.headline    { font-size: var(--t-headline);    font-weight: 400; line-height: 1.15; letter-spacing: -0.01em; }
.deck        { font-size: var(--t-deck);        font-weight: 380; line-height: 1.38; color: var(--fg-2); }
.research    { font-family: var(--serif); font-size: var(--t-research); line-height: 1.58; font-weight: 400; }
.body        { font-size: var(--t-body); line-height: 1.62; }
.small       { font-size: var(--t-small); line-height: 1.55; color: var(--fg-2); }
.label, .micro, .mono {
  font-family: var(--mono);
  font-weight: 400;
  letter-spacing: 0.06em;
  font-feature-settings: "zero" 1;
}
.label { font-size: var(--t-label); line-height: 1.4; text-transform: uppercase; color: var(--fg-2); }
.micro { font-size: var(--t-micro); line-height: 1.4; text-transform: uppercase; color: var(--fg-3); }
.mono  { font-size: 0.8125rem; letter-spacing: 0.01em; }
em, .italic { font-style: italic; }
.display-xxl em, .display-xl em, .display-l em { font-weight: inherit; }
.fg-2 { color: var(--fg-2); }
.fg-3 { color: var(--fg-3); }
.measure { max-width: var(--measure); }

.prose p + p { margin-top: 1em; }
.prose a, a.inline {
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--line-2);
  transition: text-decoration-color var(--dur-1) var(--ease-out);
}
.prose a:hover, a.inline:hover { text-decoration-color: currentColor; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2vw, 32px);
}

/* Margin-note rows: note in the margin, content in the column, air on the right */
.mrow {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 7fr) minmax(0, 2fr);
  column-gap: clamp(16px, 2vw, 32px);
  align-items: start;
}
.mrow + .mrow { margin-top: var(--s-7); }
.mrow > .mbody { grid-column: 2; }
.mrow > .mbody--wide { grid-column: 2 / 4; }
.mnote {
  grid-column: 1;
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: 0.05em;
  line-height: 1.55;
  text-transform: uppercase;
  color: var(--fg-3);
  padding-top: 0.45em;
  border-top: 1px solid var(--line);
  max-width: 26ch;
}
.mnote b { font-weight: 500; color: var(--fg-2); display: block; }
.mnote .ev { margin-top: var(--s-2); }
@media (max-width: 899px) {
  .mrow { grid-template-columns: minmax(0, 1fr); row-gap: var(--s-3); }
  .mrow > .mbody, .mrow > .mbody--wide { grid-column: 1; }
  .mnote { max-width: none; display: flex; flex-wrap: wrap; gap: 0 var(--s-3); }
  .mnote b { display: inline; }
}

/* ==========================================================================
   Line grammar
   state = dot · transition = line
   observed = solid · derived = double hairline · inferred = dashed · unknown = gap
   ========================================================================== */
.ln {
  display: block; flex: 1 1 auto;
  height: 7px; min-width: 8px;
  color: var(--fg);
  background-repeat: no-repeat;
  position: relative;
}
.ln--observed { background-image: linear-gradient(currentColor, currentColor); background-size: 100% 1.5px; background-position: 0 50%; }
.ln--derived {
  background-image: linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor);
  background-size: 100% 1px, 100% 1px;
  background-position: 0 1.5px, 0 4.5px;
}
.ln--inferred { background-image: repeating-linear-gradient(90deg, currentColor 0 6px, transparent 6px 11px); background-size: 100% 1.5px; background-position: 0 50%; }
.ln--unknown {
  height: 13px;
  background-image: repeating-linear-gradient(-45deg, var(--hatch) 0 1px, transparent 1px 5px);
  background-size: calc(100% - 14px) 100%;
  background-position: 50% 50%;
}
.ln--unknown::before, .ln--unknown::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 1.5px; background: currentColor;
}
.ln--unknown::before { left: 0; }
.ln--unknown::after { right: 0; }
.ln--signal { color: var(--sig); }
.ln--thick.ln--observed { background-size: 100% 2.5px; }

/* Vertical variants */
.ln-v { display: block; width: 7px; min-height: 8px; flex: 1 1 auto; color: var(--fg); background-repeat: no-repeat; position: relative; }
.ln-v--observed { background-image: linear-gradient(currentColor, currentColor); background-size: 1.5px 100%; background-position: 50% 0; }
.ln-v--derived {
  background-image: linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor);
  background-size: 1px 100%, 1px 100%;
  background-position: 1.5px 0, 4.5px 0;
}
.ln-v--inferred { background-image: repeating-linear-gradient(180deg, currentColor 0 6px, transparent 6px 11px); background-size: 1.5px 100%; background-position: 50% 0; }
.ln-v--unknown {
  width: 13px;
  background-image: repeating-linear-gradient(-45deg, var(--hatch) 0 1px, transparent 1px 5px);
  background-size: 100% calc(100% - 14px);
  background-position: 50% 50%;
}
.ln-v--unknown::before, .ln-v--unknown::after { content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; }
.ln-v--unknown::before { top: 0; }
.ln-v--unknown::after { bottom: 0; }

/* States */
.dot {
  display: inline-block; flex: none;
  width: 9px; height: 9px; border-radius: 50%;
  background: currentColor;
}
.dot--open { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.dot--focus { width: 13px; height: 13px; box-shadow: 0 0 0 4px var(--bg), 0 0 0 5.5px currentColor; }

/* Evidence tag: glyph + name */
.ev {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: var(--t-micro);
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--fg-2);
  white-space: nowrap;
}
.ev svg { width: 28px; height: 8px; color: var(--fg); overflow: visible; }

/* Value slots: where a real number will sit. Never filled with invented data. */
.slot {
  display: inline-block;
  font-family: var(--mono); font-size: 0.8125rem; letter-spacing: 0.01em;
  color: var(--fg-2);
  padding: 2px 8px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.slot--unknown {
  color: var(--fg);
  border-color: currentColor;
  background-image: repeating-linear-gradient(-45deg, var(--hatch) 0 1px, transparent 1px 5px);
  text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--t-micro);
  padding: 4px 10px;
}

/* ==========================================================================
   Links and calls to action
   The arrow is a transition arriving at a state: line → dot.
   ========================================================================== */
.to-state { width: 34px; height: 10px; overflow: visible; flex: none; }
.to-state__line { transform-origin: 0 50%; transform: scaleX(.62); transition: transform var(--dur-2) var(--ease-out); }
.to-state__dot { fill: transparent; transform-box: fill-box; transform-origin: center; transform: translateX(-11.4px); transition: transform var(--dur-2) var(--ease-out), fill var(--dur-1) linear; }
a:hover .to-state__line, a:focus-visible .to-state__line, button:hover .to-state__line { transform: scaleX(1); }
a:hover .to-state__dot, a:focus-visible .to-state__dot, button:hover .to-state__dot { transform: none; fill: currentColor; }

.btn {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--sans); font-weight: 500; font-size: 0.9375rem; line-height: 1;
  letter-spacing: 0.005em;
  text-decoration: none; white-space: nowrap;
  padding: 16px 18px 16px 22px;
  border-radius: 2px;
  transition: background-color var(--dur-1) linear, color var(--dur-1) linear;
}
.btn--primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn--primary:hover { background: color-mix(in srgb, var(--btn-bg) 86%, var(--sig)); }
.btn--sm { font-size: 0.8125rem; padding: 11px 12px 11px 16px; gap: 10px; }
.btn--sm .to-state { width: 26px; }

.link-2 {
  display: inline-flex; align-items: center; gap: 12px;
  font-weight: 500; font-size: 0.9375rem; text-decoration: none;
  padding-block: 10px;
  border-bottom: 1px solid var(--line-2);
  transition: border-color var(--dur-1) linear;
}
.link-2:hover { border-color: currentColor; }
.link-3 {
  font-size: 0.9375rem; color: var(--fg-2);
  text-decoration-line: underline; text-decoration-thickness: 1px;
  text-underline-offset: 0.3em; text-decoration-color: var(--line-2);
}
.link-3:hover { color: var(--fg); text-decoration-color: currentColor; }

/* ==========================================================================
   Site header / navigation
   ========================================================================== */
.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: 90;
  height: var(--head-h);
  color: var(--fg);
  /* Colour eases; the ground changes at once, so jumps never show content through the header. */
  transition: color var(--dur-2) linear, box-shadow var(--dur-2) linear;
}
.site-head[data-surface] { background: transparent; }
.site-head.is-scrolled { background: var(--texture, none), var(--bg); box-shadow: 0 1px 0 var(--line); }
/* Without JavaScript the header cannot follow the surface beneath it: give it its own ground. */
.no-js .site-head { background: var(--bg); box-shadow: 0 1px 0 var(--line); }
.site-head__inner {
  height: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter);
  display: flex; align-items: center; gap: var(--s-6);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .mark { width: 17px; height: auto; }
.brand__word { font-family: var(--serif); font-size: 1.3rem; font-weight: 460; letter-spacing: -0.012em; line-height: 1; }
.site-head__state {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: var(--t-micro); letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--fg-2);
  opacity: 0; transform: translateY(4px);
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
  padding-left: var(--s-5); border-left: 1px solid var(--line);
  height: 22px;
}
.site-head__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sig); }
.site-head.is-scrolled .site-head__state.has-state { opacity: 1; transform: none; }
.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; padding: 0; display: flex; gap: clamp(18px, 2vw, 30px); }
.site-nav a {
  font-size: 0.875rem; font-weight: 450; text-decoration: none; color: var(--fg-2);
  padding-block: 8px; position: relative;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1.5px; background: currentColor;
  transform: scaleX(0); transform-origin: 0 50%; transition: transform var(--dur-2) var(--ease-out);
}
.site-nav a:hover { color: var(--fg); }
.site-nav a:hover::after, .site-nav a[aria-current]::after { transform: scaleX(1); }
.site-head__actions { display: flex; align-items: center; gap: var(--s-5); }
.signin { font-family: var(--mono); font-size: var(--t-micro); letter-spacing: 0.07em; text-transform: uppercase; color: var(--fg-2); text-decoration: none; }
.signin:hover { color: var(--fg); }
.menu-toggle { display: none; align-items: center; gap: 10px; margin-left: auto; padding: 10px 0; }
.menu-toggle__label { font-family: var(--mono); font-size: var(--t-micro); letter-spacing: 0.08em; text-transform: uppercase; }
.menu-toggle__icon { width: 22px; height: 7px; border-block: 1.5px solid currentColor; }

@media (max-width: 1080px) {
  .site-nav, .site-head__actions { display: none; }
  .menu-toggle { display: inline-flex; margin-left: 0; }
  .site-head__state { margin-left: auto; }
}
@media (max-width: 520px) {
  .site-head__state { display: none; }
  .menu-toggle { margin-left: auto; }
}

/* Mobile menu: pages as states on a vertical line */
.site-menu {
  position: fixed; inset: 0; z-index: 120;
  display: flex; flex-direction: column;
  padding: 0 var(--gutter) var(--s-7);
  overflow-y: auto;
}
.site-menu[hidden] { display: none; }
.site-menu__top { height: var(--head-h); display: flex; align-items: center; justify-content: space-between; }
.menu-close { font-family: var(--mono); font-size: var(--t-micro); letter-spacing: 0.08em; text-transform: uppercase; padding: 10px 0; }
.site-menu__list {
  list-style: none; padding: var(--s-7) 0 var(--s-7) 0; margin: 0;
  position: relative;
}
.site-menu__list::before {
  content: ""; position: absolute; left: 48.75px; top: calc(var(--s-7) + 20px); bottom: calc(var(--s-7) + 20px);
  width: 1.5px; background: var(--line-2);
}
.site-menu__list a {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--serif); font-size: clamp(2rem, 7vw, 3rem); font-weight: 340; letter-spacing: -0.015em;
  line-height: 1; text-decoration: none; padding-block: 14px;
}
.site-menu__n { font-family: var(--mono); font-size: var(--t-micro); letter-spacing: 0.08em; color: var(--fg-3); width: 28px; flex: none; }
.site-menu__dot { width: 11px; height: 11px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1.5px currentColor; position: relative; z-index: 1; margin-right: 8px; flex: none; transition: background-color var(--dur-1) linear; }
.site-menu__list a:hover .site-menu__dot, .site-menu__list a:focus-visible .site-menu__dot { background: var(--sig); box-shadow: inset 0 0 0 1.5px var(--sig); }
.site-menu__foot { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-5); }

/* ---------- Footer ---------- */
.site-foot { padding-block: var(--s-8) var(--s-6); }
.site-foot__inner { display: grid; grid-template-columns: 1fr auto; row-gap: var(--s-5); align-items: end; }
.site-foot__line { grid-column: 1 / -1; display: flex; align-items: center; }
.site-foot__end { width: 11px; height: 11px; border-radius: 50%; background: var(--fg); }
.site-foot__brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.3rem; }
.site-foot__brand .mark { width: 16px; height: auto; }
.site-foot__meta { font-family: var(--mono); font-size: var(--t-micro); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); }

/* ==========================================================================
   Figures and artifacts
   ========================================================================== */
.fig { border-top: 1px solid var(--fg); padding-top: var(--s-3); }
.fig__head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); margin-bottom: var(--s-6); flex-wrap: wrap; }
.fig__body { position: relative; }
.fig figcaption { margin-top: var(--s-5); display: grid; gap: var(--s-2); max-width: 60ch; }
.fig__caption { font-family: var(--serif); font-style: italic; font-size: 1.0625rem; line-height: 1.45; color: var(--fg-2); }

.sheet {
  background: var(--sheet); color: var(--ink);
  border: 1px solid var(--rule);
  box-shadow: 0 1px 0 rgba(29, 24, 19, .04), 0 22px 44px -30px rgba(29, 24, 19, .45);
}

/* Index / table */
.index { width: 100%; border-collapse: collapse; }
.index th {
  text-align: left; font-family: var(--mono); font-weight: 400; font-size: var(--t-micro);
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--fg-3);
  padding: 0 var(--s-4) var(--s-3) 0; border-bottom: 1px solid var(--fg);
}
.index td { padding: var(--s-4) var(--s-4) var(--s-4) 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.index td:first-child { font-family: var(--mono); font-size: var(--t-small); color: var(--fg-2); white-space: nowrap; }

/* ==========================================================================
   Motion
   Reveal is opt-in (JS adds .is-in). Without JS, or with reduced motion,
   everything is simply present.
   ========================================================================== */
.js [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-draw] { clip-path: inset(0 100% 0 0); transition: clip-path var(--dur-4) var(--ease-inout); transition-delay: calc(var(--i, 0) * 90ms); }
.js [data-draw="down"] { clip-path: inset(0 0 100% 0); }
.js [data-draw].is-in { clip-path: inset(0 0 0 0); }

:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after {
  animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important;
  transition-duration: 1ms !important; transition-delay: 0ms !important;
  scroll-behavior: auto !important;
}
:root[data-motion="reduce"] [data-reveal] { opacity: 1; transform: none; }
:root[data-motion="reduce"] [data-draw] { clip-path: none; }
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) *, :root:not([data-motion="full"]) *::before, :root:not([data-motion="full"]) *::after {
    animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important;
    transition-duration: 1ms !important; transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
  :root:not([data-motion="full"]) [data-reveal] { opacity: 1; transform: none; }
  :root:not([data-motion="full"]) [data-draw] { clip-path: none; }
}

/* ==========================================================================
   State Line (static): states as dots, transitions as evidence lines
   ========================================================================== */
.sl { display: flex; align-items: center; position: relative; padding-top: 40px; color: var(--fg); }
.sl > .ln, .sl__break { flex: 1 1 0; }
.sl__s { position: relative; flex: none; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.sl__s--open { background: var(--bg); box-shadow: inset 0 0 0 1.5px currentColor; }
.sl__s > span {
  position: absolute; bottom: calc(100% + 14px); left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: var(--t-micro); letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--fg-2); white-space: nowrap;
}
.sl--serif .sl__s > span { font-family: var(--serif); font-size: clamp(0.95rem, 0.8rem + 0.45vw, 1.2rem); letter-spacing: 0; text-transform: none; color: var(--fg); }
.sl__s:first-child > span { left: 0; transform: none; }
.sl__s:last-child > span { left: auto; right: 0; transform: none; }
.sl__below { position: absolute; top: calc(100% + 14px); left: 50%; transform: translateX(-50%); white-space: nowrap; }

/* A transition that has come apart: the gap is where the investigation starts */
.sl__break { display: flex; align-items: center; position: relative; }
.sl__break > .ln { flex: 1 1 0; min-width: 0; }
.sl__gap { flex: none; width: var(--gap, 34%); color: var(--sig); }

/* Print: everything present, nothing mid-animation. */
@media print {
  [data-reveal], [data-draw], [data-inview] * { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .site-head, .skip { position: static; }
}
