/* ==========================================================================
   BASE — Reset, tipografia y utilidades de documento
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  /* Compensa el header fijo al saltar a una seccion con #ancla. */
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  min-height: 100svh;
  background-color: var(--c-base);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Bloquea el scroll cuando hay un modal o el menu movil abierto. */
body.is-locked {
  overflow: hidden;
}

/* --- Titulos ------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-title);
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
}

h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
}

h3 {
  font-size: var(--fs-h3);
}

p {
  text-wrap: pretty;
}

/* --- Enlaces e imagenes -------------------------------------------------- */

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

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

ul,
ol {
  list-style: none;
}

/* --- Formularios --------------------------------------------------------- */

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

button {
  cursor: pointer;
}

textarea {
  resize: vertical;
}

/* --- Accesibilidad ------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* Oculta visualmente pero mantiene el texto para lectores de pantalla. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: calc(var(--z-modal) + 1);
  padding: var(--sp-3) var(--sp-5);
  background: var(--c-accent);
  color: var(--c-base);
  font-weight: 600;
  border-radius: var(--r-pill);
  transform: translateY(-160%);
  transition: transform var(--t-base) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* --- Seleccion y scrollbar ---------------------------------------------- */

::selection {
  background: var(--c-brand);
  color: var(--c-text);
}

@supports (scrollbar-color: red blue) {
  html {
    scrollbar-color: var(--c-base-600) var(--c-base);
    scrollbar-width: thin;
  }
}
