/* ============================================================================
   Self-hosted webfonts.

   These are served from this theme, not from Google's CDN. That is a privacy
   requirement, not a performance preference: a fonts.googleapis.com request
   sends every visitor's IP address to Google on page load, and the privacy
   policy commits to not handing visitor data to third parties. Do not replace
   these with a CDN link.

   Both families are variable fonts, so a single file covers the whole weight
   range we use. Licences: Geist (SIL OFL 1.1, Vercel), Source Serif 4
   (SIL OFL 1.1, Adobe). Both permit self-hosting and redistribution; the theme
   is GPL-compatible with them.
   ========================================================================= */

/* --- Geist — body. Matches the calculator app. -------------------------- */

@font-face {
	font-family: "Geist";
	font-style: normal;
	font-weight: 400 600;
	font-display: swap;
	src: url("../fonts/geist-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
		U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
		U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Geist";
	font-style: normal;
	font-weight: 400 600;
	font-display: swap;
	src: url("../fonts/geist-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
		U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
		U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
		U+A720-A7FF;
}

/* --- Source Serif 4 — marketing display only. The app stays sans. ------- */

@font-face {
	font-family: "Source Serif 4";
	font-style: normal;
	font-weight: 400 600;
	font-display: swap;
	src: url("../fonts/source-serif-4-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
		U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
		U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: "Source Serif 4";
	font-style: italic;
	font-weight: 400 600;
	font-display: swap;
	src: url("../fonts/source-serif-4-italic-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
		U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
		U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- metric-matched fallback ---------------------------------------------
   The wordmark and the hero headline visibly changed size when the real serif
   arrived: Georgia's cap height is ~3% larger than Source Serif 4's at the same
   font-size, so the fallback renders bigger and then shrinks on swap.

   Overriding the fallback's metrics closes that gap. Values are measured, not
   guessed — both faces are 1000/2048 upem and were compared directly:

     cap height   Source Serif 0.670 em  ·  Georgia 0.692 em  -> 96.8%
     advance      Source Serif 29.781    ·  Georgia 29.962     (0.6% apart)
     hhea asc/desc Source Serif 1.036 / 0.335 em

   size-adjust matches the apparent size; the ascent and descent overrides are
   expressed against the adjusted em, so they are the source metrics divided by
   0.968. Re-measure before changing either face.

   Charter and Iowan Old Style stay in the stack below for macOS, where they are
   closer to Source Serif than Georgia is. They are not metric-matched — Georgia
   is the fallback that actually renders for most visitors here. */
@font-face {
	font-family: "Source Serif 4 Fallback";
	src: local("Georgia");
	size-adjust: 96.8%;
	ascent-override: 107%;
	descent-override: 34.6%;
	line-gap-override: 0%;
}

/* Source Serif 4 carries an optical-size axis; letting the browser drive it
   means headline sizes get the display cut and body sizes the text cut. */
.rr-page {
	font-optical-sizing: auto;
}
