/* SPDX-License-Identifier: GPL-3.0-or-later */
/* System fonts only (PRD-R74). Light and dark via prefers-color-scheme. Contrast checked for WCAG AA. */
:root {
  color-scheme: light dark;
  --bg: #faf8f4;
  --surface: #f1eee6;
  --ink: #1d1c1a;
  --muted: #5a5850;
  --line: #d9d4c6;
  --accent: #1f6f54;
  --accent-ink: #ffffff;
  --link: #1a6a4f;
  --ok: #1a6a4f;
  --warn: #7f5200;
  --bad: #a03524;
  --focus: #1f6f54;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141513;
    --surface: #1d1f1b;
    --ink: #ecebe6;
    --muted: #b0aea4;
    --line: #35362f;
    --accent: #6fcfa6;
    --accent-ink: #0d1a13;
    --link: #7fd9b2;
    --ok: #7fd9b2;
    --warn: #e5b960;
    --bad: #f39a8b;
    --focus: #7fd9b2;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 1.0625rem/1.65 var(--font-body);
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; padding-block: 2.5rem 4rem; }
.wrap { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.5vw + 0.5rem, 3.25rem); margin: 0 0 1rem; }
h2 { font-size: clamp(1.5rem, 2vw + 0.8rem, 2rem); margin: 3rem 0 0.75rem; }
h3 { font-size: 1.25rem; margin: 2rem 0 0.5rem; }
p, ul, ol, dl, pre, table, details { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; }
li + li { margin-top: 0.3rem; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 0.07em; }
a:hover { text-decoration-thickness: 0.14em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
code, pre, kbd { font-family: var(--font-mono); font-size: 0.92em; font-variant-ligatures: none; }
code { background: var(--surface); padding: 0.1em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }
pre { background: var(--surface); padding: 1rem; border-radius: 8px; overflow-x: auto; border: 1px solid var(--line); }
pre code { background: none; padding: 0; }
kbd { background: var(--surface); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0.05em 0.4em; }
.muted { color: var(--muted); }
.lede { font-size: 1.25rem; color: var(--muted); max-width: 40rem; }
.prose { max-width: 42rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 0.6rem 1rem; z-index: 10; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* Header and footer */
/* Incident or absence notice (site/config.json banner, QA-R38, QA-R54). */
.site-notice { background: var(--surface); border-bottom: 3px solid var(--warn); }
.site-notice p { margin: 0; padding: 0.7rem 0; font-weight: 600; }
.site-header { border-bottom: 1px solid var(--line); }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; padding-block: 0.9rem; }
.brand { font-family: var(--font-head); font-size: 1.35rem; font-weight: 700; color: var(--ink); text-decoration: none; margin-right: auto; }
/* Header logo: the app icon (scripts/make-app-icon.py, CLR-R7), decorative next to the product name. */
.brand { display: inline-flex; align-items: center; gap: 0.5rem; }
.brand::before { content: ""; flex: none; width: 2rem; height: 2rem; background: url("/assets/brand/app-icon-64.png") center / contain no-repeat; background-image: image-set(url("/assets/brand/app-icon-64.png") 1x, url("/assets/brand/app-icon-128.png") 2x); }
.site-header nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; list-style: none; margin: 0; padding: 0; }
/* Flex rows: the generic `li + li` spacing would push every item after the first down. */
.site-header nav li, .site-footer li { margin: 0; }
.site-header nav a { color: var(--ink); text-decoration: none; padding: 0.3rem 0; border-bottom: 2px solid transparent; }
.site-header nav a:hover { border-bottom-color: var(--line); }
.site-header nav a[aria-current="page"] { border-bottom-color: var(--accent); font-weight: 600; }
.lang-switch { font-size: 0.95rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.15rem 0.8rem; color: var(--ink); text-decoration: none; }
.lang-switch:hover { border-color: var(--accent); }
.site-footer { border-top: 1px solid var(--line); padding-block: 2rem; font-size: 0.95rem; color: var(--muted); }
.site-footer p { margin-bottom: 0.4rem; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; list-style: none; padding: 0; margin: 0.8rem 0 0; }
.site-footer a { color: var(--muted); }

/* Hero */
.hero { display: grid; gap: 2rem; padding-block: 1.5rem 1rem; }
@media (min-width: 52rem) { .hero { grid-template-columns: 1.15fr 1fr; align-items: center; } }
.typed { font-family: var(--font-mono); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem 1.5rem; }
.typed p { margin: 0.25rem 0; font-size: 1.15rem; }
.typed .arrow { color: var(--muted); }
.typed .out { font-family: var(--font-body); font-size: 1.6rem; font-weight: 600; }
.typed .cap { font-family: var(--font-body); font-size: 0.85rem; color: var(--muted); margin-top: 0.75rem; }

