/* ============================================================
   EPC — Tokens de diseño compartidos (site/ + frontend/)
   FUENTE CANÓNICA. Este repo no tiene paso de build (ver
   .claude/skills/epc-web-frontend/SKILL.md), así que este archivo se
   duplica byte-a-byte en:
     - site/assets/tokens.css
     - frontend/tokens.css
   Si editás este archivo, editá también las dos copias — no hay forma
   automática de mantenerlas sincronizadas. Mismo patrón de disciplina que
   ya usa site/assets/superposiciones.css ("usa los tokens de styles.css").

   Reconciliación (auditoría 2026-09-21, ver docs/EPC_CONTEXT/03_WEB_UI.md):
   site/assets/styles.css y frontend/app.css eran dos sistemas de :root
   independientes. Acá se resuelven los choques reales:
     - --ink significaba texto en site y fondo en frontend → se separan en
       --bg y --text, sin reusar el nombre ambiguo.
     - texto secundario/terciario: se adoptan los valores de site (más
       claros/legibles) como canónicos para ambos — frontend gana contraste,
       no lo pierde.
     - acento rojo, verde de éxito, fuentes: mismo valor en ambos, solo
       cambia el nombre de la variable en uno de los dos archivos.
   ============================================================ */

/* Barlow y Barlow Condensed (SIL Open Font License 1.1), servidas desde aquí: el navegador ya no le pide
   nada a Google (privacidad.html, 2026-11-17). Solo latín y latín extendido. */
/* latin-ext */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/barlow-400-latin-ext.woff2) 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/barlow-400-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;
}
/* latin-ext */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/barlow-500-latin-ext.woff2) 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/barlow-500-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;
}
/* latin-ext */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/barlow-600-latin-ext.woff2) 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/barlow-600-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;
}
/* latin-ext */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/barlow-700-latin-ext.woff2) 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/barlow-700-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;
}
/* latin-ext */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/barlow-condensed-500-latin-ext.woff2) 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/barlow-condensed-500-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;
}
/* latin-ext */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/barlow-condensed-600-latin-ext.woff2) 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/barlow-condensed-600-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;
}
/* latin-ext */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/barlow-condensed-700-latin-ext.woff2) 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/barlow-condensed-700-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;
}

