/* Baseline — base styles */

:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --ink: #121211;
  --ink-2: #3a3a37;
  --muted: #6b6b65;
  --faint: #9b9a93;
  --line: #e7e6e0;
  --line-2: #d8d7cf;
  --tint: #f2f1ec;
  --accent: #c4532e;
  --accent-soft: rgba(196, 83, 46, 0.1);

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max: 1120px;
  --gutter: 24px;
  --radius: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

::selection { background: var(--ink); color: var(--bg); }

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

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

/* ---------- Type ---------- */

.display {
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(44px, 7.2vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.028em;
  margin: 0;
  font-variation-settings: "opsz" 72;
}

.h2 {
  font-family: var(--serif);
  font-weight: 380;
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.022em;
  margin: 0;
  font-variation-settings: "opsz" 60;
}

.h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.01em;
  margin: 0;
}

.lede {
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 34em;
  margin: 0;
}

.body { color: var(--ink-2); margin: 0; max-width: 36em; }

.label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
}

.mono { font-family: var(--mono); }

.muted { color: var(--muted); }

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 250, 247, 0.86);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.brand svg { width: 22px; height: 22px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  color: var(--ink-2);
}
.nav-links a:not(.btn) { transition: color 0.2s; }
.nav-links a:not(.btn):hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); }

@media (max-width: 720px) {
  .nav-links .hide-sm { display: none; }
  .nav-links { gap: 18px; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
  white-space: nowrap;
}
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: #2a2a28; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); }
.btn .arrow { transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translateX(2px); }

/* ---------- Sections ---------- */

.section {
  padding: clamp(80px, 11vw, 140px) 0;
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  margin-bottom: clamp(40px, 5vw, 64px);
}
.section-head .label { padding-top: 12px; }

@media (max-width: 860px) {
  .section-head { grid-template-columns: 1fr; gap: 14px; }
  .section-head .label { padding-top: 0; }
}

.section-head .h2 + .body { margin-top: 20px; }

/* ---------- Hero (pinned, covered by .stack) ---------- */

.hero {
  position: sticky;
  top: 0;
  z-index: 0;
  min-height: 84vh;
  min-height: 84svh;
  display: flex;
  align-items: center;
  padding: 72px 0 96px;
}
.hero-inner { will-change: opacity, transform; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero .display { font-size: clamp(48px, 8.4vw, 104px); }
.hero .lede { margin-top: 28px; max-width: 26em; }
@media (max-width: 560px) { .hero .display br { display: none; } }

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 36px;
}

.stack {
  position: relative;
  z-index: 1;
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -30px 60px -40px rgba(18, 18, 17, 0.18);
}
.stack > .section:first-child { border-top: 0; }

/* ---------- Figures ---------- */

.figure {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.figure-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.figure-bar .readout { color: var(--ink-2); text-align: right; min-height: 1em; }
.figure-bar .readout .flag { color: var(--accent); }

.figure-body { padding: 12px 8px 4px; }

.chart { width: 100%; position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }

.chart-hero:empty { min-height: 300px; }
.chart-sm:empty { min-height: 240px; }

.figure-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding: 12px 18px 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}
.figure-legend span { display: inline-flex; align-items: center; gap: 8px; }
.key { display: inline-block; width: 16px; height: 10px; }
.key-line { height: 0; border-top: 1.5px solid var(--ink); }
.key-band { background: rgba(18, 18, 17, 0.07); border: 1px dashed var(--line-2); }
.key-ci { background: rgba(18, 18, 17, 0.12); }
.key-cp { width: 0; height: 12px; border-left: 1.5px dashed var(--accent); margin: 0 7px; }
.key-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--faint); margin: 0 5px; }

.caption {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  max-width: 60em;
}
.caption b { font-weight: 500; color: var(--ink-2); }

/* SVG chart text */
.chart text {
  font-family: var(--mono);
  font-size: 10.5px;
  fill: var(--faint);
}
.chart .t-ink { fill: var(--ink-2); }
.chart .t-accent { fill: var(--accent); }

