/* ============================================================
   tokens.css — base de diseño del sistema
   KUSHIRO · dirección "Cartel de pared" (brutalismo señalético)

   Se carga PRIMERO, antes que styles.css / admin.css.
   Lo único que se edita por proyecto es el bloque 1.

   Todos los contrastes de este archivo están MEDIDOS
   (OKLCH → sRGB → WCAG), no estimados. Los valores están
   anotados al lado de cada par que importa.
   ============================================================ */

/* ------------------------------------------------------------
   1. POR PROYECTO
   ------------------------------------------------------------ */
:root {
  /* Hue que gobierna TODA la paleta.
     28 = el rojo del logo KS medido pixel por pixel:
     RGB(233,38,32) → oklch(60% .227 28). No es un rojo elegido:
     es el que ya tiene la marca. */
  --h: 28;

  /* Una sola grotesca en muchos pesos Y ANCHOS (Archivo es variable:
     wdth 62-125, wght 100-900). El eje de ancho es lo que hace que
     esto se lea como cartel y no como landing.
     Martian Mono lleva los precios y la metadata: es variable también,
     y sus cifras son tabulares → el riel de precios queda a plomo. */
  --f-display: "Archivo", "Archivo Narrow", Impact, sans-serif;
  --f-texto:   "Archivo", system-ui, sans-serif;
  --f-mono:    "Martian Mono", ui-monospace, "SFMono-Regular", monospace;

  /* Brutalismo señalético = bordes duros. Cero radio en todo el sitio. */
  --radio: 0px;

  /* Grano. Sobre fondo oscuro el ruido se lee más fuerte que sobre papel,
     así que va más bajo que el 0.045 de una dirección clara. */
  --grano: 0.028;

  /* El ancho de la grilla visible: es el signature move de esta dirección. */
  --grid-cols: 12;
}

/* ------------------------------------------------------------
   2. COLOR — derivado del hue. Ningún neutro es gris puro.
   ------------------------------------------------------------ */
:root {
  /* — Rojos. Tres, y cada uno tiene UN trabajo. No son intercambiables. — */

  /* Relleno: botones, chips activos, bloques. Lleva --hueso encima. → 5.08:1 */
  --acento: oklch(53% 0.21 var(--h));

  /* El rojo exacto del logo. SOLO display grande (≥24px) y filetes. → 4.19:1
     Prohibido para texto chico: no llega a 4.5. */
  --acento-vivo: oklch(60% 0.227 var(--h));

  /* Texto rojo sobre el negro, en cualquier tamaño. → 5.85:1
     Chroma topeada en .20: arriba de eso clipea fuera de gamut y sale salmón. */
  --acento-claro: oklch(68% 0.20 var(--h));

  /* — Neutros. Todos teñidos con el hue del acento, chroma bajísima. — */
  --negro:     oklch(19% 0.008 var(--h));  /* #171212 — fondo. NO es #000 */
  --negro-alt: oklch(23% 0.010 var(--h));  /* #211b1a — bloques y filas alternas */
  --negro-alto: oklch(15% 0.007 var(--h)); /* el negro más profundo: barras fijas */

  /* El hueso corre el hue +25 (=53). Sin ese corrimiento un hue 28 al 95%
     de luz se lee rosado en vez de blanco roto. */
  --hp: calc(var(--h) + 25);
  --hueso:       oklch(95% 0.005 var(--hp));            /* #f1eeeb → 15.97:1 */
  --texto:       oklch(95% 0.005 var(--hp));
  --texto-suave: oklch(95% 0.005 var(--hp) / 0.62);     /* → 10.28:1 */
  --texto-tenue: oklch(95% 0.005 var(--hp) / 0.40);     /* solo decorativo */

  /* Hairlines — reemplazan a las sombras en todo el sitio. */
  --linea:        oklch(95% 0.005 var(--hp) / 0.14);
  --linea-fuerte: oklch(95% 0.005 var(--hp) / 0.32);
  --linea-roja:   oklch(60% 0.227 var(--h) / 0.55);

  /* Semánticos para el panel (estados de pedido). Mismo criterio: teñidos. */
  --ok:    oklch(72% 0.15 150);
  --alerta: oklch(78% 0.15 85);
}

