.clients-section {
    background: #060318;
    padding: 80px 0;
    overflow: hidden;
}

/* Section disembunyikan sampai JS memastikan ada datanya. Dengan begitu
   pengunjung tidak sempat melihat judul kosong berkedip saat AJAX berjalan.
   !important diperlukan karena .page-section dari template menetapkan display
   sendiri, yang mengalahkan aturan [hidden] bawaan browser. */
.clients-section[hidden],
#testimonial[hidden] {
    display: none !important;
}

.clients-marquee {
    position: relative;
    width: 100%;
    overflow: hidden;
    /* Tepi kiri-kanan dilembutkan supaya logo tidak terpotong mendadak */
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.clients-track {
    display: flex;
    align-items: center;
    gap: 20px;
    width: max-content;
    animation: clients-scroll var(--marquee-duration, 40s) linear infinite;
}

.clients-marquee:hover .clients-track {
    animation-play-state: paused;
}

/* Bergeser tepat setengah, karena isinya digandakan dua kali.
   Titik sambungnya jadi tidak terlihat. */
@keyframes clients-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* Kalau logonya sedikit dan muat dalam satu layar, animasi dimatikan
   dan deretannya ditengahkan - bergerak saat tidak perlu terasa gelisah. */
.clients-marquee[data-static="1"] {
    -webkit-mask-image: none;
    mask-image: none;
}

.clients-marquee[data-static="1"] .clients-track {
    animation: none;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.client-item {
    flex-shrink: 0;
    width: 200px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.client-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

.client-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* Logo klien datang dengan warna yang bermacam-macam; digrayscale-kan
       agar deretannya terbaca sebagai satu kesatuan, lalu berwarna saat disentuh. */
    filter: grayscale(100%) brightness(1.7);
    opacity: 0.75;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.client-item:hover img {
    filter: grayscale(0%) brightness(1);
    opacity: 1;
}

a.client-item {
    text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
    .clients-track {
        animation: none;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
    }

    .clients-marquee {
        -webkit-mask-image: none;
        mask-image: none;
    }
}

@media (max-width: 991px) {
    .client-item {
        width: 170px;
        height: 96px;
        padding: 16px;
    }
}

@media (max-width: 767px) {
    .clients-section {
        padding: 60px 0;
    }

    .clients-track {
        gap: 14px;
    }

    .client-item {
        width: 140px;
        height: 82px;
        padding: 14px;
        border-radius: 12px;
    }
}
