:root {
  --paper: #f4f7f9;
  --paper-strong: #ffffff;
  --ink: #111820;
  --muted: #5c6873;
  --line: #cfd9e2;
  --line-dark: #9aabb9;
  --blue: #2f66e9;
  --blue-dark: #1746ad;
  --blue-pale: #e9f0ff;
  --copper: #e27d43;
  --teal: #187f74;
  --teal-pale: #e4f4f0;
  --amber: #a8660b;
  --amber-pale: #fff1d6;
  --red: #b8443d;
  --red-pale: #fbe9e7;
  --shadow: 0 18px 55px rgba(25, 44, 62, .09);
  --radius: 18px;
  --font-display: "Bahnschrift SemiCondensed", "Arial Narrow", "Segoe UI", sans-serif;
  --font-body: "Segoe UI Variable Text", "Segoe UI", sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    linear-gradient(rgba(47,102,233,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47,102,233,.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
}
a { color: var(--blue-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue); }
button, input, select, textarea { font: inherit; }
button, a, summary, [role="button"] { -webkit-tap-highlight-color: rgba(47,102,233,.14); touch-action: manipulation; }
img, svg { max-width: 100%; }

.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: white; padding: 10px 14px; }
.skip-link:focus { top: 12px; }
.shell { width: min(calc(100% - 36px), var(--max)); margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid rgba(154,171,185,.65); background: rgba(244,247,249,.92); backdrop-filter: blur(15px); }
.header-inner { min-height: 72px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 19px/1 var(--font-display); letter-spacing: .02em; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; background: var(--ink); color: white; border-radius: 7px; font: 700 15px/1 var(--font-mono); box-shadow: inset -5px -5px 0 var(--blue); }
.primary-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.primary-nav a, .nav-toggle { color: var(--ink); text-decoration: none; padding: 10px 11px; border-radius: 8px; font-size: 14px; border: 0; background: transparent; cursor: pointer; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { background: var(--blue-pale); color: var(--blue-dark); }
.nav-group { position: relative; }
.nav-group > summary { list-style: none; cursor: pointer; padding: 10px 11px; border-radius: 8px; font-size: 14px; }
.nav-group > summary::-webkit-details-marker { display:none; }
.nav-group[open] > summary, .nav-group > summary:hover { background: var(--blue-pale); }
.nav-menu { position: absolute; min-width: 218px; top: 44px; left: 0; padding: 8px; display: grid; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.header-cta, .button { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; padding: 10px 16px; border: 1px solid var(--ink); border-radius: 8px; background: var(--ink); color: white; text-decoration: none; font-weight: 700; cursor: pointer; }
.header-cta:hover, .button:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: white; }
.button.secondary { background: transparent; color: var(--ink); border-color: var(--line-dark); }
.button.secondary:hover { background: white; color: var(--blue-dark); border-color: var(--blue); }
.button.small { min-height: 36px; padding: 7px 11px; font-size: 13px; }
.nav-toggle { display: none; font-size: 22px; }

.hero { padding: 64px 0 36px; }
.hero-grid { display: grid; grid-template-columns: minmax(0,1.18fr) minmax(340px,.82fr); gap: 42px; align-items: start; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; color: var(--blue-dark); font: 700 12px/1.2 var(--font-mono); letter-spacing: .11em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--copper); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.05; letter-spacing: -.025em; }
h1, h2, h3 { text-wrap: balance; scroll-margin-top: 92px; }
h1 { max-width: 850px; margin: 0; font-size: clamp(46px, 6.2vw, 82px); font-weight: 760; }
h2 { margin: 0 0 16px; font-size: clamp(30px, 4vw, 48px); }
h3 { margin: 0 0 10px; font-size: 23px; }
.lead { max-width: 760px; margin: 24px 0; color: #34414d; font-size: clamp(18px, 2.2vw, 22px); }
.hero-actions, .inline-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.result-actions { margin-top: 18px; }
.spaced-callout { margin-top: 18px; }
.spaced-callout-lg { margin-top: 22px; }
.stack-card { margin-top: 18px; }
.tool-title { font-size: 34px; }
.quick-result { margin-top: 18px; }
.boundary-note { margin-top: 26px; padding: 14px 16px; border-left: 3px solid var(--copper); background: rgba(255,255,255,.72); color: #384651; }
.boundary-note strong { color: var(--ink); }

.test-bench { position: relative; padding: 24px; background: var(--ink); color: white; border-radius: 4px 24px 4px 24px; box-shadow: var(--shadow); overflow: hidden; }
.test-bench::after { content: "EVIDENCE / 08.11"; position: absolute; right: -44px; top: 76px; transform: rotate(90deg); color: rgba(255,255,255,.22); font: 700 11px/1 var(--font-mono); letter-spacing: .16em; }
.bench-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.bench-head span { font: 700 12px/1 var(--font-mono); letter-spacing: .1em; color: #b8c9d8; }
.status-light { width: 9px; height: 9px; border-radius: 50%; background: var(--copper); box-shadow: 0 0 0 5px rgba(226,125,67,.17); }
.test-bench label { color: #c7d2dc; }
.test-bench select, .test-bench input { background: #1c2731; border-color: #40505f; color: white; }
.test-bench .button { width: 100%; background: var(--copper); color: #1d120c; border-color: var(--copper); }
.test-bench .button:hover { background: #ffab78; }

.page-hero { padding: 54px 0 28px; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(42px, 5.5vw, 68px); }
.page-hero .lead { max-width: 850px; }
.breadcrumbs { margin-bottom: 18px; font-size: 13px; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.verified-date { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; background: white; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font: 600 12px/1 var(--font-mono); }
.verified-date::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }

.section { padding: 54px 0; }
.section.compact { padding: 34px 0; }
.section-head { max-width: 760px; margin-bottom: 28px; }
.section-head p { color: var(--muted); font-size: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.grid-2 > *, .grid-3 > *, .tool-layout > * { min-width: 0; }
.card { position: relative; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.84); box-shadow: 0 5px 22px rgba(25,44,62,.045); }
.card:hover { border-color: var(--line-dark); }
.card p:last-child { margin-bottom: 0; }
.card .kicker { color: var(--blue-dark); font: 700 11px/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.card-link { color: inherit; text-decoration: none; }
.card-link::after { content: "↗"; position: absolute; top: 20px; right: 22px; color: var(--blue); font-size: 18px; }
.metric { font: 700 clamp(31px,4vw,48px)/1 var(--font-display); }
.metric-label { color: var(--muted); font-size: 13px; }
.callout { padding: 20px 22px; border: 1px solid var(--line); border-left: 4px solid var(--blue); background: white; border-radius: 4px 14px 14px 4px; }
.callout.warning { border-left-color: var(--amber); background: var(--amber-pale); }
.callout.danger { border-left-color: var(--red); background: var(--red-pale); }

.tool-layout { display: grid; grid-template-columns: minmax(300px,.8fr) minmax(0,1.2fr); gap: 26px; align-items: start; }
.tool-panel { padding: 24px; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.tool-panel.sticky { position: sticky; top: 94px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
label { color: #3d4b57; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 48px; padding: 9px 11px; color: var(--ink); background: white; border: 1px solid var(--line-dark); border-radius: 7px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--blue); outline: 3px solid rgba(47,102,233,.28); outline-offset: 1px; }
button:focus-visible, a:focus-visible, summary:focus-visible, [role="button"]:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
textarea { min-height: 150px; resize: vertical; font-family: var(--font-mono); font-size: 13px; }
.field-help { color: var(--muted); font-size: 12px; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; margin-top: 5px; }
.result-zone { min-height: 340px; scroll-margin-top: 92px; }
.result-empty { height: 100%; min-height: 340px; display: grid; place-items: center; padding: 30px; border: 1px dashed var(--line-dark); border-radius: var(--radius); color: var(--muted); text-align: center; background: rgba(255,255,255,.45); }
.evidence-card { position: relative; overflow: hidden; padding: 26px 26px 26px 38px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.evidence-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 9px; background: var(--blue); }
.evidence-card[data-level="A_benchmark"]::before, .evidence-card[data-level="A_fact"]::before { background: var(--teal); }
.evidence-card[data-level="A_claim"]::before, .evidence-card[data-level="C_estimated"]::before { background: var(--amber); }
.evidence-card[data-level="B_reproduced"]::before { background: var(--blue); }
.evidence-card[data-level="B_reported"]::before { background: var(--copper); }
.evidence-card[data-level="unknown"]::before { background: var(--line-dark); }
.evidence-badge { display: inline-flex; padding: 6px 9px; border-radius: 999px; background: var(--blue-pale); color: var(--blue-dark); font: 700 11px/1 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
.evidence-card[data-level="A_benchmark"] .evidence-badge, .evidence-card[data-level="A_fact"] .evidence-badge { background: var(--teal-pale); color: #0a625a; }
.evidence-card[data-level="A_claim"] .evidence-badge, .evidence-card[data-level="C_estimated"] .evidence-badge { background: var(--amber-pale); color: #7c4b08; }
.evidence-card[data-level="B_reported"] .evidence-badge { background: #ffeadf; color: #8e3d16; }
.evidence-card[data-level="unknown"] .evidence-badge { background: #edf0f2; color: #53606b; }
.result-title { margin: 15px 0 8px; font-size: 32px; }
.result-summary { font-size: 17px; color: #364551; }
.evidence-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; margin: 22px 0; background: var(--line); border: 1px solid var(--line); }
.evidence-grid > div { padding: 13px; background: white; }
.evidence-grid dt { margin-bottom: 3px; color: var(--muted); font: 600 10px/1.2 var(--font-mono); text-transform: uppercase; }
.evidence-grid dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.evidence-grid dd, .metric, .evidence-table td { font-variant-numeric: tabular-nums; }
.next-actions { padding-top: 18px; border-top: 1px solid var(--line); }
.plain-list { padding-left: 20px; }
.plain-list li { margin-bottom: 8px; }
.check-list { list-style: none; padding: 0; margin: 18px 0; }
.check-list li { position: relative; padding: 10px 0 10px 31px; border-bottom: 1px solid var(--line); }
.check-list li::before { content: "✓"; position: absolute; left: 3px; color: var(--teal); font-weight: 800; }
.file-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.file-row code, code { font-family: var(--font-mono); font-size: .88em; overflow-wrap: anywhere; }
.path { display: block; margin-top: 4px; color: var(--muted); font: 12px/1.4 var(--font-mono); }
.drop-zone { padding: 32px 18px; border: 2px dashed var(--line-dark); border-radius: 12px; text-align: center; background: var(--paper); cursor: pointer; }
.drop-zone.drag { border-color: var(--blue); background: var(--blue-pale); }

.evidence-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: white; }
.evidence-table { width: 100%; border-collapse: collapse; min-width: 920px; }
.evidence-table th, .evidence-table td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.evidence-table th { position: sticky; top: 72px; background: #edf2f6; color: #41505c; font: 700 11px/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: .04em; }
.evidence-table td { font-size: 13px; }
.evidence-table tr:last-child td { border-bottom: 0; }
.table-filters { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.table-note { margin-top: 12px; color: var(--muted); font-size: 13px; }
.tag { display: inline-flex; padding: 4px 7px; border-radius: 999px; background: #edf2f6; font: 700 10px/1 var(--font-mono); }
.source-list { display: grid; gap: 8px; }
.source-list a { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.source-list a::after { content: "↗"; }

.steps { counter-reset: step; display: grid; gap: 16px; }
.step { position: relative; padding: 22px 22px 22px 70px; background: white; border: 1px solid var(--line); border-radius: 13px; }
.step::before { counter-increment: step; content: "0" counter(step); position: absolute; left: 19px; top: 22px; color: var(--blue); font: 800 18px/1 var(--font-mono); }
.folder-tree { padding: 18px; background: var(--ink); color: #dce7ef; border-radius: 12px; overflow: auto; font: 13px/1.7 var(--font-mono); white-space: pre; }
.mini-lab { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 28px 0; border: 1px solid var(--line); background: white; }
.mini-lab > div { padding: 18px; border-right: 1px solid var(--line); }
.mini-lab > div:last-child { border-right: 0; }
.mini-lab span { display: block; color: var(--muted); font: 700 10px/1.3 var(--font-mono); text-transform: uppercase; }
.mini-lab strong { display: block; margin-top: 6px; font: 750 24px/1.15 var(--font-display); }

.site-footer { margin-top: 52px; padding: 48px 0 24px; background: var(--ink); color: #c9d4dd; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(4,1fr); gap: 30px; }
.footer-brand p { max-width: 300px; color: #9fb0be; font-size: 13px; }
.footer-brand .brand { color: white; }
.footer-group h3, .footer-heading { margin: 0 0 12px; color: white; font: 700 13px/1.2 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; }
.footer-group a { display: block; margin: 8px 0; color: #c9d4dd; text-decoration: none; font-size: 13px; }
.footer-group a:hover { color: white; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 38px; padding-top: 20px; border-top: 1px solid #35424d; color: #91a2b0; font-size: 12px; }

.prose { max-width: 790px; }
.prose p, .prose li { color: #34424d; }
.prose h2 { margin-top: 50px; }
.prose h3 { margin-top: 32px; }
.prose table { width: 100%; border-collapse: collapse; background: white; }
.prose th, .prose td { padding: 12px; border: 1px solid var(--line); text-align: left; }
.visually-hidden { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; margin: -1px!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; border: 0!important; }
[hidden] { display: none !important; }

@media (max-width: 920px) {
  .hero-grid, .tool-layout { grid-template-columns: 1fr; }
  .test-bench { max-width: 620px; }
  .tool-panel.sticky { position: static; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
  .footer-brand { grid-row: span 2; }
  .table-filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .shell { width: min(calc(100% - 24px), var(--max)); }
  .header-inner { min-height: 62px; gap: 10px; }
  .brand span:last-child { display: none; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .primary-nav { display: none; position: absolute; inset: 62px 0 auto 0; padding: 12px; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .primary-nav.open { display: grid; }
  .nav-group > summary { padding: 12px; }
  .nav-menu { position: static; box-shadow: none; margin: 4px 0 8px; }
  .nav-toggle { min-width: 48px; min-height: 48px; }
  .header-cta { min-height: 48px; padding: 8px 10px; font-size: 12px; }
  .primary-nav a, .nav-group > summary { min-height: 48px; display: flex; align-items: center; }
  .button.small { min-height: 44px; }
  .hero { padding-top: 40px; }
  h1 { font-size: clamp(42px,13vw,62px); }
  .grid-2, .grid-3, .form-grid, .mini-lab { grid-template-columns: 1fr; }
  .mini-lab > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .mini-lab > div:last-child { border-bottom: 0; }
  .evidence-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1/-1; grid-row: auto; }
  .footer-bottom { display: grid; }
  .section { padding: 42px 0; }
  .table-filters { grid-template-columns: 1fr; }
  .step { padding-left: 58px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms!important; animation-iteration-count: 1!important; transition-duration: .01ms!important; }
}
