/* Self-hosted webfonts.
 *
 * These replace the Google Fonts CDN links that used to sit in index.html.
 * Three reasons the app hosts its own fonts now:
 *
 *   1. OFFLINE. The service worker precaches these files, so a cold load with
 *      no network still renders Arabic in Noto Naskh. Against the CDN, an
 *      offline first paint fell back to a system serif — and for text whose
 *      whole purpose is harakāt placement, that is a correctness problem, not
 *      a cosmetic one.
 *   2. PRIVACY. No third-party request is made on page load, so no learner IP
 *      address reaches Google.
 *   3. SECURITY. The Content-Security-Policy in public/_headers no longer has
 *      to allow fonts.googleapis.com or fonts.gstatic.com at all.
 *
 * Files live in public/fonts/ with stable, unhashed names, so they can be
 * preloaded from index.html and precached by filename. They are immutable —
 * if a font is ever updated, change the filename rather than the contents.
 * Source: @fontsource-variable/inter@5.3.0, @fontsource/noto-naskh-arabic@5.3.0.
 *
 * The unicode-range declarations are load-bearing, not decoration: they are
 * what lets the browser fetch only the subset a page actually needs, and what
 * makes the latin-ext file load at all. The transliteration used throughout
 * the UI — muḍāriʿ, māḍī, ṣarf — lives at U+1E00-1E9F inside latin-ext, so
 * without that block those characters would silently fall back to a system
 * font mid-sentence.
 */

/* ── Inter (UI chrome) — variable weight axis 100-900 ──────────────────── */

@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-latin-wght-normal.woff2) format('woff2-variations');
  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: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-latin-ext-wght-normal.woff2) format('woff2-variations');
  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;
}

/* ── Noto Naskh Arabic (all Arabic content) ───────────────────────────────
 * font-display is `swap` for Inter but `block` here. That difference is
 * deliberate. A brief invisible pause is better than painting Arabic in a
 * fallback face and reflowing it, because fallback serifs position harakāt
 * differently — a learner reading a ḍamma against a sukūn during that swap
 * window would be reading the wrong thing.
 */

@font-face {
  font-family: 'Noto Naskh Arabic';
  font-style: normal;
  font-display: block;
  font-weight: 400;
  src: url(/fonts/noto-naskh-arabic-arabic-400-normal.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1,
    U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF,
    U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: 'Noto Naskh Arabic';
  font-style: normal;
  font-display: block;
  font-weight: 700;
  src: url(/fonts/noto-naskh-arabic-arabic-700-normal.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1,
    U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF,
    U+FE70-FE74, U+FE76-FEFC;
}
