/* MMSM Website — scroll reveal animations */

/* ===== Keyframes ===== */
@keyframes fade-up {
  from {
    transform: translateY(30px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scale-in {
  from {
    transform: scale(0.95) translateY(20px);
  }
  to {
    transform: scale(1) translateY(0);
  }
}

@keyframes slide-right {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

@keyframes count-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* ===== Reveal base ===== */
.reveal {
  opacity: 0;
  transition: none;
}

.reveal.is-visible {
  opacity: 1;
}

/* ===== Variants ===== */
.reveal--up {
  animation: fade-up 0.8s var(--ease-out) both;
}

.reveal--fade {
  animation: fade-in 1s ease both;
}

.reveal--scale {
  animation: scale-in 0.7s var(--ease-out) both;
}

.reveal--slide {
  animation: slide-right 0.7s var(--ease-out) both;
}

.reveal--float {
  animation: fade-up 0.8s var(--ease-out) both, float 6s ease-in-out 1.5s infinite;
}

/* ===== Stagger delays (up to 12) ===== */
.reveal--d1 { animation-delay: 0.1s; }
.reveal--d2 { animation-delay: 0.2s; }
.reveal--d3 { animation-delay: 0.3s; }
.reveal--d4 { animation-delay: 0.4s; }
.reveal--d5 { animation-delay: 0.5s; }
.reveal--d6 { animation-delay: 0.6s; }
.reveal--d7 { animation-delay: 0.7s; }
.reveal--d8 { animation-delay: 0.8s; }
.reveal--d9 { animation-delay: 0.9s; }
.reveal--d10 { animation-delay: 1.0s; }
.reveal--d11 { animation-delay: 1.1s; }
.reveal--d12 { animation-delay: 1.2s; }

/* ===== Accent: shimmer underline ===== */
.shimmer-text {
  background: linear-gradient(90deg, var(--color-brand-green) 0%, var(--color-accent) 25%, var(--color-brand-blue) 50%, var(--color-accent) 75%, var(--color-brand-green) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

/* ===== Parallax-like subtle scroll effect ===== */
.parallax-slow {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* ===== Hero specific ===== */
.hero__content > * {
  animation: none;
}

.hero-visual {
  animation: none;
}

/* ===== Stats counter style ===== */
.stat {
  animation: fade-up 0.6s var(--ease-out) both;
}
.stat:nth-child(1) { animation-delay: 0.15s; }
.stat:nth-child(2) { animation-delay: 0.3s; }
.stat:nth-child(3) { animation-delay: 0.45s; }
.stat:nth-child(4) { animation-delay: 0.6s; }

/* ===== Section reveal ===== */
.section,
.highlight {
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.section.is-visible,
.highlight.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Section children stagger ===== */
.section.is-visible .grid-3 > *,
.section.is-visible .cat-grid > * {
  animation: fade-up 0.6s var(--ease-out) both;
}

.section.is-visible .grid-3 > *:nth-child(1) { animation-delay: 0.15s; }
.section.is-visible .grid-3 > *:nth-child(2) { animation-delay: 0.3s; }
.section.is-visible .grid-3 > *:nth-child(3) { animation-delay: 0.45s; }

.section.is-visible .cat-grid > *:nth-child(1) { animation-delay: 0.08s; }
.section.is-visible .cat-grid > *:nth-child(2) { animation-delay: 0.16s; }
.section.is-visible .cat-grid > *:nth-child(3) { animation-delay: 0.24s; }
.section.is-visible .cat-grid > *:nth-child(4) { animation-delay: 0.32s; }
.section.is-visible .cat-grid > *:nth-child(5) { animation-delay: 0.40s; }
.section.is-visible .cat-grid > *:nth-child(6) { animation-delay: 0.48s; }

.section.is-visible .steps > * {
  animation: fade-up 0.6s var(--ease-out) both;
}
.section.is-visible .steps > *:nth-child(1) { animation-delay: 0.15s; }
.section.is-visible .steps > *:nth-child(2) { animation-delay: 0.3s; }
.section.is-visible .steps > *:nth-child(3) { animation-delay: 0.45s; }

/* ===== Highlight CTA ===== */
.highlight > * {
  opacity: 0;
  animation: fade-up 0.7s var(--ease-out) both;
}
.highlight.is-visible > *:nth-child(1) { animation-delay: 0.15s; }
.highlight.is-visible > *:nth-child(2) { animation-delay: 0.3s; }
.highlight.is-visible > *:nth-child(3) { animation-delay: 0.5s; }

/* ===== Footer reveal ===== */
.site-footer {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.site-footer.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Reduce motion preference ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal,
  .section,
  .highlight,
  .site-footer {
    opacity: 1;
    transform: none;
  }
  .section > *,
  .highlight > * {
    opacity: 1;
  }
}
