:root {
  color-scheme: light;
  --ink: #20211f;
  --muted: #666a64;
  --paper: #f7f7f4;
  --surface: #fff;
  --line: #dedfd9;
  --green: #185944;
  --green-soft: #edf4f0;
  --red: #9b3030;
  --red-soft: #f9e9e8;
  --amber: #785c15;
  --amber-soft: #fff1c5;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

header, main, footer { width: min(920px, calc(100% - 2rem)); margin-inline: auto; }
header { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
header nav a { color: var(--ink); font-size: .9rem; text-decoration: none; }
header nav a:hover { text-decoration: underline; }
a { color: var(--green); text-underline-offset: .16em; }
.brand { color: var(--ink); font-size: 1.08rem; font-weight: 750; text-decoration: none; }
.language-link { color: var(--muted); }
.skip-link { position: absolute; top: -5rem; left: 1rem; z-index: 10; padding: .7rem 1rem; background: var(--ink); color: white; }
.skip-link:focus { top: 1rem; }
.section-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; }
h1 { max-width: 30ch; margin: 0 0 .8rem; font-size: clamp(1.8rem, 3vw, 2.25rem); }
h2 { margin: 2rem 0 .65rem; font-size: clamp(1.25rem, 2.5vw, 1.55rem); }
h3 { font-size: 1.15rem; }
.lede { max-width: 68ch; color: var(--muted); font-size: 1.08rem; }
.hero, .hero.narrow, .page-intro, .reference-header { max-width: 760px; min-height: 0; display: block; padding: 2.25rem 0 1.5rem; }
.hero > div { max-width: none; }
.hero h1, .reference-header h1, .page-intro h1 { max-width: 26ch; }
.hero .actions { margin-top: 1.25rem; }

.panel, .prose, .article-card, .split-section article { background: transparent; border: 0; box-shadow: none; }
.panel { padding: 0; }
.prose { max-width: 760px; margin: 2.25rem 0 5rem; padding: 0; }
.prose.compact { margin-top: 2.25rem; }
.prose h1 { font-size: clamp(1.8rem, 3vw, 2.25rem); }
.prose h2 { margin-top: 2.4rem; }
.prose dt { font-weight: 700; }
.prose dd { margin: 0 0 .8rem; }
.prose li { margin: .4rem 0; }
.breadcrumbs { margin-bottom: 1.5rem; color: var(--muted); font-size: .88rem; }

label { display: block; margin: 0 0 .45rem; font-weight: 700; }
input[type=file] { width: 100%; padding: 1rem; border: 1px solid var(--line); background: var(--surface); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1rem; }
.button { appearance: none; display: inline-block; padding: .7rem 1rem; border: 1px solid var(--ink); border-radius: 2px; background: var(--ink); color: white; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; }
.button:hover { background: var(--green); border-color: var(--green); }
.button.secondary { background: transparent; color: var(--ink); }
.button:focus-visible, a:focus-visible, input:focus-visible, .text-button:focus-visible { outline: 3px solid #efb62c; outline-offset: 3px; }

.home-intro { padding: 2.25rem 0; }
.home-intro h1 { max-width: 22ch; margin-bottom: .9rem; font-size: clamp(2rem, 4vw, 2.75rem); }
.home-intro p { max-width: 72ch; margin: 0; color: var(--muted); font-size: 1.08rem; }
.validator-panel { max-width: 760px; scroll-margin-top: 1rem; }
.validator-panel form { padding: 1.25rem; background: var(--surface); }
.file-field { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: .25rem 1rem; margin: 0; }
.file-field small { color: var(--muted); font-weight: 400; }
.file-field input { grid-column: 1 / -1; margin-top: .45rem; }
.example-actions { display: flex; flex-wrap: wrap; gap: .35rem .75rem; color: var(--muted); font-size: .88rem; }
.text-button { appearance: none; padding: 0; border: 0; background: transparent; color: var(--green); font: inherit; text-decoration: underline; text-underline-offset: .16em; cursor: pointer; }
.form-help { max-width: 76ch; margin: 1rem 0 0; color: var(--muted); font-size: .8rem; }
#progress { margin-bottom: 0; }

.result { margin-top: 1.5rem; padding: 1.25rem; background: var(--surface); }
.result.pass h3 { color: var(--green); }
.result.fail h3 { color: var(--red); }
.summary { display: flex; flex-wrap: wrap; gap: .6rem; padding: 0; list-style: none; }
.summary li { padding: .35rem .6rem; background: var(--paper); }
.findings { display: grid; gap: .75rem; padding: 0; list-style: none; }
.finding { padding: 1rem; background: var(--paper); }
.finding code { overflow-wrap: anywhere; }
.finding-location { color: var(--muted); font-size: .88rem; }
.finding-location strong { color: var(--ink); }
.result-cta { margin-top: 1.5rem; color: var(--muted); font-size: .9rem; }
.result-cta h4 { margin-bottom: .2rem; color: var(--ink); }
.result-cta p { margin: 0 0 .7rem; }
.result-cta .button { padding: 0; border: 0; color: var(--green); text-decoration: underline; }
.badge { display: inline-block; padding: .12rem .45rem; border-radius: 999px; font-size: .68rem; font-weight: 750; text-transform: uppercase; }
.badge.error { color: var(--red); background: var(--red-soft); }
.badge.warning { color: var(--amber); background: var(--amber-soft); }

.home-details { max-width: 760px; padding: 1.5rem 0 4rem; }
.home-details h2 { margin-top: 1.5rem; font-size: 1.12rem; }
.semantic-proof { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(18rem, .85fr); gap: 2rem; max-width: 760px; margin-top: 3rem; }
.semantic-proof h2 { margin: 0 0 .6rem; font-size: 1.3rem; }
.semantic-proof p { margin-bottom: 0; }
.proof-results { display: grid; align-content: start; }
.proof-result { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; padding: .8rem 0; border-top: 1px solid var(--line); }
.proof-result:last-child { border-bottom: 1px solid var(--line); }
.proof-result span { color: var(--muted); }
.proof-result.pass strong { color: var(--green); }
.proof-result.fail strong { color: var(--red); }
.proof-result a, .proof-result small { grid-column: 1 / -1; }
.proof-result small { color: var(--muted); }
.link-list { padding-left: 1.2rem; }
.link-list li { margin: .3rem 0; }
.small-note { margin-top: 2rem; color: var(--muted); font-size: .88rem; }

.table-scroll { max-width: 100%; overflow-x: auto; }
.rule-table, .comparison-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.rule-table th, .rule-table td, .comparison-table th, .comparison-table td { padding: .75rem .6rem; text-align: left; vertical-align: top; }
.rule-table thead th, .comparison-table thead th { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.rule-table tbody tr:nth-child(odd), .comparison-table tbody tr:nth-child(odd) { background: rgb(255 255 255 / 55%); }
.rule-table td:nth-child(1) { width: 7rem; }
.rule-table td:nth-child(2) { width: 38%; }
.rule-table td:nth-child(3) { width: 20%; color: var(--muted); }
.rule-table td:nth-child(4) { color: var(--muted); }
.rule-table a { display: block; color: var(--ink); font-weight: 650; text-decoration: none; }
.rule-table a:hover { text-decoration: underline; }
.rule-id { display: block; margin-top: .15rem; color: var(--muted); font-size: .72rem; }

.product-sheet { max-width: 760px; margin: 0 0 5rem; }
.product-facts { margin: .5rem 0 2.5rem; }
.product-facts div { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; padding: .5rem 0; }
.product-facts dt { color: var(--muted); font-weight: 650; }
.product-facts dd { margin: 0; }
.manual-section { margin-top: 2.5rem; }
.manual-section h2 { margin-bottom: .7rem; }
.manual-section p { max-width: 68ch; }
.manual-section pre { margin: .8rem 0 1rem; }
.comparison-table th:first-child { width: 22%; }
.compact-list { padding-left: 1.25rem; }
.contact-row { margin-top: 2.5rem; }
.contact-row p { color: var(--muted); }

.plain-columns, .split-section { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.5rem; padding-bottom: 4rem; }
.page-tail { padding-top: 2.5rem; }
.article-grid { display: grid; gap: 0; max-width: 760px; padding-bottom: 4rem; }
.article-card { padding: .75rem 0; }
.article-card h2 { margin: 0 0 .25rem; font-size: 1.15rem; }
.article-card p { margin: 0; color: var(--muted); }
.article-card h2 a { color: var(--ink); }
.inline-cta { margin-top: 2.5rem; }
.inline-cta h2 { font-size: 1.15rem; }
.comparison { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 1rem; margin: 1.5rem 0 2rem; padding: 1rem; background: var(--surface); }
.comparison h2 { margin: 0; font-size: 1.15rem; }
.comparison-result { display: flex; flex-direction: column; }
.comparison-result span, .comparison-result small { color: var(--muted); }
.comparison-result.pass strong { color: var(--green); }
.comparison-result.fail strong { color: var(--red); }
.checklist { padding-left: 1.25rem; }
pre { max-width: 100%; overflow-x: auto; padding: 1rem; border-radius: 2px; background: #17241d; color: #e6f4eb; font-size: .88rem; }
code { overflow-wrap: anywhere; }
.notice { padding: .8rem 1rem; background: #fff6d9; }
.release { margin-bottom: 2rem; }
.status-banner { margin-bottom: 2rem; padding: 1rem; background: #fff6d9; }

footer { display: flex; justify-content: space-between; gap: 2rem; padding: 2rem 0 3.5rem; color: var(--muted); font-size: .88rem; }
footer p { max-width: 52ch; }

@media (max-width: 700px) {
  header { align-items: flex-start; padding: .9rem 0; }
  header nav { justify-content: flex-end; gap: .4rem .8rem; }
  .home-intro, .hero, .hero.narrow, .page-intro, .reference-header { padding-top: 2rem; }
  .prose, .prose.compact { margin-top: 2rem; }
  .file-field { grid-template-columns: 1fr; }
  .file-field input { grid-column: 1; }
  .validator-panel .button { width: 100%; }
  .example-actions > span { flex-basis: 100%; }
  .plain-columns, .split-section { grid-template-columns: 1fr; gap: 1rem; }
  .semantic-proof { grid-template-columns: 1fr; gap: 1.25rem; }
  .comparison { grid-template-columns: 1fr 1fr; }
  .comparison-label { grid-column: 1 / -1; }
  .product-facts div { grid-template-columns: 6rem 1fr; }
  .rule-table th:nth-child(3), .rule-table td:nth-child(3), .rule-table th:nth-child(4), .rule-table td:nth-child(4) { display: none; }
  .rule-table td:nth-child(1) { width: 5.5rem; }
  .rule-table td:nth-child(2) { width: auto; }
  footer { flex-direction: column; }
}
