/* RÝYTAS metric-matched font fallbacks (2026-11-21, CRM 857/36468).
   =================================================================

   WHY. A mobile guide page shifts while it loads. Measured cold on a Lighthouse
   mobile profile (412x823 @1.75 DPR, 4x CPU, 1.6 Mbit/s, 3 runs, production):

     /grybu-kava-gidas/   CLS 0.1236   ONE shift of 0.1215 at t=5481 ms,
                                       sources: three <p class=wp-block-paragraph>
     /matcha-gidas/       CLS 0.0017   no single shift >= 0.01

   The ten self-hosted woff2 files on that page complete between 5389 and 5669 ms.
   The shift lands inside that window, on paragraphs, with nothing else moving.
   It is the font swap.

   (The brief quoted CLS 0.2866 for /matcha-gidas/ from a 20 Nov run. That did not
   reproduce here: 0.0017 over three runs. The mechanism is real and is fixed
   below, but it was measured on the mushroom-coffee guide, not the matcha one.
   Full numbers: ops/evidence/seo-mobile-20261121/result.json.)

   WHAT ACTUALLY MOVES, AND WHY size-adjust IS THE WHOLE FIX.
   The obvious theory is line-box height -- Hanken Grotesk's own ascent+descent is
   130.3% of the em against Arial's 115.0%. That theory is WRONG FOR THIS THEME.
   Every relevant rule sets line-height as a UNITLESS NUMBER (body 1.55, .entry
   1.72, .entry h1-h4 1.28), and a numeric line-height makes the line box exactly
   font-size x number, with the font's vertical metrics playing no part.

   So the swap does not change line HEIGHTS. It changes line COUNTS: the fallback's
   glyphs are a different width, the paragraph re-wraps, its height changes, and
   every block below it moves. That is a horizontal problem and `size-adjust` is
   the only property that fixes it. The vertical overrides are kept because they
   are correct, cost nothing, and do matter for the few spots using
   line-height:normal -- but size-adjust is the load-bearing value.

   WHY ONE FACE PER WEIGHT, AND WHY THE NUMBERS ARE BROWSER-MEASURED.
   fonts.css names a separate file per weight, but Google Fonts CSS2 serves ONE
   VARIABLE file per family: hanken-grotesk-400-latin.woff2 ... -800-latin.woff2
   are byte-identical (md5 c501f578...), as are vollkorn-400 ... -700 (2b391a84...).
   fontTools reads the static hmtx table, i.e. only the default instance, so it
   reported an identical advance width for weight 400 and weight 800 -- a "0.00%
   spread" that looked like a clean result and was the measurement failing
   silently. Shipping that single number left a 600 heading 5.31% off and the 400
   italic 13.99% off (font-probe.mjs caught both). Only the browser instantiates
   the wght axis, so every size-adjust below is measured in Chromium at 200px over
   real Lithuanian/Latvian/Estonian copy, per weight, per style.
   Vollkorn italic is a genuinely separate and narrower file (md5 4cac3902...),
   hence its own face at 94.24%.

   WHY Times New Roman AND NOT Georgia. design.css names Georgia after Vollkorn and
   it is the nicer match by eye, but Georgia is not installed on this host and
   neither is Gelasio (its metric clone), so its advance widths cannot be measured
   here and will not be guessed. Times New Roman CAN be: Liberation Serif is its
   metric clone and is installed, as Liberation Sans is Arial's (both asserted, not
   assumed, by font-metrics.py -- it refuses the stand-in if the metrics ever stop
   matching). That is what makes a number measured on this Linux host correct for a
   shopper on Windows, macOS or iOS. Georgia still follows this family in the CSS
   stacks, so a machine with Georgia and no TNR keeps the old appearance.

   KNOWN GAP: ANDROID. Android ships neither Arial nor Times New Roman, so these
   families are skipped there and the stack falls through to system-ui / serif
   unadjusted. Roboto is deliberately NOT added to the src lists: it is ~3.5%
   narrower than Arial, so adopting it under an Arial-tuned size-adjust would make
   Android worse rather than better. Fixing Android properly needs its own
   calibrated face and its own measurement; it is recorded as open, not silently
   half-done.

   WHY NOT font-display:optional. Tested and rejected before this change: optional
   drops the webfont on a slow first load, so the page keeps the FALLBACK typeface
   -- a different look, not acceptable -- and it delayed paint. swap plus a
   metric-matched fallback keeps the brand typeface and removes the shift, instead
   of trading one for the other.

   DIACRITICS. No unicode-range on these faces, deliberately. The real families are
   split latin / latin-ext by unicode-range and every Baltic diacritic (ą č ę ė į š
   ų ū ž, ā ē ī ķ ļ ņ ū ž, õ ä ö ü) lives in the latin-ext file, so a narrower
   fallback range would let exactly those letters fall through to an unmatched font
   and shift on their own. Once the brand font's latin-ext file lands the brand font
   renders them -- it is earlier in the stack, and font-probe.mjs asserts that by
   checking a diacritic string measures DIFFERENTLY in the brand font than in the
   fallback (equal widths would mean the brand font never covered them).

   NOT WIRED: Caveat (.hand, a 22px decorative accent). Calibration measured it at
   75.54-76.21% against Arial; it is reported in calibration.json and left alone
   because it is one short line and out of this change's scope.

   REGENERATE: node ops/evidence/seo-mobile-20261121/calibrate-fonts.mjs <url>
   VERIFY:     node ops/evidence/seo-mobile-20261121/font-probe.mjs <url>
   CROSS-CHECK vertical metrics: python3 ops/evidence/seo-mobile-20261121/font-metrics.py */

