/* ============================================================
   BASE — Reset, Body, Tipografía, Selección, Scrollbar
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
  color-scheme: dark;
}

body {
  font-family: var(--font);
  background-color: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Selección de texto */
::selection {
  background: rgba(77, 190, 228, 0.22);
  color: var(--clr-primary-lt);
}

/* Scrollbar custom */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--clr-bg); }
::-webkit-scrollbar-thumb {
  background: var(--clr-surface-top);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--clr-primary); }

/* Links */
a { color: inherit; text-decoration: none; }

/* Imágenes */
img, video, svg { max-width: 100%; height: auto; display: block; }

/* Botones — reset */
button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  line-height: inherit;
}

/* Listas — reset */
ul, ol { list-style: none; }

/* Focus accesible */
:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
:focus:not(:focus-visible) { outline: none; }

/* Reducir movimiento (accesibilidad) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ── Escala tipográfica ── */

/* Display — Hero principal */
.display {
  font-size: clamp(2.4rem, 5.5vw, var(--fs-7xl));
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

/* Headline — Secciones */
.headline-lg {
  font-size: clamp(var(--fs-3xl), 3.5vw, var(--fs-5xl));
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.headline-md {
  font-size: clamp(var(--fs-2xl), 2.8vw, var(--fs-4xl));
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Body */
.body-lg {
  font-size: clamp(var(--fs-base), 1.5vw, var(--fs-xl));
  line-height: 1.75;
  color: var(--clr-text-muted);
}

.body-md {
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--clr-text-muted);
}

/* Label — uppercase técnico */
.label-tag {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* Gradiente en texto */
.text-gradient {
  background: var(--gradient-cta);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Scroll Reveal (IntersectionObserver en main.js) ── */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity  var(--dur-slow) var(--ease-spring),
    transform var(--dur-slow) var(--ease-spring);
}

[data-reveal="fade"]    { transform: none; }
[data-reveal="left"]    { transform: translateX(-24px); }
[data-reveal="right"]   { transform: translateX(24px); }
[data-reveal="scale"]   { transform: scale(0.94); }

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Delays encadenados */
[data-delay="100"] { transition-delay: 0.10s; }
[data-delay="200"] { transition-delay: 0.20s; }
[data-delay="300"] { transition-delay: 0.30s; }
[data-delay="400"] { transition-delay: 0.40s; }
[data-delay="500"] { transition-delay: 0.50s; }

/* Keyframes globales */
@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.05); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-10px); }
}

@keyframes typing-dot {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50%       { opacity: 1;   transform: translateY(-4px); }
}

@keyframes ripple-out {
  to { transform: scale(50); opacity: 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
