/* LIWA's own typefaces, self-hosted.
 *
 * Production audit 2026-09-19. Google Fonts loaded on EVERY student page with a
 * `preconnect` that fires before any interaction, disclosing every child's IP
 * address and user-agent to Google on page load — before the student has done
 * anything, and whether or not they ever use the app. For a platform whose users
 * are 10-to-15-year-olds under the DPDP Act, a third-party request that happens
 * before consent is the kind of thing a privacy notice has to account for.
 *
 * It was also unnecessary: all three families were ALREADY committed in the repo
 * at frontend/src/assets/fonts/, and the nine admin pages have self-hosted from
 * static/fonts/ since the Ledger Desk pass. Only the student SPA was still
 * fetching them over the network.
 *
 * The declarations below are the admin theme's, verbatim, plus Space Mono and
 * the Devanagari subset the admin does not use. Baloo 2 and Nunito are VARIABLE
 * fonts, so one file covers the whole 400-800 range the SPA asks for; Space Mono
 * is static, hence one file per weight. `unicode-range` keeps the split subsets
 * behaving exactly as Google's own CSS did — a browser downloads latin-ext or
 * devanagari only when the page actually contains those characters.
 *
 * WHAT THIS DOES NOT COVER: the six non-Bright THEME packs each declare their own
 * `googleFontsUrl`, loaded at theme-activation time by applyTheme.ts. Those still
 * reach Google, which is why main.py's CSP keeps its fonts.googleapis.com and
 * fonts.gstatic.com allowances. They fire only for a student who has chosen a
 * theme — an action, not a page load — and self-hosting fourteen more families is
 * its own piece of work. The default Bright theme, which is what every student
 * gets until they change it, now makes no third-party request at all.
 *
 * Served from /static/, so `templates/spa.html` links it directly. Deliberately
 * NOT bundled through Vite: spa.html is a Jinja template FastAPI renders, and the
 * committed source of these files is frontend/src/assets/fonts/ — never
 * static/app/assets/, which is a build artifact whose names change every build.
 */

/* ---- Baloo 2 (display) ---- */
@font-face {
  font-family: 'Baloo 2';
  src: url('/static/fonts/Baloo2-latin.woff2') format('woff2');
  font-weight: 400 800; font-style: normal; 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;
}
@font-face {
  font-family: 'Baloo 2';
  src: url('/static/fonts/Baloo2-latin-ext.woff2') format('woff2');
  font-weight: 400 800; font-style: normal; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Hindi. Students read and type Devanagari across the app (the mic hears it too),
   so this subset is not optional here the way it is on the admin pages. */
@font-face {
  font-family: 'Baloo 2';
  src: url('/static/fonts/Baloo2-devanagari.woff2') format('woff2');
  font-weight: 400 800; font-style: normal; font-display: swap;
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0,
    U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B09;
}

/* ---- Nunito (body) ---- */
@font-face {
  font-family: 'Nunito';
  src: url('/static/fonts/Nunito-latin.woff2') format('woff2');
  font-weight: 400 800; font-style: normal; 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;
}
@font-face {
  font-family: 'Nunito';
  src: url('/static/fonts/Nunito-latin-ext.woff2') format('woff2');
  font-weight: 400 800; font-style: normal; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF,
    U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- Space Mono (code / data) — static, so one file per weight ---- */
@font-face {
  font-family: 'Space Mono';
  src: url('/static/fonts/SpaceMono-400-latin.woff2') format('woff2');
  font-weight: 400; font-style: normal; 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;
}
@font-face {
  font-family: 'Space Mono';
  src: url('/static/fonts/SpaceMono-700-latin.woff2') format('woff2');
  font-weight: 700; font-style: normal; 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;
}
