/* Micro-Animations & Scroll Reveals */

/* Fade In Up */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered Delay for children */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }

/* Slide In Right */
.slide-right {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.slide-right.active {
  opacity: 1;
  transform: translateX(0);
}

/* Slide In Left */
.slide-left {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.slide-left.active {
  opacity: 1;
  transform: translateX(0);
}

/* Zoom In */
.zoom-in {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.zoom-in.active {
  opacity: 1;
  transform: scale(1);
}

/* Pulse animation for CTA */
@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 229, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 229, 255, 0);
  }
}

.btn-pulse {
  animation: pulse-glow 2s infinite;
}

/* Shine effect on image hover */
.img-shine {
  position: relative;
  overflow: hidden;
}

.img-shine::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  transition: none;
}

.img-shine:hover::after {
  animation: shine 1s;
}

@keyframes shine {
  100% {
    left: 200%;
  }
}

/* 3D Electrical Cyber Grid Animation */
.electric-3d-grid {
  position: absolute;
  bottom: -20%;
  left: -50%;
  width: 200%;
  height: 60%;
  background-image: 
    linear-gradient(rgba(255, 193, 7, 0.4) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 193, 7, 0.4) 2px, transparent 2px);
  background-size: 60px 60px;
  transform: perspective(600px) rotateX(75deg);
  animation: electricMove 5s linear infinite;
  z-index: 2; /* above bg and overlay, below content */
  pointer-events: none;
  mask-image: linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0));
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0));
  box-shadow: inset 0 0 50px rgba(255, 193, 7, 0.2);
}

@keyframes electricMove {
  0% { background-position: 0 0; }
  100% { background-position: 0 60px; }
}

/* Occasional electrical spark flash in the hero overlay */
.hero-overlay::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  animation: electricFlash 7s infinite;
  z-index: 1;
}

@keyframes electricFlash {
  0%, 94%, 98%, 100% { opacity: 0; }
  95% { opacity: 0.8; }
  96% { opacity: 0; }
  97% { opacity: 0.5; }
}

/* Footer Wiring Animation */
.footer-wiring {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  background: 
    linear-gradient(90deg, transparent 49%, rgba(255, 193, 7, 0.05) 50%, transparent 51%),
    linear-gradient(transparent 49%, rgba(255, 193, 7, 0.05) 50%, transparent 51%);
  background-size: 100px 100px;
  opacity: 0.7;
}

.wire-pulse {
  position: absolute;
  background: var(--color-accent);
  box-shadow: 0 0 10px var(--color-accent), 0 0 20px var(--color-accent);
  border-radius: 50%;
}

.pulse-1 {
  width: 3px; height: 3px;
  top: 50px; left: 0;
  animation: pulseMoveX 6s linear infinite;
}

.pulse-2 {
  width: 3px; height: 3px;
  top: 150px; left: 0;
  animation: pulseMoveX 8s linear infinite reverse;
}

.pulse-3 {
  width: 3px; height: 3px;
  bottom: 0; left: 300px;
  animation: pulseMoveY 5s linear infinite;
}

@keyframes pulseMoveX {
  0% { left: -10px; opacity: 0; }
  5% { opacity: 1; }
  95% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

@keyframes pulseMoveY {
  0% { bottom: -10px; opacity: 0; }
  5% { opacity: 1; }
  95% { opacity: 1; }
  100% { bottom: 100%; opacity: 0; }
}

/* Wire Laying Animation (SVG Background) */
.wire-laying-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.wire-laying-bg svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 5px var(--color-accent));
}

.wire-line {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 2;
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: drawWire 6s ease-in-out infinite;
}

.wire-line:nth-child(2) { animation-duration: 8s; animation-delay: 1s; stroke-width: 1.5; opacity: 0.8; }
.wire-line:nth-child(3) { animation-duration: 5s; animation-delay: 2s; stroke-width: 3; }
.wire-line:nth-child(4) { animation-duration: 7s; animation-delay: 0.5s; stroke-dasharray: 1000; }
.wire-line:nth-child(5) { animation-duration: 9s; animation-delay: 1.5s; opacity: 0.6; }

@keyframes drawWire {
  0% { stroke-dashoffset: 2000; opacity: 0; }
  10% { opacity: 1; }
  50% { stroke-dashoffset: 0; opacity: 1; }
  90% { opacity: 1; }
  100% { stroke-dashoffset: -2000; opacity: 0; }
}
