/* Homepage animations and styles */

/* Market statistics card animations */
.market-stat-card {
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.market-stat-card.fade-in-up {
  animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 15px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .market-stat-card {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Parallax effect for hero background */
.parallax-hero {
  will-change: transform;
}

/* Fade in animation */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Scale animation */
.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.8s ease-out;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Slide animations */
.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s ease-out;
}

.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s ease-out;
}

.slide-in-left.visible,
.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger animation for cards */
.stagger-animation {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.stagger-animation.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero text animations on load */
@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-animate-1 {
  animation: heroFadeIn 0.8s ease-out 0.2s both;
}

.hero-animate-2 {
  animation: heroFadeIn 0.8s ease-out 0.4s both;
}

.hero-animate-3 {
  animation: heroFadeIn 0.8s ease-out 0.6s both;
}

.hero-animate-4 {
  animation: heroFadeIn 0.8s ease-out 0.8s both;
}

/* How It Works section */
.how-it-works-steps { position: relative; }
.how-it-works-line {
  position: absolute;
  top: 26px;
  left: 90px;
  right: 90px;
  height: 2px;
  background: #e0dff5;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .hero-content-wrapper {
    margin-top: -5vh !important;
  }

  h1, h2, h3, p, a {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  section {
    overflow-x: hidden;
  }

  .fade-in-up {
    transform: translateY(15px);
  }

  .slide-in-left {
    transform: translateX(-20px);
  }

  .slide-in-right {
    transform: translateX(20px);
  }

  .fade-in-up,
  .scale-in,
  .slide-in-left,
  .slide-in-right,
  .stagger-animation {
    transition: all 0.5s ease-out;
  }

  .hero-animate-1,
  .hero-animate-2,
  .hero-animate-3,
  .hero-animate-4 {
    animation-duration: 0.6s;
  }

  @media (hover: none) {
    .transform.hover\:scale-105\:hover {
      transform: none;
    }
  }
}

@media (max-width: 640px) {
  .features-grid { grid-template-columns: 1fr !important; }
  .how-it-works-line { left: 50px; right: 50px; }
}

/* Ensure smooth scrolling on iOS */
@supports (-webkit-touch-callout: none) {
  body {
    -webkit-overflow-scrolling: touch;
  }
}
