/* ============================================
   Animations - SkillsRepo
   ============================================ */

/* Cursor blink for typing effect */
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Floating animation for CTA */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Bounce animation for scroll indicator */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(6px); }
  60% { transform: translateY(3px); }
}

/* Spinner rotation */
@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Gradient shift for hero background */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Pulse glow effect */
@keyframes pulseGlow {
  0%, 100% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1.05);
  }
}

/* Fade in up animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero fade in animation */
@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Slide in from left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide in from right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale in animation */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Code rain character fade */
@keyframes codeRainFade {
  0% { opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; }
}

/* Floating code fragment animation */
@keyframes floatFragment {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0.3;
  }
  25% {
    transform: translate(10px, -20px) rotate(1deg);
    opacity: 0.5;
  }
  50% {
    transform: translate(-5px, -40px) rotate(-1deg);
    opacity: 0.4;
  }
  75% {
    transform: translate(15px, -20px) rotate(2deg);
    opacity: 0.5;
  }
}

/* ============================================
   Animation Classes
   ============================================ */

.animate-fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

.animate-scale-in {
  animation: scaleIn 0.4s ease forwards;
}

.animate-slide-left {
  animation: slideInLeft 0.6s ease forwards;
}

.animate-slide-right {
  animation: slideInRight 0.6s ease forwards;
}

/* Stagger delays for lists */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }



/* ============================================
   Hover Micro-interactions
   ============================================ */

.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.hover-glow {
  transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
  box-shadow: 0 0 30px var(--glow-emerald);
}

.hover-border {
  transition: border-color var(--transition-base);
}

.hover-border:hover {
  border-color: var(--accent-emerald);
}

/* ============================================
   Glitch Text Effect
   ============================================ */

@keyframes glitch {
  0%, 90%, 100% {
    transform: translate(0);
    text-shadow: none;
  }
  92% {
    transform: translate(-2px, 1px);
    text-shadow: 2px 0 var(--accent-cyan), -2px 0 var(--accent-emerald);
  }
  94% {
    transform: translate(2px, -1px);
    text-shadow: -2px 0 var(--accent-cyan), 2px 0 var(--accent-blue);
  }
  96% {
    transform: translate(-1px, 2px);
    text-shadow: 2px 0 var(--accent-emerald), -2px 0 var(--accent-blue);
  }
  98% {
    transform: translate(1px, -2px);
    text-shadow: -2px 0 var(--accent-blue), 2px 0 var(--accent-cyan);
  }
}

.glitch-text {
  animation: glitch 4s ease-in-out infinite;
}

/* ============================================
   Scanlines Overlay
   ============================================ */

.scanlines::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.1) 2px,
    rgba(0, 0, 0, 0.1) 4px
  );
  z-index: 9999;
  opacity: 0.3;
}

/* ============================================
   Border Glow Animation
   ============================================ */

@keyframes borderGlow {
  0%, 100% {
    border-color: var(--border-subtle);
    box-shadow: 0 0 0 rgba(16, 185, 129, 0);
  }
  50% {
    border-color: var(--accent-emerald);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
  }
}

@keyframes borderPulse {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.8;
  }
}

/* ============================================
   Card Hover Effects
   ============================================ */

.card-interactive {
  position: relative;
  overflow: hidden;
}

.card-interactive::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(16, 185, 129, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.card-interactive:hover::before {
  left: 100%;
}

/* ============================================
   Typing Cursor
   ============================================ */

.typing-cursor::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: var(--accent-emerald);
  margin-left: 2px;
}

/* ============================================
   Typing Complete Pulse
   ============================================ */

@keyframes typingPulse {
  0% {
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 25px rgba(0, 0, 0, 0.6));
  }
  25% {
    filter: drop-shadow(0 0 25px rgba(52, 211, 153, 0.9)) drop-shadow(0 0 50px rgba(34, 211, 238, 0.7));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(96, 165, 250, 0.8)) drop-shadow(0 0 40px rgba(52, 211, 153, 0.6));
  }
  100% {
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 25px rgba(0, 0, 0, 0.6));
  }
}

.hero__tagline.typing-complete {
  animation: typingPulse 1s ease-out;
}

/* ============================================
   Flicker Effect
   ============================================ */

@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.8; }
  94% { opacity: 1; }
  96% { opacity: 0.9; }
  97% { opacity: 1; }
}

.flicker {
  animation: flicker 3s ease-in-out infinite;
}

/* ============================================
   Neon Glow
   ============================================ */

.neon-glow {
  text-shadow:
    0 0 5px var(--accent-emerald),
    0 0 10px var(--accent-emerald),
    0 0 20px var(--accent-emerald),
    0 0 40px var(--accent-cyan);
}

.neon-glow-subtle {
  text-shadow:
    0 0 5px currentColor,
    0 0 10px currentColor;
}

/* ============================================
   Data Stream Effect
   ============================================ */

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

/* ============================================
   Reduced Motion Support
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .hero__cta,
  .hero__cta svg {
    animation: none;
  }

  .animate-fade-in,
  .animate-fade-in-up,
  .animate-scale-in,
  .animate-slide-left,
  .animate-slide-right {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .page-canvas {
    opacity: 0.2;
  }
}
