/* =============================================================
   BASE — reset moderno, tipografía base, accesibilidad.
   Depende de tokens.css. No define componentes.
   ============================================================= */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: var(--fw-bold); line-height: var(--lh-tight); letter-spacing: var(--ls-tight); text-wrap: balance; }
h1 { font-size: var(--fs-4xl); letter-spacing: var(--ls-tighter); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
a { color: var(--accent-text); text-underline-offset: 2px; }

/* Foco visible AA — un solo patrón para todo control */
:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
:focus:not(:focus-visible) { outline: none; }
::selection { background: color-mix(in srgb, var(--brand-magenta) 24%, transparent); }

/* Utilidades de accesibilidad */
.u-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.u-skip-link {
  position: absolute; left: var(--space-3); top: -100px; z-index: var(--z-toast);
  background: var(--surface); color: var(--text); padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md); transition: top var(--dur-2) var(--ease-out);
}
.u-skip-link:focus { top: var(--space-3); }

/* Layout base */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--space-4); }
.container--narrow { max-width: var(--container-narrow); }
@media (min-width: 768px) { .container { padding-inline: var(--space-6); } }

/* Utilidades mínimas compartidas (no reemplazan componentes) */
.u-mono { font-family: var(--font-mono); }
.u-gradient-text { background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.u-stack { display: flex; flex-direction: column; gap: var(--space-4); }
.u-row { display: flex; align-items: center; gap: var(--space-3); }
.u-wrap { flex-wrap: wrap; }
.u-glass { background: var(--glass-bg); border: 1px solid var(--glass-border); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); }
