/* ============================================================
   tokens.css — Löwex
   Base de diseño. Se importa PRIMERO, antes de cualquier otro CSS.
   Paleta fijada por el manual de marca y por el documento de
   requerimientos (ítem 11, "Precisión Logística").
   ============================================================ */

/* League Spartan alojada en el propio sitio: sólo los pesos que se usan. */
@font-face { font-family: "League Spartan"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/league-spartan-400.woff2") format("woff2"); }
@font-face { font-family: "League Spartan"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/league-spartan-600.woff2") format("woff2"); }
@font-face { font-family: "League Spartan"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/league-spartan-700.woff2") format("woff2"); }

:root {
  /* --- Hue rector: el petróleo institucional gobierna los neutros --- */
  --h: 208;

  /* --- Marca (valores medidos del manual, convertidos a OKLCH) --- */
  --petroleo:    #00424A;
  --petroleo-on: oklch(28.0% 0.055 208);   /* hover / profundidad */
  --petroleo-up: oklch(42.0% 0.062 208);   /* bordes sobre oscuro */
  --lima:        #E7FB55;
  --lima-on:     oklch(88.0% 0.190 117);   /* hover del lima */
  --menta:       #46F6B9;
  --hueso:       #F7F6F4;

  /* --- Roles --- */
  --acento:      var(--lima);
  --fondo:       var(--hueso);
  --fondo-alt:   oklch(94.0% 0.008 208);
  --fondo-hondo: var(--petroleo);
  --texto:       #0F1B1D;
  /* 0.76 y no menos: medido con canvas, abajo de 0.72 el texto chico
     no llega a 4.5:1 sobre --fondo-alt. */
  --texto-suave: rgb(15 27 29 / 0.72);

  /* Sobre fondo petróleo */
  --texto-inv:       oklch(97.3% 0.004 208);
  --texto-inv-suave: oklch(97.3% 0.004 208 / 0.66);

  /* Hairlines — reemplazan a las sombras */
  --linea:        #E2E0DB;
  --linea-fuerte: oklch(34.7% 0.06 208 / 0.30);
  --linea-inv:    oklch(97.3% 0.004 208 / 0.18);

  /* --- Tipografía: una sola familia, jerarquía por peso y escala --- */
  --f-display: "League Spartan", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-texto:   "League Spartan", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* League Spartan: geométrica y apretada, x-height alta. */
  --t-display: clamp(2.5rem, 7vw, 6rem);
  --t-h1:      clamp(1.85rem, 4vw, 3rem);
  --t-h2:      clamp(1.45rem, 2.7vw, 2.1rem);
  --t-h3:      1.15rem;
  --t-body:    1.0625rem;
  --t-small:   0.9rem;
  --t-label:   0.75rem;

  --p-display: 700;
  --p-titulo:  700;

  --tr-display: -0.045em;
  --tr-titulo:  -0.028em;
  --tr-label:    0.16em;

  /* --- Espacio --- */
  --s-seccion: clamp(5.5rem, 12vw, 12rem);
  --s-borde:   clamp(1.25rem, 5vw, 4.5rem);

  --ancho-angosto: 44rem;
  --ancho-normal:  74rem;
  --ancho-amplio:  90rem;

  /* --- Forma --- */
  /* Ítem 11: tarjetas de 16 px, inputs y botones de 12 px, chips redondos. */
  --radio-card: 16px;
  --radio: 12px;
  --radio-pastilla: 999px;

  /* Un solo tamaño de botón para todo el sitio */
  --btn-alto: 52px;
  --btn-px: 1.75rem;
  --btn-fs: 1rem;

  /* --- Movimiento --- */
  --ease-suave:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-entrada: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-rapida: 200ms;
  --dur-media:  480ms;
  --dur-lenta:  900ms;

  --grano: 0.032;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

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

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: var(--p-titulo);
  line-height: 1.1;
  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.22em; }

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

:focus-visible {
  outline: 2px solid var(--petroleo);
  outline-offset: 3px;
}
.sobre-hondo :focus-visible { outline-color: var(--lima); }

::selection { background: var(--lima); color: var(--petroleo); }

/* ------------------------------------------------------------
   PATRONES
   ------------------------------------------------------------ */
.display {
  font-family: var(--f-display);
  font-size: var(--t-display);
  font-weight: var(--p-display);
  line-height: 1.02;
  letter-spacing: var(--tr-display);
  text-wrap: balance;
  margin: 0;
}

.etiqueta {
  font-size: var(--t-label);
  font-weight: 500;
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--texto-suave);
  margin: 0;
}
.sobre-hondo .etiqueta { color: var(--texto-inv-suave); }

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

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

.sobre-hondo { background: var(--fondo-hondo); color: var(--texto-inv); }
.sobre-hondo h1, .sobre-hondo h2, .sobre-hondo h3 { color: var(--texto-inv); }
.sobre-hondo p { color: var(--texto-inv-suave); }

/* Reveal escalonado */
.reveal {
  opacity: 0;
  transform: translateY(1rem);
  transition:
    opacity   360ms var(--ease-suave) calc(var(--i, 0) * 30ms),
    transform 360ms var(--ease-suave) calc(var(--i, 0) * 30ms);
}
.reveal.visible { opacity: 1; transform: none; }

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

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

[hidden] { display: none !important; }
