/* GeoPrimitives · geoprimitives.dev
   Cartographic instrument: paper, ink, one registration red. */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-300-900.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-var.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

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

:root {
  --paper: hsl(42 26% 96%);
  --paper-2: hsl(42 22% 92%);
  --paper-3: hsl(42 18% 87%);
  --ink: hsl(205 28% 13%);
  --ink-2: hsl(205 13% 35%);
  --ink-3: hsl(205 9% 42%);
  --rule: hsl(42 13% 79%);
  --rule-2: hsl(42 11% 68%);
  --accent: hsl(8 68% 46%);
  --accent-text: hsl(8 66% 38%);
  --accent-soft: hsl(8 68% 46% / 0.1);
  --ok: hsl(150 40% 34%);
  --globe: hsl(40 28% 93%);
  --cell-s: 38%;
  --cell-l: 52%;
  --cell-a: 0.88;
  --grid: hsl(210 30% 12% / 0.045);
  --shadow: 0 1px 0 hsl(40 30% 100% / 0.6) inset, 0 1px 2px hsl(210 30% 12% / 0.08);
  --measure: 64ch;
  --wrap: 76rem;
  --radius: 4px;
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Helvetica, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: hsl(212 26% 9%);
  --paper-2: hsl(212 24% 12%);
  --paper-3: hsl(212 22% 16%);
  --ink: hsl(40 28% 92%);
  --ink-2: hsl(40 14% 70%);
  --ink-3: hsl(40 10% 56%);
  --rule: hsl(212 16% 21%);
  --rule-2: hsl(212 14% 30%);
  --accent: hsl(8 74% 59%);
  --accent-text: hsl(8 78% 70%);
  --accent-soft: hsl(8 74% 59% / 0.14);
  --ok: hsl(150 45% 60%);
  --globe: hsl(212 26% 12%);
  --cell-s: 42%;
  --cell-l: 57%;
  --cell-a: 0.9;
  --grid: hsl(40 28% 92% / 0.05);
  --shadow: 0 1px 0 hsl(40 28% 100% / 0.04) inset, 0 1px 2px hsl(0 0% 0% / 0.4);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: hsl(212 26% 9%);
    --paper-2: hsl(212 24% 12%);
    --paper-3: hsl(212 22% 16%);
    --ink: hsl(40 28% 92%);
    --ink-2: hsl(40 14% 70%);
    --ink-3: hsl(40 10% 56%);
    --rule: hsl(212 16% 21%);
    --rule-2: hsl(212 14% 30%);
    --accent: hsl(8 74% 59%);
    --accent-text: hsl(8 78% 70%);
    --accent-soft: hsl(8 74% 59% / 0.14);
    --ok: hsl(150 45% 60%);
    --globe: hsl(212 26% 12%);
    --cell-s: 42%;
    --cell-l: 57%;
    --cell-a: 0.9;
    --grid: hsl(40 28% 92% / 0.05);
    --shadow: 0 1px 0 hsl(40 28% 100% / 0.04) inset, 0 1px 2px hsl(0 0% 0% / 0.4);
    color-scheme: dark;
  }
}

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

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

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 4rem 4rem;
  background-position: center top;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga";
  min-height: 100dvh;
  overflow-x: clip;
}

/* Paper grain: a fixed SVG turbulence layer, multiplied in. */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="dark"] .grain { mix-blend-mode: screen; opacity: 0.35; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .grain { mix-blend-mode: screen; opacity: 0.35; }
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 0;
}
h1 { font-size: clamp(2.75rem, 7vw, 5.5rem); }
h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); }
h3 { font-size: 1.375rem; font-variation-settings: "opsz" 36; line-height: 1.2; }
h1 em, h2 em { font-style: italic; color: var(--accent-text); font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; }

