/* ═══ BASE: reset ligero, superficies del navegador, tipografía global ═══ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem; /* anclas bajo la nav sticky */
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  font-family: var(--fuente-sans);
  font-size: var(--paso-0);
  line-height: 1.55;
  color: var(--texto);
  background: var(--fondo);
  overflow-x: clip;
}

/* Superficies del navegador: también llevan la marca */
::selection { background: var(--marino); color: var(--amarillo); }
input, textarea { caret-color: var(--coral); }
html { scrollbar-color: var(--azul) var(--crema); scrollbar-width: thin; }
body::-webkit-scrollbar { width: 10px; }
body::-webkit-scrollbar-track { background: var(--crema); }
body::-webkit-scrollbar-thumb { background: var(--azul); border-radius: 99px; border: 2px solid var(--crema); }

:focus-visible {
  outline: 3px solid var(--azul-vivo);
  outline-offset: 3px;
  border-radius: 4px;
}
.seccion--oscura :focus-visible,
.sobre-color :focus-visible { outline-color: var(--amarillo); }

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

h1, h2, h3, h4 {
  font-family: var(--fuente-display);
  font-variation-settings: "SOFT" 100, "WONK" 0;
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.015em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

p { max-width: 68ch; }
a { color: inherit; }

.mano {
  font-family: var(--fuente-mano);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0;
}

.contenedor {
  width: min(100% - clamp(2.5rem, 8vw, 5rem), var(--ancho-max));
  margin-inline: auto;
}

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

/* Enlace para saltar al contenido (teclado) */
.saltar {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  background: var(--marino); color: var(--amarillo);
  padding: .8rem 1.4rem; border-radius: 99px;
  text-decoration: none; font-weight: 500;
  transition: top var(--dur-micro) var(--curva-suave);
}
.saltar:focus-visible { top: 1rem; }

/* Utilidades de texto sobre bloques de color (contrastes verificados) */
.sobre-color { color: var(--tinta); }
.seccion--oscura { color: var(--crema); }

/* Barra de progreso de lectura (patrón storytelling) */
.progreso {
  position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 120;
  background: var(--coral);
  transform-origin: 0 50%;
  transform: scaleX(0);
  pointer-events: none;
}

/* Accesibilidad de movimiento: la página nace visible;
   .anim se activa solo con JS y prefiere-motion lo respeta en motion.js */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
