/* ==========================================================================
   ELYON AI — Layout
   Estructura compartida: contenedores, grid de secciones, utilidades de
   composición. Nada de estilos visuales de componentes aquí.
   ========================================================================== */

#webgl-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: var(--z-background);
  pointer-events: none;
}

/* Resplandor de fondo animado, DETRÁS del canvas 3D. Da profundidad y hace
   que el fondo "respire" reforzando la escena WebGL, con coste GPU nulo
   (solo CSS). Dos manchas de luz que derivan lentamente en sentidos opuestos. */
.bg-aurora {
  position: fixed;
  inset: -20%;
  z-index: calc(var(--z-background) - 1);
  pointer-events: none;
  background:
    radial-gradient(ellipse 45% 40% at 30% 25%, rgba(124, 92, 255, 0.22), transparent 60%),
    radial-gradient(ellipse 40% 38% at 72% 68%, rgba(0, 212, 255, 0.16), transparent 60%),
    radial-gradient(ellipse 35% 30% at 50% 50%, rgba(139, 92, 246, 0.12), transparent 65%);
  filter: blur(30px);
  animation: aurora-drift 26s ease-in-out infinite alternate;
}

@keyframes aurora-drift {
  0% {
    transform: translate3d(-3%, -2%, 0) scale(1);
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translate3d(4%, 3%, 0) scale(1.12);
    opacity: 0.9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-aurora { animation: none; }
}

/* Respaldo si Three.js falla o WebGL no está disponible: degradado
   radial estático que conserva la sensación premium sin depender de JS/GPU. */
body.no-webgl #webgl-canvas {
  display: none;
}

body.no-webgl::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: var(--z-background);
  background:
    radial-gradient(ellipse 60% 50% at 25% 15%, rgba(124, 92, 255, 0.16), transparent 60%),
    radial-gradient(ellipse 50% 45% at 80% 70%, rgba(0, 212, 255, 0.1), transparent 60%);
  pointer-events: none;
}

.page {
  position: relative;
  z-index: var(--z-base);
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.container--narrow {
  max-width: var(--container-narrow);
}

section {
  position: relative;
  padding-block: var(--section-padding);
}

.section-head {
  max-width: 720px;
  margin-bottom: var(--space-9);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.grid {
  display: grid;
  gap: var(--space-6);
}

.flex {
  display: flex;
}

.flex--center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex--between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-5);
  background: var(--accent-violet);
  color: #fff;
  border-radius: var(--radius-sm);
  transition: top var(--duration-base) var(--ease-out-quart);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ---- Divisores entre secciones: línea-luz sutil, no un <hr> genérico ---- */
.section-divider {
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, transparent, var(--glass-border) 50%, transparent);
}

/* ---- Wrapper de scroll-reveal: JS añade .is-visible ---- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--duration-slow) var(--ease-out-expo), transform var(--duration-slow) var(--ease-out-expo);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal-delay="1"] { transition-delay: 0.08s; }
[data-reveal-delay="2"] { transition-delay: 0.16s; }
[data-reveal-delay="3"] { transition-delay: 0.24s; }
[data-reveal-delay="4"] { transition-delay: 0.32s; }
[data-reveal-delay="5"] { transition-delay: 0.4s; }
[data-reveal-delay="6"] { transition-delay: 0.48s; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 1024px) {
  :root {
    --container-max: 100%;
  }
}

@media (max-width: 640px) {
  .section-head {
    margin-bottom: var(--space-7);
  }
}