p { margin: 0 0 1em; text-wrap: pretty; max-width: var(--measure); }
a { color: inherit; text-decoration-color: var(--rule-2); text-underline-offset: 0.15em; text-decoration-thickness: 1px; transition: text-decoration-color 160ms ease-out; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

code, pre, .mono { font-family: var(--font-mono); font-size: 0.92em; }
code { background: var(--paper-2); padding: 0.08em 0.35em; border-radius: 3px; }
pre code { background: none; padding: 0; font-size: inherit; }
pre.code {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  font-size: 0.875rem;
  line-height: 1.55;
  overflow-x: auto;
  margin: 0 0 1rem;
  box-shadow: var(--shadow);
  position: relative;
  tab-size: 2;
}
pre.code[data-copy] { padding-right: 4.5rem; }
.copy {
  position: absolute; top: 0.55rem; right: 0.55rem;
  font: 500 0.72rem/1 var(--font-mono);
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-2); background: var(--paper); border: 1px solid var(--rule);
  border-radius: 3px; padding: 0.5rem 0.6rem; cursor: pointer;
  min-height: 2rem; transition: color 160ms ease-out, border-color 160ms ease-out;
}
.copy:hover { color: var(--accent-text); border-color: var(--accent); }
.copy[data-done] { color: var(--ok); border-color: var(--ok); }

.muted { color: var(--ink-2); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -3rem; background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; z-index: 500; border-radius: var(--radius); }
.skip:focus { top: 1rem; }

.table-wrap { overflow-x: auto; margin: 0 0 1.5rem; -webkit-overflow-scrolling: touch; }

.eyebrow {
  font: 500 0.78rem/1.3 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 1rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.eyebrow .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.lede { font-size: 1.2rem; line-height: 1.55; color: var(--ink-2); max-width: 58ch; }
.lede code { font-size: 0.88em; }

.method {
  font: 500 0.68rem/1 var(--font-mono);
  letter-spacing: 0.08em;
  padding: 0.28em 0.45em 0.22em;
  border-radius: 3px;
  vertical-align: 0.1em;
  margin-right: 0.25rem;
  border: 1px solid currentColor;
  color: var(--ink-2);
}
.method-get { color: var(--ok); }
.method-post { color: var(--accent-text); }

.price {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--ink);
}
.price-free { color: var(--ink-3); font-weight: 400; }

/* -------------------------------------------------------------- header */

.top {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  font-variation-settings: "opsz" 36, "SOFT" 50;
  white-space: nowrap;
}
.wordmark-geo { font-style: italic; color: var(--accent-text); font-weight: 400; }
.top nav { display: flex; align-items: center; gap: clamp(0.75rem, 2vw, 1.75rem); font-size: 0.95rem; }
.top nav a { text-decoration: none; color: var(--ink-2); padding: 0.5rem 0; min-height: 44px; display: inline-flex; align-items: center; }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); }
.top nav a[aria-current] { box-shadow: 0 2px 0 var(--accent); }
.top nav .mono { font-size: 0.85rem; }
.theme {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--rule); background: transparent; color: var(--ink-2);
  cursor: pointer; transition: border-color 160ms ease-out, color 160ms ease-out;
}
.theme:hover { color: var(--accent-text); border-color: var(--accent); }
.theme .moon { display: none; }
[data-theme="dark"] .theme .sun { display: none; }
[data-theme="dark"] .theme .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { display: none; }
  :root:not([data-theme="light"]) .theme .moon { display: block; }
}
@media (max-width: 640px) {
  .top nav .mono, .top nav a[href="#ledger"], .top nav a[href="/#ledger"] { display: none; }
}

/* ----------------------------------------------------------------- layout */

main { position: relative; z-index: 2; }
section, .hero { padding: clamp(3rem, 6vw, 5.5rem) clamp(1rem, 4vw, 3rem); }
.section-head { max-width: var(--wrap); margin: 0 auto 2.5rem; }
.section-head .lede { margin-top: 1rem; }
.exchange, .ledger-section, .call, .under { border-top: 1px solid var(--rule); }
.exchange > *, .ledger-section > *, .call > *, .under > * { max-width: var(--wrap); margin-left: auto; margin-right: auto; }

