/*
 * Chhatna Marriage Office - Animations & Keyframes
 */

@keyframes cmoFloat {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-14px) rotate(6deg);
  }
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

@keyframes cmoPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

@keyframes cmoFadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll reveal trigger class */
.cmo-animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.cmo-animate-on-scroll.cmo-is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays */
.cmo-glance__card:nth-child(1) { transition-delay: 0.05s; }
.cmo-glance__card:nth-child(2) { transition-delay: 0.12s; }
.cmo-glance__card:nth-child(3) { transition-delay: 0.19s; }
.cmo-glance__card:nth-child(4) { transition-delay: 0.26s; }
.cmo-glance__card:nth-child(5) { transition-delay: 0.33s; }

.cmo-services__grid > *:nth-child(1) { transition-delay: 0.05s; }
.cmo-services__grid > *:nth-child(2) { transition-delay: 0.12s; }
.cmo-services__grid > *:nth-child(3) { transition-delay: 0.19s; }
.cmo-services__grid > *:nth-child(4) { transition-delay: 0.26s; }
.cmo-services__grid > *:nth-child(5) { transition-delay: 0.33s; }
.cmo-services__grid > *:nth-child(6) { transition-delay: 0.40s; }

/* Mobile Menu Animation */
.cmo-mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #ffffff;
  border-bottom: 2px solid var(--gold-400);
  box-shadow: 0 16px 30px rgba(0,0,0,0.15);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  z-index: 999;
}

.cmo-mobile-menu[aria-hidden="false"] {
  max-height: 80vh;
  opacity: 1;
}

.cmo-mobile-nav-list {
  list-style: none;
  padding: 20px 0 10px;
  display: flex;
  flex-direction: column;
}

.cmo-mobile-nav-list li {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.3s ease var(--delay), transform 0.3s ease var(--delay);
}

.cmo-mobile-menu[aria-hidden="false"] .cmo-mobile-nav-list li {
  opacity: 1;
  transform: translateY(0);
}

.cmo-mobile-nav-list a {
  display: block;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  border-bottom: 1px solid rgba(107, 17, 36, 0.06);
}

.cmo-mobile-nav-list a:hover {
  background: var(--cream-100);
  color: var(--maroon-700);
}

.cmo-mobile-menu__actions {
  padding: 16px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .cmo-animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
  .cmo-floating-element {
    animation: none !important;
  }
}
