/* ============================================================
   FMC · self-hosted fonts (latin subset)
   Replaces the render-blocking Google Fonts stylesheet.
   Files live in ../fonts/ · woff2 only · font-display: swap.
   Load this BEFORE sb-core.css / sb-guide.css.
   ============================================================ */

/* ---- Alfa Slab One · display · 400 ---- */
@font-face {
  font-family: "Alfa Slab One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/alfa-slab-one-400.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;
}

/* ---- Poppins · body · 400 / 500 / 600 ---- */
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/poppins-400.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: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/poppins-500.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: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/poppins-600.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;
}

/* ============================================================
   Size-adjusted local fallbacks — minimize CLS during swap.
   Metrics computed from the actual font files (hhea ascent /
   descent / line-gap + frequency-weighted average glyph width)
   against the local Georgia / Arial faces.
   ============================================================ */
@font-face {
  font-family: "Alfa Slab One Fallback";
  src: local("Georgia"), local("Georgia Bold");
  size-adjust: 121.90%;
  ascent-override: 84.99%;
  descent-override: 27.32%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Poppins Fallback";
  font-weight: 400;
  src: local("Arial");
  size-adjust: 113.71%;
  ascent-override: 92.34%;
  descent-override: 30.78%;
  line-gap-override: 8.79%;
}
@font-face {
  font-family: "Poppins Fallback";
  font-weight: 500;
  src: local("Arial");
  size-adjust: 114.62%;
  ascent-override: 91.61%;
  descent-override: 30.54%;
  line-gap-override: 8.72%;
}
@font-face {
  font-family: "Poppins Fallback";
  font-weight: 600;
  src: local("Arial Bold"), local("Arial");
  size-adjust: 115.34%;
  ascent-override: 91.04%;
  descent-override: 30.35%;
  line-gap-override: 8.67%;
}

/* Slot the tuned fallbacks into the site stacks.
   :root:root out-specifies the single :root in sb-core.css /
   sb-guide.css (which load AFTER this file), so the adjusted
   fallback — not raw system-ui/Georgia — renders during swap. */
:root:root {
  --font-display: "Alfa Slab One", "Alfa Slab One Fallback", Georgia,
    "Times New Roman", serif;
  --font-body: "Poppins", "Poppins Fallback", system-ui, "Helvetica Neue",
    Arial, sans-serif;
}
