/* ========================================
   BluSi Landing Page - Animations
   ======================================== */

/* ---------- Scroll Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered reveal for grid children */
.features__grid .reveal:nth-child(1) { transition-delay: 0s; }
.features__grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.features__grid .reveal:nth-child(3) { transition-delay: 0.16s; }
.features__grid .reveal:nth-child(4) { transition-delay: 0.24s; }
.features__grid .reveal:nth-child(5) { transition-delay: 0.32s; }
.features__grid .reveal:nth-child(6) { transition-delay: 0.40s; }

.security__grid .reveal:nth-child(1) { transition-delay: 0s; }
.security__grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.security__grid .reveal:nth-child(3) { transition-delay: 0.2s; }
.security__grid .reveal:nth-child(4) { transition-delay: 0.3s; }

.trust-bar__items .reveal:nth-child(1) { transition-delay: 0s; }
.trust-bar__items .reveal:nth-child(2) { transition-delay: 0.1s; }
.trust-bar__items .reveal:nth-child(3) { transition-delay: 0.2s; }
.trust-bar__items .reveal:nth-child(4) { transition-delay: 0.3s; }

.contact__grid .reveal:nth-child(1) { transition-delay: 0s; }
.contact__grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.contact__grid .reveal:nth-child(3) { transition-delay: 0.2s; }

/* ---------- Hero Floating Shapes ---------- */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-20px) rotate(2deg); }
  66% { transform: translateY(-10px) rotate(-1deg); }
}

@keyframes floatReverse {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(15px) rotate(-2deg); }
  66% { transform: translateY(8px) rotate(1deg); }
}

.hero__shape--1 {
  animation: float 8s ease-in-out infinite;
}

.hero__shape--2 {
  animation: floatReverse 10s ease-in-out infinite 1s;
}

.hero__shape--3 {
  animation: float 12s ease-in-out infinite 2s;
}

/* ---------- Hero Floating Badges ---------- */
@keyframes floatBadge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero__float--bluetooth {
  animation: floatBadge 3s ease-in-out infinite;
}

.hero__float--shield {
  animation: floatBadge 3.5s ease-in-out infinite 0.5s;
}

.hero__float--realtime {
  animation: floatBadge 4s ease-in-out infinite 1s;
}

/* ---------- Phone Mockup Pulse ---------- */
@keyframes pinPulse {
  0% { box-shadow: 0 2px 8px rgba(28, 161, 254, 0.5), 0 0 0 0 rgba(28, 161, 254, 0.3); }
  70% { box-shadow: 0 2px 8px rgba(28, 161, 254, 0.5), 0 0 0 10px rgba(28, 161, 254, 0); }
  100% { box-shadow: 0 2px 8px rgba(28, 161, 254, 0.5), 0 0 0 0 rgba(28, 161, 254, 0); }
}

.phone-ui__pin-dot--active {
  animation: pinPulse 2s ease-in-out infinite;
}

/* ---------- Nav Link Underline ---------- */
.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 1px;
}

.nav__link:hover::after,
.nav__link.active::after {
  width: 100%;
}

/* ---------- Card Hover Lift ---------- */
.feature-card,
.security-card,
.contact-card,
.pricing-card {
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- FAQ Animations ---------- */
.faq-item__chevron {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-item__chevron {
  transform: rotate(180deg);
}

.faq-item__answer {
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Button Hover Effects ---------- */
.btn {
  transition:
    background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Mobile Menu Transition ---------- */
.mobile-menu {
  transition:
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu__links li {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.active .mobile-menu__links li {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu.active .mobile-menu__links li:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.active .mobile-menu__links li:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.active .mobile-menu__links li:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.active .mobile-menu__links li:nth-child(4) { transition-delay: 0.25s; }
.mobile-menu.active .mobile-menu__links li:nth-child(5) { transition-delay: 0.3s; }
.mobile-menu.active .mobile-menu__links li:nth-child(6) { transition-delay: 0.35s; }

.mobile-menu__cta {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.4s;
}

.mobile-menu.active .mobile-menu__cta {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Hamburger Animation ---------- */
.nav__hamburger span {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav__hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav__hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.nav__hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---------- Reduced Motion ---------- */
@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;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .hero__float {
    animation: none;
  }

  .hero__shape {
    animation: none;
  }
}
