/* ============================================================
   DevLyon Web - Efectos visuales
   ============================================================
   Glassmorphism, glow, 3D tilt, partículas, gradientes animados.
   Diseño gamer empresarial con profundidad.
   ============================================================ */

/* ── Fondo con partículas / grid animado ──────────────────── */
.bg-effects {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  pointer-events: none;
  overflow: hidden;
}

/* Grid sutil tipo "hacking" */
.bg-effects__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 80%);
}

/* Orbes flotantes de color */
.bg-effects__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: orb-float 20s var(--ease-in-out) infinite;
}

.bg-effects__orb--purple {
  width: 400px;
  height: 400px;
  background: var(--color-purple);
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.bg-effects__orb--blue {
  width: 350px;
  height: 350px;
  background: var(--color-blue);
  bottom: 10%;
  right: -80px;
  animation-delay: -7s;
}

.bg-effects__orb--green {
  width: 300px;
  height: 300px;
  background: var(--color-green);
  top: 50%;
  left: 30%;
  animation-delay: -14s;
  opacity: 0.25;
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, -40px) scale(1.1); }
  66% { transform: translate(-40px, 60px) scale(0.95); }
}

/* ── Hero con efecto 3D ───────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  perspective: var(--perspective-far);
}

.hero__content {
  position: relative;
  z-index: var(--z-content);
  transform-style: preserve-3d;
  transition: transform var(--duration-slow) var(--ease-out);
}

.hero__greeting {
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  color: var(--color-green);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.1em;
}

/* Efecto terminal antes del nombre */
.hero__greeting::before {
  content: '> ';
  color: var(--color-purple);
}

.hero__name {
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: var(--fw-extrabold);
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: var(--space-md);
  text-shadow: 0 0 80px rgba(139, 92, 246, 0.3);
  animation: name-glow 4s var(--ease-in-out) infinite;
}

@keyframes name-glow {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.4)); }
  50% { filter: drop-shadow(0 0 40px rgba(59, 130, 246, 0.5)); }
}

.hero__role {
  font-size: clamp(1rem, 2.5vw, var(--fs-xl));
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  font-weight: var(--fw-light);
}

.hero__role span {
  color: var(--color-cyan);
}

.hero__summary {
  max-width: 600px;
  margin: 0 auto var(--space-xl);
  font-size: var(--fs-lg);
  color: var(--color-text-muted);
}

.hero__cta {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-2xl);
}

.hero__scroll {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--color-text-dim);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: scroll-bounce 2s var(--ease-in-out) infinite;
}

/* Línea vertical animada indicando scroll */
.hero__scroll::after {
  content: '';
  display: block;
  width: 1px;
  height: 40px;
  margin: var(--space-xs) auto 0;
  background: linear-gradient(to bottom, var(--color-purple), transparent);
  animation: scroll-line 2s var(--ease-in-out) infinite;
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
  50% { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

@keyframes scroll-line {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ── Card 3D tilt (efecto al hover con mouse) ─────────────── */
.card-3d {
  transform-style: preserve-3d;
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
  will-change: transform;
}

.card-3d__inner {
  transform: translateZ(var(--translate-z));
  transform-style: preserve-3d;
}

/* ── Glow ring en cards featured ──────────────────────────── */
.card-glow {
  position: relative;
}

.card-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, var(--color-purple), var(--color-cyan), var(--color-green));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
  pointer-events: none;
}

.card-glow:hover::before {
  opacity: 1;
}

/* ── Texto con efecto glitch sutil (solo en hover del nombre) ── */
.hero__name:hover {
  animation: glitch 0.3s steps(2) infinite;
}

@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 1px); }
  40% { transform: translate(2px, -1px); }
  60% { transform: translate(-1px, -1px); }
  80% { transform: translate(1px, 1px); }
  100% { transform: translate(0); }
}

/* ── Línea decorativa con gradiente animado ───────────────── */
.divider-glow {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-purple), var(--color-cyan), var(--color-green), transparent);
  background-size: 200% 100%;
  animation: divider-flow 6s linear infinite;
  margin: var(--space-2xl) 0;
  opacity: 0.5;
}

@keyframes divider-flow {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Sección L2JDevLyon con fondo especial ────────────────── */
.l2-section {
  position: relative;
  overflow: hidden;
}

.l2-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 50%, rgba(16, 185, 129, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.l2-section__content {
  position: relative;
  z-index: var(--z-content);
}

.l2-section__title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  background: linear-gradient(135deg, var(--color-purple-light), var(--color-green));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--space-sm);
}

/* ── Botones de comunidad con efecto especial ─────────────── */
.community-cta {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--space-xl);
}

/* ── Reduce motion: desactivar animaciones ────────────────── */
@media (prefers-reduced-motion: reduce) {
  .bg-effects__orb,
  .hero__name,
  .hero__scroll,
  .hero__scroll::after,
  .divider-glow,
  .status::before {
    animation: none !important;
  }

  .hero__name:hover {
    animation: none;
  }
}
