/* =====================================================================
   AUTÉNTICO CREATIVO — BASE
   Reset · tipografía · botones · utilidades · fondo animado
   ===================================================================== */

/* ───────────────────────── RESET ───────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--void);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; height: auto; }
a   { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }

/* Foco visible y coherente en toda la web */
:focus-visible {
  outline: 2px solid var(--teal-light);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Saltar al contenido (accesibilidad de teclado) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 999;
  padding: 10px 18px;
  background: var(--teal);
  color: #fff;
  border-radius: var(--r-full);
  font-size: 0.8rem;
}
.skip-link:focus { left: 12px; }

/* ───────────────────── FONDO ANIMADO ─────────────────────
   Capa 0: canvas WebGL (shader de nebulosa).
   Si WebGL no está disponible, o el usuario pide menos movimiento,
   o es un móvil con poca batería → queda el degradado CSS de respaldo. */
#bg-canvas,
#bg-fallback {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-bg);
  pointer-events: none;
}

/* El canvas se dibuja a menos resolución de la que ocupa: el propio escalado
   del navegador difumina el remolino. Así el texto de delante nunca compite. */
#bg-canvas {
  opacity: 0;
  display: block;
  transition: opacity 1.2s var(--ease);
}
#bg-canvas.ready { opacity: 1; }

/* Velo global: garantiza el contraste del texto sobre el remolino,
   sea el shader o el respaldo lo que se esté viendo. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(115% 85% at 50% 42%,
      rgba(0, 0, 0, 0.34) 0%,
      rgba(0, 0, 0, 0.52) 58%,
      rgba(0, 0, 0, 0.72) 100%);
}

/* Respaldo CSS: mismo lenguaje visual (negro → índigo + hélice teal/carmín) */
#bg-fallback {
  background-color: var(--void);
  background-image: url('../images/bg-nebulosa.webp');
  background-size: cover;
  background-position: 50% 50%;
  background-repeat: no-repeat;
}

/* Micro-tejido de píxeles: da textura y evita el "banding" del degradado */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    repeating-linear-gradient(0deg,   rgba(255,255,255,0.014) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(90deg,  rgba(255,255,255,0.014) 0 1px, transparent 1px 2px);
  mix-blend-mode: overlay;
}

/* ───────────────────── TIPOGRAFÍA ───────────────────── */
.t-display {
  font-family: var(--font-title);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 0.92;
  text-transform: uppercase;
}

.t-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.text-teal  { color: var(--teal-light); }
.text-red   { color: var(--red-light); }
.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }

/* Titular hueco con contorno — recurso característico de la marca */
.outline-text {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--teal-light);
  text-stroke: 1.5px var(--teal-light);
}

/* ───────────────────── LAYOUT ───────────────────── */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 22px;
  position: relative;
  z-index: var(--z-content);
}
.wrap-narrow { max-width: var(--wrap-narrow); }

.section { padding: var(--gap-xl) 0; position: relative; z-index: var(--z-content); }
.section-sm { padding: var(--gap-lg) 0; }

/* Espacio inferior para que el NAV flotante nunca tape contenido */
main { padding-bottom: 140px; }

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  background: var(--glass-bg-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-bottom: 18px;
}

.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-teal { background: var(--teal-light); box-shadow: 0 0 10px var(--teal-light); animation: pulse 2.6s infinite; }
.dot-red  { background: var(--red-light);  box-shadow: 0 0 10px var(--red-light);  animation: pulse 2.6s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1;   transform: scale(1);   }
  50%      { opacity: 0.45; transform: scale(0.8); }
}

/* ───────────────────── ICONOS ───────────────────── */
.icon {
  width: 20px; height: 20px;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }

/* ───────────────────── BOTONES ───────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 30px;
  border-radius: var(--r-full);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  transition: transform var(--t), background var(--t), border-color var(--t), box-shadow var(--t), color var(--t);
}

/* Destello diagonal (mirage) al pasar el ratón */
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.22) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease);
}
.btn:hover::before { transform: translateX(120%); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 10px 30px var(--teal-glow);
}
.btn-primary:hover { background: var(--teal-hover); transform: translateY(-2px); }

.btn-red {
  background: var(--red);
  color: #fff;
  box-shadow: 0 10px 30px var(--red-glow);
}
.btn-red:hover { background: var(--red-hover); transform: translateY(-2px); }

.btn-glass {
  background: var(--glass-bg);
  border-color: var(--glass-border);
  color: var(--text);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
}
.btn-glass:hover {
  border-color: var(--glass-border-strong);
  transform: translateY(-2px);
  box-shadow: 0 12px 34px rgba(0,0,0,0.45);
}

.btn-sm  { padding: 10px 22px; font-size: 0.68rem; }
.btn-lg  { padding: 17px 40px; font-size: 0.84rem; }
.btn-full { width: 100%; }

/* ───────────────────── SCROLL REVEAL ───────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: none; }
.delay-1 { transition-delay: 0.08s; }
.delay-2 { transition-delay: 0.16s; }
.delay-3 { transition-delay: 0.24s; }
.delay-4 { transition-delay: 0.32s; }
.delay-5 { transition-delay: 0.40s; }

/* ───────────────────── UTILIDADES ───────────────────── */
.mt-sm { margin-top: var(--gap-sm); }
.mt    { margin-top: var(--gap); }
.mt-lg { margin-top: var(--gap-lg); }
.center { text-align: center; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ───────────────────── ACCESIBILIDAD: MENOS MOVIMIENTO ───────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
