/* ==========================================================================
   MODO — Base: reset, tipografía global, accesibilidad
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

/* Al scrollear, la sección más cercana se acomoda sola bajo el header.
   Se usa 'proximity' y no 'mandatory': mandatory pelearía con Método MODO
   (cinco pasos de 100vh) y con el cierre (260vh de recorrido). */
@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
  html { scroll-snap-type: y proximity; }

  main > section,
  .metodo__step {
    scroll-snap-align: start;
    scroll-snap-stop: normal;
  }

  /* El cierre se recompone con el scroll: encuadrarlo lo interrumpiría */
  main > section.cierre { scroll-snap-align: none; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--texto-claro);
  background-color: var(--bg-oscuro);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.is-menu-open { overflow: hidden; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

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

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

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

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

/* --- Foco visible: obligatorio, nunca removerlo --- */
:focus-visible {
  outline: 2px solid var(--lima);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
:focus:not(:focus-visible) { outline: none; }

/* El atributo hidden tiene que ganarle a cualquier display del componente.
   Sin esto, un .btn oculto por JS seguía viéndose porque .btn impone
   display: inline-flex y le gana a la regla por defecto del navegador. */
[hidden] { display: none !important; }

/* Alternativas según el tipo de puntero: en pantalla táctil no se puede
   arrastrar un archivo, así que el texto cambia. */
.solo-tactil { display: none; }
@media (hover: none), (pointer: coarse) {
  .solo-puntero { display: none; }
  .solo-tactil { display: inline; }
}

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: 999;
  padding: 0.75rem 1.25rem;
  background: var(--lima);
  color: var(--azul-oscuro);
  font-weight: 600;
  border-radius: var(--r-md);
  transition: top var(--t-fast) var(--ease-soft);
}
.skip-link:focus { top: 1rem; }

/* --- prefers-reduced-motion: se respeta en todo el sitio --- */
@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;
    scroll-behavior: auto !important;
  }
}
