/* Sistema de diseño AEGIS: variables de los temas, tipografía y estados.
 * Copiado el 2026-12-03 del panel de la web de auditoría (Aegis Universe/auditoria (A)/dist/panel.html),
 * que es la fuente canónica. Si cambia allí, se actualiza aquí. Las reglas, en REGLAS-DISENO.md.
 *
 * Uso: <link rel="stylesheet" href="sistema-diseno/fuentes.css"> y <link rel="stylesheet" href="sistema-diseno/tokens.css">,
 * más <script src="sistema-diseno/tema.js"></script> en el <head>, antes de pintar (pone html[data-tema] y html[data-modo]).
 */

/* ---------- Tema oscuro ☾ (por defecto): obsidiana y oro ---------- */
:root {
  --brand: #ebb427;          /* oro de marca */
  --brand-soft: #f6c94a;     /* hover */
  --brand-text: #ebb427;     /* oro cuando es texto (en los temas claros se oscurece) */
  --ink: #f5f3ee;            /* texto */
  --muted: #cdc6b6;          /* texto secundario */
  --line: rgba(255,255,255,.09);
  --line-gold: rgba(235,180,39,.28);
  --gold-soft: rgba(235,180,39,.1);
  --steel: #90a7d8;          /* azul complementario: solo "en curso" */
  --neutro: #c9c4b8;         /* acento de iconos y numeración */
  --bg: #09090b;             /* negro obsidiana */
  --surface: #0f0f12;
  --surface-2: #16161a;
  --cristal: rgba(13,13,16,.88);     /* nunca más transparente: el fondo ocre lo vuelve marrón */
  --cristal-2: rgba(13,13,16,.94);
  --sobre: 255,255,255;      /* para rgba(var(--sobre), x) */
  --gris-fuerte: #3a372f;
  --velo: rgba(11,11,14,.15);
  --fondo-img: url('fondos/bg-marmol-oro.jpg');

  /* estados: un color por estado, sin verde */
  --hecho: #ebb427;          /* hecho = oro */
  --a-medias: #9c8448;       /* a medias = oro apagado */
  --ambar: #f0883e;  --ambar-bg: rgba(240,136,62,.12);    /* aviso (nunca un ámbar parecido al oro) */
  --rojo: #f87171;   --rojo-bg: rgba(248,113,113,.12);    /* error */

  /* tipografía */
  --font-display: 'Cinzel', 'Space Grotesk', Georgia, serif;   /* marca, titulares, títulos de tarjeta y cifras */
  --font-body: 'DM Sans', system-ui, sans-serif;               /* texto corrido */
  --font-mono: 'JetBrains Mono', monospace;                    /* etiquetas */

  /* movimiento */
  --ease: cubic-bezier(.19,1,.22,1);

  /* greca (como mask, con el color de fondo detrás) */
  --greca: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='12' viewBox='0 0 20 12'%3E%3Cpath d='M0 11H3V1H13V8H7V5H10M13 8V11H20' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='square'/%3E%3C/svg%3E");
  --greca-clave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='12' viewBox='0 0 20 12'%3E%3Cpath d='M0 10.5H3.5V1.5H13V8H7.5V5H10M13 8V10.5H20' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='square'/%3E%3C/svg%3E");

  color-scheme: dark;
}

/* ---------- Lo común de los temas de día (claro, diamante): pergamino y piedra, nada pasa de un 92 % de luz ---------- */
html[data-modo="claro"] {
  --ink: #24221d;
  --muted: #5a5447;
  --line: rgba(36,34,29,.13);
  --line-gold: rgba(138,98,0,.35);
  --gold-soft: rgba(235,180,39,.14);
  --steel: #3f5a99;
  --bg: #d9d2c3;
  --surface: #e6e0d3;
  --surface-2: #ded7c8;
  --cristal: rgba(232,226,213,.92);
  --cristal-2: rgba(228,221,207,.96);
  --sobre: 36,34,29;
  --brand-text: #7d5900;     /* el oro #ebb427 no se lee como texto sobre claro */
  --neutro: #67614f;
  --gris-fuerte: #cdc5b3;
  --rojo: #b2362a;  --rojo-bg: rgba(178,54,42,.1);
  --ambar: #954a0c; --ambar-bg: rgba(240,136,62,.14);   /* el panel usa #a8550f (4,0:1): aquí, oscurecido a 4,9:1 */
  --hecho: #7d5900;          /* el oro #ebb427 no se lee sobre pergamino (1,4:1) */
  --a-medias: #6e5a2a;       /* #9c8448 sobre pergamino da 2,7:1 */
  --velo: rgba(70,58,40,.32);
  --fondo-img: url('fondos/bg-medusa-dorada.jpg');
  color-scheme: light;
}

/* ---------- Tema diamante ◆: blanco, oro y cian ---------- */
html[data-tema="diamante"] {
  --ink: #16222a;
  --muted: #4b5d66;
  --line: rgba(16,40,52,.14);
  --line-gold: rgba(138,98,0,.4);
  --gold-soft: rgba(18,170,196,.12);
  --steel: #0a7586;          /* el panel usa #0b7f93 (4,4:1): aquí, oscurecido a 5,1:1 */
  --acento: #12a6bf;         /* cian solo de adorno (2,7:1): nunca para texto */
  --bg: #eef3f4;
  --surface: #f6f9f9;
  --surface-2: #eaf1f2;
  --cristal: rgba(246,250,250,.9);
  --cristal-2: rgba(240,246,247,.96);
  --sobre: 22,34,42;
  --brand-text: #7d5900;
  --neutro: #3f6a76;
  --gris-fuerte: #cfe0e3;
  --velo: rgba(28,62,74,.26);           /* velo frío para que el mármol no deslumbre */
  --fondo-img: url('fondos/bg-diamante.jpg');
}

/* ---------- Base ---------- */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
}
/* fondo con imagen y velo encima (el velo es obligatorio en los temas claros) */
.fondo-aegis {
  background:
    linear-gradient(var(--velo), var(--velo)),
    var(--fondo-img) center / cover fixed,
    var(--bg);
}

/* logotipo: el SVG es oro; en los temas de día se oscurece para que se lea */
html[data-modo="claro"] .logo-aegis { filter: brightness(.55) saturate(1.3); }

/* botones: píldora */
.btn-aegis {
  border-radius: 100px;
  background: var(--brand);
  color: #09090b;
  border: 0;
  transition: background .2s, transform .3s var(--ease);
}
.btn-aegis:hover { background: var(--brand-soft); }

/* greca fina bajo un título */
.greca {
  height: 12px;
  background: var(--brand);
  -webkit-mask: var(--greca) left center / 20px 12px repeat-x;
          mask: var(--greca) left center / 20px 12px repeat-x;
}

/* ---------- Selector de temas (lo rellena tema.js en cualquier <div class="temas" data-temas>) ---------- */
.temas {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line-gold);
  border-radius: 100px;
  background: var(--cristal-2);
}
.tema-btn {
  flex: none;
  width: 30px; height: 30px;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--brand-text);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .2s, transform .3s var(--ease);
}
.tema-btn:hover { background: var(--gold-soft); transform: rotate(-12deg); }
.tema-btn[aria-pressed="true"] { background: var(--brand); color: #09090b; }
.tema-btn[hidden] { display: none; }
.tema-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
