:root {
  --paper: #f7f7f3;
  --surface: #ffffff;
  --ink: #17212b;
  --muted: #5f6b73;
  --line: #d9dfdc;
  --teal: #0b6e69;
  --coral: #c85f49;
  --gold: #bd8426;
  --soft-teal: #e4f0ed;
  --soft-coral: #fae9e2;
  --soft-gold: #f8efd9;
  --max: 1160px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 247, 243, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.nav-wrap,
.footer-wrap {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.wordmark {
  font-size: 1.1rem;
  font-weight: 760;
  letter-spacing: .01em;
  text-decoration: none;
}

.wordmark span { color: var(--teal); }

nav { display: flex; gap: 26px; }

nav a,
.footer-wrap a {
  color: var(--muted);
  font-size: .88rem;
  text-decoration: none;
}

nav a:hover,
.footer-wrap a:hover,
.text-link:hover { color: var(--teal); }

.section-shell {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  padding: 92px 0;
}

.hero { padding-top: 86px; padding-bottom: 86px; }

.eyebrow,
.section-label {
  color: var(--teal);
  font-size: .75rem;
  font-weight: 760;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p { margin-top: 0; }

h1 {
  margin: 20px 0 10px;
  font-size: clamp(3.4rem, 9vw, 7.2rem);
  line-height: .98;
  letter-spacing: -.045em;
}

.hero-title {
  max-width: 800px;
  margin-bottom: 18px;
  color: #394751;
  font-size: clamp(1.25rem, 2.4vw, 1.9rem);
  line-height: 1.28;
}

.authors { color: var(--muted); font-size: .98rem; }
.authors span { padding: 0 7px; color: var(--coral); }

.action-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 52px; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform .18s ease, background-color .18s ease, color .18s ease;
}

.button:hover { transform: translateY(-2px); }
.button-dark { color: #fff; background: var(--ink); }
.button-dark:hover { background: var(--teal); border-color: var(--teal); }
.button-outline { color: var(--ink); background: transparent; }
.button-outline:hover { color: var(--teal); border-color: var(--teal); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: 64px;
  align-items: center;
}

.hero-copy { max-width: 500px; color: var(--muted); }
.hero-copy .lede { color: var(--ink); font-size: 1.2rem; line-height: 1.5; }

figure { margin: 0; }

.hero-figure,
.wide-figure figure { background: var(--surface); }

figure img { display: block; width: 100%; height: auto; }

figcaption {
  padding-top: 11px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.5;
}

.caption-link { color: var(--teal); font-weight: 700; text-decoration: none; }
.caption-link:hover { text-decoration: underline; }

.hero-figure { padding: 12px; border: 1px solid var(--line); }

.section-rule { border-top: 1px solid var(--line); }

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .68fr);
  gap: 44px;
  align-items: end;
  margin: 14px 0 34px;
}

h2 {
  max-width: 680px;
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.section-heading p { max-width: 440px; margin-bottom: 4px; color: var(--muted); }

.wide-figure {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.wide-figure figcaption { padding: 13px 3px 0; }

.prefix-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.prefix-item {
  display: grid;
  min-height: 136px;
  align-content: space-between;
  padding: 16px;
  border-top: 4px solid var(--ink);
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.prefix-dim { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95rem; font-weight: 760; }
.prefix-name { font-size: 1.03rem; font-weight: 750; }
.prefix-note { color: var(--muted); font-size: .79rem; line-height: 1.4; }
.prefix-teal { border-top-color: var(--teal); background: var(--soft-teal); }
.prefix-coral { border-top-color: var(--coral); background: var(--soft-coral); }
.prefix-gold { border-top-color: var(--gold); background: var(--soft-gold); }
.prefix-ink { border-top-color: var(--ink); }
.prefix-outline { border-top-color: var(--muted); background: transparent; }

.method-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 34px;
  margin-top: 56px;
}

h3 { margin-bottom: 9px; font-size: 1rem; letter-spacing: .01em; }
.method-columns p,
.code-notes dd { margin-bottom: 0; color: var(--muted); font-size: .92rem; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 36px 0 46px;
}

.metric { padding: 19px 18px 16px; background: var(--ink); color: #fff; }
.metric strong { display: block; color: #f9d88a; font-size: 1.75rem; line-height: 1.1; }
.metric span { display: block; margin-top: 10px; color: #cbd5d8; font-size: .78rem; line-height: 1.35; }

.figure-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.figure-grid figure { padding: 14px; background: var(--surface); border: 1px solid var(--line); }

.callout {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  margin-top: 35px;
  padding: 17px 20px;
  border-left: 4px solid var(--coral);
  background: var(--soft-coral);
}

.callout p { margin-bottom: 0; color: #4f403b; font-size: .92rem; }
.callout-mark { color: var(--coral); font-size: 1.55rem; font-weight: 300; line-height: 1; }

.code-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(260px, .95fr); gap: 54px; }

pre {
  overflow-x: auto;
  margin: 0 0 26px;
  padding: 17px 18px;
  color: #e6efed;
  background: #26333a;
  border-radius: 3px;
  font: .84rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.code-notes { padding-top: 1px; }
.code-notes dl { margin: 0 0 26px; }
.code-notes dl > div { padding: 11px 0; border-bottom: 1px solid var(--line); }
.code-notes dt { font-weight: 750; }
.code-notes dd { margin: 2px 0 0; }
.text-link { color: var(--teal); font-weight: 750; text-decoration: none; }
.data-note { max-width: 560px; color: var(--muted); font-size: .92rem; }

.citation-section { padding-bottom: 74px; }
.citation-section pre { max-width: 850px; }
.funding { margin: 28px 0 0; color: var(--muted); font-size: .88rem; }

.site-footer { border-top: 1px solid var(--line); }
.footer-wrap { display: flex; justify-content: space-between; gap: 20px; padding: 24px 0 30px; color: var(--muted); font-size: .8rem; }

@media (max-width: 880px) {
  .hero-grid,
  .section-heading,
  .code-layout { grid-template-columns: 1fr; gap: 28px; }
  .prefix-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .method-columns { gap: 25px; }
}

@media (max-width: 600px) {
  .nav-wrap,
  .footer-wrap,
  .section-shell { width: min(var(--max), calc(100% - 32px)); }
  .nav-wrap { min-height: 56px; }
  nav { gap: 13px; }
  nav a { font-size: .76rem; }
  .hero { padding-top: 62px; padding-bottom: 62px; }
  h1 { font-size: 4.2rem; }
  .hero-title { font-size: 1.2rem; }
  .prefix-grid,
  .metric-grid,
  .figure-grid,
  .method-columns { grid-template-columns: 1fr; }
  .prefix-item { min-height: 112px; }
  .section-shell { padding: 67px 0; }
  .wide-figure { padding: 8px; }
  .figure-grid figure { padding: 9px; }
  .footer-wrap { align-items: flex-start; flex-direction: column; }
}
