/* ==========================================================================
   fonts.css — self-hosted webfonts (no external requests)
   --------------------------------------------------------------------------
   Loaded BEFORE style.css. Replaces the fonts.googleapis.com stylesheet, so
   the site now makes zero third-party requests.

   VARIABLE FONTS
   Both families ship as variable fonts: one woff2 per subset covers the whole
   weight axis, so font-weight is declared as a RANGE instead of one rule per
   weight. Asking the Google CSS API for wght 400;700 returns byte-identical
   files to asking for 500 or 900 (verified by URL comparison), so every weight
   the stylesheets use - 300/400/500/600/700/900 - renders from these files.

       Noto Serif Hebrew  wght 100-900 + wdth 62.5-100   Monotype
       Heebo              wght 100-900                   Oded Ezer

   THE DISPLAY FACE HAS TWO AXES, AND THE WIDTH AXIS IS THE POINT
   The default fonts.googleapis.com URL for this family serves the weight axis
   only. The width axis has to be asked for explicitly:

       family=Noto+Serif+Hebrew:wdth,wght@62.5..100,100..900

   It costs 13,720 B over the weight-only file (32,220 vs 18,500) and it earns
   that back twice over. Noto's Hebrew is 8.8% taller and ~14% wider per
   character than the Frank Ruhl Libre it replaces, so at wdth 100 the hero
   headline grows ~11% and re-wraps - which would move a word onto a new line
   mid-way through the hero's staged word-entrance choreography, on the LCP
   element. Set at wdth 90 the same string measures 20.156 em against the old
   face's 20.150 em: the swap is horizontally layout-neutral, and no clamp()
   in style.css needed re-deriving for fit. See the vertical notes there.

   The axis also replaces a whole second font family. Instead of pairing a
   display face with a text face, one file provides a narrow light cut for the
   hero and a normal-width heavier cut for 20px card headings - the same
   display-cut/text-cut structure a real type family would give.

   WHY FRANK RUHL LIBRE CAME OFF
   It is a fine face, but it is a TEXT serif doing display work: the Libre
   redraw enlarged the x-height and cut stroke contrast for screen reading, so
   at 74px it reads as enlarged body copy. Worse, it was metrically near-twinned
   to Heebo (Hebrew letter height 0.590 em against Heebo's 0.575 at a similar
   advance), so the heading hierarchy was carried entirely by px and weight and
   the page had no typographic event on it. Removing it also drops its two Latin
   subsets, which existed only to render numerals - those now set in Heebo.

   Measured on the homepage from document.fonts status (which subsets actually
   got fetched, not which ones exist on disk):

       removed  frank-ruhl-libre-hebrew.woff2                     18,748 B
                frank-ruhl-libre-latin-ext.woff2                  20,932 B
                frank-ruhl-libre-latin.woff2                      44,332 B
       added    noto-serif-hebrew.woff2                           32,220 B
                noto-serif-hebrew-punct.woff2                      1,956 B
       total    140,912 B -> 91,076 B                 -49,836 B, -1 request

   Both Frank Ruhl Latin subsets were being fetched on every page load purely
   to render numerals in the display face. Setting those in Heebo instead (see
   .dash-value, .step-num in style.css) retired 65 KB outright.

   SUBSETS
   Split and ordered exactly as Google splits them, so unicode-range
   resolution matches the previously hosted behaviour character-for-character.
   A subset is fetched only if the page uses a codepoint in its range.

   Google's `math` and `symbols` subsets for Heebo are deliberately NOT
   included: their unicode-range advertises glyphs (arrows, check marks,
   geometric shapes) that Heebo does not actually contain — the files hold
   only ASCII, which their own unicode-range excludes. Shipping them would
   cost ~37 KB and one pointless fetch per page while rendering nothing.
   Characters such as the site's ▲ ← ✓ ∞ ✦ fall back to a system font, which
   is exactly what they already did when the fonts came from Google.

   LICENCE  SIL Open Font License 1.1 — see ../assets/fonts/LICENSE.txt
   ========================================================================== */


/* ---------- Noto Serif Hebrew (display) ---------- */

/* hebrew - the ONLY subset shipped for the display face.
   Verified: no h1/h2/h3/h4 on any page contains a Latin letter or digit, and
   every numeral that used to sit in the display font now sets in Heebo. So a
   Latin subset here would be 30+ KB that never renders a glyph.
   Coverage confirmed against the site's live text: U+20AA shekel, U+05BE maqaf
   (אחד־על־אחד, 4x on the homepage), U+05F4 gershayim (a standalone 41.6px gold
   glyph at audience.html:112 - this is what disqualified Bellefair, which is
   missing that codepoint), plus geresh and full nikud. */
@font-face {
  font-family: 'Noto Serif Hebrew';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62.5% 100%;
  font-display: swap;
  src: url('../assets/fonts/noto-serif-hebrew.woff2') format('woff2');
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

/* punctuation - a custom 4-glyph subset, and it is load-bearing.
   Hebrew has no punctuation of its own for these, so headings borrow ASCII:
   "שאלתם? עונים בכנות." / "כמו עיר חכמה. רק לכסף שלכם." / "מוח אנושי, מנוע חכם"
   Those codepoints are NOT in the hebrew subset above, and Frank Ruhl Libre
   used to cover them from its 44 KB latin file. Without this face they fall
   through the stack to a system serif, so 11 headings across the site would
   set Hebrew in Noto and their comma, full stop and question mark in Times -
   subtle, but wrong in exactly the way that reads as unfinished.

   Google's own latin subset for this family is 51,744 B to supply four glyphs.
   This file was cut from it with fontTools to U+002C U+002E U+002F U+003F,
   both variation axes preserved so the punctuation tracks the same weight and
   width as the Hebrew beside it. 51,744 B -> 1,956 B.

   Regenerate (needs fonttools + brotli) if a heading ever gains a new mark:
     curl -o latin.woff2 <the family's latin subset URL from the css2 API>
     python3 -c "from fontTools.ttLib import TTFont; from fontTools.subset \
       import Subsetter, Options; f=TTFont('latin.woff2'); \
       s=Subsetter(options=Options()); s.populate(text=',./?'); s.subset(f); \
       f.flavor='woff2'; f.save('noto-serif-hebrew-punct.woff2')"
   Then widen the unicode-range below to match, or the browser will not fetch
   it for the new character. */
@font-face {
  font-family: 'Noto Serif Hebrew';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62.5% 100%;
  font-display: swap;
  src: url('../assets/fonts/noto-serif-hebrew-punct.woff2') format('woff2');
  unicode-range: U+002C, U+002E-002F, U+003F;
}


/* ---------- Heebo ---------- */

/* hebrew */
@font-face {
  font-family: 'Heebo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/heebo-hebrew.woff2') format('woff2');
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

/* latin-ext */
@font-face {
  font-family: 'Heebo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/heebo-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;
}

/* latin */
@font-face {
  font-family: 'Heebo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/heebo-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;
}