/* ------------------------------------------------------------------- hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  max-width: none;
  padding-right: 0;
  padding-top: clamp(2rem, 6vw, 5rem);
  min-height: calc(100dvh - 4.5rem);
}
.hero-copy { padding-left: max(0px, calc((100vw - var(--wrap)) / 2 - 3rem)); }
.hero h1 { margin-bottom: 1.25rem; }
.hero .lede { margin-bottom: 2rem; }
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2.5rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 48px; padding: 0.7rem 1.3rem;
  border: 1px solid var(--ink); border-radius: var(--radius);
  text-decoration: none; font-weight: 500; font-size: 1rem;
  background: transparent; color: var(--ink);
  transition: transform 160ms ease-out, background-color 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); color: var(--accent-text); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: hsl(40 30% 98%); }

.stats {
  display: grid; grid-template-columns: repeat(4, auto); gap: 1.5rem 2rem;
  margin: 0; padding-top: 1.5rem; border-top: 1px solid var(--rule);
  width: fit-content;
}
.stats div { display: flex; flex-direction: column-reverse; }
.stats dt { white-space: nowrap; font: 500 0.72rem/1.3 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.stats dd { margin: 0; white-space: nowrap; font-family: var(--font-display); font-size: 1.75rem; font-weight: 300; line-height: 1.1; font-variant-numeric: tabular-nums; font-variation-settings: "opsz" 72; }

.hero-fig { margin: 0; position: relative; min-width: 0; max-width: 100%; }
.hero-map {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 24px 40px hsl(210 30% 12% / 0.12));
}
.hero-map .globe { fill: var(--globe); stroke: none; }
.hero-map .globe-edge { fill: none; stroke: var(--rule-2); stroke-width: 4; vector-effect: non-scaling-stroke; stroke-width: 1px; }
.hero-map .graticule { fill: none; stroke: var(--ink); stroke-opacity: 0.1; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.hero-map .cells path {
  fill: hsl(var(--h) var(--cell-s) var(--cell-l) / var(--cell-a));
  stroke: var(--paper);
  stroke-width: 0.6px;
  vector-effect: non-scaling-stroke;
  transition: fill 200ms ease-out;
}
.hero-map .cells path:hover { fill: var(--accent); }
.hero-map .noon { fill: none; stroke: none; }
.hero-map .noon.on {
  stroke: var(--accent);
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 6 5;
  filter: drop-shadow(0 0 6px var(--accent));
}
.hero-fig figcaption {
  font-size: 0.875rem; line-height: 1.55; color: var(--ink-2);
  max-width: 52ch; margin-top: 1.25rem;
  padding-right: clamp(1rem, 4vw, 3rem);
}
.hero-fig figcaption strong { color: var(--ink); font-weight: 500; }

/* Sweep-in: only when JS has set --d per cell, only transform/opacity. */
.hero-map.sweep .cells path {
  opacity: 0;
  transform: translateY(6px);
  transform-box: fill-box;
  transform-origin: center;
  animation: cell-in 520ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: var(--d, 0ms);
}
@keyframes cell-in { to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-right: clamp(1rem, 4vw, 3rem); min-height: 0; }
  .hero-copy { padding-left: 0; order: 2; }
  .hero-fig { order: 1; }
  .hero-fig figcaption { padding-right: 0; }
  .stats { grid-template-columns: repeat(2, auto); }
}

/* ----------------------------------------------------------------- notice */

.notice {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
  font-size: 0.95rem;
  color: var(--ink-2);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--accent-soft);
}
.notice strong { color: var(--accent-text); font-weight: 500; }
main > .notice { max-width: none; }
main > .notice::before { content: ""; }

/* --------------------------------------------------------------- exchange */

