/* The site's typefaces, declared once.
 *
 * This file is THE source of truth for both renderers: the React app links it
 * from index.html, and the static-site generator inlines it verbatim into every
 * page it writes. They cannot disagree, which they previously did in the worst
 * possible way — the generated pages set `font-family:'DM Sans'` and never
 * loaded a font file at all, so all 158 of them rendered in whatever the
 * visitor's OS defaults to while the homepage rendered in the real faces.
 *
 * Why self-hosted rather than @import from Google Fonts and Fontshare:
 * `@import` is the slowest way to load a font. The browser has to fetch and
 * parse our stylesheet before it discovers the import, then fetch a second
 * stylesheet, then the font files — a three-hop serial chain across two
 * third-party origins, all of it blocking first paint. Measured here with
 * those hosts unreachable, the homepage sat on a spinner for 12.8 seconds
 * before painting anything. Self-hosting removes the hops and the dependency
 * on anyone else's uptime.
 *
 * DM Sans is one variable file covering every weight (37KB, latin subset).
 */

@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans.woff2') format('woff2');
  font-weight: 100 1000;          /* variable: one file, all weights */
  font-style: normal;
  font-display: swap;
  /* Latin only. The site is English; latin-ext doubles the payload for glyphs
     no page uses. Declaring the range lets the browser skip the file entirely
     for text outside it rather than downloading and then not using it. */
  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;
}

/* General Sans — the display face, per DESIGN.md.
 *
 * DELIBERATELY NOT SELF-HOSTED. Do not "finish the job" by dropping the WOFF2
 * in here — it is a licensing decision, not an oversight.
 *
 * General Sans ships under the Fontshare Free Font License (Indian Type
 * Foundry). §01 grants use "in any media (including Print, Web, ...)", but §02
 * prohibits "uploading them in a public server" and transmitting the Font
 * Software "over the Internet in font serving or for font replacement by means
 * of technologies such as but not limited to EOT, Cufon, sIFR or similar
 * technologies that may be developed in the future ... without the prior
 * written consent of the Licensor." The licence then describes the sanctioned
 * web path itself: the Fontshare API, where the font "is delivered directly
 * from the servers used by Indian Type Foundry to the Licensee's website,
 * without the Licensee having to download the Font Software."
 *
 * Serving our own copy via @font-face is that prohibited thing. So the app
 * loads General Sans from api.fontshare.com with a <link> in index.html —
 * never an @import — behind a preconnect, and it is not on the critical path:
 * headings fall back to DM Sans, which IS self-hosted, so a slow or unreachable
 * Fontshare costs a slightly different heading and nothing else.
 *
 * If self-hosting becomes worth having (it is faster, and it removes a
 * third-party origin), the route is written into the licence: ask ITF for
 * written consent. Until that consent exists in writing, this stays.
 *
 * No General Sans binary belongs in this repository. A test enforces that.
 */
