/* ============================================================
   FONTS — DM Sans, self-hosted variable font
   Files live in assets/fonts/. Licence: SIL Open Font License
   (free to self-host commercially). Source: Google Fonts v17.

   Self-hosted rather than loaded from the Google Fonts CDN: it's
   faster (no third-party DNS + TLS handshake), and it keeps our
   visitors' IP addresses away from Google.

   VARIABLE FONT — one file covers every weight from 100 to 1000.
   That means:
     - two files total instead of one per weight
     - any weight is available, including in-between values
       like 450, at no extra download cost

   Split by character coverage, not weight:
     dm-sans-latin.woff2      37KB — English and most Western European
     dm-sans-latin-ext.woff2  18KB — extended Latin (accents, currency)

   The `unicode-range` descriptors mean the browser downloads
   latin-ext ONLY if the page actually contains one of those
   characters. Most visitors will only ever fetch the 37KB file.
   ============================================================ */

/* --- Latin (loaded by nearly everyone) --- */
@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/dm-sans-latin.woff2") format("woff2");
  /* A weight RANGE, not a single value — this is what makes it variable */
  font-weight: 100 1000;
  font-style: normal;
  /* swap = show fallback text immediately, swap in DM Sans when ready.
     Prevents invisible text on slow connections. */
  font-display: swap;
  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;
}

/* --- Latin Extended (fetched only when the page needs it) --- */
@font-face {
  font-family: "DM Sans";
  src: url("/assets/fonts/dm-sans-latin-ext.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
                 U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
                 U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
                 U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
