/* ==========================================================================
   SZ365 fonts.css — self-hosted IBM Plex

   WHY SELF-HOSTED
   Every screen previously pulled 11 font resources from fonts.googleapis.com:
   a cross-origin, render-blocking stylesheet on a public page in a PDPL
   context, and a hard dependency on the network just to open the prototype.
   Worse, it meant nobody had ever reviewed the Arabic type that will actually
   ship — with no local font, Arabic fell back to whatever the OS supplied.
   (MASTER-ISSUES M45.)

   LICENCE
   IBM Plex is licensed under the SIL Open Font License 1.1, which explicitly
   permits self-hosting and redistribution. See fonts/OFL.txt.

   WHAT IS HERE — 4 files, 161 KB total, of which an Arabic page uses ~2
     plex-arabic-400.woff2      42.8 KB  Arabic blocks only
     plex-arabic-600.woff2      45.7 KB  Arabic blocks only
     plex-latin-var.woff2       45.7 KB  variable 100-700, Latin + digits
     plex-latin-ext-var.woff2   30.9 KB  variable 100-700, extended Latin

   Weights are 400 and 600 ONLY. The previous stack loaded 400/500/600/700 of
   three families; two weights carry the whole design and 500/700 are
   synthesised where they appear.

   SUBSETTING — the trap
   These are Google's official subsets, split by unicode-range. Never re-subset
   Arabic by "the glyphs we use": Arabic shaping (isol/init/medi/fina, lam-alef
   ligatures, mark positioning) lives in the GSUB/GPOS tables, and a naive
   glyph subsetter produces disconnected letterforms that look like broken text.

   DIGITS COME FROM THE LATIN FACE — deliberately
   The Arabic ranges below stop short of U+0030-0039, so Western digits, SKUs,
   order ids and money amounts always resolve to IBM Plex Sans. That is what
   keeps the platform's "Western digits everywhere" rule true without a single
   line of markup, and it is why 'IBM Plex Sans' is listed FIRST in --font-sans.

   font-display: optional — an Arabic-specific choice
   The platform Arabic fallbacks (Segoe UI/Tahoma on Windows, SF Arabic/Geeza
   Pro on iOS, Noto Naskh on Android) have wildly different x-height, ascent and
   natural line-height from Plex Arabic. `swap` therefore produces a full-page
   RTL reflow when the font arrives — a guaranteed CLS spike on exactly the
   throttled mobile profile the performance budget measures. `optional` takes a
   <=100ms block window and never swaps mid-session. Because these files are
   local, that window is always satisfied here.

   NOT DONE, AND DELIBERATELY NOT GUESSED
   A metric-matched fallback face (size-adjust / ascent-override /
   descent-override) would remove the residual first-paint shift on a cold cache
   in production. Those numbers must be MEASURED from the actual woff2 (fontkit,
   or Canvas TextMetrics in a headless browser) — publishing invented values
   would be exactly the kind of fabrication this project forbids. Note also that
   next/font's adjustFontFallback only knows Arial and Times, which is useless
   for Arabic. Tracked as an implementation task.
   ========================================================================== */

/* -- IBM Plex Sans Arabic — Arabic blocks only -------------------------- */
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 400;
  font-display: optional;
  src: url('./plex-arabic-400.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1,
    U+08E3-08FF, U+200C-200E, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74,
    U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF,
    U+1EE00-1EEF1;
}
@font-face {
  font-family: 'IBM Plex Sans Arabic';
  font-style: normal;
  font-weight: 600;
  font-display: optional;
  src: url('./plex-arabic-600.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1,
    U+08E3-08FF, U+200C-200E, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74,
    U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF,
    U+1EE00-1EEF1;
}

/* -- IBM Plex Sans — Latin, digits and punctuation ---------------------- */
/* One variable file serves the whole 100-700 range: Google returns a byte-
   identical file for weight 400 and 600, so shipping two would be 46 KB of
   duplicate. */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 100 700;
  font-display: optional;
  src: url('./plex-latin-var.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: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 100 700;
  font-display: optional;
  src: url('./plex-latin-ext-var.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;
}

/* Numeric alignment. IBM Plex Mono is deliberately NOT shipped: it has no
   Arabic glyphs at all, which is precisely the defect M7 recorded (Arabic
   placeholders rendering per-glyph from a fallback inside a mono field). Its
   only real job was aligning columns of money and ids, and tabular figures on
   the Latin face do that better and for free. */
.font-mono,
.tabular,
.table td,
.price__current,
.price__compare {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}
