/*
 * iERP — tipografía Geist SELF-HOSTED (`/assets/shared/fonts/geist/`).
 *
 * Por qué self-host y no Google Fonts: la CSP que sirve
 * `SecurityHeadersPolicy` es `style-src 'self' 'unsafe-inline'` +
 * `font-src 'self' data:`. El `<link>` a `fonts.googleapis.com` que había
 * antes en los layouts quedaba BLOQUEADO por esa política, así que la web
 * se pintaba con la fuente de sistema y `--font-sans` no llegaba a usarse
 * nunca. Sirviendo los `.woff2` desde el propio origen la CSP no necesita
 * excepciones, desaparece el round-trip a un tercero y la fuente deja de
 * depender de un CDN externo (RGPD: cero IPs de visitantes a Google).
 *
 * Qué ficheros son: los subsets `latin` y `latin-ext` que Google Fonts
 * genera para Geist, que son fuentes VARIABLES (`wght` 100→900). Un solo
 * fichero por subset cubre todos los pesos que usa el diseño (400 texto,
 * 500 UI, 600/700 titulares), así que pesa menos que cuatro estáticas:
 *
 *   geist-sans-latin.woff2       ~29 KB   jetbrains-mono-latin.woff2  ~31 KB
 *   geist-sans-latin-ext.woff2   ~16 KB   jetbrains-mono-latin-ext.woff2 ~12 KB
 *
 * `latin` cubre castellano e inglés enteros (los acentos y la ñ viven en
 * U+00C0-00FF); `latin-ext` sólo se descarga si la página pinta algún
 * glifo de ese rango — de ahí el `unicode-range`.
 *
 * Licencia: SIL Open Font License 1.1 — ver `fonts/geist/LICENSE.txt`
 * (https://github.com/vercel/geist-font).
 *
 * `font-display: swap`: el texto se ve inmediatamente con la fuente de
 * fallback de `--font-sans` y cambia a Geist cuando llega. La web pública
 * hace preload del subset latin de Geist Sans en `layouts/public.twig`
 * para que ese cambio ocurra antes del primer scroll.
 *
 * El `?v=1` de cada `url()` NO lo pone `asset()` (esto es CSS, no Twig):
 * es manual, y hay que subirlo a mano si algún día se regenera un
 * `.woff2`. Sin él la URL quedaría fuera del contrato de cache-busting
 * del proyecto y nginx la sirve con `Cache-Control: immutable, 1 año`
 * (ver `docker/nginx/web-publica.conf`). El `<link rel="preload">` del
 * layout tiene que llevar EXACTAMENTE el mismo sufijo.
 *
 * Consumidores: `--font-sans` / `--font-mono` de `shared/tokens.css`
 * (también `tailwind.input.css` y `preline-ierp-theme.css`). Este fichero
 * SÓLO declara los `@font-face`; no toca ninguna variable ni elemento.
 */

/* ---------------------------------------------------------------- Sans */

/* latin-ext */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/geist/geist-sans-latin-ext.woff2?v=1') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/geist/geist-sans-latin.woff2?v=1') 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;
}

/* ---------------------------------------------------------------- Mono */

/* JetBrains Mono (variable, wght 400-700) sustituye a Geist Mono por
   decisión de dirección (2026-08-13): mono más moderna y más legible en
   cuerpos pequeños — el terminal del agente de la home es su escaparate.
   Mismo mecanismo self-hosted; OFL en fonts/jetbrains-mono/LICENSE.txt. */

/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/jetbrains-mono/jetbrains-mono-latin-ext.woff2?v=1') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
    U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/jetbrains-mono/jetbrains-mono-latin.woff2?v=1') 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;
}
