/* Scroll & entrance animations for marketing pages — v2 */

/* —— Ambient background —— */
.pa-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.pa-ambient__mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(29, 185, 84, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 10%, rgba(124, 92, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 50% 60% at 70% 85%, rgba(0, 212, 170, 0.06) 0%, transparent 55%);
  animation: paMeshShift 18s ease-in-out infinite alternate;
}

.pa-ambient__grid {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
}

.pa-ambient__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  will-change: transform;
  animation: paOrbFloat 14s ease-in-out infinite;
}

.pa-ambient__orb--1 {
  width: 420px;
  height: 420px;
  top: -8%;
  left: -6%;
  background: rgba(29, 185, 84, 0.18);
}

.pa-ambient__orb--2 {
  width: 360px;
  height: 360px;
  top: 35%;
  right: -8%;
  background: rgba(124, 92, 255, 0.16);
  animation-delay: -5s;
  animation-duration: 17s;
}

.pa-ambient__orb--3 {
  width: 280px;
  height: 280px;
  bottom: 5%;
  left: 30%;
  background: rgba(0, 212, 170, 0.14);
  animation-delay: -9s;
  animation-duration: 12s;
}

.page-animate .site-wrap {
  position: relative;
}

.page-animate:not(.page-discover):not(.page-contact) .site-main {
  position: relative;
  z-index: 1;
}

.page-animate .site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  transition: background 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}

.page-animate .site-header.is-scrolled {
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.page-animate.page-discover .pa-ambient__orb {
  filter: blur(80px);
  opacity: 0.5;
}

.page-animate.page-discover .pa-ambient__mesh {
  background:
    radial-gradient(ellipse 60% 40% at 10% 0%, rgba(29, 185, 84, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 50% 30% at 90% 20%, rgba(124, 92, 255, 0.1) 0%, transparent 45%);
}

@keyframes paMeshShift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(2%, -1%, 0) scale(1.04);
  }
}

@keyframes paOrbFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  33% {
    transform: translate3d(24px, -18px, 0) scale(1.06);
  }
  66% {
    transform: translate3d(-16px, 12px, 0) scale(0.96);
  }
}

/* —— Initial hide —— */
.page-animate.pa-init .site-main > .mk-section,
.page-animate.pa-init .site-main > section:not(.home-trust):not(.reviews-marquee),
.page-animate.pa-init .site-main .wwd-section,
.page-animate.pa-init .discover-row,
.page-animate.pa-init .discover-sidebar__card,
.page-animate.pa-init .discover-sidebar__head,
.page-animate.pa-init .about-partner--spotlight {
  opacity: 0;
}

/* —— Reveal types —— */
.page-animate .pa-reveal,
.page-animate .pa-reveal-left,
.page-animate .pa-reveal-right,
.page-animate .pa-scale,
.page-animate .pa-flip {
  opacity: 0;
  will-change: opacity, transform;
}

.page-animate .pa-reveal {
  transform: translate3d(0, 40px, 0);
}

.page-animate .pa-reveal-left {
  transform: translate3d(-48px, 12px, 0);
}

.page-animate .pa-reveal-right {
  transform: translate3d(48px, 12px, 0);
}

.page-animate .pa-scale {
  transform: translate3d(0, 24px, 0) scale(0.94);
}

.page-animate .pa-flip {
  transform: perspective(800px) rotateX(8deg) translate3d(0, 20px, 0);
}

.page-animate .pa-reveal.pa-visible,
.page-animate .pa-reveal-left.pa-visible,
.page-animate .pa-reveal-right.pa-visible,
.page-animate .pa-scale.pa-visible,
.page-animate .pa-flip.pa-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1) rotateX(0);
  transition:
    opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--pa-delay, 0ms);
}

/* Section glow sweep on reveal */
.page-animate .mk-section.pa-visible::before,
.page-animate .wwd-section.pa-visible::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(29, 185, 84, 0.5) 30%,
    rgba(0, 212, 170, 0.6) 50%,
    rgba(124, 92, 255, 0.4) 70%,
    transparent 100%
  );
  animation: paLineSweep 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
  pointer-events: none;
}

.page-animate .mk-section,
.page-animate .wwd-section {
  position: relative;
}

