/* TTM self-hosted fonts (2026-08-08)
 * Replaces the two render-blocking Google Fonts <link> requests that pushed
 * mobile LCP to 6.93s (POOR). Self-hosted WOFF2 = no third-party round-trip.
 * font-display: swap keeps text visible; metric-matched fallback @font-faces
 * below prevent the layout shift swap normally causes (holds CLS near 0).
 *
 * Weights shipped: Space Grotesk 400/500/600/700, Inter 300/400/500/600/700,
 * JetBrains Mono 400/500. font-weight 800 (used in a few hero headings)
 * synthesises from 700 - visually near-identical, no extra file needed.
 */

/* ---------- Space Grotesk ---------- */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/space-grotesk-v22-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/space-grotesk-v22-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/space-grotesk-v22-latin-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/space-grotesk-v22-latin-700.woff2') format('woff2');
}

/* ---------- Inter ---------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/fonts/inter-v20-latin-300.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-v20-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-v20-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-v20-latin-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/inter-v20-latin-700.woff2') format('woff2');
}

/* ---------- JetBrains Mono ---------- */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-v24-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-v24-latin-500.woff2') format('woff2');
}

/* ---------- Metric-matched fallbacks (prevent CLS on font swap) ----------
 * These override Arial's metrics to match the web fonts, so when the real
 * font swaps in there is no reflow. size-adjust / ascent / descent values
 * are the widely-used published overrides for these families.
 */
@font-face {
  font-family: 'Space Grotesk Fallback';
  src: local('Arial');
  ascent-override: 95%;
  descent-override: 26%;
  line-gap-override: 0%;
  size-adjust: 100%;
}
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial');
  ascent-override: 90%;
  descent-override: 22.5%;
  line-gap-override: 0%;
  size-adjust: 107%;
}