@font-face {
  font-family: 'Hanken Grotesk Fallback';
  font-style: normal;
  font-weight: 400;
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica"),
       local("Liberation Sans");
  size-adjust: 99.39%;
  ascent-override: 100.61%;
  descent-override: 30.49%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Hanken Grotesk Fallback';
  font-style: normal;
  font-weight: 500;
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica"),
       local("Liberation Sans");
  size-adjust: 100.15%;
  ascent-override: 99.85%;
  descent-override: 30.25%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Hanken Grotesk Fallback';
  font-style: normal;
  font-weight: 600;
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica"),
       local("Liberation Sans");
  size-adjust: 100.94%;
  ascent-override: 99.07%;
  descent-override: 30.02%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Hanken Grotesk Fallback';
  font-style: normal;
  font-weight: 700;
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica"),
       local("Liberation Sans");
  size-adjust: 101.67%;
  ascent-override: 98.36%;
  descent-override: 29.8%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Hanken Grotesk Fallback';
  font-style: normal;
  font-weight: 800;
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica"),
       local("Liberation Sans");
  size-adjust: 102.47%;
  ascent-override: 97.59%;
  descent-override: 29.57%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Vollkorn Fallback';
  font-style: normal;
  font-weight: 400;
  src: local("Times New Roman"), local("Liberation Serif");
  size-adjust: 107.76%;
  ascent-override: 88.34%;
  descent-override: 40.92%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Vollkorn Fallback';
  font-style: normal;
  font-weight: 500;
  src: local("Times New Roman"), local("Liberation Serif");
  size-adjust: 110.58%;
  ascent-override: 86.09%;
  descent-override: 39.88%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Vollkorn Fallback';
  font-style: normal;
  font-weight: 600;
  src: local("Times New Roman"), local("Liberation Serif");
  size-adjust: 113.62%;
  ascent-override: 83.79%;
  descent-override: 38.81%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Vollkorn Fallback';
  font-style: normal;
  font-weight: 700;
  src: local("Times New Roman"), local("Liberation Serif");
  size-adjust: 117.29%;
  ascent-override: 81.17%;
  descent-override: 37.6%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Vollkorn Fallback';
  font-style: italic;
  font-weight: 400;
  src: local("Times New Roman Italic"), local("Liberation Serif Italic"),
       local("Times New Roman"), local("Liberation Serif");
  size-adjust: 93.75%;
  ascent-override: 101.55%;
  descent-override: 47.04%;
  line-gap-override: 0%;
}
