/*
  Styles for the static pages (/p/<product>/, /about/), written to dist/static.css by scripts/build-pages.ts.
  Same tokens as src/index.css (see DESIGN.md), as a calm reading layout with no JavaScript.
*/
@font-face {
  font-family: 'Chivo Variable';
  src: url('/fonts/chivo.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Chivo Mono Variable';
  src: url('/fonts/chivo-mono.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #f4f6f8;
  --raised: #ffffff;
  --ink: #10141a;
  --muted: #5b6573;
  --rule: #d5dbe2;
  --g0: #0c8a5e; --g1: #3949d6; --g2: #d99a0b; --g3: #7a3fd1;
  --g4: #5c8a17; --g5: #0a86b0; --g6: #c0397a; --g7: #5b6b7f;
  --on-g0: #fff; --on-g1: #fff; --on-g2: #10141a; --on-g3: #fff;
  --on-g4: #fff; --on-g5: #fff; --on-g6: #fff; --on-g7: #fff;
  --t0: #0d7854; --t1: #3949d6; --t2: #896411; --t3: #7a3fd1;
  --t4: #517817; --t5: #0b759a; --t6: #c0397a; --t7: #5b6b7f;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1116;
    --raised: #151b23;
    --ink: #e8ecf1;
    --muted: #9ba5b3;
    --rule: #28313d;
    --g0: #34d399; --g1: #8f9bff; --g2: #f5b941; --g3: #b48cff;
    --g4: #a6d04f; --g5: #4cc3ec; --g6: #f17cb0; --g7: #b5c0cd;
    --on-g0: #0d1116; --on-g1: #0d1116; --on-g2: #0d1116; --on-g3: #0d1116;
    --on-g4: #0d1116; --on-g5: #0d1116; --on-g6: #0d1116; --on-g7: #0d1116;
    --t0: #34d399; --t1: #8f9bff; --t2: #f5b941; --t3: #b48cff;
    --t4: #a6d04f; --t5: #4cc3ec; --t6: #f17cb0; --t7: #b5c0cd;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 'Chivo Variable', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
::selection { background: color-mix(in srgb, var(--g1) 24%, transparent); }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: currentColor; }
a:focus-visible { outline: 2px solid var(--g1); outline-offset: 2px; border-radius: 2px; }
.mono { font-family: 'Chivo Mono Variable', ui-monospace, monospace; }
.muted { color: var(--muted); }

.bar {
  background: var(--raised);
  border-bottom: 1px solid var(--rule);
}
.bar-inner, main, .foot-inner {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1rem;
}
@media (min-width: 640px) {
  .bar-inner, main, .foot-inner { padding: 0 1.5rem; }
}
.bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.wordmark { font-weight: 800; font-size: 1.125rem; letter-spacing: -0.01em; text-decoration: none; }
.bar nav { display: flex; gap: 1.25rem; margin-left: auto; font-size: 0.9375rem; }

.byline { font-size: 0.875rem; color: var(--muted); margin: 0; }
.byline a { color: var(--ink); font-weight: 600; }

main { padding-top: 2rem; padding-bottom: 3rem; }
.crumbs { font-size: 0.875rem; color: var(--muted); margin: 0 0 1rem; }

/* The element block: the product's tile in its group hue, as in the app's card. */
.element { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: flex-start; }
.tile {
  width: 8.5rem;
  height: 8.5rem;
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.7rem;
  background: var(--c);
  color: var(--on);
}
.tile .row { display: flex; justify-content: space-between; font-size: 0.8125rem; }
.tile .sym { font: 600 3.25rem/1 'Chivo Mono Variable', ui-monospace, monospace; letter-spacing: -0.03em; margin-top: 0.35rem; }
.tile .short { margin-top: auto; font-size: 0.8125rem; font-weight: 600; }
.head { min-width: 0; flex: 1 1 18rem; }
h1 { font-size: 2rem; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 0.6rem; text-wrap: balance; }
.facts { display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; align-items: center; margin: 0 0 0.4rem; font-size: 0.9375rem; }
.chip { border: 1px solid var(--rule); border-radius: 999px; padding: 0.05rem 0.6rem; font-size: 0.8125rem; }
.swatch { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 2px; background: var(--c); margin-right: 0.4rem; }

.lede { font-size: 1.0625rem; max-width: 70ch; margin: 1.5rem 0 1rem; }
.links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; padding: 0; margin: 0.75rem 0; list-style: none; }
.links a::after { content: ' ↗'; font-size: 0.8em; }
.meta { font-size: 0.875rem; color: var(--muted); }

h2 {
  margin: 2.25rem 0 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.rel { list-style: none; padding: 0; margin: 0; }
/* Long source URLs and entry names wrap instead of widening the page on phones. */
.rel a, .entry, .links a { overflow-wrap: anywhere; }
.rel li { margin: 0.2rem 0; }

/* Contains: the product's parts as nested sections, each entry addressable by its #id. */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 1rem; padding-left: 1rem; border-left: 1px solid var(--rule); }
@media (max-width: 639px) {
  .tree ul { margin-left: 0.25rem; padding-left: 0.75rem; }
}
.tree li { margin: 0.6rem 0; scroll-margin-top: 1rem; }
.tree li:target > .entry { background: color-mix(in srgb, var(--c) 14%, transparent); }
.entry { padding: 0.15rem 0.35rem; margin-left: -0.35rem; border-radius: 3px; }
.entry .name { font-weight: 600; }
.tree > li > .entry .name { font-size: 1.0625rem; font-weight: 700; }
.entry .kind { font-size: 0.8125rem; color: var(--muted); }
.entry p { margin: 0.15rem 0 0; max-width: 70ch; }
.entry .small { font-size: 0.875rem; color: var(--muted); }
.anchor { color: var(--muted); text-decoration: none; margin-left: 0.25rem; }

.foot { border-top: 1px solid var(--rule); background: var(--raised); }
.foot-inner { padding-top: 1rem; padding-bottom: 1.5rem; font-size: 0.875rem; color: var(--muted); }
.foot-inner p { margin: 0.25rem 0; }

.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1.5rem; }
.groups h2 { color: var(--ct); border-bottom: 2px solid var(--c); padding-bottom: 0.3rem; }
.groups ul { list-style: none; padding: 0; margin: 0; }
.groups li { margin: 0.3rem 0; }

/* What changed: one section per update. */
.update { margin-top: 2rem; }
.update h2 { font-size: 1.125rem; letter-spacing: -0.01em; text-transform: none; color: var(--ink); border-bottom: 1px solid var(--rule); padding-bottom: 0.4rem; }
.update h2 a { text-decoration: none; font-family: 'Chivo Mono Variable', ui-monospace, monospace; }
.update h2 .summary { color: var(--muted); font-weight: 400; font-size: 0.9375rem; margin-left: 0.5rem; }
.update h3 { margin: 1.25rem 0 0.4rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
