/*
 * Sistema visual «Piezas que conversan» (2026-11).
 *
 * Única fuente de colores, letras, espacios, radios y sombras. Los demás CSS
 * usan estas variables; no deben escribir colores sueltos.
 * Rasgos: fondo lila, tarjetas blancas con borde de 2 px en tinta y sombras
 * duras desplazadas (sin desenfoque); el morado es la acción y el hueco.
 * Referencia: docs/rediseno-visual-2026-11/piezas-que-conversan/
 *
 * Contraste (WCAG 2.x, calculado con la fórmula de luminancia relativa):
 *   Claro
 *     tinta #1C1233 / papel #F4F1FF ........ 15.94   / hoja #FFF ...... 17.74
 *     tinta-2 #4D4566 / papel .............. 8.00    / hoja ........... 8.90
 *     tinta-3 #5E5679 / papel .............. 6.12    / hoja ........... 6.81
 *     acento-texto #5A22BD / papel ......... 7.87    / hoja ........... 8.76
 *     acento-hover #3F1690 / papel ......... 10.92
 *     blanco / acento #6A2BD6 .............. 7.17  (botón primario, hueco relleno)
 *     acento #6A2BD6 / papel (borde hueco) . 6.44  (≥3:1 de componente)
 *     peligro #B3261E / papel .............. 5.87    / peligro-suave .. 5.58
 *     exito #1F7A4D / papel ................ 4.78
 *     tinta / tintes de categoría .......... ≥13.09 (el más bajo: investigación)
 *     tinta / seleccion #EDE5FF ............ 14.58
 *     linea-fuerte #8A82A6 / hoja .......... 3.61  (bordes finos de campo ≥3:1)
 *     linea-punteada #CFC7E8 ............... 1.62  (solo decorativa: separadores)
 *   Oscuro
 *     tinta #F1EDFF / papel #15102A ........ 16.06   / hoja #221A3D ... 14.26
 *     tinta-2 #C4BBE0 / hoja ............... 8.99
 *     tinta-3 #A79DC8 / hoja ............... 6.47
 *     acento-texto #C9B2FF / hoja .......... 8.80    / papel .......... 9.91
 *     blanco / acento #6A2BD6 .............. 7.17
 *     hueco-borde #B79CFF / hoja ........... 7.18
 *     trazo #A797E0 / hoja ................. 6.35  (bordes)
 *     sombra-solida #7A66C9 / papel ........ 4.01  (sombra dura, decorativa)
 *     peligro #FF9A8F / hoja ............... 8.00
 *     exito #72D6A3 / hoja ................. 9.25
 *     tinta / tintes oscuros ............... ≥9.29
 */

/* Letras: Gabarito (títulos), Figtree (texto), DM Mono (cuerpo del prompt).
   Archivos locales en /fonts, subconjuntos latin + latin-ext (SIL OFL 1.1). */
