/* ==========================================================================
   TTS — Tahir Termite Services (Pvt.) Ltd.
   Animations Stylesheet (animations.css)
   ========================================================================== */

/* Preloader Spinner Keyframes */
@keyframes rotatePreloader {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dashPreloader {
  0% {
    stroke-dashoffset: 120;
  }

  50% {
    stroke-dashoffset: 30;
    transform: rotate(135deg);
  }

  100% {
    stroke-dashoffset: 120;
    transform: rotate(450deg);
  }
}

@keyframes logoPreloader {

  0%,
  100% {
    transform: scale(0.94);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(217, 164, 65, 0.38);
  }

  50% {
    transform: scale(1);
    box-shadow: 0 7px 22px rgba(0, 0, 0, 0.3), 0 0 0 12px rgba(217, 164, 65, 0);
  }
}

@keyframes sprayCanMove {
  from {
    transform: rotate(-23deg) translateX(0);
  }

  to {
    transform: rotate(-23deg) translateX(7px);
  }
}

@keyframes sprayDrop {
  0% {
    left: 0;
    opacity: 0;
    transform: scale(0.4);
  }

  15% {
    opacity: 1;
  }

  80% {
    opacity: 1;
  }

  100% {
    left: 245px;
    opacity: 0;
    transform: scale(1);
  }
}

@keyframes pestAlive {

  0%,
  100% {
    margin-top: 0;
  }

  50% {
    margin-top: -4px;
  }
}

@keyframes pestDeath {

  0%,
  51% {
    opacity: 1;
    transform: translateX(-50%) rotate(0deg) scale(1);
  }

  62% {
    opacity: 1;
    transform: translateX(-50%) rotate(-12deg) scale(1.08);
  }

  74% {
    opacity: 0.75;
    transform: translate(-50%, 12px) rotate(90deg) scale(0.8);
  }

  100% {
    opacity: 0;
    transform: translate(-30%, 95px) rotate(270deg) scale(0.12);
  }
}

@keyframes preloaderImpact {

  0%,
  51% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
  }

  58% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.7);
  }

  72%,
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(4);
  }
}

@keyframes imageBlobFrame {

  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(217, 164, 65, 0.45), 0 10px 28px rgba(11, 27, 94, 0.12);
  }

  25% {
    box-shadow: 5px -3px 0 2px rgba(30, 64, 175, 0.55), 0 14px 32px rgba(11, 27, 94, 0.16);
  }

  50% {
    box-shadow: 2px 5px 0 2px rgba(217, 164, 65, 0.55), 0 16px 34px rgba(11, 27, 94, 0.18);
  }

  75% {
    box-shadow: -5px 2px 0 2px rgba(30, 64, 175, 0.55), 0 12px 30px rgba(11, 27, 94, 0.14);
  }
}

/* Subtle Pulse Glow */
@keyframes goldPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(217, 164, 65, 0.4);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(217, 164, 65, 0);
  }
}

.pulse-gold {
  animation: goldPulse 2.8s infinite;
}