.beats {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem;
  counter-reset: beat;
}
.beat {
  position: relative;
  padding-top: 1rem;
  border-top: 2px solid var(--rule-2);
}
.beat::before {
  content: ""; position: absolute; top: -2px; left: 0; width: 3rem; height: 2px; background: var(--accent);
}
.beat-label { font-family: var(--font-display); font-size: 1.35rem; margin-bottom: 0.9rem; display: flex; align-items: baseline; gap: 0.6rem; font-variation-settings: "opsz" 36; }
.beat-n { font: 500 0.75rem/1 var(--font-mono); color: var(--accent-text); letter-spacing: 0.1em; }
.beat-label .status { font-family: var(--font-mono); font-weight: 500; color: var(--accent-text); font-size: 1.1rem; }
.beat pre.code { font-size: 0.8rem; }
.beat .code-terms { white-space: pre-wrap; overflow-wrap: anywhere; }
.beat-note { font-size: 0.92rem; color: var(--ink-2); }
@media (max-width: 900px) { .beats { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------------ ledger */

.ledger { width: 100%; border-collapse: collapse; font-size: 1rem; }
.ledger .ledger-head th {
  text-align: left; padding: 2.25rem 0 0.6rem;
  border-bottom: 1px solid var(--ink);
  font-weight: 400;
}
.ledger .ledger-group:first-child .ledger-head th { padding-top: 0; }
.ledger-family { font-family: var(--font-display); font-size: 1.5rem; font-variation-settings: "opsz" 36; margin-right: 1rem; }
.ledger-blurb { color: var(--ink-2); font-size: 0.95rem; }
.ledger td { padding: 0.85rem 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.ledger tr:last-child td { border-bottom-color: transparent; }
.ledger-route { white-space: nowrap; padding-right: 1.5rem !important; width: 1%; }
.ledger-route a { text-decoration: none; }
.ledger-route a:hover code { color: var(--accent-text); }
.ledger-route code { background: none; padding: 0; font-size: 0.95rem; }
.ledger-what { color: var(--ink-2); padding-right: 1.5rem !important; }
.ledger-price { text-align: right; white-space: nowrap; font-size: 1.05rem; }
.ledger-foot { margin: 2rem 0 0; max-width: var(--measure); color: var(--ink-2); font-size: 0.95rem; }
@media (max-width: 700px) {
  .ledger-what { display: none; }
  .ledger-route { white-space: normal; }
  .ledger-blurb { display: block; }
}

/* -------------------------------------------------------------------- call */

.call-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.call-col h3 { margin-bottom: 0.5rem; }
.call-col > p { font-size: 0.95rem; color: var(--ink-2); }
.call-col pre.code { font-size: 0.8rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.links { list-style: none; margin: 0; padding: 0; font-size: 0.95rem; }
.links li { padding: 0.65rem 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); }
.links li:first-child { padding-top: 0; }
.links a { color: var(--ink); }
.soon { display: inline-block; font: 500 0.7rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); border: 1px dashed var(--accent); padding: 0.3em 0.5em; border-radius: 3px; margin-right: 0.3rem; }
@media (max-width: 900px) { .call-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------- under */

.under-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.under-grid > div { padding-top: 1rem; border-top: 1px solid var(--ink); }
.under-grid p { font-size: 0.95rem; color: var(--ink-2); }
@media (max-width: 900px) { .under-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ footer */

.foot { position: relative; z-index: 2; border-top: 1px solid var(--rule); padding: 3rem clamp(1rem, 4vw, 3rem) 2rem; background: var(--paper-2); }
.foot-grid { max-width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 2rem; align-items: start; }
.foot-meta { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1.5rem; font-size: 0.85rem; }
.foot-meta dt { font: 500 0.68rem/1.3 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.foot-meta dd { margin: 0.15rem 0 0; color: var(--ink-2); overflow-wrap: anywhere; }
.foot-meta code { font-size: 0.82rem; background: none; padding: 0; }
.foot-nav { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.95rem; align-items: flex-start; }
.foot-nav a { text-decoration: none; color: var(--ink-2); }
.foot-nav a:hover { color: var(--accent-text); }
.colophon { max-width: var(--wrap); margin: 2.5rem auto 0; font-size: 0.8rem; color: var(--ink-3); }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr; } }

/* -------------------------------------------------------------------- docs */

.docs {
  display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 3rem;
  max-width: var(--wrap); margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem);
}
.toc { position: sticky; top: 5rem; align-self: start; max-height: calc(100dvh - 6rem); overflow-y: auto; font-size: 0.88rem; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li a { display: block; padding: 0.3rem 0; text-decoration: none; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toc li a:hover, .toc li a[aria-current] { color: var(--ink); }
.toc li a[aria-current] code { color: var(--accent-text); }
.toc code { background: none; padding: 0; font-size: 0.85rem; }
.toc .toc-family { font-family: var(--font-display); font-size: 1.05rem; margin: 1.1rem 0 0.2rem; color: var(--ink); font-variation-settings: "opsz" 24; }
.toc .toc-family:first-child { margin-top: 0; }
.toc .method { font-size: 0.58rem; padding: 0.2em 0.35em 0.15em; }
.docs-head { margin-bottom: 3rem; }
.docs-head .notice { margin: 1.5rem 0; padding: 0.9rem 1.1rem; border: 1px solid var(--rule); border-radius: var(--radius); }
.protocol { padding: 0; border: 0; margin-top: 2rem; }
.protocol h2 { font-size: 1.5rem; margin-top: 1.5rem; }
.protocol p { color: var(--ink-2); font-size: 0.98rem; max-width: 72ch; }
.route { padding: 2.5rem 0 1rem; border-top: 1px solid var(--ink); margin-bottom: 1rem; }
.route-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.75rem; }
.route-head h2 { font-family: var(--font-mono); font-size: 1.2rem; font-weight: 500; letter-spacing: 0; margin: 0; font-variation-settings: normal; }
.route-head h2 code { background: none; padding: 0; font-size: inherit; }
.route-price { margin: 0; font-size: 1.25rem; }
.route-price .atomic { font: 400 0.78rem var(--font-mono); color: var(--ink-3); margin-left: 0.5rem; }
.route-summary { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.25; max-width: 40ch; font-variation-settings: "opsz" 36; margin-bottom: 1rem; }
.route-desc p { color: var(--ink-2); font-size: 0.98rem; max-width: 72ch; }
.route h3 { font-size: 0.78rem; font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin: 2rem 0 0.75rem; font-variation-settings: normal; }
.route-pay { font-size: 0.85rem; margin-top: 1.5rem; }
.schema { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.schema th, .schema td { text-align: left; vertical-align: top; padding: 0.6rem 1rem 0.6rem 0; border-bottom: 1px solid var(--rule); }
.schema thead th { font: 500 0.7rem/1.3 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); border-bottom-color: var(--rule-2); }
.schema tbody th { font-weight: 400; white-space: nowrap; }
.schema tbody th code { background: none; padding: 0; }
.schema td { color: var(--ink-2); }
.schema .type { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-3); }
.schema .num { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.schema .unit { color: var(--ink-3); font-size: 0.85em; }
.schema .extras { font-size: 0.85rem; color: var(--ink-3); margin-top: 0.25rem; }
.schema .extras code { font-size: 0.85em; }
.req { display: inline-block; margin-left: 0.5rem; font: 500 0.62rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); border: 1px solid currentColor; border-radius: 3px; padding: 0.25em 0.4em 0.2em; vertical-align: 0.15em; }
.example summary { cursor: pointer; font-size: 0.9rem; color: var(--ink-2); padding: 0.5rem 0; }
.example summary:hover { color: var(--accent-text); }
.example pre.code { font-size: 0.8rem; max-height: 32rem; overflow: auto; }
@media (max-width: 900px) {
  .docs { grid-template-columns: minmax(0, 1fr); }
  .toc { min-width: 0; position: static; max-height: none; border-bottom: 1px solid var(--rule); padding-bottom: 1.5rem; }
  .toc ul { columns: 2; column-gap: 1.5rem; }
  .toc li { break-inside: avoid; }
  .toc li a { white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 560px) { .toc ul { columns: 1; } }

/* ------------------------------------------------------------- attribution */

.prose { max-width: var(--wrap); margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem); }
.prose section { padding: 2rem 0 0; border: 0; }
.prose section h2 { font-size: 1.9rem; margin-bottom: 1rem; }
.prose section p { color: var(--ink-2); max-width: 72ch; }
.sources tbody th { white-space: normal; min-width: 16rem; }
.sources tbody th a { color: var(--ink); }

/* ------------------------------------------------------------------ motion */

@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; }
  .hero-map.sweep .cells path { opacity: 1; transform: none; animation: none; }
}

/* ------------------------------------------------------------------- print */

@media print {
  .grain, .top, .theme, .copy { display: none; }
  body { background: #fff; color: #000; }
}
