/* Decorative butterfly — GPU layer, no pointer events, scroll-safe */

.butterfly-fly {
  position: fixed;
  inset: 0;
  z-index: 850;
  pointer-events: none;
  overflow: hidden;
  contain: layout style;
  isolation: isolate;
}

.butterfly-fly__body {
  position: absolute;
  left: 0;
  top: 0;
  width: 88px;
  height: 88px;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  filter: drop-shadow(0 3px 10px rgba(196, 163, 90, 0.3));
  transition: width 0.35s ease, height 0.35s ease, filter 0.35s ease, opacity 0.25s ease;
}

.butterfly-fly__body dotlottie-wc {
  display: block;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
}

.butterfly-fly__body.is-perched {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 2px 6px rgba(255, 215, 120, 0.4));
}

.butterfly-fly.is-flying .butterfly-fly__body::after {
  content: '';
  position: absolute;
  right: 55%;
  top: 50%;
  width: 56px;
  height: 10px;
  margin-top: -5px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 236, 160, 0.15) 30%,
    rgba(251, 191, 36, 0.55) 70%,
    rgba(255, 255, 255, 0.85) 100%
  );
  filter: blur(3px);
  transform-origin: right center;
  animation: butterflyTrail 0.45s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes butterflyTrail {
  from {
    opacity: 0.55;
    transform: scaleX(0.85);
  }
  to {
    opacity: 1;
    transform: scaleX(1.1);
  }
}

.butterfly-fly.is-flying .butterfly-fly__body {
  filter: drop-shadow(0 0 10px rgba(255, 236, 160, 0.45))
    drop-shadow(0 3px 12px rgba(245, 158, 11, 0.28));
}

@media (max-width: 768px) {
  .butterfly-fly__body {
    width: 76px;
    height: 76px;
  }

  .butterfly-fly__body.is-perched {
    width: 44px;
    height: 44px;
  }

  .butterfly-fly.is-flying .butterfly-fly__body::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .butterfly-fly {
    display: none !important;
  }
}
