:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6b6862;
  --rule: #e3e0da;
  --accent: #2447cc;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171614;
    --surface: #201f1c;
    --text: #eceae5;
    --muted: #9c9891;
    --rule: #33312d;
    --accent: #8ba3ff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.62 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  padding: 0 20px 90px;
}
.wrap { max-width: 720px; margin: 0 auto; }

header { padding: 54px 0 24px; border-bottom: 2px solid var(--text); margin-bottom: 30px; }
.mark {
  display: inline-block; font-weight: 700; letter-spacing: -0.01em;
  font-size: 14px; color: var(--accent); text-decoration: none; margin-bottom: 16px;
}
h1 { font-size: 30px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 4px; font-weight: 700; }
.sub { font-size: 17px; color: var(--muted); margin: 0 0 18px; }

.meta { margin: 0; font-size: 14px; color: var(--muted); }
.meta div { display: flex; gap: 8px; padding: 2px 0; }
.meta dt { min-width: 122px; font-weight: 600; color: var(--text); }
.meta dd { margin: 0; }

h2 {
  font-size: 19px; line-height: 1.3; letter-spacing: -0.01em;
  margin: 40px 0 12px; font-weight: 700; scroll-margin-top: 16px;
}
h3 { font-size: 16px; margin: 24px 0 8px; font-weight: 650; }

p { margin: 0 0 12px; }
a { color: var(--accent); }

/* Numbered clauses with a hanging indent */
.c { padding-left: 2.9em; text-indent: -2.9em; margin: 0 0 11px; }
.c > b { font-weight: 600; font-variant-numeric: tabular-nums; }

ul.alpha { list-style: none; padding: 0; margin: 0 0 12px 2.9em; }
ul.alpha li { padding-left: 1.9em; text-indent: -1.9em; margin-bottom: 7px; }

nav.toc {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 12px;
  padding: 20px 24px; margin: 0 0 8px;
}
nav.toc h2 { margin: 0 0 10px; font-size: 14px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
nav.toc ol { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 32px; font-size: 14.5px; }
nav.toc li { margin-bottom: 5px; break-inside: avoid; }
nav.toc a { text-decoration: none; color: var(--text); }
nav.toc a:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 560px) { nav.toc ol { columns: 1; } }

.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 12px;
  padding: 20px 22px; margin: 0 0 18px;
}
.card p:last-child { margin-bottom: 0; }

footer {
  margin-top: 54px; padding-top: 20px; border-top: 1px solid var(--rule);
  color: var(--muted); font-size: 14px;
}
footer a { color: var(--muted); }

/* ---------- Landing page ---------- */
.hero { padding: 64px 0 8px; border: 0; margin-bottom: 0; }
.hero h1 { font-size: 46px; line-height: 1.05; letter-spacing: -0.035em; margin: 0 0 12px; }
.hero .tag { font-size: 20px; line-height: 1.45; color: var(--muted); margin: 0 0 24px; max-width: 34em; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; padding: 0; list-style: none; }
.badges li {
  font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
  border: 1px solid var(--rule); border-radius: 999px; padding: 5px 12px;
  color: var(--muted); background: var(--surface);
}

.shots {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 14px; margin: 34px -80px 10px;
}
@media (max-width: 920px) { .shots { margin-left: 0; margin-right: 0; } }
@media (max-width: 560px) { .shots { gap: 7px; } .shots figcaption { font-size: 11px; margin-top: 5px; } }
.shots figure { margin: 0; min-width: 0; }
.shots img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--rule); border-radius: 14px;
}
.shots figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; text-align: center; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 0 0 16px; }
.grid .card { margin: 0; }
.grid h3 { margin: 0 0 6px; font-size: 16px; }
.grid p { margin: 0; color: var(--muted); font-size: 15px; }

table.langs { width: 100%; border-collapse: collapse; font-size: 15px; margin: 0 0 8px; }
table.langs th, table.langs td { text-align: right; padding: 9px 8px; border-bottom: 1px solid var(--rule); }
table.langs th:first-child, table.langs td:first-child { text-align: left; font-weight: 600; }
table.langs thead th { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.langs td { font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.links { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 0; padding: 0; list-style: none; }
.links a {
  display: inline-block; text-decoration: none; font-weight: 600; font-size: 15px;
  border: 1px solid var(--rule); border-radius: 10px; padding: 10px 16px;
  background: var(--surface); color: var(--text);
}
.links a:hover { border-color: var(--accent); color: var(--accent); }
.note { font-size: 14px; color: var(--muted); }
