/* gnomevoice.org — SPDX-License-Identifier: GPL-3.0-or-later */
:root {
  --bg: #fafafb;
  --surface: #ffffff;
  --surface-2: #f2f2f5;
  --fg: #1f1f23;
  --muted: #5e5c64;
  --line: #deddda;
  --accent: #1c71d8;
  --accent-soft: #e3eefc;
  --accent-fg: #ffffff;
  --rec: #e01b24;
  --code-bg: #f4f4f6;
  --radius: 14px;
  --font: "Cantarell", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Source Code Pro", "DejaVu Sans Mono", ui-monospace, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1d20;
    --surface: #262629;
    --surface-2: #2e2e32;
    --fg: #f1f1f3;
    --muted: #a8a7ad;
    --line: #3a3a3f;
    --accent: #78aeed;
    --accent-soft: #233650;
    --accent-fg: #0b1726;
    --rec: #ff7b63;
    --code-bg: #18181b;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--fg); text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--rec); display: grid; place-items: center;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--rec) 22%, transparent);
}
.brand-mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.site-nav { display: flex; gap: 18px; margin-left: auto; font-size: 15px; overflow-x: auto; }
.site-nav a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--fg); }

/* Hero */
.hero { padding: 72px 0 56px; }
.hero h1 { font-size: clamp(40px, 7vw, 64px); line-height: 1.05; margin: 0 0 16px; letter-spacing: -0.02em; }
.hero .lede { font-size: clamp(19px, 2.4vw, 22px); color: var(--muted); max-width: 640px; margin: 0 0 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: 16px;
  text-decoration: none; border: 1px solid var(--line); color: var(--fg); background: var(--surface);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn:hover { filter: brightness(1.05); }

/* Sections */
section { padding: 48px 0; border-top: 1px solid var(--line); }
section > .wrap > h2, .doc h2 { font-size: 30px; line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.01em; }
.section-lede { color: var(--muted); margin: 0 0 28px; max-width: 680px; }
h3 { font-size: 20px; margin: 28px 0 8px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 8px;
}
.card h3 { margin: 0; font-size: 21px; }
.card .tag { font-size: 13px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.card p { margin: 0; color: var(--muted); font-size: 16px; }
.card .meta { font-size: 14px; color: var(--muted); }
.card .btn { align-self: flex-start; margin-top: auto; }
.card.new { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; counter-increment: step; }
.steps li::before {
  content: counter(step); display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: 10px;
}
.steps strong { display: block; font-size: 19px; margin-bottom: 4px; }
.steps span { color: var(--muted); font-size: 16px; }

/* Code */
code, pre { font-family: var(--mono); font-size: 14.5px; }
:not(pre) > code { background: var(--code-bg); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); }
pre {
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; overflow-x: auto; line-height: 1.5; margin: 12px 0 20px;
}
.tabs h3 { margin-top: 24px; }

/* Thesis */
.thesis { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 760px) { .thesis { grid-template-columns: 1.4fr 1fr; } }
.thesis dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 16px; }
.thesis dt { color: var(--muted); }
.thesis dd { margin: 0; }

/* Tables */
table { border-collapse: collapse; width: 100%; font-size: 15.5px; margin: 12px 0 20px; display: block; overflow-x: auto; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 700; white-space: nowrap; }

/* Spec document */
.doc { padding: 48px 0 64px; }
.doc h1 { font-size: clamp(34px, 5vw, 46px); line-height: 1.1; margin: 0 0 8px; letter-spacing: -0.02em; }
.doc h2 { margin-top: 44px; padding-top: 12px; border-top: 1px solid var(--line); }
.doc h2 .num, .doc h3 .num { color: var(--muted); margin-right: 8px; font-weight: 400; }
.doc-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: 15.5px; color: var(--muted); margin: 20px 0; }
.doc-meta dd { margin: 0; color: var(--fg); }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 24px 0; }
.toc ol { margin: 6px 0 0; padding-left: 22px; columns: 2 240px; }
.note { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 16px 0; }
.must { font-variant: small-caps; font-weight: 700; letter-spacing: .03em; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .site-header .wrap { gap: 14px; }
  .brand-text { display: none; }
  .site-nav { gap: 16px; font-size: 15px; }
  .hero { padding: 48px 0 40px; }
}
