/* Self-hosted brand fonts (replaces the removed Google Fonts <link>).
   Weights limited to what styles.css actually uses:
     Spectral: 500, 600
     Instrument Sans: 400, 500, 700
     JetBrains Mono: 400, 500
   Each @font-face uses font-display: swap plus a metric-matched local
   fallback face (below) so the swap causes no layout shift. */

@font-face {
  font-family: 'Spectral';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/spectral-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Spectral';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/spectral-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/instrument-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/instrument-sans-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/instrument-sans-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2');
}

/* Metric-matched local fallbacks, computed from each webfont's OS/2 table
   against @capsizecss/metrics' published Georgia / Arial / Courier New
   metrics, so the fallback occupies the same box as the webfont and the
   swap at load time causes zero reflow.
   Formula (standard capsize / next/font approach):
     sizeAdjust = (webFont.xAvgCharWidth / webFont.unitsPerEm)
                / (fallback.xAvgCharWidth / fallback.unitsPerEm)
     ascent/descent/lineGap override = (webFont metric / webFont.unitsPerEm) / sizeAdjust */
@font-face {
  font-family: 'Spectral Fallback';
  src: local('Georgia');
  size-adjust: 134.1406%;
  ascent-override: 78.947%;
  descent-override: 34.516%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Instrument Sans Fallback';
  src: local('Arial');
  size-adjust: 126.5139%;
  ascent-override: 76.6714%;
  descent-override: 19.7607%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'JetBrains Mono Fallback';
  src: local('Courier New');
  size-adjust: 99.9837%;
  ascent-override: 102.0166%;
  descent-override: 30.0049%;
  line-gap-override: 0%;
}

/* Insert the metric-matched fallback into each font stack. styles.css sets
   these custom properties without a fallback face; redeclaring them here
   (this stylesheet loads after styles.css) overrides the values without
   editing styles.css. */
:root {
  --font-display: 'Spectral', 'Spectral Fallback', Georgia, serif;
  --font-body: 'Instrument Sans', 'Instrument Sans Fallback', system-ui, -apple-system, sans-serif;
  --font-data: 'JetBrains Mono', 'JetBrains Mono Fallback', ui-monospace, monospace;
}
