/*--------------------------------------------------------------
# Hero Animation - Revised Sequence Support
--------------------------------------------------------------*/

/* Hero section should have NO background - gradient is on child element */
.hero-section {
  background: none !important;
}

/* Gradient layer starts hidden */
.hero-bg-gradient {
  opacity: 0;
  background: linear-gradient(145deg, #000000 0%, #0e0064 35%, #000000 100%);
}

/* Blur overlay starts hidden */
.hero-bg-blur-overlay {
  opacity: 0;
}

/* Grid canvas initial state */
#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 1;
}

/* Typewriter spans - hidden by default */
#typewriter span {
  display: inline-block;
  opacity: 0;
  transform: translateY(10px);
  will-change: opacity, transform;
}

#typewriter span.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* AI Rays - hidden by default, smooth fade-in */
#ai-rays {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 108;
  opacity: 0;
  /* Transition set by JS based on TIMING.raysFadeIn */
}

#ai-rays.active {
  opacity: 1;
}

/* Blobs - hidden by default */
.blobpattern2,
.hero-blob2,
.hero-blob3 {
  opacity: 0;
  /* Transition set by JS based on TIMING.blobsFadeIn */
}

/* Safari-specific optimizations */
@supports (-webkit-backdrop-filter: blur(1px)) {
  .hero-bg-wrap {
    will-change: opacity;
  }
  
  #typewriter span {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* Performance optimizations */
.hero-section {
  will-change: auto;
  contain: layout style paint;
}

.hero-bg-wrap,
.hero-bg-gradient,
.hero-bg-image,
.hero-bg-blur-overlay {
  will-change: opacity;
}

#scene,
#ai-rays {
  will-change: transform;
  contain: strict;
}

/* Ensure smooth transitions */
.hero-bg-gradient,
.hero-bg-blur-overlay {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}