/*
   Self-hosted webfonts.

   These were coming from Google. The problem wasn't the bytes — it was the chain: the browser fetched
   the HTML, then a stylesheet from fonts.googleapis.com, and only then discovered the font files on
   fonts.gstatic.com. Measured on the live site, the CSS arrived at 224 ms and the fonts weren't even
   requested until 913 ms. Two sequential round trips to two origins it had never spoken to, each
   costing DNS, TLS and a request, before a single glyph could render.

   Served from our own origin the files are discoverable in the initial HTML and preloadable, so they
   arrive alongside the CSS instead of after it. That removes the swap that was intermittently shifting
   the layout, and takes two third-party connections off the critical path.

   All three are VARIABLE fonts — one file per family covering its whole weight range, which is why
   Playfair 700 and 800 were being served the same URL by Google. Declared with a weight *range* rather
   than one face per weight; declaring them separately would download the same file three times.

   Latin subset only. Google serves several unicode ranges; the rest are dead weight for an
   English-language site on the Gulf Coast. If the site ever needs extended Latin or Cyrillic, take the
   corresponding subset from Google's stylesheet rather than dropping the whole family back to their CDN.

   ---------------------------------------------------------------------------
   font-display: why the two preloaded faces differ from Bangers
   ---------------------------------------------------------------------------
   The two preloaded families use `optional`, which is what makes layout shift impossible rather than
   merely unlikely. With `optional` the browser allows a short window; if the font misses it, the
   fallback is kept FOR THAT PAGEVIEW and never swapped in. No swap means no reflow — CLS is 0 by
   construction rather than by luck. Measured before this change: identical deploys scored 93 when the
   font won that race and 89 when it lost, which is exactly the shift `swap` permits.

   `optional` is only reasonable BECAUSE these two are preloaded. The preload gives them their best
   chance at the window, so in practice most visitors see the real typeface; somebody on a cold cache
   and a slow connection gets the fallback for one pageview and the correct font from then on.

   Bangers deliberately keeps `swap`. It is not preloaded — only the comic pages use it — and
   `optional` without preload means a font that essentially never loads. Those pages would quietly lose
   their typeface, which is a worse outcome than a shift on a page nobody measures.
*/

/*
   ---------------------------------------------------------------------------
   Playfair Display and Source Sans 3 are NOT declared here
   ---------------------------------------------------------------------------
   They live in a <style> block in App.razor, next to their preloads. A preload only matches the
   later request when the URL is identical, and Assets[] emits a fingerprinted filename that a
   src: url() in this file cannot name — so the browser preloaded one URL, parsed this stylesheet,
   and downloaded a second copy of the same file. Measured live: preloads at 559 ms, the fonts the
   page actually used starting at 1233 ms, 65 KB spent twice.

   That defeated `optional` on both faces. It keeps the fallback for the whole pageview if the font
   misses a short window, which is what makes CLS zero by construction — and it is only reasonable
   because they are preloaded. With the preload pointing somewhere nothing used, the real font
   always missed, and every cold-cache visitor read the site in the fallback typeface.

   If either face needs changing, change it in App.razor. Moving it back here reintroduces the
   double download silently: the page still looks right, because the font does eventually arrive.
*/

/* Bangers is only used on the comic pages, so it is deliberately NOT preloaded — the home page
   shouldn't pay for a font it never draws with. font-display: swap means those pages render in the
   fallback and switch when it lands. */
@font-face {
    font-family: 'Bangers';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/bangers-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;
}