:root{
  color-scheme:light;
  /* superficie */
  --bg:#F2F2F4;           /* fondo de página: gris muy claro (rebrand 2026-10-14, video promo_web) */
  --bg2:#E9E9EC;          /* banda alterna (footer, secciones de cierre) */
  --panel:#FFFFFF;        /* tarjeta: blanca, con --shadow-card */
  --panel2:#F6F6F7;       /* hover / anidado / campos */

  /* texto — 3 niveles */
  --text:#0B0B0C;         /* primario: negro */
  --text2:#45454C;        /* secundario */
  --text3:#5E5E66;        /* terciario/metadata — ≥4,5:1 sobre --bg2, lo mide tests/contrast.test.mjs */

  /* bordes / marcas técnicas — ya idénticos en ambos */
  --line:#E4E4E7;
  --line2:#D4D4D8;
  --edge:#B8B8BF;

  /* acento = negro. Sin rojo de marca desde el rebrand (coach 2026-10-14):
     el color queda solo para datos y estados. tests/anti-slop lo vigila. */
  --accent:#0B0B0C;       /* botón principal, ítem elegido, foco */
  --accent2:#2A2A2E;      /* hover del acento */
  --on-accent:#FFFFFF;    /* texto sobre el acento */

  /* estado — solo estado, nunca marca */
  --ok:#5B3FC4;           /* cumplido: violeta (coach 2026-11-24: «el verde no debe existir… blanco y negro, si es caso, algún violeta») */
  --flag:#8A5A06;         /* parcial / aviso */
  --resalte:#F1EEFB;       /* fondo de la tarjeta donde se escribe: el único resalte (violeta muy suave) */
  --bad:#B3261E;          /* atrasado / error */

  /* datos del portal (macros, agua) — el sitio no los usa; viven acá por
     disciplina de fuente única. Oscurecidos para dar ≥4,5:1 como texto. */
  --prot:#5A5AB0;
  --carb:#8F5E0C;
  --fat:#A5512F;
  --water:#17749E;

  /* forma */
  --r:var(--r-md);        /* alias heredado → --r-md */

  /* ancho/gutter de página — solo site (frontend usa .wrap{max-width:600px}
     fijo, es un PWA angosto, no un valor que "se separó por error") */
  --maxw:1140px;
  --pad:clamp(20px,5vw,44px);

  /* tipografía */
  --display:"Barlow Condensed","Oswald","Arial Narrow",system-ui,sans-serif;
  --body:"Barlow",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace;
  /* estilo Apple (coach 2026-11-19, docs/DECISIONS/0011-estilo-apple.md): el portal usa la letra del
     sistema (SF Pro en iPhone y Mac, Roboto en Android, Segoe en Windows) y los números grandes en su versión
     redondeada (SF Pro Rounded, como Fitness). Barlow queda para el logo y el sitio público. */
  --ui:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --num:ui-rounded,"SF Pro Rounded",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;

  /* ---- Design System v4 (docs/EPC_CONTEXT/DESIGN/04_EPC_TOKENS.md) ---- */
  /* radios (coach 2026-09-27: esquinas redondeadas) */
  --r-sm:6px;
  --r-md:10px;
  --r-lg:16px;
  --r-full:999px;

  /* escala tipográfica única — 12px es el mínimo absoluto */
  --fs-12:.75rem;
  --fs-13:.8125rem;      /* rótulos y notas (Footnote de Apple) */
  --fs-14:.875rem;
  --fs-16:1rem;
  --fs-20:1.25rem;
  --fs-21:1.3125rem;     /* Fibonacci (coach 2026-11-19): 13 · 21 · 34 · 55, cada nivel ≈ 1,618 × el anterior */
  --fs-28:1.75rem;
  --fs-34:2.125rem;      /* título grande de cada pantalla (Large Title de Apple) */
  --fs-55:3.4375rem;     /* el número protagonista de una pantalla (peso de Progreso) */
  --fs-40:2.5rem;
  --fs-hero:clamp(3rem,8vw,6rem);

  /* espaciado (base 4) */
  --s-1:4px;--s-2:8px;--s-3:12px;--s-4:16px;--s-6:24px;--s-8:32px;--s-12:48px;--s-16:64px;--s-24:96px;

  /* objetivo táctil mínimo */
  --tap:44px;

  /* elevación: solo lo que flota */
  --shadow-card:0 1px 2px rgba(0,0,0,.04),0 8px 24px rgba(0,0,0,.06);
  --shadow-overlay:0 16px 40px rgba(0,0,0,.14),0 2px 6px rgba(0,0,0,.06);

  /* motion */
  --dur-fast:120ms;
  --dur:200ms;
  --dur-slow:320ms;
  --ease:cubic-bezier(.2,.7,.2,1);
  /* resortes (coach 2026-11-19): curvas linear() muestreadas de un resorte de masa 1 (app.js <resortes>).
     Llegan al 90 % antes de 320 ms (lo mide tests/ui-movimiento.test.mjs) y terminan de asentarse en --dur-resorte.
     Suave: sin rebote, para casi todo. Ágil: rebote 15 %, para lo que sigue al dedo y la presión al soltar. */
  --dur-resorte:520ms;
  --resorte:linear(0,.059,.1838,.326,.4612,.5793,.6772,.7556,.817,.8642,.9,.9268,.9467,.9614,.9721,.9799,.9856,.9897,.9927,.9948,1);
  --resorte-agil:linear(0,.0981,.2932,.4957,.6666,.7952,.884,.941,.975,.9935,1.0024,1.0057,1.0061,1.0052,1.004,1.0028,1.0018,1.0011,1.0006,1.0003,1);

  /* breakpoints (no se pueden usar como var() dentro de @media; son los
     únicos valores permitidos): 600 · 900 · 1200 */
}

/* «Aumentar contraste» del sistema (iPhone, Mac, Windows, Android): texto secundario y
   terciario ≥ 7:1 y bordes visibles (≥ 3:1 sobre --panel/--bg). Lo mide tests/ui-celular.test.mjs.
   Origen: apple-design §14 (emilkowalski/skills @ c8a7962, MIT), skill epc-ui-celular. */
@media (prefers-contrast:more){
  :root{
    --text2:#33333A;
    --text3:#45454C;
    --line:#77777F;
    --line2:#6B6B73;
    --edge:#55555C;
  }
}
