/* ===================================================================
   VYOMANTRA TECHNOLOGIES - ANIMATIONS & SCROLL ENGINE STYLES
   Native ScrollTimeline Keyframes, Cyber Glows & Pulse Effects
=================================================================== */

/* Keyframe Animations */
@keyframes pulse-glow {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 10px var(--cyan);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.9);
    box-shadow: 0 0 4px var(--cyan);
  }
}

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

@keyframes scanline {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(1000%);
  }
}

@keyframes cyber-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes border-glow-cycle {
  0%, 100% {
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
  }
  50% {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.25);
  }
}

/* Floating animation helper */
.animate-float {
  animation: float-subtle 4s ease-in-out infinite;
}

.animate-glow-border {
  animation: border-glow-cycle 4s ease-in-out infinite;
}

/* Scanline Effect on Canvas Wrapper */
.pixel-canvas-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0.7;
  animation: scanline 4s linear infinite;
  pointer-events: none;
  z-index: 4;
}

/* Scroll-driven Reveal Animations */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes reveal-up {
      from {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    .scroll-reveal {
      animation: reveal-up auto linear backwards;
      animation-timeline: view();
      animation-range: entry 10% cover 30%;
    }
  }
}

/* Fallback for browsers without CSS scroll-timeline */
.scroll-reveal {
  opacity: 1;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal.hidden-pre-scroll {
  opacity: 0;
  transform: translateY(30px);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(15px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
