/* ============================================================================
 * BASE — reset y comportamiento de elementos HTML.
 * Requiere tokens.css cargado antes.
 * ========================================================================= */

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--ink-900);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Manrope tiene cifras tabulares opcionales: en precios y datos técnicos
     evitan que los números "bailen" al actualizarse. */
  font-variant-numeric: tabular-nums;
  /* Evita el desplazamiento horizontal accidental en móvil: el defecto
     visual más frecuente y el más fácil de pasar por alto. */
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  /* Reparte las líneas de un titular de forma pareja en vez de dejar una
     palabra huérfana en la última línea. */
  text-wrap: balance;
}

p {
  margin: 0;
  /* Evita líneas finales de una sola palabra en párrafos. */
  text-wrap: pretty;
}

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

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* El anillo de foco solo aparece con teclado: no estorba al tocar con el
   dedo, pero sigue disponible para quien navega con Tab. */
:focus-visible {
  outline: 3px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Etiqueta en versalitas: el recurso tipográfico que más eleva la percepción
   de calidad por línea de CSS escrita. */
.eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  /* energy-600, no energy-400: el ámbar claro sobre papel da 2.75:1 y no
     alcanza el mínimo AA de 4.5:1. Sobre fondo oscuro sí se usa el claro
     (ver .section--dark .eyebrow en layout.css). */
  color: var(--energy-600);
}

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

/* Enlace de salto: invisible con el ratón, pero DEBE aparecer al llegar con
   Tab. Sin esta regla el enlace existe en el HTML y nunca se puede usar, que
   es peor que no tenerlo: da falsa sensación de accesibilidad. */
.visually-hidden:focus,
.visually-hidden:focus-visible {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: calc(var(--z-toast) + 1);
  width: auto; height: auto;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: var(--space-3) var(--space-5);
  clip-path: none;
  overflow: visible;
  background: var(--brand-900);
  color: var(--paper);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-weight: 700;
  text-decoration: 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;
  }
}
