/* Motion & Interaction Effects */

.fadeIn {
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  filter: blur(5px);
  transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.8s ease;
}

.fadeIn.in {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

/* Glitch Text Effect */
.glitch-text {
  position: relative;
  display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg0);
}

.glitch-text::before {
  left: 2px;
  text-shadow: -1px 0 red;
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim-1 5s infinite linear alternate-reverse;
}

.glitch-text::after {
  left: -2px;
  text-shadow: -1px 0 blue;
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim-2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
  0% { clip: rect(20px, 9999px, 10px, 0); }
  20% { clip: rect(60px, 9999px, 80px, 0); }
  40% { clip: rect(10px, 9999px, 50px, 0); }
  60% { clip: rect(80px, 9999px, 20px, 0); }
  80% { clip: rect(30px, 9999px, 70px, 0); }
  100% { clip: rect(50px, 9999px, 40px, 0); }
}

@keyframes glitch-anim-2 {
  0% { clip: rect(10px, 9999px, 90px, 0); }
  20% { clip: rect(80px, 9999px, 10px, 0); }
  40% { clip: rect(40px, 9999px, 50px, 0); }
  60% { clip: rect(20px, 9999px, 30px, 0); }
  80% { clip: rect(70px, 9999px, 20px, 0); }
  100% { clip: rect(30px, 9999px, 80px, 0); }
}

/* Scanning Line */
.scan-line {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: rgba(0, 255, 255, 0.3);
  opacity: 0.5;
  animation: scan 6s linear infinite;
  pointer-events: none;
  z-index: 9998;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

@keyframes scan {
  0% { top: -10%; }
  100% { top: 110%; }
}

/* Hover Pulse for Interactive Elements */
.interactive-target:hover {
  animation: pulse-glow 1s infinite alternate;
}

@keyframes pulse-glow {
  from { box-shadow: 0 0 5px var(--neon-cyan); }
  to { box-shadow: 0 0 20px var(--neon-cyan), 0 0 10px var(--neon-pink); }
}

details.collapsible > .content {
  opacity: 0.85;
  transform: translateY(-4px);
  transition: opacity 220ms ease, transform 220ms ease;
}

details.collapsible[open] > .content {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .fadeIn,
  .fadeIn.in {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }

  .scan-line {
    display: none;
  }
}
