/* ============================================================
   SM TRADING HUB — ANIMATIONS
   CSS Keyframes, Transitions, and Intersection Observer Classes
   ============================================================ */

/* ---- Base Reveal States ---- */
.sm-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.sm-reveal[data-reveal-direction="left"] {
  transform: translateX(-36px);
}

.sm-reveal[data-reveal-direction="right"] {
  transform: translateX(36px);
}

/* Stagger delays for sibling reveal elements */
.sm-reveal[data-reveal-stagger]:nth-child(1) { transition-delay: 0ms; }
.sm-reveal[data-reveal-stagger]:nth-child(2) { transition-delay: 80ms; }
.sm-reveal[data-reveal-stagger]:nth-child(3) { transition-delay: 160ms; }
.sm-reveal[data-reveal-stagger]:nth-child(4) { transition-delay: 240ms; }
.sm-reveal[data-reveal-stagger]:nth-child(5) { transition-delay: 320ms; }
.sm-reveal[data-reveal-stagger]:nth-child(6) { transition-delay: 400ms; }
.sm-reveal[data-reveal-stagger]:nth-child(n+7) { transition-delay: 460ms; }

/* Explicit delay attributes */
.sm-reveal[data-reveal-delay="100"] { transition-delay: 100ms; }
.sm-reveal[data-reveal-delay="150"] { transition-delay: 150ms; }
.sm-reveal[data-reveal-delay="200"] { transition-delay: 200ms; }
.sm-reveal[data-reveal-delay="250"] { transition-delay: 250ms; }
.sm-reveal[data-reveal-delay="300"] { transition-delay: 300ms; }
.sm-reveal[data-reveal-delay="400"] { transition-delay: 400ms; }

/* Active / Revealed state */
.sm-reveal.is-revealed {
  opacity: 1;
  transform: none;
}

/* ---- Keyframe Animations ---- */

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

/* Shimmer effect on gold elements */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

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

/* Fade In */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Scale In */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Slide In from right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide in from left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Gold gradient sweep (for decorative elements) */
@keyframes goldSweep {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Hero entrance animations */
.hero-copy .hero-eyebrow {
  animation: fadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.hero-copy .hero-title {
  animation: fadeInUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.38s both;
}

.hero-copy .hero-subtitle {
  animation: fadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.54s both;
}

.hero-copy .hero-actions {
  animation: fadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.68s both;
}

.hero-panel {
  animation: fadeInUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

/* Trust strip items */
.trust-strip .trust-item {
  opacity: 0;
  animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.trust-strip .trust-item:nth-child(1) { animation-delay: 0.05s; }
.trust-strip .trust-item:nth-child(2) { animation-delay: 0.12s; }
.trust-strip .trust-item:nth-child(3) { animation-delay: 0.19s; }
.trust-strip .trust-item:nth-child(4) { animation-delay: 0.26s; }
.trust-strip .trust-item:nth-child(5) { animation-delay: 0.33s; }

/* Hover animations for cards */
.project-card,
.contact-detail-item,
.vision-pillar,
.founder-highlight,
.signal-card {
  will-change: transform;
}

/* Signal card entrance (injected dynamically) */
.signal-card {
  animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Project cards stagger */
.projects-grid .project-card:nth-child(1).is-revealed { transition-delay: 0ms; }
.projects-grid .project-card:nth-child(2).is-revealed { transition-delay: 100ms; }
.projects-grid .project-card:nth-child(3).is-revealed { transition-delay: 200ms; }

/* Mobile nav links stagger */
.mobile-menu.is-open .mobile-nav-link:nth-child(1) { animation: slideInRight 0.4s 0.05s both; }
.mobile-menu.is-open .mobile-nav-link:nth-child(2) { animation: slideInRight 0.4s 0.10s both; }
.mobile-menu.is-open .mobile-nav-link:nth-child(3) { animation: slideInRight 0.4s 0.15s both; }
.mobile-menu.is-open .mobile-nav-link:nth-child(4) { animation: slideInRight 0.4s 0.20s both; }
.mobile-menu.is-open .mobile-nav-link:nth-child(5) { animation: slideInRight 0.4s 0.25s both; }
.mobile-menu.is-open .mobile-nav-link:nth-child(6) { animation: slideInRight 0.4s 0.30s both; }

/* Button hover shimmer effect */
.btn-gold::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  background-position: 200% center;
  border-radius: inherit;
  pointer-events: none;
  transition: background-position 0.55s ease;
}

.btn-gold:hover::after {
  background-position: -100% center;
}

/* WhatsApp float button animation */
.wa-float-btn {
  animation: float 3s ease-in-out 2s infinite;
}

.wa-float-btn:hover { animation-play-state: paused; }

/* Active section highlight on nav */
@keyframes navUnderline {
  from { width: 0; }
  to   { width: 20px; }
}

/* 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;
  }

  .sm-reveal {
    opacity: 1;
    transform: none;
  }

  html { scroll-behavior: auto; }
}
