/* BeFit scroll & pop-up animations */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-pop,
  .reveal-up,
  .reveal-down,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .stagger-group > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}

/* Initial hidden state */
.reveal,
.reveal-pop,
.reveal-up,
.reveal-down,
.reveal-left,
.reveal-right,
.reveal-scale {
  opacity: 0;
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal-up { transform: translateY(36px); }
.reveal-down { transform: translateY(-24px); }
.reveal-left { transform: translateX(-32px); }
.reveal-right { transform: translateX(32px); }
.reveal-pop { transform: scale(0.88) translateY(20px); }
.reveal-scale { transform: scale(0.92); }
.reveal { transform: translateY(24px); }

.reveal.is-visible,
.reveal-pop.is-visible,
.reveal-up.is-visible,
.reveal-down.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible,
.reveal-scale.is-visible {
  opacity: 1;
  transform: none;
}

/* Hero load sequence (no scroll needed) */
.hero-load {
  opacity: 0;
  animation: heroPop 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-load-d1 { animation-delay: 0.08s; }
.hero-load-d2 { animation-delay: 0.18s; }
.hero-load-d3 { animation-delay: 0.28s; }
.hero-load-d4 { animation-delay: 0.38s; }
.hero-load-d5 { animation-delay: 0.48s; }
.hero-load-d6 { animation-delay: 0.58s; }

@keyframes heroPop {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Nav entrance */
.nav-enter {
  animation: navSlide 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes navSlide {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Floating phone mockup */
.phone-float {
  animation: phoneFloat 5s ease-in-out infinite;
}
@keyframes phoneFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Interactive pop */
.pop-hover {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
}
.pop-hover:hover {
  transform: translateY(-4px) scale(1.02);
}
.pop-hover:active {
  transform: translateY(-1px) scale(0.98);
}

.glass-card {
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}
.glass-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(59, 130, 246, 0.15);
}

/* Chat / dynamic pop-in */
@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.animate-pop-in {
  animation: popIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Ambient glow pulse on sections */
.glow-pulse {
  animation: glowPulse 4s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* Icon badge bounce */
.icon-bounce {
  animation: iconBounce 2.5s ease-in-out infinite;
}
@keyframes iconBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Smooth language switch */
[data-i18n],
[data-i18n-html],
[data-i18n-placeholder],
[data-i18n-alt],
#policy-content {
  transition:
    opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

html.lang-fading [data-i18n],
html.lang-fading [data-i18n-html],
html.lang-fading [data-i18n-placeholder],
html.lang-fading #policy-content {
  opacity: 0 !important;
  transform: translateY(10px) scale(0.99);
  filter: blur(4px);
}

html.lang-fading nav [data-i18n],
html.lang-fading .lang-switcher {
  filter: none;
  transform: none;
}

.lang-switcher {
  position: relative;
  isolation: isolate;
}

.lang-switcher-pill {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(50% - 2px);
  height: calc(100% - 4px);
  border-radius: 9999px;
  background: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 0;
  pointer-events: none;
}

html[data-lang="en"] .lang-switcher-pill {
  transform: translateX(100%);
}

.lang-switcher .lang-btn {
  position: relative;
  z-index: 1;
  min-width: 2.75rem;
  background: transparent !important;
  transition: color 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.lang-switcher .lang-btn[aria-pressed="true"] {
  color: #fff;
}

.lang-switcher .lang-btn[aria-pressed="false"] {
  color: #94a3b8;
}

.lang-switcher .lang-btn:hover {
  color: #e2e8f0;
}

@media (prefers-reduced-motion: reduce) {
  [data-i18n],
  [data-i18n-html],
  [data-i18n-placeholder],
  #policy-content {
    transition: none !important;
  }
  html.lang-fading [data-i18n],
  html.lang-fading [data-i18n-html],
  html.lang-fading #policy-content {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .lang-switcher-pill {
    transition: none;
  }
}
