/* 
 * Page Transitions CSS
 * Kirsten Van Der Merwe - Found VA Website
 */

/* Page Load Animation - Subtle fade in only */
.page-content {
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Smooth Transitions for Interactive Elements */
.card,
.btn,
.nav-link {
  transition: all var(--transition-base);
}

/* Section Fade-In on Scroll - Subtle */
.section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero Section Specific Animation */
.hero {
  opacity: 0;
  animation: heroFadeIn 1s ease-out forwards;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Hero Brand Animation */
.hero-brand {
  opacity: 0;
  animation: brandFadeIn 1s ease-out 0.2s forwards;
}

.hero-tagline {
  opacity: 0;
  animation: brandFadeIn 1s ease-out 0.5s forwards;
}

@keyframes brandFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Card Animations on Scroll */
.section .card {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 1s ease-out, transform 1s ease-out;
}

.section.visible .card {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation for cards in grid */
.section.visible .grid > .card:nth-child(1) {
  transition-delay: 0.15s;
}

.section.visible .grid > .card:nth-child(2) {
  transition-delay: 0.3s;
}

.section.visible .grid > .card:nth-child(3) {
  transition-delay: 0.45s;
}

.section.visible .grid > .card:nth-child(4) {
  transition-delay: 0.6s;
}

.section.visible .grid > .card:nth-child(5) {
  transition-delay: 0.75s;
}

.section.visible .grid > .card:nth-child(6) {
  transition-delay: 0.9s;
}

/* Heading slide-in effect */
.section h2 {
  opacity: 0;
  transform: translateY(15px) scale(0.98);
  transition: opacity 1.4s ease-out, transform 1.4s ease-out;
  position: relative;
}

.section.visible h2 {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 0.15s;
}

/* Decorative underline for centered headings */
.section h2.text-center::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  transition: transform 1s ease-out 0.4s;
}

.section.visible h2.text-center::after {
  transform: translateX(-50%) scaleX(1);
}

/* Button fade-in within cards */
.section .card .btn {
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section.visible .card .btn {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s;
}

/* Parallax Effect */
.hero {
  will-change: transform;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .page-content,
  .section,
  .section .card,
  .section .card .btn,
  .section h2,
  .hero,
  .hero-brand,
  .hero-tagline {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
