/* =====================================================================
   G.S. Auto Import — base.css
   Reset, tokens de diseño, tipografía y utilidades
   ===================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
}

/* Sólo cuando Lenis NO está gobernando el scroll: si ambos actúan a la vez,
   el navegador anima cada salto de Lenis y el scroll vibra. */
html:not(.lenis) { scroll-behavior: smooth; }

html.lenis,
html.lenis body { height: auto; }

.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  min-height: 100vh;
  font-family: var(--font-texto);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--fg);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, svg, video, iframe {
  display: block;
  max-width: 100%;
}

img { height: auto; }

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

button { background: none; border: none; cursor: pointer; }

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

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

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

::selection {
  background: var(--fg);
  color: var(--bg);
}

/* ---------- Tokens ---------- */
:root {
  /* Escala monocromática */
  --negro: #0a0a0a;
  --carbon: #141414;
  --grafito: #1f1f1f;
  --acero: #3d3d3d;
  --gris: #6b6b6b;
  --gris-claro: #a3a3a3;
  --niebla: #d9d9d9;
  --humo: #f4f4f4;
  --blanco: #ffffff;

  /* Semánticos — tema claro */
  --bg: var(--blanco);
  --bg-alt: var(--humo);
  --surface: var(--blanco);
  --surface-2: #fafafa;
  --fg: var(--negro);
  --fg-suave: #4a4a4a;
  --muted: var(--gris);
  --border: #e2e2e2;
  --border-fuerte: #c9c9c9;
  --inverso-bg: var(--negro);
  --inverso-fg: var(--blanco);
  --overlay: rgba(10, 10, 10, 0.55);
  --sombra: 0 1px 2px rgba(10, 10, 10, .04), 0 8px 24px rgba(10, 10, 10, .06);
  --sombra-alta: 0 2px 4px rgba(10, 10, 10, .06), 0 18px 48px rgba(10, 10, 10, .12);

  /* Tipografía */
  --font-display: 'Archivo', system-ui, sans-serif;
  --font-texto: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Medidas */
  --ancho: 1240px;
  --ancho-estrecho: 880px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radio: 6px;
  --radio-lg: 12px;
  --header-h: 76px;

  /* Movimiento */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-rapida: 180ms var(--ease);
  --t-media: 320ms var(--ease);
  --t-lenta: 620ms var(--ease);
}

[data-theme='dark'] {
  --bg: var(--negro);
  --bg-alt: var(--carbon);
  --surface: var(--carbon);
  --surface-2: var(--grafito);
  --fg: var(--blanco);
  --fg-suave: #d0d0d0;
  --muted: var(--gris-claro);
  --border: #2b2b2b;
  --border-fuerte: #3d3d3d;
  --inverso-bg: var(--blanco);
  --inverso-fg: var(--negro);
  --overlay: rgba(0, 0, 0, 0.65);
  --sombra: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .4);
  --sombra-alta: 0 2px 4px rgba(0, 0, 0, .5), 0 18px 48px rgba(0, 0, 0, .55);
}

/* ---------- Tipografía fluida ---------- */
.display-xl { font-size: clamp(2.75rem, 8.5vw, 6.5rem); letter-spacing: -0.035em; }
.display-lg { font-size: clamp(2.25rem, 5.5vw, 4rem); letter-spacing: -0.03em; }
.display-md { font-size: clamp(1.75rem, 3.6vw, 2.75rem); letter-spacing: -0.025em; }
.display-sm { font-size: clamp(1.35rem, 2.4vw, 1.75rem); letter-spacing: -0.02em; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-texto);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: currentColor;
}

.lead {
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
  color: var(--fg-suave);
  max-width: 60ch;
}

.tabular { font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */
.contenedor {
  width: 100%;
  max-width: var(--ancho);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.contenedor--estrecho { max-width: var(--ancho-estrecho); }

.seccion { padding-block: clamp(3.5rem, 8vw, 7rem); }
.seccion--alt { background: var(--bg-alt); }
.seccion--oscura {
  background: var(--negro);
  color: var(--blanco);
}
.seccion--oscura .lead,
.seccion--oscura .eyebrow { color: var(--gris-claro); }

.seccion__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}

.seccion__head p { max-width: 46ch; margin-top: .9rem; }

.grid { display: grid; gap: clamp(1.25rem, 2.5vw, 2rem); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

.divisor { height: 1px; background: var(--border); border: 0; }

/* ---------- Accesibilidad ---------- */
.saltar {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: .8rem 1.2rem;
  background: var(--fg);
  color: var(--bg);
}
.saltar:focus { left: 1rem; top: 1rem; }

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

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

/* ---------- Animaciones de revelado ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
}

.no-js [data-reveal],
.reveal-listo [data-reveal] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html, html:not(.lenis) { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ---------- Responsive de layout ---------- */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  :root { --header-h: 66px; }
  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: 1fr; }
  .seccion__head { align-items: flex-start; }
}
