/* ==========================================================================
   VEER SINGH ARCHIVAL PORTFOLIO ANIMATIONS SYSTEM
   High-performance transitions, scroll reveals & interactive keyframes
   ========================================================================== */

/* 1. Beacon Pulses */
@keyframes beaconPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(15, 169, 88, 0.6);
    transform: scale(0.95);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(15, 169, 88, 0);
    transform: scale(1);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(15, 169, 88, 0);
    transform: scale(0.95);
  }
}

@keyframes beaconPulseBlue {
  0% {
    box-shadow: 0 0 0 0 rgba(43, 93, 249, 0.6);
    transform: scale(0.95);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(43, 93, 249, 0);
    transform: scale(1);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(43, 93, 249, 0);
    transform: scale(0.95);
  }
}

/* 2. Active Nav Line Pulse */
@keyframes pulseLine {
  0%, 100% {
    opacity: 1;
    transform: scaleX(1);
  }
  50% {
    opacity: 0.6;
    transform: scaleX(0.85);
  }
}

/* 3. Continuous Infinite Marquee */
@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* 4. Electrical Circuit Signal Flow & Energy Beams */
@keyframes circuitPulse {
  0% {
    stroke-dashoffset: 100;
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0.2;
  }
}

/* 4b. Laser Border Beam Rotation */
@keyframes borderBeamRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 4c. Energy Packet Flow along Pipeline */
@keyframes energyPacket {
  0% {
    left: 0%;
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

@keyframes energyPacketVertical {
  0% {
    top: 0%;
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* 4d. Holographic Glare Shimmer */
@keyframes holoShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* 4e. Corner Crosshair Expansion */
@keyframes crosshairPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.35);
    opacity: 1;
    color: var(--accent-blue);
  }
}

/* 5. Pipeline Step Traveling Light */
@keyframes nodePulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 rgba(43, 93, 249, 0.2);
    border-color: var(--accent-blue);
  }
  50% {
    box-shadow: 0 0 18px rgba(43, 93, 249, 0.7);
    border-color: #5580ff;
  }
}

/* 6. Subtle Watermark Float */
@keyframes subtleFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(-0.5deg);
  }
}

.purpose-watermark {
  animation: subtleFloat 8s ease-in-out infinite;
}

/* 7. Scroll Reveal Classes (Driven by IntersectionObserver) */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children transitions */
.stagger-parent > .reveal-child {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-parent.is-revealed > .reveal-child {
  opacity: 1;
  transform: translateY(0);
}

.stagger-parent.is-revealed > .reveal-child:nth-child(1) { transition-delay: 0.05s; }
.stagger-parent.is-revealed > .reveal-child:nth-child(2) { transition-delay: 0.12s; }
.stagger-parent.is-revealed > .reveal-child:nth-child(3) { transition-delay: 0.19s; }
.stagger-parent.is-revealed > .reveal-child:nth-child(4) { transition-delay: 0.26s; }
.stagger-parent.is-revealed > .reveal-child:nth-child(5) { transition-delay: 0.33s; }
.stagger-parent.is-revealed > .reveal-child:nth-child(6) { transition-delay: 0.40s; }
.stagger-parent.is-revealed > .reveal-child:nth-child(7) { transition-delay: 0.47s; }
.stagger-parent.is-revealed > .reveal-child:nth-child(8) { transition-delay: 0.54s; }
.stagger-parent.is-revealed > .reveal-child:nth-child(9) { transition-delay: 0.61s; }
.stagger-parent.is-revealed > .reveal-child:nth-child(10) { transition-delay: 0.68s; }

/* 8. Micro-interactions */
.btn-primary, .btn-secondary, .btn-header {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary::after, .btn-secondary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  height: 150%;
  background: radial-gradient(circle, rgba(255,255,255,0.35) 0%, transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: transform 0.6s ease, opacity 0.4s ease;
  pointer-events: none;
}

.btn-primary:active::after, .btn-secondary:active::after {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  transition: 0s;
}

/* 9. Card Accent Glow on Hover */
.archetype-card, .node-card, .capability-card, .foundation-card, .vector-card, .cohort-card, .ledger-card {
  position: relative;
  overflow: hidden;
}

/* Luminous border sweep on hover */
.archetype-card::before, 
.capability-card::before,
.foundation-card::before,
.cohort-card::before,
.vector-card::before,
.ledger-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    transparent,
    transparent 70%,
    rgba(43, 93, 249, 0.3) 85%,
    transparent 100%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.archetype-card:hover::before,
.capability-card:hover::before,
.foundation-card:hover::before,
.cohort-card:hover::before,
.vector-card:hover::before,
.ledger-card:hover::before {
  opacity: 1;
  animation: borderBeamRotate 4s linear infinite;
}

/* Inner card shield to preserve content over conic beam */
.archetype-card > *,
.capability-card > *,
.foundation-card > *,
.cohort-card > *,
.vector-card > *,
.ledger-card > * {
  position: relative;
  z-index: 2;
}

/* 10. Dynamic Cursor Spotlight & Interactive Crosshair */
.cursor-spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(43, 93, 249, 0.045) 0%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9998;
  transition: opacity 0.3s ease;
}

.custom-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background-color: var(--accent-blue);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background-color 0.2s;
}

