/*
 * The one theme file: maps the semantic properties `blog.css` reads onto the
 * Cube Algos design tokens (`brand/tokens.css`, a byte-identical copy of
 * apps/website's vendored brand tokens, checked by test/css_test.dart).
 * `brand/tokens.css` already switches its colours under
 * `prefers-color-scheme: dark`, so this file needs a dark block only for what
 * the brand has no token for: the band.
 *
 * The reading sizes, the measure and the container are layout constants, not
 * brand tokens. The band (the second ground behind the question and the home
 * page's first post) is proposed here, not in the brand: it takes the cool
 * neutral step between the page ground and the raised surface.
 *
 * Fonts: Onest and DM Mono, the website's own subsets, served from this
 * site's origin (licences in fonts/licenses/).
 */
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/onest-800.woff2") format("woff2");
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/onest-400.woff2") format("woff2");
}

@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/dm-mono-400.woff2") format("woff2");
}

:root {
  color-scheme: light dark;

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

  /* Fonts. */
  --font-display: var(--font-family-sans);
  --font-text: var(--font-family-sans);
  --font-mono: var(--font-family-mono);
  --w-display: var(--font-weight-display);
  --w-text: var(--font-weight-text);
  --w-strong: var(--font-weight-display);
  --display-tracking: var(--font-scale-h1-tracking);

  /* Shape. */
  --cut: var(--chamfer-md);
  --radius: var(--radius-sm);

  /* Sizes: the reading column is 66 characters at 1.125 rem / 1.65. */
  --display-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.5rem);
  --h2-size: var(--font-scale-h3-size);
  --h2-lh: 1.3;
  --lede-size: 1.25rem;
  --lede-lh: 1.55;
  --prose-size: 1.125rem;
  --prose-lh: 1.65;
  --small: var(--font-scale-small-size);
  --code-size: var(--font-scale-small-size);
  --measure: 66ch;
  --container: 72rem;
  --gutter: clamp(1rem, 4vw, 3rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --band: #1d1f25;
  }
}
