/* Animations CSS */

/* Letter-by-letter animation for the name */
.animated-text {
  display: inline-block;
  margin: 0;
}

.animated-text span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.3s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in animation for other elements */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered delay utility classes */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }
.delay-9 { animation-delay: 0.9s; }
.delay-10 { animation-delay: 1s; }

/* Button hover animation */
.btn:hover, 
.download-btn:hover,
.submit-btn:hover,
.project-link:hover,
.pub-link:hover {
  transform: translateY(-2px);
  transition: all 0.3s ease;
}

/* Pulsing glow animation */
.glow {
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    box-shadow: 0 0 5px rgba(190, 85, 4, 0.3);
  }
  to {
    box-shadow: 0 0 20px rgba(190, 85, 4, 0.6);
  }
}

/* Smooth scaling animation */
.scale-on-hover {
  transition: transform 0.3s ease;
}

.scale-on-hover:hover {
  transform: scale(1.05);
}

/* Navigation link hover effect */
.nav-links a {
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links .active a::after {
  width: 100%;
}

/* Page transitions */
.page-transition {
  opacity: 0;
  animation: fadeIn 0.5s ease-in-out forwards;
}

/* Stars twinkling effect */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.stars::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(white, rgba(255, 255, 255, 0.2) 2px, transparent 2px);
  background-size: 100px 100px;
  animation: twinkle 4s ease-in-out infinite alternate;
}

.stars::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(white, rgba(255, 255, 255, 0.15) 1px, transparent 2px);
  background-size: 150px 150px;
  background-position: 50px 50px;
  animation: twinkle 6s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from {
    opacity: 0.3;
  }
  to {
    opacity: 0.8;
  }
}