:root {
  --paper: #fbfaf6;
  --surface: #ffffff;
  --sunk: #f3f1ea;
  --ink: #1b1a17;
  --ink-2: #47443d;
  --muted: #6f6b62;
  --line: #e6e2d8;
  --accent: #c93f24;
  --accent-ink: #ffffff;
  --accent-soft: #fbe6df;
  --highlight: #ffe17a;
  --ok: #2f7d4f;
  --warn: #8a5800;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(27 26 23 / 6%), 0 8px 24px rgb(27 26 23 / 7%);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131210;
    --surface: #1c1b18;
    --sunk: #24221e;
    --ink: #efebe2;
    --ink-2: #cfcabf;
    --muted: #a19c92;
    --line: #34312b;
    --accent: #f06446;
    --accent-ink: #1b0b06;
    --accent-soft: #3a1d15;
    --highlight: rgb(255 214 90 / 30%);
    --ok: #6cc28f;
    --warn: #e0a640;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 30%);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); margin-top: 2.2em; }
h3 { font-size: 1.15rem; margin-top: 1.4em; }
p, ul, ol { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--sunk); padding: 0.1em 0.35em; border-radius: 5px; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.center { text-align: center; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 92%, transparent); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px); }
.header-row { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }
.header-row > .btn { padding: 8px 16px; font-size: 0.92rem; }
@media (max-width: 900px) { .site-nav { display: none; } .header-row > .btn { margin-left: auto; } }

.site-footer { border-top: 1px solid var(--line); margin-top: 80px; padding: 40px 0 24px; background: var(--sunk); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid a { color: var(--ink-2); text-decoration: none; }
.footer-grid a:hover { color: var(--accent); text-decoration: underline; }
.footer-h { font-weight: 700; margin-bottom: 8px; }
.brand-line { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.copyright { margin-top: 24px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-weight: 650; text-decoration: none; border: 1.5px solid transparent; white-space: nowrap; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); text-decoration: none; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--ink-2); }

/* Home */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding: 56px 0 24px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; font-weight: 700; color: var(--accent); }
.lead { font-size: 1.15rem; color: var(--ink-2); }
.lead strong { color: var(--ink); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; padding: 0; color: var(--muted); font-size: 0.95rem; }
.facts strong { color: var(--ink); }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; padding-top: 32px; } }
.cards { list-style: none; padding: 0; display: grid; gap: 16px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.cards li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.cards h3 { margin-top: 0; }
.cards p { margin: 0; color: var(--ink-2); }
@media (max-width: 760px) { .cards.three { grid-template-columns: 1fr; } }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.split h2 { margin-top: 2.2em; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.checks { list-style: none; padding: 0; }
.checks li { padding-left: 30px; position: relative; margin-bottom: 10px; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 0.75rem; display: grid; place-items: center; margin-top: 4px; }
.cta-band { margin-top: 72px; padding: 40px 24px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) * 1.5); box-shadow: var(--shadow); }
.cta-band h2 { margin-top: 0; }

/* Figures and tables */
.shot { margin: 24px 0; }
.shot img { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface); }
.prose .shot img { max-width: 400px; }
.shot figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 8px; }
.table-wrap { overflow-x: auto; margin: 20px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.96rem; }
caption { text-align: left; padding: 12px 16px 0; font-weight: 650; color: var(--ink-2); }
th, td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--line); }
thead th { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 650; }

/* Articles */
.prose { max-width: 760px; }
article.prose, div.prose { padding-top: 16px; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 24px 0 8px; font-size: 0.9rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; }
.crumbs a { color: var(--muted); }
.byline { color: var(--muted); font-size: 0.92rem; margin: -4px 0 24px; }
.answer { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; padding: 18px 20px; margin: 0 0 24px; box-shadow: var(--shadow); }
.answer p:last-child { margin-bottom: 0; }
.callout { border-radius: var(--radius); padding: 16px 20px; margin: 24px 0; background: var(--accent-soft); }
.callout-warn { background: color-mix(in srgb, var(--warn) 14%, var(--paper)); }
.callout-title { font-weight: 700; margin-bottom: 4px; }
.callout p:last-child { margin-bottom: 0; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding: 2px 0 12px 44px; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; display: grid; place-items: center; font-size: 0.9rem; }
.faq .qa { border-top: 1px solid var(--line); padding: 16px 0 4px; }
.faq .qa h3 { margin: 0 0 6px; font-size: 1.1rem; }
.sources { margin-top: 48px; font-size: 0.95rem; }
.sources h2 { font-size: 1.3rem; }
.author-card { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.author-card img { flex: none; }
.timeline { padding-left: 20px; }
.timeline li { margin-bottom: 8px; }
.guide-list { list-style: none; padding: 0; }
.guide-list li { border-top: 1px solid var(--line); padding: 20px 0 4px; }
.guide-list h2 { margin: 0 0 6px; font-size: 1.4rem; }
.guide-list h2 a { color: var(--ink); text-decoration: none; }
.guide-list h2 a:hover { color: var(--accent); text-decoration: underline; }
.release h2 { font-size: 1.4rem; }

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: filter 0.15s, border-color 0.15s; }
}
