/**
 * Self-hosted, subset (Latin) woff2 for Space Grotesk, Karla and JetBrains
 * Mono — CLAUDE.md §14 "self-hosted fonts, font-display: swap, preloaded",
 * replacing the Google Fonts CDN load design-reference.html originally
 * specified (deferred to Workstream 8, IMPLEMENTATION.md). Weights match
 * exactly what theme-setup.php's superseded Google Fonts URL requested:
 * Karla 400/500/600/700, Space Grotesk 400/500/600/700, JetBrains Mono
 * 400/500/700. Files are the Latin-only static instances Google serves to
 * non-variable-font user agents (~13-22KB each, ~200KB declared total —
 * only the weights actually rendered on a given page are ever fetched by
 * the browser, since unused @font-face rules are not downloaded).
 *
 * Enqueued by inc/setup/enqueue-fonts.php, which also dequeues the
 * Google-hosted si-fonts/si-fonts-preconnect handles theme-setup.php
 * registers.
 */

@font-face {
	font-family: 'Karla';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/karla-400.woff2') format('woff2');
}

@font-face {
	font-family: 'Karla';
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url('../fonts/karla-500.woff2') format('woff2');
}

@font-face {
	font-family: 'Karla';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('../fonts/karla-600.woff2') format('woff2');
}

@font-face {
	font-family: 'Karla';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('../fonts/karla-700.woff2') format('woff2');
}

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

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

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

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

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

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

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

/*
 * issueslog.md #053 — metric-matched fallbacks. With font-display: swap the
 * first paint uses the system fallback, and the swap to the web font
 * rewrapped hero headings and intros (CLS 0.14 on cold loads). These faces
 * point at the local Arial but are resized/re-spaced to the web fonts'
 * metrics, so the swap barely moves anything. Values: size-adjust is the
 * measured advance-width ratio of each web font to Arial over a body-copy
 * sample (Space Grotesk at the 600 heading weight, Karla at 400);
 * ascent/descent are the fonts' own hhea metrics divided by that ratio.
 * Listed second in the --font-display / --font-body stacks (tokens.css).
 */
@font-face {
	font-family: 'Space Grotesk Fallback';
	src: local('Arial'), local('ArialMT');
	size-adjust: 101.9%;
	ascent-override: 96.6%;
	descent-override: 28.7%;
	line-gap-override: 0%;
}

@font-face {
	font-family: 'Karla Fallback';
	src: local('Arial'), local('ArialMT');
	size-adjust: 102.7%;
	ascent-override: 89.3%;
	descent-override: 24.5%;
	line-gap-override: 0%;
}
