:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface: #fcfcfb;
  --surface-2: #efeeea;
  --border: #dddcd6;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #6f6e69;
  --accent: #2a78d6;
  --accent-ink: #1d5ea8;
  --series: #2a78d6;
  --grid: #e6e5e0;
  --good: #1a7f37;
  --good-bg: #e6f4ea;
  --warn: #8a5a00;
  --warn-bg: #fdf3dc;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --radius: 10px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211;
    --surface: #1a1a19;
    --surface-2: #232321;
    --border: #34342f;
    --text: #ffffff;
    --text-2: #c3c2b7;
    --muted: #9d9c93;
    --accent: #3987e5;
    --accent-ink: #7fb2f0;
    --series: #3987e5;
    --grid: #2c2c29;
    --good: #5cc27a;
    --good-bg: #16301f;
    --warn: #e8b64c;
    --warn-bg: #33280f;
    --bad: #f08a80;
    --bad-bg: #3a1a17;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211; --surface: #1a1a19; --surface-2: #232321; --border: #34342f;
  --text: #ffffff; --text-2: #c3c2b7; --muted: #9d9c93;
  --accent: #3987e5; --accent-ink: #7fb2f0; --series: #3987e5; --grid: #2c2c29;
  --good: #5cc27a; --good-bg: #16301f; --warn: #e8b64c; --warn-bg: #33280f;
  --bad: #f08a80; --bad-bg: #3a1a17;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--font);
}
a { color: var(--accent-ink); }
code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; }
h2 { font-size: 1.75rem; margin: 0 0 0.5rem; }
h3 { font-size: 1.15rem; margin: 1.75rem 0 0.5rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main > section { padding: 3.5rem 16px 0; }
.section-lede { color: var(--text-2); max-width: 70ch; margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* hero */
.hero { background: var(--surface); border-bottom: 1px solid var(--border); padding: 3rem 0 2.5rem; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; color: var(--accent-ink); font-weight: 600; margin: 0; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin: 0.4rem 0 1rem; }
.lede { font-size: 1.1rem; color: var(--text-2); max-width: 60ch; }
.links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }
.btn {
  display: inline-block; padding: 0.6rem 1.1rem; border-radius: 8px; text-decoration: none;
  border: 1px solid var(--border); color: var(--text); background: var(--surface); font-weight: 500;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.hero-model { margin: 0; }
.hero-model model-viewer { width: 100%; height: 360px; background: var(--surface-2); border-radius: var(--radius); }
.hero-model figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }

/* pipeline */
.pipeline { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.75rem; counter-reset: none; }
.pipeline li { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.1rem 0.6rem; }
.pipeline li:not(:last-child)::after {
  content: "\2192"; position: absolute; right: -1.45rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 1.25rem;
}
.pipeline h3 { margin: 0.5rem 0 0.4rem; }
.pipeline p { font-size: 0.92rem; color: var(--text-2); margin: 0 0 0.6rem; }
.step-n {
  display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 0.9rem;
}

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.viewer model-viewer { width: 100%; height: 280px; background: var(--surface-2); }
.card-body { padding: 1rem 1.1rem 1.2rem; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; }
.card-title { margin: 0; font-size: 1.2rem; }
.card-req { margin: 0; font-size: 0.9rem; }
.card-blurb { color: var(--text-2); margin: 0.5rem 0; font-size: 0.95rem; }
.warning {
  display: flex; gap: 0.5rem; background: var(--warn-bg); color: var(--text); border-left: 3px solid var(--warn);
  padding: 0.5rem 0.7rem; border-radius: 6px; font-size: 0.875rem; margin: 0.5rem 0;
}
.warning::before { content: "\26A0"; color: var(--warn); font-weight: 700; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin: 0.9rem 0 0.4rem; }
.metrics div { background: var(--surface-2); border-radius: 8px; padding: 0.5rem 0.6rem; min-width: 0; }
.metrics dt { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.metrics dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.metrics dd small { font-weight: 400; color: var(--text-2); font-size: 0.78rem; }
.blade-note { margin: 0.2rem 0 0.8rem; }

/* charts */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.chart { margin: 0; position: relative; }
.chart figcaption { font-size: 0.8rem; color: var(--text-2); font-weight: 600; margin-bottom: 0.2rem; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 10px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .hair { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 2 2; }
.chart .dot { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.tip {
  position: absolute; pointer-events: none; background: var(--text); color: var(--bg);
  font-size: 0.75rem; padding: 0.25rem 0.45rem; border-radius: 5px; white-space: nowrap;
  transform: translate(-50%, -110%); font-variant-numeric: tabular-nums;
}
.tip b { font-weight: 700; }

/* candidates + downloads */
.cands { margin-top: 0.9rem; font-size: 0.9rem; }
.cands summary { cursor: pointer; color: var(--accent-ink); }
.downloads { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.downloads a { font-size: 0.85rem; padding: 0.35rem 0.75rem; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0.75rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
caption, .table-note { text-align: left; font-size: 0.85rem; color: var(--text-2); padding-bottom: 0.5rem; }
th, td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.num { text-align: right; }
tr.out td { color: var(--muted); }
tr.chosen td { background: var(--surface-2); }
.pill { display: inline-block; font-size: 0.75rem; padding: 0.1rem 0.5rem; border-radius: 999px; font-weight: 600; }
.pill.pass { background: var(--good-bg); color: var(--good); }
.pill.fail { background: var(--bad-bg); color: var(--bad); }
.pill.na { background: var(--surface-2); color: var(--muted); }

/* validation */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin: 1rem 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1rem; }
.stat-v { display: block; font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-l { display: block; font-size: 0.82rem; color: var(--text-2); line-height: 1.4; }
.callout { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 0.2rem 1.1rem; margin: 1rem 0; }
#validation p, #about p { max-width: 75ch; }

.limits { padding-left: 1.2rem; max-width: 80ch; }
.limits li { margin-bottom: 0.6rem; }
.footer { padding-top: 3rem; padding-bottom: 2rem; border-top: 1px solid var(--border); margin-top: 3.5rem; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-model model-viewer { height: 300px; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .pipeline li:nth-child(2)::after { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .hero { padding: 2rem 0 1.75rem; }
  main > section { padding-top: 2.5rem; }
  .pipeline { grid-template-columns: 1fr; gap: 1.6rem; }
  .pipeline li:not(:last-child)::after, .pipeline li:nth-child(2)::after {
    display: block; content: "\2193"; right: auto; left: 50%; top: auto; bottom: -1.45rem; transform: translateX(-50%);
  }
  .metrics { grid-template-columns: 1fr 1fr; }
  .charts { grid-template-columns: 1fr; }
  .viewer model-viewer { height: 240px; }
  #phase3 th:nth-child(3), #phase3 td:nth-child(3),
  #phase3 th:nth-child(4), #phase3 td:nth-child(4) { display: none; }
}
