/* ==========================================================================
   base.css — Reset, tipografía global y primitivas de maquetación.
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;   /* red de seguridad: nada puede ensanchar el documento */
}
/* Lenis toma el control del scroll; si está activo, desactivamos el nativo
   para que no peleen entre ellos. */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

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

/* Grano de película sobre TODA la página: es lo que da el aire "vintage
   badge" del logo sin tener que meter texturas en cada componente. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--oro);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

::selection { background: var(--oro); color: var(--negro-asfalto); }

/* --- Tipografía ---------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-wrap: balance;
}

p { text-wrap: pretty; }

.antetitulo {
  font-family: var(--f-cond);
  font-size: var(--t-sm);
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--oro);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.antetitulo::before {
  content: '';
  width: 2.5rem;
  height: 2px;
  background: linear-gradient(90deg, var(--oro), transparent);
}

.plomo {
  font-size: var(--t-md);
  color: var(--texto-suave);
  max-width: var(--ancho-texto);
}

/* --- Maquetación --------------------------------------------------------- */

.envoltorio {
  width: min(100% - var(--gutter) * 2, var(--ancho));
  margin-inline: auto;
}

.seccion {
  padding-block: var(--seccion-y);
  position: relative;
}

.seccion__cabecera {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: clamp(2.25rem, 4vw, 3.5rem);
}
.seccion__cabecera h2 { font-size: var(--t-xl); }

.rejilla {
  display: grid;
  gap: clamp(1rem, 2vw, 1.75rem);
}
.rejilla--3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.rejilla--4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }

/* --- Utilidades ---------------------------------------------------------- */

.solo-lectores {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.saltar {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  background: var(--oro);
  color: var(--negro-asfalto);
  padding: 0.75rem 1.25rem;
  font-family: var(--f-cond);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.saltar:focus { top: 1rem; }

/* --- Movimiento reducido: se apaga todo ---------------------------------- */

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