/*
 * The Arabic face, actually shipped.
 *
 * `tailwind.config.js` has named "Noto Sans Arabic" as the Arabic family since
 * the design system was written, with a comment claiming it was self-hosted. It
 * never was: there was no @font-face anywhere in the product, no font file under
 * `public/`, and no font dependency in `apps/web/package.json`, so every Arabic
 * and Kurdish screen rendered in whatever face the client machine happened to
 * offer — Tahoma on Windows, a fontconfig guess on Linux, nothing legible on a
 * locked-down kiosk. Sorani degrades first, because Windows resolves ڕ ڵ ۆ ێ ە
 * by per-glyph font-linking to a DIFFERENT face than the surrounding Arabic, so
 * a Kurdish sentence was drawn from two typefaces at once. The 1.75 line-height
 * `index.css` applies to every RTL body was tuned for Noto's metrics and was
 * being applied to somebody else's.
 *
 * These files are subsets of Noto Sans Arabic 2.005 (SIL OFL 1.1 — see OFL.txt
 * beside this file), produced with:
 *
 *   fonttools subset NotoSansArabic-{Regular,Bold}.ttf \
 *     --unicodes=U+0020,U+00A0,U+0600-06FF,U+0750-077F,U+08A0-08FF,\
 *                U+200C-200F,U+2010-2011,U+2018,U+2019,U+201C,U+201D,\
 *                U+2026,U+25CC,U+FB50-FDFF,U+FE70-FEFF \
 *     --layout-features='*' --flavor=woff2
 *
 * `--layout-features='*'` is not optional and is the whole reason a naive subset
 * fails: Arabic is shaped, not spelled. Drop GSUB and every letter renders in
 * its isolated form, so a word becomes a row of disconnected shapes that is
 * still, technically, the right letters. Hinting is kept (ttfautohint, as
 * upstream shipped it) because the deployment target is Windows, where
 * DirectWrite still uses it at UI sizes; that costs about 21 KB a weight and
 * buys legibility at 13px, which is most of this product.
 *
 * Two weights, not four. 400 and 700 are what Tailwind's `font-normal`,
 * `font-medium`, `font-semibold` and `font-bold` collapse to under the CSS
 * font-matching rules, and a third file would be 70 KB for a step nobody can
 * see at 13px.
 *
 * NOT loaded from a CDN, and that is a hard constraint rather than a preference:
 * the deployed Content-Security-Policy is `default-src 'self'` with
 * `font-src 'self' data:` (deploy/caddy/Caddyfile), so a Google Fonts URL would
 * be refused by the browser and `navigation-coverage.spec.ts` asserts as much.
 *
 * This lives in `public/` rather than being imported from `main.tsx` because
 * `index.css` and `package.json` belong to another change in flight; a file
 * under `public/` is copied verbatim into `dist/` by Vite and served from the
 * same origin in both dev and production, which is all the @font-face needs.
 */

@font-face {
  font-family: 'Noto Sans Arabic';
  font-style: normal;
  font-weight: 400;
  /*
   * `swap`, not `block`. An ERP is read, not admired: showing the sentence
   * immediately in the system's fallback and restyling it a moment later is
   * strictly better than three seconds of invisible text on a stock list.
   */
  font-display: swap;
  src: url('/fonts/noto-sans-arabic-400.woff2') format('woff2');
  /*
   * Exactly what the subset covers, and deliberately no more.
   *
   * `unicode-range` is what keeps this off an English reader's wire: the
   * browser fetches the file only once a glyph on the page falls inside the
   * range, so an English session downloads nothing at all. Space (U+0020) and
   * the general punctuation the Latin text also uses are left OUT for the same
   * reason — including them would make every English screen pull 70 KB of
   * Arabic to draw a space.
   */
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200F, U+25CC,
    U+FB50-FDFF, U+FE70-FEFF;
}

@font-face {
  font-family: 'Noto Sans Arabic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/noto-sans-arabic-700.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200F, U+25CC,
    U+FB50-FDFF, U+FE70-FEFF;
}
