/* Design tokens, self-hosted fonts and the reset.

   SHARED FILE - every page loads it, so two branches editing it collide.
   A rule that belongs to one page goes in that page's css/page-*.css
   instead. See CONTRIBUTING.md, merge magnets.
*/

/* ===== Paper design tokens =====
   One set of light values on :root; dark overrides its colours twice - once for
   the system preference, once for the explicit data-theme, because the theme
   toggle has to win in both directions. A colour defined ONLY inside the media
   query would be undefined for a viewer whose OS says light but who chose dark.

   The dark palette is warm charcoal, not blue-grey: a cold dark next to a warm
   light reads as two different products.

   `color-scheme` rides along with every palette because the native controls we
   do not style - the <audio> player above all, but also scrollbars, <select>
   and <input> - take their look from it and from nothing else. Without it the
   browser paints them light on top of the dark panel. */
:root {
  color-scheme: light;
  --paper: #fbf8f3; --paper-2: #f1eee8;
  --panel: #ffffff; --panel-2: #fdfcfa;
  --border: #e8e2d9; --border-strong: #d9d1c4;
  --ink: #1a1a1a; --ink-2: #3a3835;
  --muted: #7a756f; --muted-2: #7d7668;
  --ok: #4a7c52; --warn: #a1712a; --err: #a3452f;
  --accent: #1a1a1a; --accent-fg: #fbf8f3;
  --shadow: 0 1px 4px rgba(60,50,35,.06);
  --shadow-2: 0 2px 12px rgba(60,50,35,.08);
  --radius: 5px; --radius-pill: 999px;
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: Newsreader, Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #14120f; --paper-2: #1b1815;
    --panel: #211e1a; --panel-2: #1a1714;
    --border: #322d26; --border-strong: #443d33;
    --ink: #ece6da; --ink-2: #cfc7b8;
    --muted: #9c9384; --muted-2: #948b7b;
    --ok: #7fa87f; --warn: #d3a259; --err: #cf7a60;
    --accent: #ece6da; --accent-fg: #14120f;
    --shadow: 0 1px 4px rgba(0,0,0,.5);
    --shadow-2: 0 2px 12px rgba(0,0,0,.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #14120f; --paper-2: #1b1815;
  --panel: #211e1a; --panel-2: #1a1714;
  --border: #322d26; --border-strong: #443d33;
  --ink: #ece6da; --ink-2: #cfc7b8;
  --muted: #9c9384; --muted-2: #948b7b;
  --ok: #7fa87f; --warn: #d3a259; --err: #cf7a60;
  --accent: #ece6da; --accent-fg: #14120f;
  --shadow: 0 1px 4px rgba(0,0,0,.5);
  --shadow-2: 0 2px 12px rgba(0,0,0,.55);
}
:root[data-theme="light"] {
  color-scheme: light;
  --paper: #fbf8f3; --paper-2: #f1eee8;
  --panel: #ffffff; --panel-2: #fdfcfa;
  --border: #e8e2d9; --border-strong: #d9d1c4;
  --ink: #1a1a1a; --ink-2: #3a3835;
  --muted: #7a756f; --muted-2: #7d7668;
  --ok: #4a7c52; --warn: #a1712a; --err: #a3452f;
  --accent: #1a1a1a; --accent-fg: #fbf8f3;
  --shadow: 0 1px 4px rgba(60,50,35,.06);
  --shadow-2: 0 2px 12px rgba(60,50,35,.08);
}

/* ===== Self-hosted fonts =====
   Subset to latin + latin-ext: latin alone drops the Czech r-hacek, e-hacek and
   u-ring mid-word. The opsz axis is pinned and wght narrowed to the ranges
   declared here, which is what keeps all three under 90 kB - see
   static/fonts/LICENSES.md for the exact subsetting commands. */
@font-face {
  font-family: Inter; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("/static/fonts/inter-var-latin-ext.woff2") format("woff2");
}
@font-face {
  font-family: Newsreader; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("/static/fonts/newsreader-var-latin-ext.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("/static/fonts/jetbrains-mono-var-latin-ext.woff2") format("woff2");
}

* { box-sizing: border-box; }
