/* ============================================================
   tokens.css — base de diseño (Fari Play)
   Dirección: "Casita de juegos" · refresco 2026 con el arte nuevo.
   Paleta medida pixel-real del logo/flyer nuevos: BEIGE (crema) +
   MARRÓN tinta + VERDE LIMA, con fucsia/dorado sólo como chispa.
   Regla clave: la lima es RELLENO, nunca texto sobre crema
   (contraste 1.66). El texto y los bordes son marrón tinta.
   ============================================================ */

/* ------------------------------------------------------------
   1. POR PROYECTO
   ------------------------------------------------------------ */
:root {
  /* Hue cálido (arena/dorado) que gobierna los NEUTROS crema. Los
     acentos no se derivan de --h: son los colores de marca medidos
     del arte nuevo (lima #9ECD25, fucsia #EC057A, dorado #F4B54E). */
  --h: 84;

  --f-display: "Fredoka", ui-rounded, "Segoe UI", sans-serif;
  --f-texto: "Figtree", system-ui, sans-serif;
  --f-mono: "Space Mono", ui-monospace, monospace;

  --radio: 1.75rem;      /* orgánico, kid-friendly */
  --radio-chico: 0.9rem;

  --grano: 0.035;
}

/* ------------------------------------------------------------
   2. COLOR — verde lima protagonista + fucsia/dorado de chispa,
      sobre neutros crema/arena y texto marrón tinta. Medidos del
      arte nuevo (#9ECD25 / #EC057A / #F4B54E / crema #FCF0DD /
      tinta #3A1A0B). Contrastes verificados (WCAG):
        marrón sobre crema 14:1 · marrón sobre lima 8.4:1 ·
        crema sobre marrón 14:1 · lima sobre crema 1.66 → NO texto.
   ------------------------------------------------------------ */
:root {
  --lima:          oklch(78.7% 0.188 125);  /* #9ECD25 verde lima: relleno, formas, CTA */
  --lima-prof:     oklch(72.3% 0.177 126);  /* lima honda: detalle sobre lima */
  --fucsia:        oklch(61.1% 0.245 1);    /* #EC057A chispa: corazones, estrellas, puntos */
  --dorado:        oklch(81.3% 0.138 77);   /* #F4B54E chispa cálida, uso mínimo */

  --acento:        var(--lima);             /* acento principal del sistema (relleno) */
  --acento-cta:    var(--lima);             /* botón primario: lima + texto marrón (8.4:1) */
  --acento-suave:  oklch(87% 0.095 123);
  --acento-2:      var(--fucsia);           /* segundo acento, decorativo */
  --acento-2-suave:oklch(87% 0.10 4);
  --chispa:        var(--dorado);

  --fondo:        oklch(96%  0.030 var(--h));   /* crema cálida #FCF0DD */
  --fondo-alt:    oklch(92%  0.046 var(--h));   /* arena */
  --texto:        oklch(26%  0.055 44);         /* marrón tinta #3A1A0B */
  --texto-suave:  oklch(26%  0.055 44 / 0.64);

  --cta-texto:    oklch(26% 0.055 44);          /* texto marrón sobre lima/fondos claros */

  --linea:        oklch(26% 0.055 44 / 0.15);
  --linea-fuerte: oklch(26% 0.055 44 / 0.32);
}

:root[data-tema="oscuro"] {
  --fondo:        oklch(23%  0.03 50);
  --fondo-alt:    oklch(28%  0.035 50);
  --texto:        oklch(95%  0.02 90);
  --texto-suave:  oklch(95%  0.02 90 / 0.64);
  --linea:        oklch(95% 0.02 90 / 0.16);
  --linea-fuerte: oklch(95% 0.02 90 / 0.32);
  --acento:       var(--lima);
  --cta-texto:    oklch(26% 0.055 44);
}

/* ------------------------------------------------------------
   3. TIPOGRAFÍA
   ------------------------------------------------------------ */
:root {
  --t-display: clamp(2.75rem, 9vw, 7.5rem);
  --t-h1:      clamp(2rem, 5vw, 3.5rem);
  --t-h2:      clamp(1.5rem, 3vw, 2.25rem);
  --t-h3:      1.25rem;
  --t-body:    1.0625rem;
  --t-small:   0.875rem;
  --t-label:   0.75rem;

  --tr-display: -0.03em;
  --tr-titulo:  -0.02em;
  --tr-label:    0.14em;
}

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

  --ancho-angosto: 42rem;
  --ancho-normal:  72rem;
  --ancho-amplio:  88rem;
}

/* ------------------------------------------------------------
   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; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--f-texto);
  font-size: var(--t-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: var(--tr-titulo);
  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; }

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

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

/* ------------------------------------------------------------
   7. PATRONES
   ------------------------------------------------------------ */
.display {
  font-family: var(--f-display);
  font-size: var(--t-display);
  line-height: 0.95;
  letter-spacing: var(--tr-display);
  text-wrap: balance;
}

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

.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(12, 1fr); gap: var(--s-borde); }

.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; }

/* ------------------------------------------------------------
   8. GRANO
   ------------------------------------------------------------ */
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; }
}
