/* ===========================================================================
   NetaRecord
   ---------------------------------------------------------------------------
   Dark ground, warm off-white type, one orange. Structure from hairlines and
   negative space, never from a bordered box with a shadow.

   Motion rules, held everywhere:
     Only transform and opacity are animated. Nothing animates width, height,
     top or left, so every transition stays on the compositor at 60fps.
     Durations: 120ms for a control, 180 to 260ms for a panel, 600 to 1400ms
     for a first-paint reveal. Nothing loops except a caret and a data pulse.
     One easing curve does almost all the work: cubic-bezier(.22, 1, .36, 1).
     Everything is off under prefers-reduced-motion.
   ========================================================================= */

/* ------------------------------------------------------------------ type */

@font-face {
  font-family: 'Instrument Sans';
  src: url('/assets/fonts/instrument-sans-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('/assets/fonts/instrument-sans-latin-ext.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/jetbrains-mono-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------------------------------------- tokens */

:root {
  color-scheme: dark;

  --bg:          #121110;
  --bg-2:        #171412;
  --bg-3:        #1d1916;
  --bg-deep:     #0d0c0b;

  --text:        #f4f0ea;
  --text-hi:     #fffbf5;
  --muted:       #a49d94;
  --faint:       #766f67;

  --line:        rgba(236, 227, 216, 0.10);
  --line-2:      rgba(236, 227, 216, 0.18);
  --line-3:      rgba(236, 227, 216, 0.30);

  --accent:      #f6821f;
  --accent-hi:   #ff9a3d;
  --accent-dim:  rgba(246, 130, 31, 0.10);
  --accent-line: rgba(246, 130, 31, 0.50);
  --on-accent:   #1a1512;

  --ok:          #4bbf87;
  --warn:        #d9a227;
  --bad:         #e8695f;
  --neutral:     #8b9099;

  --s1: #6ba6d8;  --s2: #f6821f;  --s3: #78be84;
  --s4: #b294d6;  --s5: #d9ae4e;  --s6: #66bebe;

  --sans: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;

  --wrap: 1180px;
  --wide: 1420px;
  --gut: clamp(1.15rem, 0.5rem + 2.4vw, 2.75rem);
  --nav-h: 62px;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.4, 0, .2, 1);
  --ease-back: cubic-bezier(.34, 1.4, .64, 1);
}

/* Light is a genuine second design, not an inverted filter. The orange holds,
   the ground becomes warm paper, and hairlines gain contrast to compensate. */
:root[data-theme='light'] {
  color-scheme: light;
  --bg:          #fbf9f6;
  --bg-2:        #f4f1eb;
  --bg-3:        #ece7de;
  --bg-deep:     #ffffff;
  --text:        #1b1917;
  --text-hi:     #0c0b0a;
  --muted:       #5d574f;
  --faint:       #8b8378;
  --line:        rgba(27, 25, 23, 0.12);
  --line-2:      rgba(27, 25, 23, 0.20);
  --line-3:      rgba(27, 25, 23, 0.34);
  --accent:      #d2620c;
  --accent-hi:   #b8540a;
  --accent-dim:  rgba(210, 98, 12, 0.09);
  --accent-line: rgba(210, 98, 12, 0.45);
  --on-accent:   #fffdfa;
  --ok:          #237a52;
  --warn:        #8a6300;
  --bad:         #b03024;
  --s1: #2f6f9f;  --s3: #3f7a4b;  --s4: #6d4f96;  --s5: #92701c;  --s6: #2c6f6f;
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.022em;
  color: var(--text-hi);
  text-wrap: balance;
}

p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration: none; }
a:not([class]) {
  border-bottom: 1px solid var(--line-2);
  transition: border-color 140ms var(--ease), color 140ms var(--ease);
}
a:not([class]):hover { color: var(--accent-hi); border-bottom-color: var(--accent); }

img, svg, canvas { display: block; max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }

code, .mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-feature-settings: 'tnum' 1, 'zero' 1; letter-spacing: -0.02em; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }
.wrap--wide { max-width: var(--wide); }
.prose { max-width: 68ch; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: -9999px; top: 0; z-index: 200;
  background: var(--bg-3); color: var(--text-hi);
  padding: 0.8rem 1.2rem; border: 1px solid var(--line-3);
}
.skip:focus { left: 1rem; top: 1rem; }

/* =========================================================== navigation */

