:root {
  --fg: #1f2328;
  --muted: #59636e;
  --bg: #ffffff;
  --soft: #f6f8fa;
  --line: #d1d9e0;
  --accent: #1f6feb;
  --pass: #1a7f37;
  --fail: #9a6700;
  --bad: #cf222e;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--soft); padding: 0.1em 0.3em; border-radius: 4px; }
pre { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; overflow-x: auto; line-height: 1.45; }
pre code { background: none; padding: 0; font-size: 13px; }
pre.term { background: #0d1117; color: #e6edf3; border-color: #0d1117; }
figure.diagram { margin: 16px 0; text-align: center; }
figure.diagram img { width: 100%; max-width: 760px; height: auto; }
details { margin: 12px 0; }
summary { cursor: pointer; color: var(--muted); }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
section { padding: 32px 0 8px; }
h1 { font-size: 2.4rem; line-height: 1.15; margin: 0.2em 0 0.4em; letter-spacing: -0.02em; }
h2 { font-size: 1.6rem; margin: 1.2em 0 0.5em; padding-bottom: 0.3em; border-bottom: 1px solid var(--line); }
h3 { font-size: 1.15rem; margin: 1.6em 0 0.5em; }

.topbar { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, 0.95); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.brand { font-weight: 700; color: var(--fg); font-family: var(--mono); }
nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.92rem; }
nav a { color: var(--muted); }
nav a[aria-current="page"] { color: var(--fg); font-weight: 600; }

.hero { background: linear-gradient(180deg, var(--soft), var(--bg)); padding: 48px 0 24px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 0; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 820px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 28px 0; }
.stat { border: 1px solid var(--line); border-left: 4px solid var(--pass); border-radius: 8px; padding: 12px 14px; background: var(--bg); }
.stat.warn { border-left-color: var(--fail); }
.stat.bad { border-left-color: var(--bad); }
.stat .num { display: block; font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .lbl { color: var(--muted); font-size: 0.86rem; }
.cta { display: flex; gap: 12px; margin: 20px 0 8px; }
.button { display: inline-block; padding: 9px 18px; border-radius: 6px; background: var(--accent); color: #fff; font-weight: 600; }
.button:hover { text-decoration: none; opacity: 0.9; }
.button.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }

figure.chart { margin: 16px 0; }
figure.chart img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
figure.chart.small { margin: 0; }
figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 8px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
th, td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; vertical-align: top; }
th { background: var(--soft); font-weight: 600; white-space: nowrap; }
tfoot td { font-weight: 600; border-top: 2px solid var(--line); }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sub { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.sub.unsafe { color: var(--bad); }
.sub.fail { color: var(--fail); }
.pill { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; color: #fff; }
.pill.pass { background: var(--pass); }
.pill.fail { background: var(--fail); }
.pill.unsafe { background: var(--bad); }
.scenarios td:first-child { min-width: 300px; }
.scenarios td.tags { font-family: var(--mono); font-size: 0.78rem; white-space: nowrap; }
.misses li { font-family: var(--mono); font-size: 0.8rem; }

.prose table { margin: 12px 0; }
.prose li { margin: 4px 0; }
.footer { color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--line); margin-top: 48px; padding-top: 16px; padding-bottom: 32px; }

@media (max-width: 760px) {
  h1 { font-size: 1.8rem; }
  .stats { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  nav { display: none; }
}