/* ---------- Story (pinned panel, steps flip in place) ---------- */

html { scroll-snap-type: y proximity; }

.story-section { padding: 0; }
.story { position: relative; height: 300vh; }
.story-snap {
  position: absolute;
  left: 0;
  width: 1px;
  height: 1px;
  scroll-snap-align: start;
  pointer-events: none;
}
.story-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  padding-top: calc(60px + max(24px, 9vh));
  z-index: 2;
}
.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.story-copy { padding-top: clamp(24px, 6vh, 72px); }
.story-stage .figure { position: relative; }

.story-steps {
  display: grid;
  margin-top: 28px;
  perspective: 900px;
}
.story-step {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(22px) rotateX(-55deg);
  transform-origin: 50% 100%;
  transition: opacity 0.45s var(--ease), transform 0.6s var(--ease);
  pointer-events: none;
}
.story-step.is-past {
  transform: translateY(-22px) rotateX(55deg);
  transform-origin: 50% 0%;
}
.story-step.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition-delay: 0.12s;
}
.story-step .mono { font-size: 12px; color: var(--faint); }
.story-step h3 {
  font-family: var(--serif);
  font-weight: 380;
  font-size: clamp(40px, 4.4vw, 60px);
  letter-spacing: -0.022em;
  line-height: 1.02;
  margin: 10px 0 16px;
}
.story-step p { margin: 0; color: var(--muted); font-size: 17px; max-width: 20em; }

.story-nav { display: flex; gap: 6px; margin-top: 36px; }
.story-nav button {
  position: relative;
  font: inherit;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  background: none;
  border: 0;
  padding: 12px 0 0;
  width: 88px;
  text-align: left;
  cursor: pointer;
  transition: color 0.3s;
}
.story-nav button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 8px;
  height: 2px;
  background: var(--line-2);
  transition: background 0.3s;
}
.story-nav button.is-active { color: var(--ink); }
.story-nav button.is-active::before { background: var(--ink); }
.story-nav button:hover { color: var(--ink-2); }