/* Three zones: mark left, links centred, actions right. Transparent over the
   hero, then it gains a ground and a hairline once the page moves. */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color 200ms var(--ease-io), border-color 200ms var(--ease-io),
              backdrop-filter 200ms var(--ease-io);
}
html[data-scrolled] .nav {
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  border-bottom-color: var(--line);
  backdrop-filter: blur(14px) saturate(1.35);
}
.nav__in {
  height: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gut);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.03em;
  color: var(--text-hi);
  justify-self: start;
}
.mark svg { width: 20px; height: 20px; flex: none; }
.mark b { font-weight: 600; color: var(--accent); }

.nav__links { display: flex; gap: 0.15rem; justify-self: center; }
.nav__links a {
  position: relative;
  padding: 0.45rem 0.8rem;
  font-size: 0.875rem;
  color: var(--muted);
  border-radius: 3px;
  transition: color 140ms var(--ease), background-color 140ms var(--ease);
}
.nav__links a::after {
  content: '';
  position: absolute;
  left: 0.8rem; right: 0.8rem; bottom: 0.1rem;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms var(--ease);
}
.nav__links a:hover { color: var(--text-hi); background: var(--bg-3); }
.nav__links a[aria-current='page'] { color: var(--text-hi); }
.nav__links a[aria-current='page']::after { transform: scaleX(1); }

.nav__actions { display: flex; gap: 0.5rem; align-items: center; justify-self: end; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.42rem 0.9rem;
  border: 1px solid var(--line-2);
  background: none;
  color: var(--text);
  cursor: pointer;
  border-radius: 3px;
  transition: transform 120ms var(--ease), border-color 140ms var(--ease),
              background-color 140ms var(--ease), color 140ms var(--ease);
}
.btn:hover { border-color: var(--line-3); background: var(--bg-3); }
.btn:active { transform: translateY(1px); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 500; }
.btn--accent:hover { background: var(--accent-hi); border-color: var(--accent-hi); color: var(--on-accent); }
.btn--icon { padding: 0.42rem; width: 2rem; justify-content: center; }
.btn svg { width: 15px; height: 15px; }

.icon-dark { display: none; }
:root[data-theme='light'] .icon-dark { display: block; }
:root[data-theme='light'] .icon-light { display: none; }

.nav__burger { display: none; }

/* ================================================================== hero */

.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(2.5rem, 6vw, 5.5rem));
  padding-bottom: clamp(2.5rem, 5vw, 4.5rem);
  overflow: hidden;
  isolation: isolate;
}

/* The map sits behind the copy, bled off the right edge, dimmed. It is the
   real constituency geometry, so it earns the space. */
.hero__map {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: -6%;
  translate: 0 -50%;
  width: min(58vw, 720px);
  aspect-ratio: 1;
  opacity: 0;
  transition: opacity 900ms var(--ease);
  pointer-events: none;
  mask-image: radial-gradient(ellipse 78% 78% at 55% 45%, #000 55%, transparent 100%);
}
.hero__map[data-ready] { opacity: 1; }
.hero__map canvas { width: 100%; height: 100%; }

/* A single warm bloom behind the headline, so the dark ground is not flat. */
.hero::before {
  content: '';
  position: absolute;
  z-index: -2;
  top: -30%; left: -10%;
  width: 70%; height: 130%;
  background: radial-gradient(closest-side, var(--accent-dim), transparent 70%);
  opacity: 0.85;
  pointer-events: none;
}

.hero__in { position: relative; max-width: 40rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--faint);
  margin-bottom: 1.1rem;
}
.eyebrow::before {
  content: '';
  width: 5px; height: 5px;
  background: var(--accent);
  animation: pulse 2.6s var(--ease-io) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.7); }
}

.hero h1 {
  font-size: clamp(2.35rem, 1.2rem + 4.4vw, 4.1rem);
  letter-spacing: -0.04em;
  line-height: 1.03;
}
.hero h1 em { font-style: normal; color: var(--accent); }

.lede {
  margin-top: 1.35rem;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.13rem);
  line-height: 1.55;
  color: var(--muted);
  max-width: 34rem;
}

/* ================================================================ search */

/* A terminal prompt, not a rounded pill. Mono, a caret, an orange return key. */
.finder { margin-top: 2.1rem; max-width: 34rem; position: relative; }
.finder__box {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line-2);
  background: color-mix(in oklab, var(--bg-2) 88%, transparent);
  backdrop-filter: blur(8px);
  transition: border-color 160ms var(--ease), box-shadow 220ms var(--ease);
}
.finder__box:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 1px var(--accent-line), 0 12px 40px -18px rgb(0 0 0 / 0.6);
}
.finder__sigil {
  display: grid;
  place-items: center;
  width: 2.6rem;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--accent);
  border-right: 1px solid var(--line);
  user-select: none;
}
.finder input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--text-hi);
  font-family: var(--mono);
  font-size: 0.95rem;
  padding: 0.9rem 0.85rem;
  caret-color: var(--accent);
}
.finder input:focus { outline: none; }
.finder input::placeholder { color: var(--faint); }
.finder input::-webkit-search-cancel-button { display: none; }

