/* ==========================================================================
   Base — reset ligero, tipografía y utilidades
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--color-fondo);
  color: var(--color-texto);
  font-family: var(--fuente-texto);
  font-size: var(--texto-base);
  line-height: 1.6;
  overflow-x: clip;
}

/* height:auto evita que los atributos width/height del HTML —necesarios para
   reservar espacio y no provocar saltos de layout— fijen el alto renderizado. */
img { display: block; max-width: 100%; height: auto; }

/* El atributo hidden debe ganar a cualquier display de clase. */
[hidden] { display: none !important; }

h1, h2, h3 {
  font-family: var(--fuente-display);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

a { color: inherit; }

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

:focus-visible {
  outline: var(--trazo) solid var(--c-morado);
  outline-offset: 4px;
  border-radius: var(--radio-sm);
}

/* --- Utilidades --- */

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

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

.saltar-al-contenido {
  position: absolute;
  top: 0.75rem; left: 0.75rem;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  background: var(--c-tinta);
  color: #fff;
  border-radius: var(--radio-sm);
  font-weight: 700;
  transform: translateY(-150%);
  transition: transform var(--dur-rapida) var(--ease-salida);
}
.saltar-al-contenido:focus-visible { transform: translateY(0); }

/* --- Aparición al hacer scroll --- */

.revelar {
  opacity: 0;
  transform: translate3d(0, 2rem, 0);
  transition:
    opacity var(--dur-lenta) var(--ease-salida),
    transform var(--dur-lenta) var(--ease-salida);
}
.revelar.es-visible { opacity: 1; transform: none; }

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

  .revelar { opacity: 1; transform: none; }
}
