/* Clients: two auto-scrolling rows of logo + name. */
.clients-marquee-section {
    padding: 60px 0;
    background: var(--bg-main-light);
    border-top: 1px solid var(--border-card);
    overflow: hidden;
    transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

/* Size, weight and font come from the shared .section-title. */
.clients-marquee-title {
    text-align: center;
    margin-bottom: 40px;
}

.clients-row {
    overflow: hidden;
    padding: 20px 0; /* room for the hovered card to grow without being clipped */
}

.clients-track {
    display: flex;
    align-items: center;
    width: max-content;
    animation: clients-scroll-left 78s linear infinite;
}

/* .clients-copy only groups the repeats; its children sit in the same row. */
.clients-copy { display: contents; }

.clients-row-reverse .clients-track {
    animation-name: clients-scroll-right;
    animation-duration: 72s;
    animation-delay: -20s; /* start offset from row 1 */
}

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

.client-item {
    padding: 0 12px;
    flex-shrink: 0;
}

/* One card holds the logo and the name. */
.client-card {
    display: flex;
    align-items: stretch;
    overflow: hidden;
    border-radius: 14px;
    background: var(--bg-card);
    box-shadow: 0 4px 14px var(--yellow-400-alpha-15); /* faint resting glow */
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Hovered card (logo + name together) grows a little; the row is already paused. */
.client-card:hover {
    transform: scale(1.08);
    /* Primary-colour glow reads on both light and dark themes. */
    box-shadow: 0 10px 28px var(--yellow-400-alpha-45);
}

/* White panel keeps every logo readable on both themes. */
.client-logo-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 68px;
    padding: 8px;
    background: var(--white);
}

.client-logo-chip img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.client-name {
    align-self: center;
    /* Fits the name, but never narrower than min-width (short names like "JK")
       and never wider than max-width (long names wrap to two lines). */
    width: auto;
    min-width: 120px;
    max-width: 160px;
    text-wrap: balance; /* even line lengths, so less empty space at the end */
    padding: 0 14px 0 8px; /* tight gap after the logo */
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    /* Max two lines; a longer name ends with "..." instead of growing the card. */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
}

/* Track holds 4 copies; moving half of it is exactly 2 copies = seamless loop. */
@keyframes clients-scroll-left {
    to { transform: translateX(-50%); }
}

@keyframes clients-scroll-right {
    from { transform: translateX(-50%); }
    to { transform: translateX(0); }
}

@media (max-width: 768px) {
    .clients-marquee-section { padding: 40px 0; }
    .client-item { padding: 0 8px; }
    .client-logo-chip { width: 68px; height: 56px; }
    .client-name { font-size: 13px; width: 150px; padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .clients-track { animation: none; }
    .clients-row { overflow-x: auto; }
}
