/* ===== ANIMATED ENHANCEMENTS ===== */

/* Pulsing effect for navigation buttons */
.quest-navigation a {
  position: relative;
  overflow: hidden;
}

.quest-navigation a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.8s ease;
}

.quest-navigation a:hover::before {
  left: 100%;
}


/* ===== FAST STORYTELLING ANIMATIONS ===== */

/* 1. Story section - title and content appear together quickly */
.story-content {
  animation: story-section-reveal 0.8s ease-out both;
}

@keyframes story-section-reveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 2. Quest section header - appears right after story */
.quests-section h2 {
  opacity: 0;
  animation: quest-header-reveal 0.6s ease-out 0.9s both;
}

@keyframes quest-header-reveal {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 3. Quest cards - simple fade in sequence */
.quest-link:nth-child(1) { animation: quest-reveal 0.5s ease-out 1.6s both; }
.quest-link:nth-child(2) { animation: quest-reveal 0.5s ease-out 1.8s both; }
.quest-link:nth-child(3) { animation: quest-reveal 0.5s ease-out 2.0s both; }
.quest-link:nth-child(4) { animation: quest-reveal 0.5s ease-out 2.2s both; }
.quest-link:nth-child(5) { animation: quest-reveal 0.5s ease-out 2.4s both; }
.quest-link:nth-child(6) { animation: quest-reveal 0.5s ease-out 2.6s both; }

@keyframes quest-reveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced hover effects for completed animations */
.quest-link:hover {
  transform: translateY(-8px) scale(1.03);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Quest content pages - simpler animation */
.quest-content {
  animation: content-reveal 0.8s ease-out;
}

@keyframes content-reveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced code block animations */
.code-block {
  animation: code-appear 0.6s ease-out;
}

@keyframes code-appear {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}


/* Responsive: Reduce animations on mobile for performance */
@media (max-width: 768px) {
  /* Simplified mobile animations - faster and less intensive */
  .story-content {
    animation: simple-fade-in 0.6s ease-out both;
  }
  
  .quests-section h2 {
    animation: simple-fade-in 0.4s ease-out 0.7s both;
  }
  
  .quest-link {
    animation: simple-fade-in 0.4s ease-out both;
    opacity: 0;
  }
  
  .quest-link:nth-child(1) { animation-delay: 1.0s; }
  .quest-link:nth-child(2) { animation-delay: 1.1s; }
  .quest-link:nth-child(3) { animation-delay: 1.2s; }
  .quest-link:nth-child(4) { animation-delay: 1.3s; }
  .quest-link:nth-child(5) { animation-delay: 1.4s; }
  .quest-link:nth-child(6) { animation-delay: 1.5s; }
  
  @keyframes simple-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .quest-link,
  .story-content,
  .quest-content,
  .quests-section h2,
  .quest-navigation a::before,
  .code-block {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}