@font-face {
  font-family: "Gabarito";
  src: url("/fonts/gabarito-latin-400-900.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  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-face {
  font-family: "Gabarito";
  src: url("/fonts/gabarito-latin-ext-400-900.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  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;
}
@font-face {
  font-family: "Figtree";
  src: url("/fonts/figtree-latin-300-900.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  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-face {
  font-family: "Figtree";
  src: url("/fonts/figtree-latin-ext-300-900.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  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;
}
@font-face {
  font-family: "Figtree";
  src: url("/fonts/figtree-latin-300-900-italic.woff2") format("woff2");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
  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-face {
  font-family: "Figtree";
  src: url("/fonts/figtree-latin-ext-300-900-italic.woff2") format("woff2");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
  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;
}
@font-face {
  font-family: "DM Mono";
  src: url("/fonts/dm-mono-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  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-face {
  font-family: "DM Mono";
  src: url("/fonts/dm-mono-latin-ext-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  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;
}
@font-face {
  font-family: "DM Mono";
  src: url("/fonts/dm-mono-latin-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  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-face {
  font-family: "DM Mono";
  src: url("/fonts/dm-mono-latin-ext-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  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;
}

:root {
  color-scheme: light;

  /* Letras */
  --letra-titulo: "Gabarito", "Segoe UI", system-ui, sans-serif;
  --letra-texto: "Figtree", "Segoe UI", system-ui, sans-serif;
  --letra-mono: "DM Mono", ui-monospace, Consolas, monospace;
  --f-titulo: var(--letra-titulo);
  --f-texto: var(--letra-texto);
  --f-prompt: var(--letra-mono);

  /* Escala fija (rem relativo a 16 px; «texto grande» sube la raíz a 18 px) */
  --t-xs: 0.875rem;   /* 14 */
  --t-s: 1rem;        /* 16 */
  --t-m: 1.125rem;    /* 18 */
  --t-l: 1.3125rem;   /* 21 */
  --t-xl: 1.5rem;     /* 24 */
  --t-2xl: 1.875rem;  /* 30 */
  --t-3xl: 2.25rem;   /* 36 */
  --t-4xl: 3rem;      /* 48 */
  --t-5xl: 3.75rem;   /* 60 */

  /* Espacios: múltiplos de 4 px */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.25rem;
  --s-6: 1.5rem;
  --s-8: 2rem;
  --s-10: 2.5rem;
  --s-12: 3rem;
  --s-16: 4rem;

  /* Forma: píldora, tarjeta, mosaico (y un radio chico para campos de varias líneas) */
  --radio-pildora: 999px;
  --radio-tarjeta: 18px;
  --radio-mosaico: 14px;
  --radio-campo: 12px;
  --r-1: var(--radio-campo);
  --r-2: var(--radio-tarjeta);
  --r-p: var(--radio-pildora);

  --ancho: 1180px;
  --barra-alto: 68px;

  /* Color — claro «tinta y categorías»: papel cálido, botones y huecos en
     tinta casi negra; el color lo ponen las categorías (como el oscuro). */
  --tinta: #1c1917;
  --tinta-hover: #3a3532;
  --tinta-2: #4a4540;
  --tinta-3: #5f5952;
  --sobre-tinta: #ffffff;
  --papel: #f7f5f0;
  --hoja: #ffffff;
  --panel: #f7f5f0;
  --hundido: #f1eee7;
  --seleccion: #ece8df;
  --deshabilitado: #e2ddd2;
  --trazo: var(--tinta);
  --linea: #d9d3c7;
  --linea-punteada: #d1cabd;
  --linea-fuerte: #8a8377;

  --acento: #1c1917;
  --acento-texto: #1c1917;
  --acento-hover: #3a3532;
  --sobre-acento: #ffffff;
  --accion: var(--acento-texto);
  --foco: var(--acento);
  /* Contorno de «opción elegida» (avatar, modelo): ≥3:1 sobre las superficies del tema. */
  --indicador: var(--acento);

  /* Huecos: vacío = píldora punteada en tinta; relleno = píldora de tinta sólida */
  --hueco-borde: var(--acento);
  --hueco-texto: var(--acento-texto);
  --hueco-fondo: var(--hoja);
  --hueco-relleno: var(--acento);
  --hueco-relleno-texto: var(--sobre-acento);

  /* El «resaltador» de antes ahora es el morado del hueco relleno. */
  --resaltador: var(--hueco-relleno);
  --resaltador-suave: var(--seleccion);
  --sobre-resaltador: var(--hueco-relleno-texto);
  --amarillo: #ffe8a8;
  /* Estrella de «Editorial». */
  --estrella: var(--acento);

  --peligro: #b3261e;
  --peligro-suave: #fbe9e7;
  --exito: #1f7a4d;
  --exito-suave: #ddf5e6;
  --velo: rgb(28 25 23 / 55%);

  /* Sombras duras: desplazadas, sin desenfoque, del color del trazo */
  --sombra-solida: var(--trazo);
  --sombra-dura-s: 3px 3px 0 var(--sombra-solida);
  --sombra-dura-m: 4px 4px 0 var(--sombra-solida);
  --sombra-dura-l: 6px 6px 0 var(--sombra-solida);
  --sombra-dura-xs: 2px 2px 0 var(--sombra-solida);
  --borde-grueso: 2px solid var(--trazo);
  --borde-fino: 1.5px solid var(--trazo);
  --separador: 2px dotted var(--linea-punteada);
  --sombra-color: 28 25 23;
  --sombra-1: var(--sombra-dura-m);
  --sombra-2: var(--sombra-dura-l);

  /* Fichas en claro: franja superior y píldora con el tinte de su categoría. */
  --ficha-banda: 10px;
  --ficha-chip: 100%;
  --ficha-chip-pad: 10px;

  /* Tintes de categoría (fondos de mosaico, chips y etiquetas; texto en tinta) */
  --tinte-programacion: #cfe0ff;
  --tinte-escritura: #ebd9ff;
  --tinte-marketing: #ffd9c7;
  --tinte-productividad: #c9f0da;
  --tinte-vida-cotidiana: #ffe8a8;
  --tinte-negocios: #ecdcb8;
  --tinte-diseno: #ffd1e6;
  --tinte-aprendizaje: #c8eef3;
  --tinte-investigacion: #d9e3ef;

  /* Categorías: color del icono (≥3:1 sobre blanco) + su tinte */
  --cat-escritura: #7a3fc4;
  --cat-escritura-suave: var(--tinte-escritura);
  --cat-marketing: #b5532f;
  --cat-marketing-suave: var(--tinte-marketing);
  --cat-programacion: #2f5bb3;
  --cat-programacion-suave: var(--tinte-programacion);
  --cat-datos: #4f4f80;
  --cat-datos-suave: var(--tinte-investigacion);
  --cat-productividad: #1f7a4d;
  --cat-productividad-suave: var(--tinte-productividad);
  --cat-aprendizaje: #1f7480;
  --cat-aprendizaje-suave: var(--tinte-aprendizaje);
  --cat-diseno: #b0386f;
  --cat-diseno-suave: var(--tinte-diseno);
  --cat-negocios: #6e6440;
  --cat-negocios-suave: var(--tinte-negocios);
  --cat-vida: #8a6200;
  --cat-vida-suave: var(--tinte-vida-cotidiana);

  /* Nombres anteriores: alias para que el CSS existente use el sistema nuevo */
  --paper: var(--papel);
  --white: var(--hoja);
  --ink: var(--tinta);
  --muted: var(--tinta-2);
  --line: var(--linea);
  --green: var(--seleccion);
  --dark: var(--tinta);
  --coral: var(--peligro);
  --soft: var(--hundido);
  --font-display: var(--f-titulo);
  --font-body: var(--t-s);
  --font-small: var(--t-xs);
}

/* Oscuro «blanco y negro»: papel negro profundo, trazo y acento blancos. Sigue al sistema
   salvo que la persona elija otra cosa (theme.js pone data-theme). Los dos
   bloques siguientes deben quedar iguales. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --tinta: #f5f5f4;
    --tinta-hover: #ffffff;
    --tinta-2: #c2c2c0;
    --tinta-3: #9a9a97;
    --sobre-tinta: #0a0a0a;
    --papel: #050505;
    --hoja: #121212;
    --panel: #0c0c0c;
    --hundido: #0c0c0c;
    --seleccion: #262626;
    --deshabilitado: #2b2b2b;
    --trazo: #626260;
    --linea: #262626;
    --linea-punteada: #3a3a3a;
    --linea-fuerte: #8a8a87;
    --acento: #f5f5f4;
    --acento-texto: #ffffff;
    --acento-hover: #d6d6d4;
    --sobre-acento: #0a0a0a;
    --foco: #ffffff;
    --indicador: #ffffff;
    --hueco-borde: #d6d6d4;
    --hueco-texto: #ffffff;
    --hueco-fondo: #0c0c0c;
    --hueco-relleno: #f5f5f4;
    --hueco-relleno-texto: #0a0a0a;
    --amarillo: #3a3a3a;
    --estrella: #f2c94c;
    --peligro: #ff9a8f;
    --peligro-suave: #2e1716;
    --exito: #7fd6a8;
    --exito-suave: #12261d;
    --velo: rgb(0 0 0 / 75%);
    --sombra-solida: #262625;
    --sombra-color: 0 0 0;
    /* Sin franja ni píldora de color en las fichas: en oscuro el color va en el texto. */
    --ficha-banda: 0px;
    --ficha-chip: 0%;
    --ficha-chip-pad: 0px;
    --tinte-programacion: #11161f;
    --tinte-escritura: #17131f;
    --tinte-marketing: #1d1411;
    --tinte-productividad: #101a14;
    --tinte-vida-cotidiana: #1c180d;
    --tinte-negocios: #191710;
    --tinte-diseno: #1d1218;
    --tinte-aprendizaje: #0f191a;
    --tinte-investigacion: #15151c;
    --cat-escritura: #c9a6ff;
    --cat-marketing: #f08f6b;
    --cat-programacion: #8fb4ff;
    --cat-datos: #b8b8e8;
    --cat-productividad: #6fd6a0;
    --cat-aprendizaje: #6fd3df;
    --cat-diseno: #f39cc4;
    --cat-negocios: #d8cca0;
    --cat-vida: #f2cf6a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --tinta: #f5f5f4;
  --tinta-hover: #ffffff;
  --tinta-2: #c2c2c0;
  --tinta-3: #9a9a97;
  --sobre-tinta: #0a0a0a;
  --papel: #050505;
  --hoja: #121212;
  --panel: #0c0c0c;
  --hundido: #0c0c0c;
  --seleccion: #262626;
  --deshabilitado: #2b2b2b;
  --trazo: #626260;
  --linea: #262626;
  --linea-punteada: #3a3a3a;
  --linea-fuerte: #8a8a87;
  --acento: #f5f5f4;
  --acento-texto: #ffffff;
  --acento-hover: #d6d6d4;
  --sobre-acento: #0a0a0a;
  --foco: #ffffff;
  --indicador: #ffffff;
  --hueco-borde: #d6d6d4;
  --hueco-texto: #ffffff;
  --hueco-fondo: #0c0c0c;
  --hueco-relleno: #f5f5f4;
  --hueco-relleno-texto: #0a0a0a;
  --amarillo: #3a3a3a;
  --estrella: #f2c94c;
  --peligro: #ff9a8f;
  --peligro-suave: #2e1716;
  --exito: #7fd6a8;
  --exito-suave: #12261d;
  --velo: rgb(0 0 0 / 75%);
  --sombra-solida: #262625;
  --sombra-color: 0 0 0;
  /* Sin franja ni píldora de color en las fichas: en oscuro el color va en el texto. */
  --ficha-banda: 0px;
  --ficha-chip: 0%;
  --ficha-chip-pad: 0px;
  --tinte-programacion: #11161f;
  --tinte-escritura: #17131f;
  --tinte-marketing: #1d1411;
  --tinte-productividad: #101a14;
  --tinte-vida-cotidiana: #1c180d;
  --tinte-negocios: #191710;
  --tinte-diseno: #1d1218;
  --tinte-aprendizaje: #0f191a;
  --tinte-investigacion: #15151c;
  --cat-escritura: #c9a6ff;
  --cat-marketing: #f08f6b;
  --cat-programacion: #8fb4ff;
  --cat-datos: #b8b8e8;
  --cat-productividad: #6fd6a0;
  --cat-aprendizaje: #6fd3df;
  --cat-diseno: #f39cc4;
  --cat-negocios: #d8cca0;
  --cat-vida: #f2cf6a;
}
