/* ============================================================
   TGDC Typography — self-hosted fonts + tokens
   Tiempos Headline + Tiempos Text: LICENSED retail WOFF2 (Klim
   Order 26060580, 2026-06-12 — see fonts/licenses/KLIM-Tiempos.txt),
   Latin-subset via fontTools per the commercial license. Variable
   fonts also owned (order folder) if wanted later.
   General Sans: Fontshare kit WOFF2, shipped byte-identical
   (ITF Free Font License prohibits modification — do NOT subset
   or re-encode these files; see fonts/licenses/FFL-GeneralSans.txt).
   Erode/Literata (superseded 2026-06 by Tiempos, files retained in
   fonts/ for rollback; licenses in fonts/licenses/).
   Fallback metric overrides computed from font tables (hhea ascent/
   descent/lineGap, frequency-weighted avg advance width) against
   macOS Georgia/Arial — fontaine-style CLS insurance. Verified
   identical between Klim test and retail files 2026-06-12.
   ============================================================ */

/* ---- Tiempos Headline (display) — Latin subset ---- */
@font-face {
  font-family: 'Tiempos Headline';
  src: url('fonts/tiempos-headline-medium-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-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Tiempos Headline';
  src: url('fonts/tiempos-headline-semibold-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-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Tiempos Headline';
  src: url('fonts/tiempos-headline-regular-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;
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ---- Tiempos Text (body) — Latin subset ---- */
@font-face {
  font-family: 'Tiempos Text';
  src: url('fonts/tiempos-text-regular-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-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Tiempos Text';
  src: url('fonts/tiempos-text-regular-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;
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Tiempos Text';
  src: url('fonts/tiempos-text-semibold-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-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---- General Sans (UI) ---- */
@font-face {
  font-family: 'General Sans';
  src: url('fonts/GeneralSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('fonts/GeneralSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('fonts/GeneralSans-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('fonts/GeneralSans-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ---- Metric-adjusted local fallbacks (CLS insurance) ---- */
@font-face {
  font-family: 'Tiempos Headline Fallback';
  src: local('Georgia');
  size-adjust: 104.66%;
  ascent-override: 91.92%;
  descent-override: 23.89%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Tiempos Text Fallback';
  src: local('Georgia');
  size-adjust: 105.92%;
  ascent-override: 90.82%;
  descent-override: 23.60%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'General Sans Fallback';
  src: local('Arial');
  size-adjust: 101.60%;
  ascent-override: 99.41%;
  descent-override: 23.62%;
  line-gap-override: 9.84%;
}

/* ---- Tokens ---- */
:root {
  --font-display: 'Tiempos Headline', 'Tiempos Headline Fallback', Georgia, 'Times New Roman', serif;
  --font-body: 'Tiempos Text', 'Tiempos Text Fallback', Georgia, serif;
  --font-ui: 'General Sans', 'General Sans Fallback', -apple-system, 'Segoe UI', sans-serif;
  --display-weight: 600;
  /* Optical size dials. Tiempos carries its sizes natively (cap height
     0.702em ≈ Lora/Poppins/Georgia ~0.70), so both dials are OFF.
     They existed to compensate Erode (caps 0.604em → dial was 0.51) and
     Literata (body bump → 0.53). Every swept display rule references
     font-size-adjust: var(--display-optical-size, none); every swept
     body rule references var(--body-optical-size, none). Set a number
     (it's an x-height aspect target) to re-engage either dial. */
  --display-optical-size: none;
  --body-optical-size: none;
}

/* ---- Global retune ----
   Loaded bold faces top out at 600 (no 700 shipped for any family);
   600 is the design's bold across all three families. */
b, strong { font-weight: 600; }

/* Display serif tracks slightly loose at large sizes */
h1, h2 { letter-spacing: -0.005em; }
