/* ============================================================================
   BASE — Reset moderno + tipografía por defecto + utilidades mínimas.
   No hay componentes acá: sólo cómo se comportan los elementos nativos.
   ========================================================================== */

/* ---- Reset ------------------------------------------------------------- */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Los anchors no quedan tapados por el header sticky */
  scroll-padding-top: calc(var(--header-h) + var(--sp-5));
}

/* Si el usuario pidió menos movimiento, el scroll suave también molesta. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  min-height: 100svh;
  background-color: var(--surface-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Nada de overflow-x acá a propósito:
     - `hidden` convierte al body en contenedor de scroll y rompe sticky.
     - `clip` recorta los descendientes position:fixed (adiós header y fondo).
     Los orbes que se salen del viewport ya los recorta `.bg`, que es
     position:fixed con overflow:hidden. Ver layout.css. */
}

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

/* El `display: block` de arriba le gana al `display: none` que el navegador
   aplica por el atributo [hidden] — los estilos del autor pesan más que los
   del navegador. Sin esta regla, un `el.hidden = true` sobre una imagen no
   hace nada. Es el único !important del proyecto y está justificado. */
[hidden] { display: none !important; }

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

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

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

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;          /* evita huérfanas en titulares */
}

h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); line-height: var(--lh-snug); }

p { text-wrap: pretty; }

strong { font-weight: 650; }

/* ---- Foco visible ------------------------------------------------------
   Nunca sacar el outline sin reemplazarlo: hay gente que navega con teclado. */

:focus-visible {
  outline: 2px solid var(--brand-cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: rgba(28, 231, 242, 0.28);
  color: var(--text-primary);
}

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

/* Visible sólo para lectores de pantalla */
.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;
}

/* Link para saltar al contenido (aparece al tabular) */
.skip-link {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: var(--z-overlay);
  padding: var(--sp-2) var(--sp-4);
  background: var(--brand-cyan);
  color: var(--surface-base);
  font-weight: 600;
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus-visible { transform: translateY(0); }

/* Texto con el gradiente de marca. Se usa en una o dos palabras por titular,
   nunca en un párrafo entero (baja el contraste y se vuelve ilegible). */
.text-gradient {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
