/* Reset y fundamentos tipográficos */

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

html { color-scheme: dark; }

body {
  background: var(--ink-950);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

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

button { font-family: inherit; cursor: pointer; }

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

ul { list-style: none; }

code, .mono { font-family: var(--font-mono); }

/* Scrollbar discreto, coherente con el tema oscuro */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-600); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-500); }

/* Foco visible siempre — accesibilidad no es opcional */
:focus-visible {
  outline: 2px solid var(--accent-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

/* --- Aurora ambiental ---
   Referencia: seenode.com — un halo dominante arriba del viewport,
   claramente visible y en movimiento perceptible (no un tinte casi
   invisible), más una textura de grano fino para que no quede como
   un simple degradé difuminado sino con esa calidad "diseñada" de
   ruido/dither. Vive en pseudo-elementos del body (fixed, detrás de
   todo) para no requerir cambios de markup y respeta
   prefers-reduced-motion vía la regla global de abajo. */
body::before {
  content: '';
  position: fixed;
  inset: -20%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1000px 720px at 50% -8%, rgba(76, 126, 243, 0.40), transparent 62%),
    radial-gradient(620px 560px at 12% 28%, rgba(76, 126, 243, 0.16), transparent 65%),
    radial-gradient(560px 520px at 92% 18%, rgba(201, 162, 39, 0.12), transparent 62%);
  filter: blur(70px);
  animation: aurora-pulse 16s ease-in-out infinite alternate;
  will-change: transform, opacity;
}
@keyframes aurora-pulse {
  0%   { transform: translate3d(0, 0, 0) scale(1);    opacity: 0.85; }
  50%  { transform: translate3d(3%, 2%, 0) scale(1.14); opacity: 1; }
  100% { transform: translate3d(-3%, -1%, 0) scale(1.04); opacity: 0.92; }
}

/* Grano fino sobre el aurora (ruido tipo dither vía feTurbulence),
   con mix-blend-mode:overlay para que se funda con el brillo en vez
   de verse como una textura pegada encima. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Tamaño por defecto de todos los íconos SVG (ver components/icons.js).
   Sin esta regla, un <svg> inline sin width/height explícito cae al
   tamaño de reemplazo por defecto del navegador (~300×150px) — se
   sobrescribe puntualmente donde haga falta un tamaño distinto. */
.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  vertical-align: middle;
}
