/* ============================================================================
   @offal/ui · tokens.css
   Origen único de colores, tipografía, medidas y reglas globales de los
   sistemas Offal. Se copia a cada repo con `scripts/ui-sync.sh`.
   NO EDITAR EN EL REPO DESTINO: cambiar en plataforma/ui y propagar.
   ============================================================================ */

:root {
  /* --- paleta (la de kpi-offal, elegida como referencia en el issue #11) --- */
  --bg: #0c1c26;
  --bg-2: #0a171f;
  --panel: #12242f;
  --panel-2: #162b37;
  --line: #23353f;
  --line-2: #2f4552;
  --text: #eef2f5;
  --muted: #8ba0ab;
  --muted-2: #6b7f89;

  /* bronce de marca (el mismo del wordmark) */
  --primary: #b27746;
  --primary-bright: #d19a63;
  --primary-dark: #8a5a33;
  /* texto que va ENCIMA del bronce lleno. En blanco no llega a AA. */
  --sobre-primary: #1a1208;

  /* semánticos: fondo/borde y su variante legible como texto sobre oscuro */
  --info: #26b6d9;     --info-txt: #7fdcf0;
  --success: #2f9e6e;  --success-txt: #6ee7b7;
  --warn: #f5a623;     --warn-txt: #ffd27a;
  --danger: #e2574e;   --danger-txt: #f4a09a;

  /* --- forma --- */
  --radius: 14px;
  --radius-s: 10px;
  --radius-pill: 999px;
  --sombra: 0 16px 40px rgba(0, 0, 0, 0.5);
  --focus: 0 0 0 3px rgba(38, 182, 217, 0.55);

  /* --- medidas --- */
  --tap: 44px;        /* área táctil mínima (WCAG 2.5.5 / issue #11 punto 4) */
  --tap-l: 52px;      /* acciones principales en planta */
  --nav-h: 64px;
  --maxw: 1220px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;

  /* --- tipografía --- */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 11px; --fs-s: 13px; --fs-m: 14px; --fs-l: 16px; --fs-xl: 20px;
  --fs-h1: clamp(22px, 3vw, 30px);
}

/* Breakpoints. No son variables CSS (no se puede), así que van fijos y son
   SOLO estos dos. Ningún módulo agrega otros:
     celular   @media (max-width: 520px)
     tablet    @media (max-width: 820px)
     escritorio: el resto */

/* --- base --- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  font-family: var(--font);
  font-size: var(--fs-m);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#root { min-height: 100vh; }

/* Foco visible en todo lo interactivo, sólo cuando se navega con teclado. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

/* Quien pidió menos movimiento no ve spinners girando ni transiciones. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Link "Ir al contenido": invisible hasta que recibe foco por teclado. */
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 14px; border-radius: var(--radius-s);
  background: var(--info); color: #06222b; font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

/* Animaciones compartidas */
@keyframes ui-gira { to { transform: rotate(360deg); } }
@keyframes ui-brillo { from { background-position: 200% 0; } to { background-position: -200% 0; } }
