#bg-butterfly-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.bg-butterfly-wrapper {
    position: absolute;
    pointer-events: none;
    z-index: 9999;
    --butterfly-color: #0066ff;
    --butterfly-dark-color: #003380;
}

.butterfly {
    width: 8px;
    height: 30px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    position: relative;
    transform-origin: center center;
}

.bf_left,
.bf_right {
    width: 8px;
    height: 30px;
    position: relative;
    animation: bfAnim 3s infinite;
}

.bf_left:after {
    content: "";
    top: 0;
    right: 0;
    width: 40px;
    height: 60%;
    position: absolute;
    background: linear-gradient(to right, var(--butterfly-color), var(--butterfly-dark-color));
    border-top-right-radius: 80%;
    border-top-left-radius: 20%;
    border-bottom-right-radius: 0%;
    border-bottom-left-radius: 62%;
}

.bf_left:before {
    content: "";
    bottom: 0;
    right: 0;
    width: 25px;
    height: 40%;
    position: absolute;
    background: linear-gradient(to right, var(--butterfly-color), var(--butterfly-dark-color));
    border-top-right-radius: 0%;
    border-top-left-radius: 90%;
    border-bottom-right-radius: 90%;
    border-bottom-left-radius: 22%;
}

.bf_right:after {
    content: "";
    top: 0;
    left: 0;
    width: 40px;
    height: 60%;
    position: absolute;
    background: linear-gradient(to left, var(--butterfly-color), var(--butterfly-dark-color));
    border-top-right-radius: 20%;
    border-top-left-radius: 80%;
    border-bottom-right-radius: 62%;
    border-bottom-left-radius: 0%;
}

.bf_right:before {
    content: "";
    bottom: 0;
    left: 0;
    width: 25px;
    height: 40%;
    position: absolute;
    background: linear-gradient(to left, var(--butterfly-color), var(--butterfly-dark-color));
    border-top-right-radius: 90%;
    border-top-left-radius: 0%;
    border-bottom-right-radius: 22%;
    border-bottom-left-radius: 90%;
}

@keyframes bfAnim {
    0% {
        transform: rotateY(40deg);
    }
    50% {
        transform: rotateY(70deg);
    }
    100% {
        transform: rotateY(40deg);
    }
}

.bg-butterfly-wrapper:nth-child(2n) .bf_left,
.bg-butterfly-wrapper:nth-child(2n) .bf_right {
    animation-delay: 0.5s;
    animation-duration: 2.5s;
}

.bg-butterfly-wrapper:nth-child(3n) .bf_left,
.bg-butterfly-wrapper:nth-child(3n) .bf_right {
    animation-delay: 1s;
    animation-duration: 3.5s;
}

.bg-butterfly-wrapper:nth-child(4n) .bf_left,
.bg-butterfly-wrapper:nth-child(4n) .bf_right {
    animation-delay: 1.5s;
    animation-duration: 2.8s;
}

.bg-butterfly-wrapper:nth-child(5n) .bf_left,
.bg-butterfly-wrapper:nth-child(5n) .bf_right {
    animation-delay: 0.3s;
    animation-duration: 3.2s;
}

.bg-butterfly-wrapper,
.butterfly,
.bf_left,
.bf_right {
    will-change: transform;
    backface-visibility: hidden;
}

@media (max-width: 768px) {
    .bg-butterfly-wrapper {
        transform-origin: center;
    }
    
    .bf_left,
    .bf_right {
        animation-duration: 2.5s;
    }
}

.bg-butterfly-wrapper {
    transition: none;
}

.butterfly {
    opacity: 0.85;
}

.bf_left:after,
.bf_left:before,
.bf_right:after,
.bf_right:before {
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.2));
    transition: background 0.3s ease;
}