.head-box {
    height: 300px;
    position: relative; /* Add this to position the overlay */
}

.head-box-bg {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* Ensure positioning for the pseudo-element */
    z-index: 1; /* Ensure this is above the background image */
}

.head-box-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Optional: add a color overlay */
    backdrop-filter: blur(5px); /* Adjust blur radius as needed */
    z-index: -1; /* Position behind the content */
}

.head-box-title {
    position: relative;
    z-index: 2; /* Ensure this is above the blur overlay */
    font-weight: 600;
    display: inline-block;
    letter-spacing: 2px;
    font-size: 54px;
    margin: 0;
    padding: 0;
    transition: transform 0.2s;
    color: #fff;
}


.head-box-title span {
    display: inline-block;
    animation: downward 1s ease-in-out infinite;
}

/* Animation keyframes */
@keyframes downward {
    50% {
        transform: translateY(20px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Adding delays for each span */
.head-box-title span:nth-child(1) { animation-delay: 0.1s; }
.head-box-title span:nth-child(2) { animation-delay: 0.2s; }
.head-box-title span:nth-child(3) { animation-delay: 0.3s; }
.head-box-title span:nth-child(4) { animation-delay: 0.4s; }
.head-box-title span:nth-child(5) { animation-delay: 0.5s; }
.head-box-title span:nth-child(6) { animation-delay: 0.6s; }
.head-box-title span:nth-child(7) { animation-delay: 0.7s; }
.head-box-title span:nth-child(8) { animation-delay: 0.8s; }
.head-box-title span:nth-child(9) { animation-delay: 0.9s; }
.head-box-title span:nth-child(10) { animation-delay: 1.0s; }
.head-box-title span:nth-child(11) { animation-delay: 1.1s; }
.head-box-title span:nth-child(12) { animation-delay: 1.2s; }

@media (max-width: 620px) {
    .head-box-long-title {
        font-size: 44px;
    }
}

@media (max-width: 520px) {
    .head-box-title {
        font-size: 48px;
    }
    .head-box-long-title {
        font-size: 38px;
    }
}

@media (max-width: 440px) {
    .head-box-long-title {
        font-size: 34px;
    }
}

@media (max-width: 425px) {
    .head-box-title {
        font-size: 44px;
    }
    .head-box-long-title {
        font-size: 32px;
    }
}

@media (max-width: 375px) {
    .head-box-title {
        font-size: 32px;
    }
    .head-box-long-title {
        font-size: 28px;
    }
}

@media (max-width: 336px) {
    .head-box-long-title {
        font-size: 26px;
    }
}

@media (max-width: 320px) {
    .head-box-title {
        font-size: 30px;
    }
    .head-box-long-title {
        font-size: 26px;
        text-align: center;
    }
}

@media (max-width: 310px) {
    .head-box-long-title {
        font-size: 24px;
    }
}