.match-strip {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.6s var(--ease);
}
.is-connect .match-strip { grid-template-rows: 1fr; }
.ms-inner { overflow: hidden; min-height: 0; }
.ms-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}
.ms-head .flag { color: var(--accent); white-space: nowrap; }
.ms-head .factors { text-align: right; }
.ms-rows {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.ms-item { padding: 14px 18px 16px; }
.ms-item + .ms-item { border-left: 1px solid var(--line); }
.ms-item b { display: block; font-size: 14px; font-weight: 500; letter-spacing: -0.01em; }
.ms-item small { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 2px; }
.ms-score { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.ms-score .mono { font-size: 11.5px; color: var(--ink-2); }
.chart .ref-note { opacity: 0; transition: opacity 0.5s var(--ease) 0.2s; }
.is-connect .chart .ref-note { opacity: 1; }
.bar { width: 100%; height: 3px; background: var(--tint); border-radius: 2px; overflow: hidden; }
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  transition: width 0.9s var(--ease) 0.2s;
}
.is-connect .bar i { width: var(--w); }

@media (max-width: 900px) {
  .story-pin { padding-top: 80px; }
  .story-copy { padding-top: 0; }
  .story-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .story-steps { margin-top: 16px; }
  .story-step h3 { font-size: 38px; margin: 6px 0 10px; }
  .story-step p { font-size: 16px; }
  .story-nav { margin-top: 20px; }
  .story-nav button { width: 76px; }
  .story-stage .figure-legend { display: none; }
  .ms-head { padding: 10px 14px; }
  .ms-head .factors { display: none; }
  .ms-item { padding: 10px 12px 12px; }
  .ms-item small { display: none; }
  .ms-item b { font-size: 13px; }
  .ms-score { margin-top: 8px; gap: 8px; }
}

/* ---------- Split ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* ---------- Statement (pinned word fill) ---------- */

.statement { height: 230vh; position: relative; border-top: 1px solid var(--line); }
.statement-inner {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}
.statement .label { margin-bottom: 28px; }
.statement-text {
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(40px, 7vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 auto;
  max-width: 11em;
  font-variation-settings: "opsz" 72;
}
.statement-text .w { opacity: 0.12; transition: opacity 0.35s ease; }
.statement-text .w.on { opacity: 1; }
.statement-foot {
  margin: 40px auto 0;
  max-width: 38em;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.statement-foot.on { opacity: 1; transform: none; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--surface);
}
.statement-foot p { color: var(--muted); margin: 0 0 18px; font-size: 15px; }

.terms-line { margin-top: 28px; justify-content: flex-start; }
.terms-line .chip { color: var(--muted); }

/* ---------- Research cards ---------- */

.papers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 760px) { .papers { grid-template-columns: 1fr; } }

.paper {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.25s, transform 0.35s var(--ease);
  min-height: 200px;
}
.paper:hover { border-color: var(--line-2); transform: translateY(-2px); }
.paper-top { display: flex; justify-content: space-between; gap: 12px; }
.paper-title {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.22;
  letter-spacing: -0.01em;
  font-weight: 400;
  margin: 0;
  font-variation-settings: "opsz" 24;
}
.paper-authors { font-size: 13px; color: var(--muted); margin: 0; }
.paper-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.paper:hover .paper-foot .go { color: var(--ink); }

.note {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
}
.textlink {
  color: var(--ink);
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 1px;
  transition: border-color 0.2s;
}
.textlink:hover { border-color: var(--ink); }

/* ---------- Company ---------- */

.people {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 860px) { .people { grid-template-columns: 1fr; } }

.person {
  padding: 32px 32px 36px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.avatar {
  width: 112px;
  height: 112px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--tint);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--muted);
  margin: 0 auto 56px;
}
.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
}
.person .name { font-size: 19px; font-weight: 500; letter-spacing: -0.015em; }
.person .role { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.person p { margin: 16px 0 0; font-size: 14px; color: var(--muted); }

.funding {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.funding > div { padding: 28px; }
.backers {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.backers li {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 18px 16px;
  border-radius: 6px;
  background: var(--tint);
  text-align: center;
}

@media (max-width: 860px) {
  .backers { grid-template-columns: 1fr; }
  .backers li { text-align: left; }
}

/* ---------- CTA / form ---------- */

.cta {
  padding: clamp(96px, 13vw, 168px) 0;
  border-top: 1px solid var(--line);
  text-align: center;
}
.cta .display { font-size: clamp(40px, 6vw, 68px); }
.cta .lede { margin: 20px auto 0; }

.join {
  display: flex;
  gap: 8px;
  max-width: 440px;
  margin: 40px auto 0;
  padding: 5px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color 0.2s;
}
.join:focus-within { border-color: var(--ink); }
.join input[type="email"] {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  padding: 0 14px;
  color: var(--ink);
  outline: none;
}
.join input::placeholder { color: var(--faint); }
.join .btn { height: 38px; }

.form-status {
  min-height: 24px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
}
.form-status.ok { color: var(--ink); }

.fineprint {
  margin: 28px auto 0;
  max-width: 36em;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--faint);
}

.hp { position: absolute; left: -9999px; }

@media (max-width: 520px) {
  .join { flex-direction: column; gap: 10px; padding: 0; border: 0; border-radius: 0; background: none; width: 100%; }
  .join input[type="email"] {
    flex: none;
    width: 100%;
    height: 50px;
    padding: 0 16px;
    font-size: 16px;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: var(--surface);
    transition: border-color 0.2s;
  }
  .join input[type="email"]:focus { border-color: var(--ink); }
  .join .btn { width: 100%; height: 50px; border-radius: 12px; font-size: 15px; }
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 48px;
  font-size: 13px;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
}
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--ink); }
.crisis {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--faint);
  max-width: 60em;
}
.crisis strong { color: var(--muted); font-weight: 500; }

/* ---------- Reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }

.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .bar i, .story-step, .story-nav button, .match-strip, .chart .ref-note, .statement-text .w, .statement-foot { transition: none; }
  .paper, .btn .arrow { transition: none; }
}

/* =========================================================
   Research page
   ========================================================= */