@keyframes paLineSweep {
  from {
    opacity: 0;
    transform: scaleX(0);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

/* —— Hero —— */
.page-animate .pa-hero {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
}

.page-animate .pa-hero.pa-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition:
    opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.page-animate .pa-hero.pa-visible .mk-eyebrow,
.page-animate .pa-hero.pa-visible .contact-hero__eyebrow {
  animation: paEyebrowIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.page-animate .pa-hero.pa-visible .pa-line {
  animation: paLineUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(0.15s + var(--line-i, 0) * 0.1s);
}

.page-animate .pa-hero.pa-visible blockquote.pa-line {
  animation: paQuoteIn 1s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(0.2s + var(--line-i, 0) * 0.08s);
}

@keyframes paLineUp {
  from {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes paQuoteIn {
  from {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
}

.page-animate .pa-hero.pa-visible .mk-eyebrow,
.page-animate .mk-eyebrow {
  position: relative;
}

.page-animate .pa-hero.pa-visible .mk-eyebrow::before,
.page-animate .mk-section.pa-visible > .mk-eyebrow::before,
.page-animate .mk-section.pa-visible .mk-eyebrow:first-child::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.5em;
  border-radius: 50%;
  background: #1db954;
  box-shadow: 0 0 12px rgba(29, 185, 84, 0.7);
  animation: paDotPulse 2s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes paDotPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.7;
  }
}

@keyframes paEyebrowIn {
  from {
    opacity: 0;
    letter-spacing: 0.22em;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    letter-spacing: 0.12em;
    transform: translateY(0);
  }
}

/* Shimmer gradient text */
.page-animate .mk-gradient {
  background: linear-gradient(
    90deg,
    #1db954 0%,
    #00d4aa 25%,
    #7c5cff 50%,
    #00d4aa 75%,
    #1db954 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: paGradientShimmer 4s linear infinite;
}

@keyframes paGradientShimmer {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* —— Stagger —— */
.page-animate .pa-stagger .pa-stagger-item {
  opacity: 0;
  transform: translate3d(0, 28px, 0) scale(0.98);
}

.page-animate .pa-stagger.pa-visible .pa-stagger-item {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--pa-i, 0) * 80ms + 100ms);
}

.page-animate .pa-stagger-row.pa-visible .pa-stagger-item {
  transition-delay: calc(var(--pa-i, 0) * 60ms + 80ms);
}

/* —— Stats counter glow —— */
.page-animate .page-stats__value,
.page-animate .about-stats__value,
.page-animate .mission-stats__value,
.page-animate .projects-card__stat-value {
  display: inline-block;
  transition: text-shadow 0.3s ease;
}

.page-animate .pa-counter-done {
  animation: paStatPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes paStatPop {
  0% {
    transform: scale(0.85);
    text-shadow: none;
  }
  60% {
    transform: scale(1.08);
    text-shadow: 0 0 24px rgba(29, 185, 84, 0.5);
  }
  100% {
    transform: scale(1);
    text-shadow: 0 0 12px rgba(29, 185, 84, 0.2);
  }
}

.page-animate .about-stats__item.pa-stagger-item,
.page-animate .mission-stats__item.pa-stagger-item {
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.page-animate .pa-stagger.pa-visible .page-stats__item:hover,
.page-animate .pa-stagger.pa-visible .about-stats__item:hover,
.page-animate .pa-stagger.pa-visible .mission-stats__item:hover {
  border-color: rgba(29, 185, 84, 0.35);
  box-shadow: 0 8px 32px rgba(29, 185, 84, 0.12);
  transform: translate3d(0, -3px, 0);
}

/* —— 3D tilt cards —— */
.page-animate .pa-tilt {
  transform-style: preserve-3d;
  transition:
    transform 0.15s ease-out,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.page-animate .pa-tilt:hover {
  border-color: rgba(0, 212, 170, 0.4);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(0, 212, 170, 0.15);
}

.page-animate .pa-tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--tilt-x, 50%) var(--tilt-y, 50%),
    rgba(255, 255, 255, 0.08) 0%,
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.page-animate .pa-tilt:hover::after {
  opacity: 1;
}

/* —— WWD sections —— */
.page-animate .wwd-section.pa-visible {
  background: linear-gradient(
    90deg,
    rgba(29, 185, 84, 0.04) 0%,
    transparent 40%
  );
}

.page-animate .wwd-section.pa-reveal-left.pa-visible {
  background: linear-gradient(90deg, rgba(29, 185, 84, 0.05) 0%, transparent 50%);
}

.page-animate .wwd-section.pa-reveal-right.pa-visible {
  background: linear-gradient(270deg, rgba(124, 92, 255, 0.05) 0%, transparent 50%);
}

.page-animate .wwd-section.pa-visible .wwd-section__num {
  animation: paNumGlow 2.5s ease-in-out infinite;
}

@keyframes paNumGlow {
  0%,
  100% {
    text-shadow: 0 0 8px rgba(0, 212, 170, 0.3);
  }
  50% {
    text-shadow: 0 0 20px rgba(0, 212, 170, 0.6);
  }
}

.page-animate .wwd-section.pa-visible .wwd-section__tagline {
  animation: paTaglineIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}

@keyframes paTaglineIn {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* —— Timeline —— */
.page-animate .about-timeline__item.pa-stagger-item {
  transform: translate3d(-24px, 0, 0);
}

.page-animate .pa-stagger.pa-visible .about-timeline__year {
  animation: paYearPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: calc(var(--pa-i, 0) * 80ms + 200ms);
}

@keyframes paYearPop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* —— Platform pills —— */
.page-animate .pa-stagger.pa-visible .about-platforms__pill,
.page-animate .pa-stagger.pa-visible .mission-platforms__pill {
  animation: paPillBounce 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: calc(var(--pa-i, 0) * 50ms + 150ms);
}

@keyframes paPillBounce {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.page-animate .about-platforms__pill:hover,
.page-animate .mission-platforms__pill:hover {
  transform: translateY(-2px);
  border-color: rgba(29, 185, 84, 0.4);
  box-shadow: 0 6px 20px rgba(29, 185, 84, 0.15);
}

/* —— Projects —— */
.page-animate .discover-row.pa-reveal {
  transform: translate3d(0, 48px, 0);
}

.page-animate .discover-sidebar__card.pa-scale {
  transform: translate3d(0, 20px, 0) scale(0.97);
}

.page-animate .pa-visible.projects-card,
.page-animate .pa-stagger.pa-visible .projects-card {
  position: relative;
  overflow: hidden;
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.page-animate .projects-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.06),
    transparent
  );
  transition: left 0.55s ease;
  pointer-events: none;
}

.page-animate .projects-card:hover::before {
  left: 120%;
}

.page-animate .pa-visible.projects-card:hover,
.page-animate .pa-stagger.pa-visible .projects-card:hover {
  transform: translate3d(0, -6px, 0);
}

.page-animate .projects-feature-video.pa-reveal {
  transform: translate3d(0, 56px, 0) scale(0.97);
}

.page-animate .projects-feature-video.pa-visible {
  transform: translate3d(0, 0, 0) scale(1);
  transition:
    opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.page-animate .projects-feature-video.pa-visible .projects-feature-video__media video,
.page-animate .projects-feature-video.pa-visible .projects-feature-video__media img {
  animation: paVideoZoom 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

@keyframes paVideoZoom {
  from {
    transform: scale(1.15);
  }
  to {
    transform: scale(1);
  }
}

/* —— Discover cards —— */
.page-animate .discover-card.pa-stagger-item {
  transform: translate3d(0, 20px, 0) scale(0.95);
}

.page-animate .pa-stagger.pa-visible .discover-card .discover-card__play {
  animation: paPlayPulse 2s ease-in-out infinite;
}

@keyframes paPlayPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 4px 16px rgba(29, 185, 84, 0.3);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(29, 185, 84, 0.55);
  }
}

.page-animate .discover-card:hover .discover-card__media img {
  transform: scale(1.06);
}

.page-animate .discover-card .discover-card__media img {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.page-animate .discover-row.pa-visible .discover-row__title {
  animation: paTitleUnderline 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

@keyframes paTitleUnderline {
  from {
    opacity: 0.6;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.page-animate .discover-row.pa-visible .discover-row__title::after {
  content: "";
  display: block;
  width: 0;
  height: 2px;
  margin-top: 4px;
  background: linear-gradient(90deg, #1db954, #00d4aa);
  animation: paUnderlineGrow 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
}

@keyframes paUnderlineGrow {
  to {
    width: 48px;
  }
}

/* —— Partner gallery —— */
.page-animate .about-partner__figure.pa-stagger-item {
  transform: translate3d(0, 24px, 0) scale(0.96);
}

.page-animate .pa-stagger.pa-visible .about-partner__figure:hover {
  transform: translate3d(0, -4px, 0) scale(1.02);
  transition: transform 0.3s ease;
}

.page-animate .pa-stagger.pa-visible .about-partner__figure:hover img {
  transform: scale(1.05);
  transition: transform 0.4s ease;
}

/* —— Link cards —— */
.page-animate .about-links__card {
  position: relative;
  overflow: hidden;
}

.page-animate .pa-stagger.pa-visible .about-links__card:hover {
  transform: translate3d(4px, -3px, 0);
  border-color: rgba(29, 185, 84, 0.35);
}

/* —— Scroll text reveal (site-wide) —— */
.page-animate .pa-text {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  filter: blur(8px);
  will-change: opacity, transform, filter;
}

.page-animate .pa-text--title {
  transform: translate3d(0, 36px, 0);
  filter: blur(10px);
}

.page-animate .pa-text.pa-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: blur(0);
  transition:
    opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--text-i, 0) * 70ms);
}

.page-animate .pa-text--title.pa-visible {
  transition-duration: 0.85s;
  transition-delay: calc(var(--text-i, 0) * 55ms);
}

.page-animate .pa-text--title.pa-visible .mk-gradient {
  animation: paGradientShimmer 4s linear infinite;
  animation-delay: 0.4s;
}

.page-animate .pa-text.pa-visible::selection {
  background: rgba(29, 185, 84, 0.35);
}

.page-animate .reviews-marquee.pa-visible {
  animation: paReviewsIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes paReviewsIn {
  from {
    opacity: 0;
    transform: translate3d(0, 32px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.page-animate .site-footer.pa-reveal.pa-visible .site-footer__col.pa-text {
  transition-delay: calc(var(--text-i, 0) * 90ms + 80ms);
}

/* —— Final CTA —— */
.page-animate .mk-final-cta.pa-visible {
  background: radial-gradient(
    ellipse 80% 60% at 50% 100%,
    rgba(29, 185, 84, 0.08) 0%,
    transparent 70%
  );
}

.page-animate .mk-final-cta.pa-visible .mk-btn:first-of-type {
  animation: paCtaGlow 3s ease-in-out 0.8s infinite;
}

.page-animate .mk-final-cta.pa-visible .mk-btn {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.page-animate .mk-final-cta.pa-visible .mk-btn:hover {
  transform: translateY(-3px);
}

@keyframes paCtaGlow {
  0%,
  100% {
    box-shadow: 0 8px 28px rgba(29, 185, 84, 0.25);
  }
  50% {
    box-shadow: 0 14px 40px rgba(29, 185, 84, 0.45);
  }
}

/* —— Team photos —— */
.page-animate .pa-stagger.pa-visible .about-team__photo {
  animation: paPhotoIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--pa-i, 0) * 100ms + 200ms);
}

@keyframes paPhotoIn {
  from {
    transform: scale(0.92);
    filter: brightness(0.7);
  }
  to {
    transform: scale(1);
    filter: brightness(1);
  }
}

/* —— Mission quote —— */
.page-animate .mission-hero__quote.pa-line {
  position: relative;
}

.page-animate .pa-hero.pa-visible .mission-hero__quote::before {
  content: "\201C";
  position: absolute;
  left: -0.15em;
  top: -0.2em;
  font-size: 3em;
  line-height: 1;
  color: rgba(29, 185, 84, 0.2);
  font-family: Georgia, serif;
  animation: paQuoteMark 1s ease 0.3s both;
}

@keyframes paQuoteMark {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pa-ambient,
  .pa-ambient * {
    display: none !important;
  }

  .page-animate .pa-reveal,
  .page-animate .pa-reveal-left,
  .page-animate .pa-reveal-right,
  .page-animate .pa-scale,
  .page-animate .pa-flip,
  .page-animate .pa-hero,
  .page-animate .pa-stagger .pa-stagger-item {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }

  .page-animate .pa-text {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }

  .page-animate .mk-gradient {
    animation: none !important;
  }
}