/* ------------------------------------------------------------
   3. TIPOGRAFÍA — contraste alto de escala (display/body ≈ 9:1)
   ------------------------------------------------------------ */
:root {
  --t-display: clamp(3.4rem, 13vw, 9.5rem);
  --t-h1:      clamp(2.1rem, 6vw, 4rem);
  --t-h2:      clamp(1.7rem, 4vw, 2.75rem);
  --t-h3:      1.3rem;
  --t-body:    1.0625rem;
  --t-small:   0.875rem;
  --t-label:   0.6875rem;

  --tr-display: -0.035em;
  --tr-titulo:  -0.02em;
  --tr-label:    0.16em;

  /* Anchos del eje wdth de Archivo. La display va condensada fuerte. */
  --w-display: 66%;
  --w-titulo:  78%;
  --w-texto:   100%;
}

/* ------------------------------------------------------------
   4. ESPACIO
   ------------------------------------------------------------ */
:root {
  --s-seccion: clamp(5rem, 12vw, 12rem);
  --s-borde:   clamp(1.25rem, 5vw, 4rem);

  --ancho-angosto: 42rem;
  --ancho-normal:  75rem;
  --ancho-amplio:  92rem;
}

/* ------------------------------------------------------------
   5. MOVIMIENTO
   ------------------------------------------------------------ */
:root {
  --ease-suave:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-entrada: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-rapida: 180ms;
  --dur-media:  420ms;
  --dur-lenta:  900ms;
}

/* ------------------------------------------------------------
   6. BASE
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--negro);
}

body {
  margin: 0;
  background: var(--negro);
  color: var(--texto);
  font-family: var(--f-texto);
  font-size: var(--t-body);
  font-variation-settings: "wdth" 100;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 700;
  font-stretch: var(--w-titulo);
  line-height: 1.02;
  letter-spacing: var(--tr-titulo);
  text-transform: uppercase;
  text-wrap: balance;
  margin: 0;
}

p {
  max-width: 62ch;
  text-wrap: pretty;
  margin: 0 0 1.2em;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

img, video, svg { max-width: 100%; height: auto; display: block; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--acento-claro);
  outline-offset: 3px;
}

::selection { background: var(--acento); color: var(--hueso); }

/* ------------------------------------------------------------
   7. PATRONES
   ------------------------------------------------------------ */
.display {
  font-family: var(--f-display);
  font-size: var(--t-display);
  font-weight: 800;
  font-stretch: var(--w-display);
  line-height: 0.88;
  letter-spacing: var(--tr-display);
  text-transform: uppercase;
  text-wrap: balance;
}

.etiqueta {
  font-family: var(--f-mono);
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--texto-suave);
}

/* Cifras a plomo: precios, totales, cantidades. Sin esto el riel baila. */
.cifra {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.02em;
}

.seccion { padding: var(--s-seccion) var(--s-borde); }

.contenedor          { max-width: var(--ancho-normal);  margin-inline: auto; }
.contenedor--angosto { max-width: var(--ancho-angosto); margin-inline: auto; }
.contenedor--amplio  { max-width: var(--ancho-amplio);  margin-inline: auto; }

.linea     { border: 1px solid var(--linea); }
.linea-top { border-top: 1px solid var(--linea); }

.grid12 {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  gap: var(--s-borde);
}

/* Reveal escalonado: .reveal + --i:0,1,2… en los hijos */
.reveal {
  opacity: 0;
  transform: translateY(1.5rem);
  transition:
    opacity   var(--dur-media) var(--ease-suave) calc(var(--i, 0) * 70ms),
    transform var(--dur-media) var(--ease-suave) calc(var(--i, 0) * 70ms);
}
.reveal.visible { opacity: 1; transform: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------
   8. GRANO — siempre activo. Sobre negro hace de textura de tinta.
   ------------------------------------------------------------ */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: var(--grano);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------
   9. ACCESIBILIDAD
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
