/* ==========================================================================
   NEXTGEN FULL-SCREEN CENTER & SIDE LIGHTNING SYSTEM
   ========================================================================== */

body {
  position: relative;
  isolation: isolate;
  background: #ffffff;
  min-height: 100vh;
}

.ng-storm-background {
  position: fixed;
  inset: 0;
  z-index: -10;
  pointer-events: none;
  overflow: hidden;
}

.ng-storm-clouds {
  position: absolute;
  inset: -20%;
  z-index: -2;
  opacity: 0.3;
  filter: blur(60px);
  background:
    radial-gradient(ellipse at 20% 30%, rgba(255,224,116,.3) 0 10%, transparent 30%),
    radial-gradient(ellipse at 80% 25%, rgba(255,236,165,.35) 0 12%, transparent 35%),
    radial-gradient(ellipse at 50% 50%, rgba(255,218,91,.25) 0 15%, transparent 40%);
  animation: ngClouds 12s ease-in-out infinite alternate;
}

.ng-vignette {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(255,248,220,.15) 100%);
}

.ng-storm-flash {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: #fff3c4;
  opacity: 0;
  mix-blend-mode: multiply;
}

/* Flash Animations */
.ng-storm-background.flash .ng-storm-flash { animation: ngFlash .65s ease-out; }
.ng-storm-background.flash-strong .ng-storm-flash { animation: ngFlashStrong .9s ease-out; }

/* Lightning Bolt Positioning (Expanded across full screen & center) */
.ng-lightning {
  position: absolute;
  z-index: 1;
  width: min(65vw, 650px);
  height: 85vh;
  top: -5%;
  opacity: 0;
  overflow: visible;
  filter: drop-shadow(0 0 8px rgba(255,218,91,.9)) drop-shadow(0 0 22px rgba(255,224,116,.75));
}

/* Left, Center, and Right Bolt Variations */
.ng-lightning.left { left: -5%; transform: rotate(-5deg); }
.ng-lightning.center-left { left: 15%; transform: rotate(4deg); }
.ng-lightning.center-right { right: 15%; transform: scaleX(-1) rotate(6deg); }
.ng-lightning.right { right: -5%; transform: scaleX(-1) rotate(-5deg); }

.ng-bolt {
  fill: none;
  stroke: #ffe875;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
}

/* Strike triggers */
.ng-storm-background.strike .ng-lightning { animation: ngBoltFlash 1s ease-out; }
.ng-storm-background.strike .ng-bolt { animation: ngBoltDraw .45s ease-out forwards; }

/* Keyframes */
@keyframes ngClouds { 
  to { transform: translate3d(4%, 3%, 0) scale(1.1); opacity: .8; } 
}

@keyframes ngFlashStrong {
  0%, 100% { opacity: 0; }
  5% { opacity: .25; }
  12% { opacity: .02; }
  19% { opacity: .16; }
  29% { opacity: .01; }
  38% { opacity: .08; }
}

@keyframes ngBoltFlash {
  0%, 100% { opacity: 0; }
  10%, 30% { opacity: .85; }
  18% { opacity: .2; }
  25% { opacity: .65; }
  50% { opacity: 0; }
}

@keyframes ngBoltDraw { 
  to { stroke-dashoffset: 0; } 
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .ng-lightning {
    width: min(85vw, 450px);
  }
  .ng-lightning.center-left { left: 5%; }
  .ng-lightning.center-right { right: 5%; }
}


/* Force GPU acceleration for background storm and lightning elements */
.ng-storm-background,
.ng-storm-clouds,
.ng-vignette,
.ng-storm-flash,
.ng-lightning {
  transform: translateZ(0);
  will-change: transform, opacity;
  backface-visibility: hidden;
}

/* Pause SVG lightning animations during active scroll via the HTML class */
.is-scrolling .ng-lightning path,
.is-scrolling .ng-storm-flash {
  animation-play-state: paused !important;
}