/* =========================================================
   base.css
   Reset ligero, tipografía base, utilidades de layout
   y helpers globales. Mobile-first.
   ========================================================= */

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

* { margin: 0; }

html {
  scroll-behavior: smooth;          /* scroll suave nativo (sin librerías) */
  scroll-padding-top: var(--header-h); /* el ancla no queda bajo el header fijo */
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Bloquea el scroll cuando el menú móvil está abierto */
body.is-menu-open { overflow: hidden; }

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

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

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

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

ul { list-style: none; padding: 0; }

[hidden] { display: none !important; }

/* ---------- Tipografía ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}

strong { font-weight: 700; color: var(--text); }

/* ---------- Layout: contenedor ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 0.5rem + 3vw, 2rem);
}
.container--narrow { max-width: var(--container-narrow); }

/* ---------- Secciones ---------- */
.section { padding-block: var(--section-y); position: relative; }
.section--alt { background: var(--bg-alt); }

/* Cabecera de sección reutilizable */
.section__head {
  max-width: 720px;
  margin: 0 auto var(--space-7);
  text-align: center;
}
/* Variante alineada a la izquierda (rompe la monotonía de "todo centrado") */
.section__head--left {
  max-width: 760px;
  margin-left: 0;
  margin-right: auto;
  text-align: left;
}
.section__head--left .section__eyebrow { justify-content: flex-start; }
.section__head--left .section__lead { margin-left: 0; }
.section__eyebrow {
  font-family: var(--font-head);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.22em;             /* tracking amplio, más editorial/deportivo */
  text-transform: uppercase;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: var(--space-4);
}
.section__num {
  font-variant-numeric: tabular-nums;
  color: var(--c-cyan);               /* número como acento, sin píldora */
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
}
/* línea de acento tras el número → "07 —— ETIQUETA" */
.section__num::after {
  content: ""; display: inline-block;
  width: 24px; height: 1px; margin-left: 0.6em;
  background: var(--c-cyan); opacity: 0.6; vertical-align: middle;
}
.section__title {
  font-size: var(--fs-3xl);
  margin-bottom: var(--space-4);
}
.section__lead {
  color: var(--text-muted);
  font-size: var(--fs-lg);
  max-width: 60ch;
}
.section__lead--center { margin-inline: auto; }
.section__cta-row { text-align: center; margin-top: var(--space-7); }

/* ---------- Utilidades ---------- */
.text-gradient {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--c-cyan);
  background: var(--grad-accent-soft);
  border: 1px solid var(--border-strong);
  padding: 0.4em 1em;
  border-radius: var(--r-pill);
  margin-bottom: var(--space-5);
}

/* Rejillas */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-7);
  align-items: center;
}

/* ---------- Foco visible (accesibilidad) ---------- */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--c-cyan);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ---------- Animación de entrada (se gestiona en animations.js) ----------
   Regla defensiva: si JS falla o no carga, el contenido SIEMPRE se ve. */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  /* snap atlético: entrada rápida con un leve overshoot, no un fade blando */
  transition: opacity 0.45s var(--ease-out),
              transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1.08);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Variantes direccionales (sutiles). El estado final siempre es .is-visible → none */
.reveal[data-reveal="in"]    { transform: none; }
.reveal[data-reveal="scale"] { transform: scale(0.97); }
.reveal[data-reveal="left"]  { transform: translateX(-20px); }
.reveal[data-reveal="right"] { transform: translateX(20px); }

/* Red de seguridad: sin JS mostramos todo. */
.no-js .reveal { opacity: 1; transform: none; }

/* Con "reducir movimiento": mantenemos los reveals (son micro-interacciones sutiles;
   en Windows "reduce" viene activado por defecto y caparlos dejaría la web plana).
   Lo intrusivo (malla reactiva al ratón, tilt, scroll-driven continuo) sí se capa
   en otros sitios. Solo desactivamos el scroll suave de anclas. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- BONUS: scroll-driven nativo (navegadores modernos) ----------
   Se enlaza al scroll real (muy fluido, sin JS). Acotado a .reveal[data-reveal]
   (los bloques auto-asignados), que viven en secciones de overflow normal:
   así evitamos el hero / bandas con overflow:hidden donde view() podría
   dejar contenido oculto. Fallback automático al reveal por JS. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal[data-reveal] {
      opacity: 0;
      animation: rv-up linear both;
      animation-timeline: view();
      animation-range: entry 5% entry 48%;
      transition: none;          /* el scroll-driven toma el control, no el transition */
    }
    .reveal[data-reveal="in"]    { animation-name: rv-in; }
    .reveal[data-reveal="scale"] { animation-name: rv-scale; }
    .reveal[data-reveal="left"]  { animation-name: rv-left; }
    .reveal[data-reveal="right"] { animation-name: rv-right; }
  }
}
@keyframes rv-up    { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes rv-in    { from { opacity: 0; } to { opacity: 1; } }
@keyframes rv-scale { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes rv-left  { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }
@keyframes rv-right { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
