/* ============================================================
   base.css — reset, tokens, tipografía, utilidades
   ATX Central · Minimalismo premium (fondo OSCURO azulado)
   ============================================================ */

:root {
  /* Paleta — fondo oscuro */
  --bg:            #0a0d14;  /* negro azulado (armoniza con el azul) */
  --bg-2:          #131820;  /* paneles / fondo secundario */
  --bg-3:          #1a212c;  /* elevación superior */
  --blue:          #2952A3;  /* cobalto — fondos de botones/bloques */
  --blue-dark:     #1c3a73;
  --blue-bright:   #4a7fe0;  /* acentos y textos sobre oscuro */
  --blue-glow:     #6b9bf5;  /* glow / brillo */
  --ink:           #f0f2f5;  /* texto principal */
  --muted:         #8b95a5;  /* texto secundario */
  --line:          rgba(74, 127, 224, 0.15);  /* líneas y bordes */
  --line-strong:   rgba(74, 127, 224, 0.28);

  /* Escala tipográfica / radios */
  --radius:        10px;
  --radius-sm:     8px;
  --radius-lg:     14px;

  /* Layout */
  --maxw:          1160px;
  --nav-h:         72px;

  /* Sombras / glows */
  --shadow-sm:     0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md:     0 18px 50px rgba(0, 0, 0, 0.5);
  --glow-blue:     0 0 0 1px rgba(74, 127, 224, 0.25), 0 12px 40px rgba(41, 82, 163, 0.35);

  /* Transiciones */
  --ease:          cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-precise:  cubic-bezier(0.16, 1, 0.3, 1);
}

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

* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-weight: 400;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Sora', sans-serif;
  color: var(--ink);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

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

button { font-family: inherit; cursor: pointer; border: none; background: none; }

iframe { max-width: 100%; }

address { font-style: normal; }

/* Selección */
::selection { background: rgba(74, 127, 224, 0.30); color: #fff; }

/* ---------- Fondo animado global (patrón geométrico + gradiente radial) ---------- */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
/* Patrón de líneas angulares muy sutil, con parallax lentísimo al scroll */
.bg-fx__grid {
  position: absolute;
  inset: -20% 0 -20% 0;
  background-image:
    linear-gradient(115deg, rgba(74, 127, 224, 0.05) 1px, transparent 1px),
    linear-gradient(65deg, rgba(74, 127, 224, 0.04) 1px, transparent 1px);
  background-size: 68px 68px, 68px 68px;
  will-change: transform;
}
/* Gradiente radial azul tenue que se desplaza suavemente */
.bg-fx__glow {
  position: absolute;
  width: 120vmax;
  height: 120vmax;
  left: 50%;
  top: -30%;
  transform: translate(-50%, 0);
  background: radial-gradient(circle at center, rgba(41, 82, 163, 0.18), transparent 55%);
  will-change: transform;
  animation: bgGlowDrift 26s ease-in-out infinite;
}
@keyframes bgGlowDrift {
  0%   { transform: translate(-58%, -4%); }
  50%  { transform: translate(-42%, 6%); }
  100% { transform: translate(-58%, -4%); }
}

/* ---------- Utilidades ---------- */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 2000;
  background: var(--blue);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: top 0.2s var(--ease);
  font-size: 0.9rem;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Botones ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.3s var(--ease), color 0.3s var(--ease),
              border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  white-space: nowrap;
}
.btn > * { position: relative; z-index: 1; }
/* Relleno que crece desde el centro */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease);
}
.btn:hover::before { transform: scaleX(1); }

.btn--lg { padding: 15px 30px; font-size: 1rem; }

.btn--primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 24px rgba(41, 82, 163, 0.35);
}
.btn--primary::before { background: var(--blue-bright); }
.btn--primary:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(74, 127, 224, 0.45);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn--ghost::before { background: rgba(74, 127, 224, 0.12); }
.btn--ghost:hover {
  border-color: var(--blue-bright);
  color: var(--blue-glow);
  transform: translateY(-2px);
}

.btn--white {
  background: #fff;
  color: var(--blue-dark);
}
.btn--white::before { background: #eef3fc; }
.btn--white:hover {
  color: var(--blue-dark);
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

/* ---------- Reveal (animación al scroll) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition: opacity 0.7s var(--ease-precise), transform 0.7s var(--ease-precise);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: transform, opacity;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
/* Libera will-change al terminar */
.reveal.is-done { will-change: auto; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { animation: none !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .bg-fx__glow { animation: none; }
  .btn::before { display: none; }
}