.r-hero { padding: clamp(64px, 9vw, 112px) 0 clamp(48px, 6vw, 72px); }
.r-hero .display { font-size: clamp(40px, 6vw, 72px); max-width: 12em; }
.r-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.r-meta b { color: var(--ink-2); font-weight: 400; }

.r-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 56px;
  padding-bottom: 120px;
}
@media (max-width: 960px) {
  .r-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
}

.toc {
  position: sticky;
  top: 92px;
  align-self: start;
  font-size: 13px;
}
.toc ol { list-style: none; padding: 0; margin: 16px 0 0; }
.toc li a {
  display: flex;
  gap: 10px;
  padding: 5px 0;
  color: var(--muted);
  transition: color 0.2s;
}
.toc li a span { font-family: var(--mono); font-size: 11px; color: var(--faint); padding-top: 2px; }
.toc li a:hover, .toc li a.active { color: var(--ink); }

.prose { max-width: 700px; }
.prose > section { padding-top: 56px; margin-top: 56px; border-top: 1px solid var(--line); }
.prose > section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  letter-spacing: -0.018em;
  line-height: 1.15;
  margin: 8px 0 20px;
  font-variation-settings: "opsz" 36;
}
.prose h3 { font-size: 16px; font-weight: 500; margin: 32px 0 8px; letter-spacing: -0.01em; }
.prose p, .prose li { color: var(--ink-2); font-size: 16px; line-height: 1.7; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 20px; margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--faint); }
.prose em { font-style: italic; }
.prose strong { font-weight: 500; color: var(--ink); }
.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--tint);
  padding: 1px 5px;
  border-radius: 4px;
}
.prose a:not(.paper) { border-bottom: 1px solid var(--line-2); }
.prose a:not(.paper):hover { border-color: var(--ink); }

.prose .figure, .prose .tablewrap, .prose .eq { margin: 28px 0; }
.prose .caption { margin-top: -14px; margin-bottom: 28px; }

.eq {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.eq .katex-display { margin: 0; flex: 1; }
.eq .eqn { font-family: var(--mono); font-size: 12px; color: var(--faint); margin-left: auto; padding-left: 12px; }

.callout {
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 18px;
  margin: 24px 0;
  color: var(--ink-2);
}

.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.scroll-x > svg { min-width: 640px; }

.arch text { font-family: var(--sans); font-size: 12.5px; fill: var(--ink); }
.arch .sub { font-family: var(--mono); font-size: 10.5px; fill: var(--muted); }
.arch .edge-label { font-family: var(--mono); font-size: 10px; fill: var(--faint); }

.tablewrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow-x: auto;
}
.tablewrap .figure-bar { position: sticky; left: 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: right; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: 0.02em; }
td { font-variant-numeric: tabular-nums; color: var(--ink-2); }
td.num { font-family: var(--mono); font-size: 13px; }
tr:last-child td { border-bottom: 0; }
tr.best td { color: var(--ink); background: #fcfcfa; }
tr.best td.num { font-weight: 500; }
td .ci { color: var(--faint); font-size: 11px; margin-left: 4px; }

.defs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0; }
.defs div { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.defs b { display: block; font-family: var(--mono); font-size: 12px; font-weight: 500; margin-bottom: 4px; }
.defs span { font-size: 14px; color: var(--muted); line-height: 1.5; display: block; }
@media (max-width: 560px) { .defs { grid-template-columns: 1fr; } }

.refs { list-style: none; padding: 0 !important; counter-reset: ref; }
.refs li {
  counter-increment: ref;
  display: grid;
  grid-template-columns: 32px 1fr;
  font-size: 14px !important;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  margin: 0 !important;
}
.refs li::before { content: "[" counter(ref) "]"; font-family: var(--mono); font-size: 12px; color: var(--faint); padding-top: 2px; }
.refs .t { color: var(--ink); }

@media (max-width: 480px) {
  .figure-bar { flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; }
  .figure-bar .readout { text-align: left; }
}
