/* ─── Fonts, self-hosted ─────────────────────────────────────────────────────
 * WD Denim SemiBold is the display face (headlines), Geist the text face and
 * Geist Mono the code face. All three are served from this origin: a
 * third-party request on the critical path is one more host that can be slow,
 * blocked or down. Geist and Geist Mono are SIL Open Font License 1.1, which
 * permits redistributing them here as long as the licence travels with them -
 * OFL.txt sits in ../fonts/geist/. WD Denim is licensed for web self-hosting
 * (decision recorded in API-2445's PRD).
 *
 * The `url()`s are RELATIVE on purpose. Vite's CSS pipeline treats a relative
 * url() as a module asset: it hashes the file and applies the build's base
 * ("/dashboard/", see vite.config.ts) automatically. A root-absolute path in
 * plain CSS is never rewritten for base, and CSS has no import.meta.env.BASE_URL
 * to reach for, so it would have to be wrong in either dev or production. That
 * is also why the fonts live in src/assets/ and not in public/, whose files are
 * copied byte-for-byte with no such rewriting.
 *
 * Geist is split latin / latin-ext by unicode-range so a page with no extended
 * Latin characters - nearly every page here - never fetches the second file.
 * `font-display: swap` on every face: text paints at once in the fallback and
 * reflows into the real face when it arrives.
 *
 * The three "Fallback" faces are what makes that swap invisible. Each wraps a
 * system face (Arial, Courier New) and scales it to the real face's widths
 * (`size-adjust`) and line box (the three overrides), so headlines and body
 * text occupy the same space before and after the real font loads and nothing
 * moves. The figures come from the fonts' own hmtx/hhea tables measured against
 * Arial's (average advance over a mixed-case sample) - re-measure them if the
 * font files change. The 404 and blocked-font cases land on the same fallback.
 *
 * Adding a weight or face means adding the file and its face here; the drift
 * guard in src/lib/fonts.test.ts asserts the two sides agree.
 * ─────────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "WD Denim Fallback";
  src: local("Arial");
  size-adjust: 105.5%;
  ascent-override: 89.9%;
  descent-override: 20.1%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Geist Fallback";
  src: local("Arial");
  size-adjust: 103.9%;
  ascent-override: 96.7%;
  descent-override: 28.4%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Geist Mono Fallback";
  src: local("Courier New");
  size-adjust: 100%;
  ascent-override: 100.5%;
  descent-override: 29.5%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "WD Denim";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/DenimWD-SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/geist-400-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;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/geist-400-latin-ext.woff2") format("woff2");
  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;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/geist-500-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;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/geist-500-latin-ext.woff2") format("woff2");
  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;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/geist-600-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;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/geist-600-latin-ext.woff2") format("woff2");
  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;
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/geist-mono-400-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;
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/geist-mono-500-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;
}