.custom-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(43, 93, 249, 0.45);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease-out, height 0.25s ease-out, border-color 0.25s ease-out, transform 0.08s ease-out;
}

body.cursor-hover .custom-cursor-ring {
  width: 48px;
  height: 48px;
  border-color: var(--accent-blue);
  background: rgba(43, 93, 249, 0.08);
}

/* 11. Global Neon Scroll Progress Bar */
.scroll-progress-line {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  width: 0%;
  background: linear-gradient(90deg, #2b5df9, #0fa958, #2b5df9);
  background-size: 200% 100%;
  animation: gradientShift 4s ease infinite;
  box-shadow: 0 0 10px rgba(43, 93, 249, 0.7);
  z-index: 999999;
  pointer-events: none;
  transition: width 0.08s cubic-bezier(0.1, 0.5, 0.1, 1);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 12. Sci-Fi Laser Scanline for Portrait Plate */
.plate-photo-frame::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(43, 93, 249, 0.95), transparent);
  box-shadow: 0 0 14px 2px rgba(43, 93, 249, 0.8), 0 0 4px #fff;
  opacity: 0;
  pointer-events: none;
  animation: portraitLaserScan 5.5s ease-in-out infinite;
  z-index: 5;
}

@keyframes portraitLaserScan {
  0% {
    top: 0%;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* Holographic subtle scan grid lines over portrait */
.plate-photo-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(43, 93, 249, 0.035) 4px
  );
  pointer-events: none;
  z-index: 4;
  opacity: 0.75;
}

/* 13. Interactive Click Shockwave Pulse */
.click-shockwave {
  position: fixed;
  border-radius: 50%;
  border: 1.5px solid var(--accent-blue);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  opacity: 1;
  z-index: 99999;
  animation: shockwaveExpand 0.55s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes shockwaveExpand {
  0% {
    width: 0px;
    height: 0px;
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0);
  }
  100% {
    width: 80px;
    height: 80px;
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* 14. Live Telemetry Equalizer Bars */
.telemetry-equalizer {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 11px;
  vertical-align: middle;
  margin-left: 6px;
}

.telemetry-equalizer span {
  display: inline-block;
  width: 2px;
  background-color: var(--accent-blue);
  border-radius: 1px;
  animation: eqBounce 1.2s ease-in-out infinite alternate;
}

.telemetry-equalizer span:nth-child(1) { height: 35%; animation-delay: 0.1s; }
.telemetry-equalizer span:nth-child(2) { height: 85%; animation-delay: 0.35s; }
.telemetry-equalizer span:nth-child(3) { height: 50%; animation-delay: 0.18s; }
.telemetry-equalizer span:nth-child(4) { height: 100%; animation-delay: 0.5s; }
.telemetry-equalizer span:nth-child(5) { height: 65%; animation-delay: 0.28s; }
.telemetry-equalizer span:nth-child(6) { height: 40%; animation-delay: 0.42s; }

@keyframes eqBounce {
  0% { transform: scaleY(0.25); opacity: 0.5; }
  50% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(0.4); opacity: 0.7; }
}

/* 15. Dynamic Cursor Glow on Cards */
.card-interactive-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  background: radial-gradient(350px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(43, 93, 249, 0.12), transparent 70%);
}

.archetype-card:hover .card-interactive-glow,
.node-card:hover .card-interactive-glow,
.capability-card:hover .card-interactive-glow,
.foundation-card:hover .card-interactive-glow,
.frontier-card:hover .card-interactive-glow,
.vector-card:hover .card-interactive-glow,
.cohort-card:hover .card-interactive-glow,
.ledger-card:hover .card-interactive-glow {
  opacity: 1;
}

/* 16. Cybernetic Text Scramble Indicator */
.scramble-active {
  color: var(--accent-blue) !important;
  text-shadow: 0 0 8px rgba(43, 93, 249, 0.4);
}

/* 17. Ambient Floating Particle Canvas */
.ambient-particle-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

@media (hover: none) {
  .cursor-spotlight, .custom-cursor-dot, .custom-cursor-ring, .ambient-particle-canvas {
    display: none !important;
  }
}
