/* Valonia — tokens canónicos de identidad (fuente única: valonia-identidad).
   Consumir LITERAL; no editar fuera de este repo.
   DUAL (claro + oscuro) desde 2026-06-27 · ACENTO ÚNICO (esmeralda) desde 2026-07-11.
   RETIRADOS: verde viejo #42C96F · zafiro #4D8DE6 · rosa #FF5468/#C9184A (11-jul).
   Patrón dual: los componentes usan el token de TEXTO (--accent-ink) para tinta;
   resuelve al tono profundo (AA) sobre claro. El vivo (--accent) queda para
   grafismo grande, fills de botón y display.

   Este fichero es también LA CARGA DE FUENTES: cualquier HTML que lo enlace
   (<link rel="stylesheet" href=".../tokens/tokens.css">) recibe color + tipografía
   sin depender de Google Fonts ni de rutas propias. Un solo <link>, fuente de verdad
   única — no dupliques @font-face en otros ficheros del repo. */

/* ===== TIPOGRAFÍA — carga local self-hosted (rev. 2026-07-11c) =========== */
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/InstrumentSans-Variable.woff2") format("woff2-variations"),
       url("../fonts/InstrumentSans-Variable.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/InstrumentSans-Italic-Variable.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* Archivo: SOLO para el wordmark trazado (logo dibujado). Nunca en cuerpo/UI/headings. */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/Archivo.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ===== CARA OSCURA (por defecto) — el "AI-lab serio" ===================== */
:root {
  /* Declara el esquema a propósito: evita que el navegador "auto-oscurezca"
     una página que ya gestiona su propio dual (pelea de recoloreado). */
  color-scheme: dark;

  /* Superficies (profundidad por capas, no por sombras) */
  --carbon: #0F1415;        /* fondo inmersivo profundo */
  --bg: #14191A;            /* fondo base */
  --surface: #1C2325;       /* paneles */
  --surface2: #232B2C;      /* paneles elevados */

  /* Acento de marca — esmeralda, ÚNICO acento (la señal viva, escasa ~5%).
     Dato comparado / 2ª serie: escala de esmeralda + neutros (accent-ink vs
     accent vs muted), nunca un segundo matiz. Rosa #FF5468 ELIMINADO 2026-07-11. */
  --accent: #15C2A0;
  --accent-bright: #2FD9BC;
  --accent-ink: #0C8B73;    /* esmeralda profunda — texto/borde SOBRE FONDO NEUTRO */
  --accent-soft: #D9F4EE;
  --accent-rgb: 21, 194, 160;
  /* Tinta SOBRE el acento (botón primario, chips rellenos). Carbón en AMBAS caras:
     el fill esmeralda vivo no cambia entre caras, así que su tinta tampoco.
     7.7:1 sobre #15C2A0 (AAA). NUNCA uses --accent-ink aquí: daría verde
     sobre verde (1.9:1, ilegible). */
  --on-accent: #14191A;

  /* Tinta */
  --fg: #D7DDDA;
  --fg-strong: #F8F8FF;     /* ghost white */
  --muted: #8A9491;         /* stone */

  /* Líneas */
  --line: #2C3537;
  --line-strong: #3A4548;

  /* Estados (color + forma; nunca solo color). Error en naranja-rojo, nunca en el acento de marca. */
  --success: var(--accent);
  --danger: #FF7A4D;
  --warning: #E5B567;

  /* Tipografía (rev. 2026-07-11c: SISTEMA A 2 VOCES — Instrument Sans para
     display+cuerpo+UI y Geist Mono como firma técnica. Peso REGULAR: 400
     centro, 500 énfasis máximo, nunca bold, evitar ultra-thin; jerarquía por
     tamaño, aire y tinta. SIN SERIF. Clash Display y Satoshi RETIRADAS el
     11-jul (ficheros en ../_archivo/fonts-retiradas/). El wordmark sigue
     trazado en Archivo 900 como logo, no como tipografía de uso.
     Ficheros en ../fonts/ */
  --font-display: "Instrument Sans", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;

  /* Pesos (regla 2026-07-11b: regular como centro; nunca bold) */
  --weight-regular: 400;
  --weight-medium: 500;      /* énfasis máximo permitido */

  /* Escala tipográfica editorial (rev. 2026-07-11c; todo en Instrument Sans) */
  --text-hero: clamp(2.75rem, 2rem + 3.5vw, 4.5rem);      /* 400 · ls -0.01em */
  --text-display: clamp(2.125rem, 1.7rem + 2vw, 3rem);    /* 400 */
  --text-h1: clamp(1.625rem, 1.4rem + 1.2vw, 2.25rem);    /* 400-500 */
  --text-h2: 1.375rem;                                    /* 500 */
  --text-h3: 1.125rem;                                    /* 500 */
  --text-body-lg: 1.1875rem;
  --text-body: 1.0625rem;
  --text-body-sm: 0.9375rem;
  --text-caption: 0.8125rem;
  --text-kicker: 0.78rem;                                 /* Geist Mono, uppercase */
  --leading-display: 1.05;
  --leading-body: 1.65;
  --tracking-display: -0.01em;
  --tracking-kicker: 0.18em;

  /* Forma */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
}

/* ===== CARA CLARA — la cercana al ciudadano ============================== */
/* Activar con <html data-theme="light"> o la clase .theme-light (compat web). */
[data-theme="light"], .theme-light {
  color-scheme: light;
  --carbon: #FFFFFF;
  --bg: #F4F5F3;            /* off-white cálido dominante */
  --surface: #FFFFFF;
  --surface2: #ECEEEA;

  /* Esmeralda (único acento): vivo para grafismo, profundo para texto/UI (AA sobre blanco) */
  --accent: #15C2A0;
  --accent-bright: #2FD9BC;
  --accent-ink: #008064;    /* esmeralda profunda — AA texto sobre blanco (colorScale 700) */
  --accent-soft: #D9F4EE;
  --on-accent: #14191A;     /* igual que en oscuro: el fill esmeralda no cambia entre caras */

  /* Tinta */
  --fg: #2C302C;
  --fg-strong: #14191A;     /* carbón = titulares */
  --muted: #5F6864;         /* stone profundo — AA sobre blanco */

  /* Líneas */
  --line: #E2E3DF;
  --line-strong: #D2D4CF;

  /* Estados */
  --success: var(--accent-ink);
  --danger: #C0392B;
  --warning: #B8791F;
}
