/* ============================================
   GROWING TREE — Animations & Keyframes
   Micro-interactions, transitions, and effects
   ============================================ */

/* ── Seed Pulse ── */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

.seed-emoji {
  animation: pulse 3s ease-in-out infinite;
}

/* ── Scroll Indicator Bounce ── */
@keyframes scrollBounce {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
    opacity: 0.35;
  }
  50% {
    transform: translateX(-50%) translateY(10px);
    opacity: 0.7;
  }
}

.scroll-mouse::after {
  animation: scrollBounce 2.2s ease-in-out infinite;
}

/* ── Fade In Variants ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Float / Hover Effect ── */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* ── Twinkle (for sparkle elements) ── */
@keyframes twinkle {
  0%, 100% {
    opacity: 0.1;
    transform: scale(0.8);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.2);
  }
}

/* ── Leaf Sway ── */
@keyframes sway {
  0%, 100% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(2deg);
  }
}

/* ── Grow In (for elements that scale from 0) ── */
@keyframes growIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ── Shimmer (for loading/accent effects) ── */
@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* ── Glow Pulse (for accent elements) ── */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.1);
  }
  50% {
    box-shadow: 0 0 40px rgba(74, 222, 128, 0.2);
  }
}

/* ── Hero Section Staggered Entry ── */
.hero-section.visible .hero-content > * {
  animation: fadeInUp 0.8s ease forwards;
  opacity: 0;
}

.hero-section.visible .hero-content > *:nth-child(1) {
  animation-delay: 0.1s;
}
.hero-section.visible .hero-content > *:nth-child(2) {
  animation-delay: 0.3s;
}
.hero-section.visible .hero-content > *:nth-child(3) {
  animation-delay: 0.5s;
}
.hero-section.visible .hero-content > *:nth-child(4) {
  animation-delay: 0.7s;
}
.hero-section.visible .hero-content > *:nth-child(5) {
  animation-delay: 0.9s;
}
.hero-section.visible .hero-content > *:nth-child(6) {
  animation-delay: 1.1s;
}

/* ── Card Hover Lift ── */
.story-card:hover {
  transform: translateY(-4px);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Override transform when first appearing */
.story-section:not(.visible) .story-card:hover {
  transform: none;
}

/* ── Photo Placeholder Hover ── */
.photo-placeholder {
  transition: border-color 0.4s ease, background 0.4s ease, transform 0.4s ease;
}

.photo-placeholder:hover {
  transform: scale(1.01);
}

/* ── Project Mini Card Hover ── */
.project-mini-card {
  transition: background 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

.project-mini-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ── Social Link Hover Glow ── */
.social-link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50px;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
}

.social-link {
  position: relative;
  overflow: hidden;
}

.social-link:hover::after {
  opacity: 1;
}

/* ── Scroll Progress Bar (optional) ── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cricket), var(--coding), var(--web-biz), var(--future));
  z-index: 1000;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.1s linear;
  width: 100%;
}

/* ── Reduced Motion Preference ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .seed-emoji {
    animation: none;
  }

  .scroll-mouse::after {
    animation: none;
  }
}