/* Hero Background Subtle Expansion Effect */
.hero-reveal-bg {
  animation: heroBgExpand 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes heroBgExpand {
  0% {
    opacity: 0;
    transform: scale(0.96);
    clip-path: inset(8% 8% 8% 8% round 14px);
  }

  100% {
    opacity: 1;
    transform: scale(1);
    clip-path: inset(0% 0% 0% 0% round 14px);
  }
}

.hero-text-reveal {
  opacity: 0;
  transform: translateY(24px);
  animation: heroTextFade 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-text-reveal.delay-1 {
  animation-delay: 0.15s;
}

.hero-text-reveal.delay-2 {
  animation-delay: 0.3s;
}

.hero-text-reveal.delay-3 {
  animation-delay: 0.45s;
}

@keyframes heroTextFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 3D Shield Interactive Card Styling */
.shield-3d-container {
  perspective: 1000px;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}

.shield-3d-card {
  width: 100%;
  position: relative;
  background: linear-gradient(135deg, #0B1B5E 0%, #050D38 100%);
  border-radius: var(--radius-lg);
  border: 2px solid rgba(217, 164, 65, 0.45);
  box-shadow: 0 25px 50px -12px rgba(5, 13, 56, 0.35);
  padding: 2.75rem 2.25rem;
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out, box-shadow 0.3s ease;
  overflow: hidden;
}

.shield-3d-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(217, 164, 65, 0.15) 0%, transparent 65%);
  pointer-events: none;
  transform: translateZ(20px);
}

.shield-3d-emblem {
  width: 90px;
  height: 90px;
  margin: 0 auto 1.75rem auto;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(217, 164, 65, 0.25) 0%, rgba(30, 64, 175, 0.25) 100%);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transform: translateZ(40px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.shield-3d-emblem svg {
  width: 48px;
  height: 48px;
}

.shield-3d-title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  color: #FFFFFF;
  text-align: center;
  margin-bottom: 0.65rem;
  transform: translateZ(35px);
}

.shield-3d-subtitle {
  font-size: 0.92rem;
  color: #D7DEEF;
  text-align: center;
  line-height: 1.55;
  margin-bottom: 1.75rem;
  transform: translateZ(30px);
}

.shield-3d-pills {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transform: translateZ(25px);
}

.shield-pill-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.07);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F7F7F3;
  font-size: 0.88rem;
  font-weight: 600;
}

.shield-pill-item svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
  flex-shrink: 0;
}

/* Scroll fade-up animation for all pages */
.reveal-on-scroll,
[data-animate="fade-up"],
.stagger-group>* {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-revealed,
[data-animate="fade-up"].is-revealed,
.stagger-group.is-revealed>* {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.reveal-on-scroll.reverse-exit,
[data-animate="fade-up"].reverse-exit {
  opacity: 0.2;
  transform: translate3d(0, 16px, 0);
}

/* Stagger children inside grouped sections */
.stagger-group .reveal-child {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-group.is-revealed .reveal-child:nth-child(1) {
  transition-delay: 0.06s;
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.stagger-group.is-revealed .reveal-child:nth-child(2) {
  transition-delay: 0.14s;
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.stagger-group.is-revealed .reveal-child:nth-child(3) {
  transition-delay: 0.22s;
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.stagger-group.is-revealed .reveal-child:nth-child(4) {
  transition-delay: 0.30s;
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.stagger-group.is-revealed .reveal-child:nth-child(5) {
  transition-delay: 0.38s;
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.stagger-group.is-revealed .reveal-child:nth-child(6) {
  transition-delay: 0.46s;
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.stagger-group.is-revealed .reveal-child:nth-child(7) {
  transition-delay: 0.54s;
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.stagger-group.is-revealed .reveal-child:nth-child(8) {
  transition-delay: 0.62s;
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Fade & Slide Transitions for Interactive Tabs/Gallery */
.fade-scale-in {
  animation: fadeScaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.section-scroll-motion {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition: opacity 0.7s ease-out, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-scroll-motion.section-scroll-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@keyframes fadeScaleIn {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Accessibility: Prefers 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;
  }

  .preloader-spray-can,
  .preloader-spray-stream i,
  .preloader-pest,
  .preloader-impact,
  .preloader-logo-icon {
    animation-duration: 1s !important;
    animation-iteration-count: infinite !important;
  }

  .preloader-spray-stream i {
    animation-duration: 1.05s !important;
  }

  .preloader-pest {
    animation-duration: 0.9s, 1.35s !important;
    animation-delay: 0s, 0.1s !important;
    animation-iteration-count: infinite, 1 !important;
  }

  .preloader-impact {
    animation-duration: 1.35s !important;
    animation-delay: 0.1s !important;
    animation-iteration-count: 1 !important;
  }

  .preloader-logo-icon {
    animation-duration: 1.8s !important;
  }

  .reveal-on-scroll,
  .stagger-group .reveal-child,
  .hero-text-reveal,
  .section-scroll-motion {
    opacity: 1 !important;
    transform: none !important;
  }

  .shield-3d-card {
    transform: none !important;
    transition: none !important;
  }
}