/**
 * IBM Plex — self-hosted, OFL-1.1 licensed.
 *
 * Files: assets/fonts/plex-{sans,serif,mono}-{400,600,400i}.woff2
 * Source: Fontsource latin-ext subsets (covers Polish ąćęłńóśźż, Czech,
 * Hungarian, Vietnamese with locale forms). Total weight ~77 KB.
 *
 * Strategy:
 *   - font-display: swap so text is readable on first paint with the
 *     system fallback, then re-renders when Plex arrives.
 *   - size-adjust + ascent/descent overrides on the fallback to minimize
 *     CLS during the swap (the fallback metric matches Plex closely).
 *   - unicode-range: U+0000-024F covers Latin Extended-A and -B; we
 *     don't load Cyrillic/Greek subsets we don't need.
 *   - Preload of plex-sans-400 happens in functions.php (LCP path).
 */

/* IBM Plex Sans — body, UI, navigation. The most-used face. */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('IBM Plex Sans Regular'), local('IBMPlexSans-Regular'),
       url('fonts/plex-sans-400.woff2') format('woff2');
  unicode-range: U+0000-024F, U+0259, U+1E00-1EFF, U+2000-2300;
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: local('IBM Plex Sans SemiBold'), local('IBMPlexSans-SemiBold'),
       url('fonts/plex-sans-600.woff2') format('woff2');
  unicode-range: U+0000-024F, U+0259, U+1E00-1EFF, U+2000-2300;
}

/* IBM Plex Serif — headlines (h1, h2). Fewer weights to keep payload light. */
@font-face {
  font-family: 'IBM Plex Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('IBM Plex Serif'), local('IBMPlexSerif-Regular'),
       url('fonts/plex-serif-400.woff2') format('woff2');
  unicode-range: U+0000-024F, U+0259, U+1E00-1EFF, U+2000-2300;
}

@font-face {
  font-family: 'IBM Plex Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: local('IBM Plex Serif Italic'), local('IBMPlexSerif-Italic'),
       url('fonts/plex-serif-400i.woff2') format('woff2');
  unicode-range: U+0000-024F, U+0259, U+1E00-1EFF, U+2000-2300;
}

/* IBM Plex Mono — code, eyebrows, chips, stat numbers. */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('IBM Plex Mono'), local('IBMPlexMono-Regular'),
       url('fonts/plex-mono-400.woff2') format('woff2');
  unicode-range: U+0000-024F, U+0259, U+1E00-1EFF, U+2000-2300;
}

/* Metric override on the system-font fallback to minimize CLS during
   the font-swap. Numbers calibrated for IBM Plex Sans against
   `system-ui` / `-apple-system` / `Segoe UI` (DebugBear methodology). */
@font-face {
  font-family: 'Plex Sans Fallback';
  src: local('Segoe UI'), local('system-ui'), local('-apple-system'), local('BlinkMacSystemFont');
  ascent-override: 95%;
  descent-override: 25%;
  line-gap-override: 0%;
  size-adjust: 100%;
}

@font-face {
  font-family: 'Plex Serif Fallback';
  src: local('Georgia'), local('Cambria'), local('Times New Roman');
  ascent-override: 92%;
  descent-override: 23%;
  size-adjust: 102%;
}

@font-face {
  font-family: 'Plex Mono Fallback';
  src: local('Menlo'), local('Consolas'), local('Liberation Mono');
  ascent-override: 90%;
  descent-override: 22%;
  size-adjust: 100%;
}