.finder__go {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 0;
  border-left: 1px solid var(--line);
  background: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding-inline: 0.95rem;
  cursor: pointer;
  transition: background-color 140ms var(--ease), color 140ms var(--ease);
}
.finder__go:hover { background: var(--accent); color: var(--on-accent); }
.finder__go kbd {
  font: inherit;
  border: 1px solid currentColor;
  border-radius: 2px;
  padding: 0 0.28rem;
  opacity: 0.8;
}

/* Live results. Hairline-separated rows, no card. */
.finder__out {
  position: absolute;
  inset: calc(100% + 6px) 0 auto 0;
  z-index: 40;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  max-height: min(60vh, 26rem);
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-6px) scale(0.995);
  transform-origin: top;
  pointer-events: none;
  transition: opacity 160ms var(--ease), transform 200ms var(--ease);
  box-shadow: 0 24px 60px -24px rgb(0 0 0 / 0.7);
}
.finder__out[data-open] { opacity: 1; transform: none; pointer-events: auto; }
.finder__group {
  font-family: var(--mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  padding: 0.7rem 0.9rem 0.35rem;
  border-bottom: 1px solid var(--line);
}
.finder__hit {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.62rem 0.9rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background-color 100ms var(--ease);
}
.finder__hit:last-child { border-bottom: 0; }
.finder__hit:hover, .finder__hit[data-cursor] { background: var(--bg-3); }
.finder__hit[data-cursor] { box-shadow: inset 2px 0 0 var(--accent); }
.finder__hit b { font-weight: 500; color: var(--text-hi); }
.finder__hit b mark { background: none; color: var(--accent); font-weight: 600; }
.finder__hit span { font-size: 0.78rem; color: var(--muted); margin-left: auto; text-align: right; }
.finder__empty { padding: 1.1rem 0.9rem; color: var(--faint); font-size: 0.85rem; }

/* ================================================================= stats */

/* A figure, its label, and its context. Hairline above, nothing around. */
.figs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
}
.fig {
  padding: 1.15rem 1.15rem 1.15rem 0;
  border-right: 1px solid var(--line);
}
.fig:last-child { border-right: 0; }
.fig dt {
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--faint);
}
.fig dd {
  margin: 0.4rem 0 0;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.8rem);
  letter-spacing: -0.035em;
  color: var(--text-hi);
  line-height: 1;
}
.fig dd.is-null { font-size: 0.95rem; color: var(--faint); font-family: var(--sans); font-style: italic; letter-spacing: 0; }
.fig small { display: block; margin-top: 0.45rem; font-size: 0.72rem; color: var(--muted); line-height: 1.4; }

/* ============================================================== sections */

.sect { padding-block: clamp(3rem, 6vw, 5.5rem); }
.sect--line { border-top: 1px solid var(--line); }

.sect__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.sect__head h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.95rem); letter-spacing: -0.03em; }
.sect__head p { margin: 0; font-size: 0.82rem; color: var(--faint); font-family: var(--mono); }

/* ================================================================ tables */

