/* CHAZEN — self-hosted type
   ==========================================================================
   Noto Sans TC and Noto Serif TC, subset to this site and served from this
   repository rather than fonts.gstatic.com.

   Three measured reasons, not a preference:

   1. The CDN was returning REAL 404s for Noto Serif TC subsets — confirmed
      with curl, not just in a browser — on a different handful of pages each
      run. A missing subset means the Chinese falls back mid-page, and on this
      site the Chinese is content, not decoration.
   2. It was the render-blocking step in every page's baseline LCP: HTML, then
      a third-party CSS round trip, then the font. Pages whose largest element
      was a plain paragraph still sat at 4.1-5.5s on Fast 3G because of it.
   3. It was the CLS driver — fallback text painted, then reflowed when the
      real font arrived. 0.478 on store, 0.353 on tea-boxes.

   HOW THIS IS BUILT, and why it is two files per family rather than 213.

   Mirroring Google's own output meant 213 woff2 files and 812KB of CSS,
   because their CJK subsetting is generic: ~106 frequency-ordered slices per
   weight, sized for any site. This site's Chinese is a known, finite set —
   2,295 glyphs across every page and every string table. Subsetting to
   exactly that set collapses it to:

       one variable file per family, all weights 100-900 in the one file
       plus a Latin-only cut, so English text paints without waiting for CJK

   513KB + 684KB for the full faces, 61KB + 87KB for the Latin cuts. The
   unicode-range below is what makes the split work: a browser fetches the
   Latin file immediately and the CJK file only for pages that need it.

   TO REBUILD after adding new Chinese copy — the subset is only as complete
   as the text it was built from, so this is not optional:

     1. collect every codepoint in every .html and .js file under
        public/redesign, recursively
     2. pyftsubset NotoSansTC[wght].ttf --unicodes-file=... \
          --layout-features='*' --flavor=woff2 --output-file=...
        (masters: github.com/google/fonts ofl/notosanstc, ofl/notoseriftc)
     3. repeat for the Latin cut with U+0020-024F, 2000-206F, 20A0-20BF, 2100-214F

   A character that was not in the source at build time will fall through to
   the system CJK face — visible as a weight or shape mismatch mid-sentence.

   Do not write a shell glob for a nested directory anywhere in this comment —
   the double-star form used to be right there in step 1, spelling out star,
   star, slash, star. Read as four separate characters that is an ordinary
   glob. Read by a CSS tokenizer it is: an asterisk, then an asterisk-slash
   pair that CLOSES THIS COMMENT, then a stray asterisk left over. A CSS
   tokenizer does not know it is looking at prose inside a comment about globs;
   it just scans for asterisk-slash and stops at the first one it meets,
   wherever that is. (Writing out the two-character close sequence itself,
   even in quotes, reproduces the exact same failure — an earlier draft of
   this very explanation did that and broke the file it was describing.
   Spelling it as words is not a style choice here, it is the only way to
   discuss the bug inside the file it lives in.)

   The old glob truncated this comment right there, mid-sentence, and left
   everything after it — the remaining rebuild steps — parsed as invalid CSS.
   The parser's error recovery ate tokens until it resynchronized, and the
   rule it swallowed on the way was the very next one: the Noto Sans TC Latin
   @font-face block below. That block was never invalid. It was silently
   absent from every page on the site for as long as this comment contained
   that glob — present in the file, present in every HTTP response, verified
   byte-for-byte identical between disk and what the browser fetched, and
   still never reaching document.styleSheets, because the browser was not
   parsing the file the author thought they were looking at.

   The visible symptom was the preload warning every page logged in the
   console (preloaded but not used) plus, on close inspection, a font file
   that loaded, decoded, had every expected glyph, and was simply never once
   selected — an earlier investigation ruled out the file, the server, the
   cache and the unicode-range before finding this. If a future edit needs to
   describe a recursive path, write it as prose the way step 1 now does.
   ========================================================================== */

/* --- Latin. Small, and first: English headings paint immediately. --------- */
@font-face {
  font-family: "Noto Sans TC";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/noto-sans-tc-latin.woff2?v=c8cae01b) 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+2074, U+20AC,
                 U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Noto Serif TC";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/noto-serif-tc-latin.woff2?v=c8cae01b) 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+2074, U+20AC,
                 U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- The full faces, carrying the CJK. One variable file each. ------------ */
@font-face {
  font-family: "Noto Sans TC";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/noto-sans-tc.woff2?v=c8cae01b) format("woff2");
}
@font-face {
  font-family: "Noto Serif TC";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/noto-serif-tc.woff2?v=c8cae01b) format("woff2");
}
