/*
 * The one theme file: maps the semantic properties `blog.css` reads onto this
 * site's design tokens (`tokens.css`, built from the repository's `tokens/*.json`
 * and copied here by `tool/blog_assets.dart`; never edited by hand). The tokens
 * are the main site's: the dark theme is the default (decision 36) and the light
 * theme follows `prefers-color-scheme: light`.
 *
 * The one value the palette does not have is the band, the second ground behind
 * a post's question. It is proposed here, one step off the page ground in each
 * theme, and is the only colour literal of the blog:
 *   dark  #22201D  a step above `--color-bg` #11100F and `--color-surface` #1B1A18 (1.17:1 on the ground)
 *   light #EEEBE5  between `--color-bg` #F6F4F0 and `--color-rule` #E2DED7
 * The text colour reads on both at 4.5:1 or more (`test/css_test.dart`).
 *
 * The values below that are plain numbers (the reading sizes, the measure, the
 * container) are layout constants, not brand tokens.
 */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 520;
  font-display: swap;
  src: url("/fonts/newsreader-520.woff2") format("woff2");
}
@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/hanken-grotesk-400-600.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-400.woff2") format("woff2");
}

:root {
  color-scheme: dark light;

  /* Grounds, text, rules, links, accent. */
  --bg: var(--color-bg);
  --surface: var(--color-surface);
  --band: #22201D;
  --fg: var(--color-fg);
  --muted: var(--color-muted);
  --rule: var(--color-rule);
  --rule-strong: var(--color-fg);
  --link: var(--color-accent);
  --accent-fill: var(--color-accent);
  --focus: var(--color-focus);

  /* Fonts. */
  --font-display: var(--font-family-display);
  --font-text: var(--font-family-text);
  --font-mono: var(--font-family-mono);
  --w-display: var(--font-weight-display);
  --w-text: var(--font-weight-text);
  --w-strong: var(--font-weight-strong);
  --display-tracking: -0.012em;

  /* Shape: square, as on the main site. */
  --cut: 0px;
  --radius: var(--radius-sm);

  /* Sizes: the reading column is 66 characters at 1.125 rem / 1.65. */
  --display-size: clamp(2.25rem, 1.2rem + 4vw, 4rem);
  --h2-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
  --h2-lh: 1.2;
  --lede-size: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);
  --lede-lh: 1.55;
  --prose-size: 1.125rem;
  --prose-lh: 1.65;
  --small: 0.875rem;
  --code-size: 0.8125rem;
  --measure: 66ch;
  --container: 74rem;
  --gutter: clamp(1rem, 4vw, 3rem);
}

@media (prefers-color-scheme: light) {
  :root {
    --band: #EEEBE5;
  }
}
