/* ── Home ribbon carousel ── */
.clients-ribbon-section {
    position: relative;
    overflow: hidden;
    padding: 1.5rem 0 1.25rem;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, #fff 100%);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.clients-ribbon-heading {
    margin: 0 0 1rem;
    font-size: clamp(1.05rem, 2.5vw, 1.35rem);
    font-weight: 800;
    color: #0f172a;
    text-align: center;
    letter-spacing: -0.02em;
}

.clients-ribbon-fade {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    z-index: 2;
    pointer-events: none;
}

.clients-ribbon-fade-left {
    left: 0;
    background: linear-gradient(90deg, #fff 0%, transparent 100%);
}

.clients-ribbon-fade-right {
    right: 0;
    background: linear-gradient(270deg, #fff 0%, transparent 100%);
}

.clients-ribbon-track {
    overflow: hidden;
    width: 100%;
    direction: ltr;
}

.clients-ribbon-inner {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    width: max-content;
    direction: ltr;
    animation: clients-ribbon-scroll 50s linear infinite;
}

.clients-ribbon-inner:hover {
    animation-play-state: paused;
}

@keyframes clients-ribbon-scroll {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

.clients-ribbon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    /* gap: 0.65rem; */
    flex-shrink: 0;
    width: 140px;
    min-width: 140px;
    max-width: 160px;
    padding: 1rem 0.75rem 0.85rem;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.clients-ribbon-item:hover {
    transform: translateY(-2px);
    border-color: rgba(85, 42, 134, 0.2);
    box-shadow: 0 8px 28px rgba(85, 42, 134, 0.1);
}

.clients-ribbon-logo-wrap {
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.clients-ribbon-logo {
    max-width: 76px;
    max-height: 76px;
    object-fit: contain;
}

.clients-ribbon-logo-fallback {
    font-size: 2rem;
    font-weight: 800;
    color: #552a86;
}

.clients-ribbon-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    width: 100%;
}

.clients-ribbon-name {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    color: #0f172a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.clients-ribbon-title {
    font-size: 0.8rem;
    line-height: 1.3;
    color: #64748b;
    margin-top: 0.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Clients page ── */
.clients-page {
    padding-bottom: 4.5rem;
    background:
        radial-gradient(ellipse 80% 50% at 10% 20%, rgba(85, 42, 134, 0.06), transparent 55%),
        radial-gradient(ellipse 70% 40% at 90% 80%, rgba(124, 58, 237, 0.05), transparent 50%),
        #f1f5f9;
}

/* Keep header readable (avoid white nav on white bg) */
body:has(.clients-page) .header {
    --background-color: #552a86;
    --heading-color: #ffffff;
    --nav-color: #ffffff;
    background-color: #552a86 !important;
}

body:has(.clients-page).index-page.scrolled .header {
    background-color: #552a86 !important;
}

@media (min-width: 1200px) {
    body:has(.clients-page) .header .navmenu a:not(.wc-nav-btn),
    body:has(.clients-page) .header .navmenu a:not(.wc-nav-btn):focus {
        color: #ffffff !important;
    }
}

body:has(.clients-page) .header .mobile-nav-toggle {
    color: #ffffff;
}

.clients-page-hero {
    padding: 5.5rem 0 3rem;
    background:
        linear-gradient(135deg, rgba(85, 42, 134, 0.35) 0%, transparent 45%),
        linear-gradient(165deg, #0f1728 0%, #1a1040 45%, #0f1728 100%);
    color: #fff;
    text-align: center;
}

.clients-page-kicker {
    display: inline-block;
    margin: 0 0 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #c4b5fd;
    background: rgba(124, 58, 237, 0.2);
    border: 1px solid rgba(167, 139, 250, 0.35);
}

.clients-page-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    margin: 0 0 0.65rem;
}

.clients-page-subtitle {
    max-width: 36rem;
    margin: 0 auto;
    font-size: 1rem;
    color: rgba(226, 232, 240, 0.75);
    line-height: 1.6;
}

.clients-page-body {
    margin-top: -1.75rem;
    position: relative;
    z-index: 1;
}

.clients-page-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #64748b;
    background: #fff;
    border-radius: 20px;
    border: 1px dashed rgba(15, 23, 42, 0.12);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.05);
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.clients-card {
    --i: 0;
    position: relative;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 22px;
    overflow: hidden;
    box-shadow:
        0 2px 4px rgba(15, 23, 42, 0.04),
        0 12px 28px rgba(15, 23, 42, 0.08),
        0 28px 56px rgba(85, 42, 134, 0.1);
    display: flex;
    flex-direction: column;
    transition:
        transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.35s ease,
        border-color 0.35s ease;
    animation: clients-card-in 0.55s ease both;
    animation-delay: calc(var(--i) * 55ms);
}

@keyframes clients-card-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.clients-card-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #552a86, #7c3aed 55%, #a78bfa);
    opacity: 0.85;
    transform: scaleX(0.35);
    transform-origin: left center;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.clients-card:hover {
    transform: translateY(-6px);
    border-color: rgba(85, 42, 134, 0.18);
    box-shadow:
        0 4px 8px rgba(15, 23, 42, 0.05),
        0 18px 40px rgba(85, 42, 134, 0.16),
        0 36px 72px rgba(85, 42, 134, 0.14);
}

.clients-card:hover .clients-card-accent {
    transform: scaleX(1);
    opacity: 1;
}

.clients-card:hover .clients-card-logo {
    transform: scale(1.06);
}

.clients-card-logo-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 168px;
    padding: 1.75rem 1.5rem 1.25rem;
    background:
        radial-gradient(circle at 50% 30%, rgba(124, 58, 237, 0.08), transparent 55%),
        linear-gradient(165deg, #f8fafc 0%, #eef2ff 48%, #f8fafc 100%);
}

.clients-card-logo-wrap::after {
    content: "";
    position: absolute;
    inset: auto 12% 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(85, 42, 134, 0.15), transparent);
}

.clients-card-logo {
    max-width: 140px;
    max-height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.08));
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.clients-card-logo-fallback {
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: linear-gradient(145deg, #7c3aed, #552a86);
    color: #fff;
    font-size: 1.9rem;
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(85, 42, 134, 0.28);
}

.clients-card-body {
    padding: 1.25rem 1.35rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.35rem;
}

.clients-card-name {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
    text-align: center;
}

.clients-card-title {
    display: inline-flex;
    align-self: center;
    margin: 0.15rem 0 0.25rem;
    padding: 0.2rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #552a86;
    background: rgba(85, 42, 134, 0.08);
    border: 1px solid rgba(85, 42, 134, 0.12);
    border-radius: 999px;
    line-height: 1.4;
    text-align: center;
}

.clients-card-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #64748b;
    margin: 0.35rem 0 0;
    text-align: center;
}

@media (max-width: 640px) {
    .clients-ribbon-item {
        min-width: 190px;
        padding: 0.65rem 0.85rem;
    }

    .clients-ribbon-logo-wrap {
        width: 44px;
        height: 44px;
    }

    .clients-grid {
        grid-template-columns: 1fr;
        gap: 1.1rem;
    }

    .clients-card-logo-wrap {
        min-height: 140px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .clients-card {
        animation: none;
    }

    .clients-card,
    .clients-card-accent,
    .clients-card-logo {
        transition: none;
    }
}
