/* ============================================================================
 * HelitIA Design System v2 — Self-hosted typography
 *
 * Fonts (all OFL — SIL Open Font License 1.1, safe for commercial use):
 *   - Geist Variable      (sans)    — Vercel, Copyright 2023 basement.studio
 *   - Geist Mono Variable (mono)    — Vercel, Copyright 2023 basement.studio
 *   - Fraunces Variable   (display) — Undercase Type, Copyright 2018
 *
 * Files are served from /fonts/** (copied to public/fonts/** at build time).
 * Unicode-range is limited to Latin + Italian diacritics to reduce payload.
 * Variable fonts expose a weight axis (100–900) → single file covers all weights.
 * ============================================================================
 */

/* --------------------------------------------------------------------------
 * Unicode ranges
 * Basic Latin + Latin-1 Supplement + Latin Extended-A + currency + punctuation
 * Covers all Italian diacritics (à è é ì í î ò ó ù ú) + quotes/symbols.
 * -------------------------------------------------------------------------- */

/* ------ Geist (sans) — variable weight 100–900 -------------------------- */
@font-face {
  font-family: 'Geist';
  src: url('/fonts/geist/Geist-Variable.woff2') format('woff2-variations'),
       url('/fonts/geist/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0100-017F, U+0180-024F, U+2000-206F, U+2070-209F,
                 U+20A0-20CF, U+2100-214F, U+2150-218F, U+2190-21FF, U+2200-22FF;
}

/* ------ Geist Mono (monospace) — variable weight 100–900 ---------------- */
@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/geist-mono/GeistMono-Variable.woff2') format('woff2-variations'),
       url('/fonts/geist-mono/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0100-017F, U+0180-024F, U+2000-206F, U+2070-209F,
                 U+20A0-20CF, U+2100-214F, U+2190-21FF;
}

/* ------ Fraunces (display serif) — variable weight 100–900, opsz 9–144 - */
@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces/Fraunces-Variable.woff2') format('woff2-variations'),
       url('/fonts/fraunces/Fraunces-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0100-017F, U+0180-024F, U+2000-206F, U+2070-209F,
                 U+20A0-20CF, U+2100-214F, U+2150-218F, U+2190-21FF, U+2200-22FF;
}

/* ------ Fraunces Italic — variable weight 100–900, opsz 9–144 ----------- */
@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces/Fraunces-Italic-Variable.woff2') format('woff2-variations'),
       url('/fonts/fraunces/Fraunces-Italic-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0100-017F, U+0180-024F, U+2000-206F, U+2070-209F,
                 U+20A0-20CF, U+2100-214F, U+2150-218F, U+2190-21FF, U+2200-22FF;
}

/* --------------------------------------------------------------------------
 * CSS custom properties — expose font stacks for tokens/typography.js
 * -------------------------------------------------------------------------- */
:root {
  --font-sans:    'Geist', ui-sans-serif, system-ui, -apple-system,
                  BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
                  Arial, sans-serif;
  --font-mono:    'Geist Mono', ui-monospace, SFMono-Regular, 'Cascadia Code',
                  Menlo, Consolas, monospace;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
}

/* --------------------------------------------------------------------------
 * Utility classes (optional — tailwind `font-sans|mono|display` covers these)
 * -------------------------------------------------------------------------- */
.ds-font-sans    { font-family: var(--font-sans); }
.ds-font-mono    { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.ds-font-display { font-family: var(--font-display); font-feature-settings: 'ss01', 'ss02'; }
