/* ==========================================================================
   Self-hosted DM Sans — Latin subset, variable weight (400–700)
   ========================================================================== */

/* Primary body font — font-display: optional avoids layout shift (FOIT).
   If the font hasn't loaded by first paint, the browser uses the fallback
   for the entire page lifetime. This prevents CLS for body text. */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: optional;
  src: url('/static/fonts/dm-sans-latin.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;
}

/* Fallback font with metric overrides to minimise CLS when DM Sans loads.
   Values derived from DM Sans metrics:
     - Capital height / UPM ≈ 0.700
     - Ascender  / UPM ≈ 1.000
     - Descender / UPM ≈ 0.250
     - Line gap  / UPM ≈ 0           */
@font-face {
  font-family: 'DM Sans Fallback';
  src: local('Arial');
  size-adjust: 96.2%;
  ascent-override: 100%;
  descent-override: 25%;
  line-gap-override: 0%;
}
