/* Finarium — self-hosted webfonts for the WordPress theme.
   Replaces the Google Fonts <link>: no third-party request, no CLS,
   no consent-banner problem under GDPR (Google Fonts hotlinking is a
   documented data transfer — self-hosting removes it entirely).

   ── 1. Download the files (run once, from the theme root) ──────────────
   mkdir -p assets/fonts && cd assets/fonts
   # Archivo — variable, width + weight axes (the design uses wdth 106/108, wght 400–700)
   curl -LO https://github.com/googlefonts/archivo/raw/main/fonts/variable/Archivo%5Bwdth%2Cwght%5D.woff2
   mv 'Archivo[wdth,wght].woff2' archivo-var.woff2
   # IBM Plex Sans — static 300/400/500/600, latin + latin-ext
   curl -LO https://github.com/IBM/plex/raw/master/packages/plex-sans/fonts/complete/woff2/IBMPlexSans-Light.woff2
   curl -LO https://github.com/IBM/plex/raw/master/packages/plex-sans/fonts/complete/woff2/IBMPlexSans-Regular.woff2
   curl -LO https://github.com/IBM/plex/raw/master/packages/plex-sans/fonts/complete/woff2/IBMPlexSans-Medium.woff2
   curl -LO https://github.com/IBM/plex/raw/master/packages/plex-sans/fonts/complete/woff2/IBMPlexSans-SemiBold.woff2
   # IBM Plex Mono — static 400/500
   curl -LO https://github.com/IBM/plex/raw/master/packages/plex-mono/fonts/complete/woff2/IBMPlexMono-Regular.woff2
   curl -LO https://github.com/IBM/plex/raw/master/packages/plex-mono/fonts/complete/woff2/IBMPlexMono-Medium.woff2

   ── 2. Preload the two fonts above the fold (functions.php / <head>) ───
   <link rel="preload" href="/wp-content/themes/finarium/assets/fonts/archivo-var.woff2"        as="font" type="font/woff2" crossorigin>
   <link rel="preload" href="/wp-content/themes/finarium/assets/fonts/IBMPlexSans-Light.woff2"  as="font" type="font/woff2" crossorigin>
   Nothing else is preloaded — Mono and the heavier Sans weights are below the fold.

   ── 3. Licensing ──────────────────────────────────────────────────────
   Archivo: SIL Open Font License 1.1 (Omnibus-Type).
   IBM Plex Sans / Mono: SIL Open Font License 1.1 (IBM).
   Ship the OFL.txt of each family in assets/fonts/. */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var.woff2") format("woff2-variations");
  font-weight: 400 700;
  font-stretch: 100% 125%;   /* the design uses wdth 106 and 108 */
  font-style: normal;
  font-display: swap;
  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+2074, U+20AC, U+2122, U+2191,
                 U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/IBMPlexSans-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/IBMPlexSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/IBMPlexSans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* Fallback metrics — keeps the swap from shifting layout.
   Helvetica/Arial are close enough to Plex Sans at these settings. */
html {
  font-synthesis-weight: none;
}
