/* ==========================================================================
   fonts.css — self-hosted webfonts

   These were previously loaded from Google Fonts. Serving them from our own
   origin instead means:

     * one fewer third-party origin to connect to (no extra DNS lookup, TLS
       handshake and round trip before text can render in the real font),
     * no dependency on a service that can be slow, blocked or blocked by
       a network the visitor is on,
     * nothing about the visitor is sent to Google on every page load, and
     * a tighter Content-Security-Policy, because font-src and style-src no
       longer need to allow an external host.

   Both are VARIABLE fonts, so a single file per family covers every weight
   the site uses. Together they are ~78 KB.

   Only the `latin` subset is included — matching what Google served for this
   site — which is why the unicode-range below is declared explicitly. A
   character outside that range falls back to the next font in the stack
   rather than rendering as a blank box.

   To update: refetch from Google Fonts with a modern browser User-Agent,
   take the `latin` @font-face block for each family, then add the new file
   under a NEW NAME (e.g. inter-latin-var-2.woff2) and update both this file
   and the two <link rel="preload"> tags in base.html.

   Rename rather than overwrite: these are served with a one-year immutable
   cache header and, unlike the CSS and JS, their URLs carry no ?v= stamp,
   so a file replaced in place would not reach anyone who has already
   visited. The preload URL and the url() below must stay byte-identical or
   the browser downloads each font twice.
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  /* A range, not a single value: this is one variable file covering 100-900,
     and the site uses 400 / 500 / 600 / 650 / 700 from it. */
  font-weight: 100 900;
  /* swap: text paints immediately in the fallback and is upgraded when the
     file arrives. It must never block the first paint. */
  font-display: swap;
  src: url('../fonts/inter-latin-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
