/* Möbius-owned font faces shared by the shell and isolated app frames. */

/* Self-hosted Inter and JetBrains Mono — served same-origin from
   /vendor/fonts/ so the shell renders correctly offline and without
   any Google Fonts network dependency. Latin subset only (covers
   all UI text); font-display: swap avoids FOIT on a cold load.
   Weights: Inter 400/500/600/700, JetBrains Mono 400/500.
   (Weight 450 appeared in the old Google Fonts URL but was never
   referenced in component CSS — omitted here.) */

/* Metric-matched local fallbacks (R7 prerequisite).
   `font-display: swap` means the FIRST paint of every chat uses a fallback
   family and the real face rewraps the whole transcript when it arrives. That
   rewrap is the single largest height producer on a cold visit and no scroll
   machinery can predict it, so it is removed at the source: the fallback is
   re-metricked to match Inter / JetBrains Mono, and the swap becomes a glyph
   substitution with no reflow.

   Derivation (all values MEASURED from public/vendor/fonts/*.woff2 with
   fontTools, not copied):
     size-adjust      = target.avgCharWidth / fallback.avgCharWidth
     ascent-override  = target.hheaAscent  / (unitsPerEm * size-adjust)
     descent-override = |target.hheaDescent| / (unitsPerEm * size-adjust)
     line-gap-override= target.hheaLineGap / (unitsPerEm * size-adjust)
   avgCharWidth uses the legacy OS/2 xAvgCharWidth algorithm (weighted mean of
   the advances of space + a-z) for BOTH sides, because that is the algorithm
   the fallback families' own published xAvgCharWidth was produced with;
   Inter's stored OS/2 value uses the newer all-glyph mean and is not
   comparable.

   Inter 400:            unitsPerEm 2048, hhea asc 1984, desc -494, gap 0,
                         legacy xAvgCharWidth 972.3 (0.474745em)
   Arial (fallback):     unitsPerEm 2048, OS/2 xAvgCharWidth 904 (0.441406em)
     size-adjust        = 0.474745 / 0.441406 = 1.07553  -> 107.6%
     ascent-override    = (1984/2048) / 1.07553 = 0.90072 -> 90.1%
     descent-override   = (494/2048)  / 1.07553 = 0.22427 -> 22.4%

   JetBrains Mono 400:   unitsPerEm 1000, hhea asc 1020, desc -300, gap 0,
                         legacy xAvgCharWidth 600 (0.6em)
   Menlo / DejaVu Sans Mono (fallback): advance 1233/2048 = 0.602051em
     size-adjust        = 0.6 / 0.602051 = 0.996593 -> 99.7%
     ascent-override    = 1.02 / 0.996593 = 1.023487 -> 102.3%
     descent-override   = 0.30 / 0.996593 = 0.301026 -> 30.1%

   A wrong number here shifts text once, statically, and is visible in review.
   It cannot become a race. */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial');
  size-adjust: 107.6%;
  ascent-override: 90.1%;
  descent-override: 22.4%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'JetBrains Mono Fallback';
  src: local('Menlo'), local('Consolas'), local('DejaVu Sans Mono');
  size-adjust: 99.7%;
  ascent-override: 102.3%;
  descent-override: 30.1%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/vendor/fonts/inter-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-036F, U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/vendor/fonts/inter-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-036F, U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/vendor/fonts/inter-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-036F, U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/vendor/fonts/inter-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-036F, U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/vendor/fonts/jetbrains-mono-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-036F, U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/vendor/fonts/jetbrains-mono-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-036F, U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