.tbl { overflow-x: auto; border-block: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
caption { caption-side: bottom; text-align: left; padding-top: 0.8rem; font-size: 0.72rem; color: var(--faint); }
th {
  position: sticky; top: 0;
  text-align: left;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  padding: 0.7rem 0.9rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
td { padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: baseline; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color 90ms var(--ease); }
tbody tr:hover { background: var(--bg-2); }
td.num, th.num { text-align: right; }
.tbl--tight td, .tbl--tight th { padding: 0.42rem 0.8rem; }

/* ================================================================== rows */

/* The register entry. Whole row clickable through a stretched pseudo element. */
.row {
  position: relative;
  display: grid;
  grid-template-columns: 2.6rem 1fr auto;
  gap: 0.15rem 1.1rem;
  padding: 0.95rem 0.6rem;
  border-bottom: 1px solid var(--line);
  transition: background-color 120ms var(--ease);
}
.row:hover { background: var(--bg-2); }
.row:hover .row__name { color: var(--accent-hi); }
.row__i { grid-row: 1 / span 2; font-family: var(--mono); font-size: 0.7rem; color: var(--faint); text-align: right; padding-top: 0.25rem; }
.row__name { font-size: 1.02rem; font-weight: 500; color: var(--text-hi); letter-spacing: -0.015em; transition: color 120ms var(--ease); }
.row__name::after { content: ''; position: absolute; inset: 0; }
.row__name i { font-style: normal; font-weight: 400; color: var(--muted); margin-left: 0.4rem; }
.row__meta {
  display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem;
  font-size: 0.8rem; color: var(--muted);
}
.row__fig {
  grid-column: 3; grid-row: 1 / span 2;
  display: flex; gap: 1.2rem; align-items: baseline;
  font-family: var(--mono); font-size: 0.8rem;
  position: relative; z-index: 1;
}
.row__fig div { text-align: right; }
.row__fig em { display: block; font-style: normal; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--faint); }

/* ================================================================= chips */

.party { display: inline-flex; align-items: center; gap: 0.42rem; white-space: nowrap; }
.party::before {
  content: ''; width: 3px; height: 0.9em; flex: none;
  background: var(--pc, var(--faint));
}
.party--logo::before { display: none; }
.party__logo { width: 1.1rem; height: 1.1rem; flex: none; }

.tag {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--mono); font-size: 0.66rem;
  text-transform: uppercase; letter-spacing: 0.07em; white-space: nowrap;
}
.tag::before { content: ''; width: 5px; height: 5px; background: currentColor; flex: none; }
.tag--pend { color: var(--warn); }
.tag--conv { color: var(--bad); }
.tag--ok   { color: var(--ok); }
.tag--unk  { color: var(--neutral); }
.tag--unk::before { background: none; box-shadow: inset 0 0 0 1px currentColor; }

.nil { color: var(--faint); font-style: italic; font-size: 0.85rem; }

.src {
  display: inline-block;
  width: 1.05rem; height: 1.05rem;
  border: 1px solid var(--line-2);
  position: relative;
  transition: border-color 140ms var(--ease), background-color 140ms var(--ease);
  vertical-align: middle;
}
.src::after {
  content: '';
  position: absolute; inset: 3px;
  background: var(--faint);
  clip-path: polygon(0 0, 100% 0, 100% 22%, 38% 22%, 38% 100%, 0 100%);
  transition: background-color 140ms var(--ease);
}
.src:hover { border-color: var(--accent); background: var(--accent-dim); }
.src:hover::after { background: var(--accent); }

/* ================================================================ notice */

.note {
  border-left: 2px solid var(--line-3);
  padding: 0.15rem 0 0.15rem 1.05rem;
  margin-block: 1.5rem;
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 70ch;
}
.note--legal { border-left-color: var(--accent); }
.note strong { color: var(--text); font-weight: 600; }

/* ================================================================ charts */

.chart { width: 100%; overflow: visible; }
.chart text { font-family: var(--mono); font-size: 10px; fill: var(--faint); font-variant-numeric: tabular-nums; }
.chart .ax { stroke: var(--line); }
.chart .ser { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.chart .pt { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.chart .pt--last { fill: var(--accent); }
.chart .bar { fill: var(--accent); }

/* The line draws itself once, then stops. */
@media (prefers-reduced-motion: no-preference) {
  .chart--draw .ser {
    stroke-dasharray: var(--len, 900);
    stroke-dashoffset: var(--len, 900);
    animation: draw 900ms var(--ease) 120ms forwards;
  }
  .chart--draw .pt { opacity: 0; animation: pop 260ms var(--ease-back) forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes pop { from { transform: scale(0.4); } to { opacity: 1; transform: none; } }
}

.meter { height: 3px; background: var(--line); overflow: hidden; }
.meter i {
  display: block; height: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(var(--v, 0));
  transition: transform 900ms var(--ease);
}

/* ============================================================= hub-spoke */

/* The provenance diagram: sources feeding a centre, dashes flowing inward.
   Every line is a real source in the database. */
.hub { width: 100%; max-width: 46rem; margin-inline: auto; overflow: visible; }
.hub .spoke {
  fill: none;
  stroke: var(--line-2);
  stroke-width: 1;
  stroke-dasharray: 3 6;
}
.hub .flow {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-dasharray: 4 200;
  opacity: 0.85;
}
@media (prefers-reduced-motion: no-preference) {
  .hub .flow { animation: flow 3.4s linear infinite; }
  @keyframes flow { to { stroke-dashoffset: -204; } }
}
.hub .node { fill: var(--bg-3); stroke: var(--line-2); }
.hub .core { fill: var(--accent-dim); stroke: var(--accent); }
.hub text { font-family: var(--mono); font-size: 9.5px; fill: var(--muted); }
.hub .core-label { fill: var(--text-hi); font-size: 11px; font-weight: 500; }

/* ============================================================== reveals */

/* One reveal primitive, applied by the observer. Transform and opacity only. */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 640ms var(--ease), transform 640ms var(--ease);
    transition-delay: var(--d, 0ms);
    will-change: opacity, transform;
  }
  [data-reveal][data-seen] { opacity: 1; transform: none; will-change: auto; }
}

/* Mono rows that decode on reveal, the way a record resolves out of noise. */
.decode { font-family: var(--mono); }
.decode[data-scramble] { color: var(--faint); }

.caret {
  display: inline-block;
  width: 0.52em; height: 1.05em;
  background: var(--accent);
  vertical-align: -0.16em;
  margin-left: 0.1em;
}
@media (prefers-reduced-motion: no-preference) {
  .caret { animation: blink 1.05s steps(1) infinite; }
  @keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
}

/* ================================================================ footer */

.foot {
  border-top: 1px solid var(--line);
  margin-top: clamp(3rem, 7vw, 6rem);
  padding-block: 3rem 3.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.foot__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 2.25rem; }
.foot h3 {
  font-family: var(--mono); font-size: 0.64rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--faint);
  margin-bottom: 0.8rem;
}
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 0.4rem; }
.foot li a { color: var(--muted); transition: color 120ms var(--ease); }
.foot li a:hover { color: var(--accent-hi); }