/* Buttons and command line */
.btn { display: inline-flex; flex-direction: column; gap: 0.1rem; background: var(--accent); color: var(--accent-ink); text-decoration: none; padding: 0.8rem 1.4rem; border-radius: 10px; font-weight: 600; }
.btn small { font-weight: 400; opacity: 0.92; }
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn-disabled { background: var(--surface); color: var(--muted); border: 1px dashed var(--line); cursor: default; }
.btn-disabled:hover { filter: none; }
.cmd { display: block; user-select: all; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.9rem; max-width: 100%; overflow-x: auto; white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-block: 1.25rem; }

/* Sections */
.proof { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin-block: 2rem; padding: 0; list-style: none; }
.proof li { border-top: 3px solid var(--accent); padding-top: 0.8rem; margin: 0; }
.proof h3 { margin: 0 0 0.3rem; font-size: 1.15rem; }
.proof p { margin: 0; color: var(--muted); }
.demo-slot { border: 2px dashed var(--line); border-radius: 12px; aspect-ratio: 16 / 9; max-width: 44rem; display: grid; place-items: center; text-align: center; padding: 1rem; color: var(--muted); background: var(--surface); margin: 0 0 1rem; }
video { width: 100%; max-width: 44rem; border-radius: 12px; border: 1px solid var(--line); }
figure { margin: 0 0 1.5rem; }
figcaption { font-size: 0.92rem; color: var(--muted); margin-top: 0.4rem; }
.callout { border-left: 4px solid var(--accent); background: var(--surface); padding: 0.9rem 1.1rem; border-radius: 0 8px 8px 0; margin-block: 1.25rem; }
.callout p:last-child { margin-bottom: 0; }
.callout.warn { border-left-color: var(--warn); }
.verify { display: inline-block; font: 600 0.7rem/1 var(--font-mono); letter-spacing: 0.04em; color: var(--warn); border: 1px solid var(--warn); border-radius: 4px; padding: 0.15rem 0.35rem; vertical-align: 0.15em; margin-inline: 0.15rem; }
.cards { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); list-style: none; padding: 0; }
.cards li { margin: 0; }
.cards a { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 0.9rem 1rem; text-decoration: none; color: var(--ink); height: 100%; }
.cards a:hover { border-color: var(--accent); }
.cards strong { display: block; }
.cards span { color: var(--muted); font-size: 0.92rem; }
.toc { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; list-style: none; padding: 0; }
.steps { padding-left: 1.5rem; }
.steps li { margin-bottom: 0.6rem; }
details { border: 1px solid var(--line); border-radius: 8px; padding: 0.2rem 1rem; }
details[open] { padding-bottom: 0.6rem; }
summary { cursor: pointer; font-weight: 600; padding: 0.6rem 0; }
summary:focus-visible { outline-offset: 0; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.25rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.release { border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem 1.5rem; margin-block: 1rem; }
.release h3 { margin-top: 0; }

/* Tables */
.table-wrap { overflow-x: auto; margin-bottom: 1.5rem; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 0.97rem; margin: 0; }
caption { text-align: left; padding: 0.7rem 0.9rem; font-weight: 600; font-family: var(--font-head); font-size: 1.15rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.9rem; border-top: 1px solid var(--line); }
thead th { border-top: 0; background: var(--surface); font-weight: 600; white-space: nowrap; }
tbody tr:first-child td, tbody tr:first-child th { border-top: 1px solid var(--line); }
td small, th small { display: block; color: var(--muted); font-weight: 400; }
tr[hidden], section[hidden] { display: none; }
.status { white-space: nowrap; font-weight: 600; }
.status::before { content: attr(data-icon); display: inline-block; width: 1.3em; text-align: center; margin-right: 0.15em; }
.status-works { color: var(--ok); }
.status-worksWithNotes { color: var(--warn); }
.status-notVerified { color: var(--muted); }
.status-knownLimitation { color: var(--bad); }
.legend { display: grid; gap: 0.5rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); padding: 0; list-style: none; }
.legend li { margin: 0; }
[data-matrix-filters] { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; margin-bottom: 1.25rem; }
.field { display: flex; flex-direction: column; gap: 0.25rem; }
.field label { font-size: 0.9rem; color: var(--muted); }
select { font: inherit; padding: 0.45rem 0.7rem; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); min-width: 12rem; }

/* Donate */
.qr-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin-block: 1.5rem; }
.qr-card { border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem; max-width: 26rem; }
.qr-card h3 { margin-top: 0; }
.qr-card img { width: 100%; max-width: 15rem; height: auto; display: block; margin-bottom: 0.75rem; border-radius: 8px; background: #fff; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .site-header, .site-footer, .skip { display: none; } body { background: #fff; color: #000; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
