/* base.css — reset, tipografía, foco visible, utilidades y movimiento reducido.
   Sin valores literales de color: todo viene de tokens.css. */

/* Nunito variable (OFL, ver /fonts/OFL.txt), auto-hospedada: la CSP no admite CDNs. */
@font-face {
  font-family: "Nunito Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url("/fonts/nunito-latin-ext-wght-normal.woff2?v=1") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Nunito Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url("/fonts/nunito-latin-wght-normal.woff2?v=1") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: light;
  scrollbar-color: var(--rosa-300) transparent;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--fuente);
  font-size: var(--texto-base);
  font-weight: var(--peso-normal);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  color: var(--titulo);
  font-weight: var(--peso-negro);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--enlace);
  font-weight: var(--peso-fuerte);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 0.1em;
}

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

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

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

input {
  caret-color: var(--acento);
}

::selection {
  background: var(--rosa-200);
  color: var(--tinta-marca);
}

:focus-visible {
  outline: 3px solid var(--foco);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* Encabezado enfocado por código al navegar: no necesita anillo. */
[tabindex="-1"]:focus {
  outline: none;
}

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

/* "Saltar al contenido": fuera de pantalla hasta recibir foco. */
.saltar {
  position: fixed;
  top: var(--esp-2);
  left: var(--esp-2);
  z-index: var(--z-saltar);
  padding: var(--esp-3) var(--esp-5);
  border-radius: var(--radio-md);
  background: var(--superficie);
  color: var(--titulo);
  box-shadow: var(--sombra-flotante);
  text-decoration: none;
  transform: translateY(-200%);
}

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

/* Movimiento reducido: sin traslados, escalados ni animaciones decorativas;
   quedan solo fundidos breves de opacidad (el feedback no desaparece). */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-property: opacity !important;
    transition-duration: var(--dur-rapida) !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}