/* ================================================================== misc */

.cluster { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: baseline; }
.between { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.stack > * + * { margin-top: var(--st, 1rem); }

/* Text utilities used by the explanatory pages. */
.title { font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.6rem); letter-spacing: -0.03em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 0.85rem; }
.micro { font-size: 0.72rem; }
kbd {
  font-family: var(--mono); font-size: 0.85em;
  border: 1px solid var(--line-2); border-radius: 2px;
  padding: 0.05em 0.32em; color: var(--muted);
}
code {
  font-size: 0.9em; color: var(--accent-hi);
  background: var(--accent-dim); padding: 0.08em 0.32em; border-radius: 2px;
}

.pager {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line);
  font-size: 0.85rem;
}
.pager .num { color: var(--faint); }

select.sel, textarea.ta, input.ip {
  font: inherit; font-size: 0.9rem;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line-2);
  padding: 0.55rem 0.75rem;
  transition: border-color 140ms var(--ease);
}
select.sel:focus, textarea.ta:focus, input.ip:focus { outline: none; border-color: var(--accent-line); }
textarea.ta { width: 100%; resize: vertical; font-family: inherit; }
input.ip { width: 100%; }

/* Filter pills instead of a dropdown, so choices are visible not hidden. */
.pills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pill {
  font-family: var(--mono); font-size: 0.72rem;
  padding: 0.32rem 0.65rem;
  border: 1px solid var(--line);
  color: var(--muted);
  transition: border-color 140ms var(--ease), color 140ms var(--ease), background-color 140ms var(--ease);
}
.pill:hover { border-color: var(--line-3); color: var(--text-hi); }
.pill[aria-pressed='true'], .pill[data-on] {
  border-color: var(--accent); color: var(--accent); background: var(--accent-dim);
}

/* ---------------------------------------------------------- responsive */

@media (max-width: 60rem) {
  .hero__map { right: -22%; width: 78vw; opacity: 0; }
  .hero__map[data-ready] { opacity: 0.5; }
}

@media (max-width: 48rem) {
  .nav__in { grid-template-columns: auto 1fr auto; }
  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gut) 1rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms var(--ease), transform 220ms var(--ease);
  }
  html[data-menu] .nav__links { opacity: 1; transform: none; pointer-events: auto; }
  .nav__links a { padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
  .nav__links a::after { display: none; }
  .nav__burger { display: inline-flex; }
  .figs { grid-template-columns: repeat(2, 1fr); }
  .fig:nth-child(2n) { border-right: 0; }
  .fig { border-bottom: 1px solid var(--line); }
  .row { grid-template-columns: 1fr auto; }
  .row__i { display: none; }
  .row__meta { grid-column: 1; }
  .row__fig { grid-column: 2; gap: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

@media print {
  .nav, .foot, .hero__map, .finder { display: none; }
  body { background: #fff; color: #000; }
}
