/* Lightning Easter Egg Styles ⚡ */

/* Title letter styling */
#tech-stack-title .letter {
  display: inline-block;
  transition: all 0.3s ease-out;
  will-change: transform, color, text-shadow;
}

#tech-stack-title .letter-space {
  display: inline-block;
  width: 0.3em;
}

/* Lightning overlay container */
.lightning-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

/* Lightning bolt styling */
.lightning-bolt {
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: flickerBolt 0.1s infinite;
}

.lightning-branch {
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: flickerBranch 0.15s infinite;
}

/* Flicker animation for lightning */
@keyframes flickerBolt {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

@keyframes flickerBranch {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.4; }
}

/* Flash effect on impact */
.lightning-flash {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}

/* Mobile optimizations */
@media screen and (max-width: 768px) {
  #tech-stack-title .letter {
    transition: all 0.2s ease-out;
  }

  .lightning-bolt {
    stroke-width: 2 !important;
  }

  .lightning-branch {
    stroke-width: 1.5 !important;
  }

  /* Reduce glow effects on mobile for performance */
  .lightning-bolt,
  .lightning-branch {
    filter: none !important;
  }

  /* Reduce breathing glow intensity on mobile */
  @keyframes breatheGlowStrong {
    0%, 100% {
      filter: brightness(1);
    }
    50% {
      filter: brightness(1.06) drop-shadow(0 0 8px currentColor);
    }
  }

  @keyframes breatheGlowMedium {
    0%, 100% {
      filter: brightness(1);
    }
    50% {
      filter: brightness(1.03) drop-shadow(0 0 4px currentColor);
    }
  }

  @keyframes breatheGlowWeak {
    0%, 100% {
      filter: brightness(1);
    }
    50% {
      filter: brightness(1.01) drop-shadow(0 0 2px currentColor);
    }
  }
}

/* Ensure title stays above logo items */
.logo-loop-header {
  position: relative;
  z-index: 10;
}

/* Prevent text selection during lightning animation */
.logo-loop-section.lightning-active {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

/* Progressive breathing glow animations */

/* First breath - strongest */
#tech-stack-title.breathing-glow-strong {
  animation: breatheGlowStrong 2s ease-in-out 1;
}

@keyframes breatheGlowStrong {
  0% {
    filter: brightness(1) drop-shadow(0 0 5px transparent);
  }
  50% {
    filter: brightness(1.12) drop-shadow(0 0 25px currentColor);
  }
  100% {
    filter: brightness(1) drop-shadow(0 0 5px transparent);
  }
}

/* Second breath - medium (dramatically less) */
#tech-stack-title.breathing-glow-medium {
  animation: breatheGlowMedium 2s ease-in-out 1;
}

@keyframes breatheGlowMedium {
  0% {
    filter: brightness(1) drop-shadow(0 0 3px transparent);
  }
  50% {
    filter: brightness(1.05) drop-shadow(0 0 10px currentColor);
  }
  100% {
    filter: brightness(1) drop-shadow(0 0 3px transparent);
  }
}

/* Third breath - barely visible */
#tech-stack-title.breathing-glow-weak {
  animation: breatheGlowWeak 2s ease-in-out 1;
}

@keyframes breatheGlowWeak {
  0% {
    filter: brightness(1) drop-shadow(0 0 1px transparent);
  }
  50% {
    filter: brightness(1.02) drop-shadow(0 0 3px currentColor);
  }
  100% {
    filter: brightness(1) drop-shadow(0 0 1px transparent);
  }
}
