/* Home page: clients floating around the Karzaan card (views/site/_clients.php, assets/js/home-clients.js) */
.cl {
    padding: 6px 38px 34px;
}
.cl-stage {
    --px: 0px;
    --py: 0px;
    position: relative;
    height: 600px;
    margin-top: 6px;
}
.cl-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1.5px dashed rgba(17, 14, 45, .08);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.cl-orbit-1 {
    width: 52%;
    height: 54%;
}
.cl-orbit-2 {
    width: 84%;
    height: 82%;
    border-color: rgba(238, 93, 56, .12);
}
.cl-beam {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}
.cl-beam line {
    stroke: #EE5D38;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 4 7;
    opacity: 0;
    transition: opacity .25s;
    animation: clBeam .8s linear infinite;
}
.cl-beam.is-on line {
    opacity: .9;
}
@keyframes clBeam {
    to { stroke-dashoffset: -11; }
}

/* the middle card */
.cl-core {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 5;
    display: grid;
    width: 300px;
    min-height: 232px;
    padding: 26px 24px;
    border-radius: 28px;
    color: #fff;
    background:
        radial-gradient(260px circle at 50% 0, rgba(238, 93, 56, .38), transparent 70%),
        radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1.4px) 0 0 / 16px 16px,
        linear-gradient(160deg, #110E2D, #241E58);
    box-shadow: 0 0 0 10px rgba(238, 93, 56, .08), 0 30px 60px -24px rgba(17, 14, 45, .75);
    transform: translate(-50%, -50%);
    text-align: center;
}
.cl-core-pulse {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(238, 93, 56, .45);
    border-radius: inherit;
    animation: clPulse 3s ease-out infinite;
    pointer-events: none;
}
@keyframes clPulse {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(1.14); opacity: 0; }
}
.cl-core-default,
.cl-core-client {
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity .3s, transform .35s cubic-bezier(.2, .8, .2, 1);
}
.cl-core-client {
    opacity: 0;
    transform: translateY(10px);
}
.cl-core.is-client .cl-core-default {
    opacity: 0;
    transform: translateY(-10px);
}
.cl-core.is-client .cl-core-client {
    opacity: 1;
    transform: none;
}
.cl-core-logo {
    display: inline-flex;
    padding: 12px 20px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .5);
}
.cl-core-logo img {
    height: 54px;
    width: auto;
}
.cl-core-stats {
    display: flex;
    gap: 0;
    margin-top: 18px;
    width: 100%;
}
.cl-core-stats > div {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.cl-core-stats > div + div {
    border-inline-start: 1px dashed rgba(255, 255, 255, .18);
}
.cl-core-stats strong {
    font-size: 28px;
    line-height: 1.3;
    text-shadow: 0 0 18px rgba(238, 93, 56, .55);
}
.cl-core-stats span {
    font-size: 11.5px;
    color: rgba(255, 255, 255, .6);
}
.cl-core-client-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .5);
}
.cl-core-client-logo img {
    max-width: 68px;
    max-height: 56px;
    object-fit: contain;
}
.cl-core-client-name {
    margin-top: 14px;
    font-size: 17px;
    line-height: 1.6;
}
.cl-core-client-work {
    margin-top: 2px;
    font-size: 13px;
    color: #FF9A6B;
}

/* client cards: placed by --x/--y, depth --d (1 near .. 3 far), own float rhythm */
.cl-card {
    --k: calc(1.4 - var(--d) * .35);
    position: absolute;
    left: var(--x);
    top: var(--y);
    z-index: calc(5 - var(--d));
    width: calc(150px - (var(--d) - 1) * 20px);
    opacity: calc(1.12 - var(--d) * .1);
    transform: translate(-50%, -50%) translate(calc(var(--px) * var(--k)), calc(var(--py) * var(--k)));
    transition: transform .7s cubic-bezier(.2, .7, .2, 1), opacity .3s;
}
.cl-card-in {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 10px 12px;
    border: 1px solid rgba(17, 14, 45, .06);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 16px 30px -18px rgba(17, 14, 45, .45);
    animation: clFloat var(--dur) ease-in-out var(--delay) infinite;
    transition: border-color .25s, box-shadow .25s, scale .3s cubic-bezier(.3, 1.5, .5, 1);
}
.cl-card-in img {
    width: 72%;
    height: 52px;
    object-fit: contain;
}
.cl-card-name {
    max-width: 100%;
    overflow: hidden;
    color: rgba(17, 14, 45, .55);
    font-size: 11px;
    line-height: 1.6;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@keyframes clFloat {
    0%, 100% { transform: translateY(-7px) rotate(var(--rot)); }
    50% { transform: translateY(7px) rotate(calc(var(--rot) * -1)); }
}
.cl-card:hover,
.cl-card:focus-visible,
.cl-card.is-hot {
    z-index: 10;
    opacity: 1;
    outline: none;
}
.cl-card.is-hot .cl-card-in {
    scale: 1.14;
    border-color: rgba(238, 93, 56, .55);
    box-shadow: 0 0 0 4px rgba(238, 93, 56, .15), 0 22px 40px -18px rgba(238, 93, 56, .6);
}
.cl-stage.has-hot .cl-card:not(.is-hot) {
    opacity: .35;
}

/* entrance: cards fly out from the middle (only once JS runs) */
.cl-ready .cl-card {
    left: 50%;
    top: 50%;
    opacity: 0;
}
.cl-ready.is-in .cl-card {
    left: var(--x);
    top: var(--y);
    opacity: calc(1.12 - var(--d) * .1);
    transition: left .9s cubic-bezier(.2, .8, .2, 1), top .9s cubic-bezier(.2, .8, .2, 1), opacity .6s, transform .7s cubic-bezier(.2, .7, .2, 1);
    transition-delay: calc(var(--i) * 60ms);
}
.cl-ready.is-in.cl-settled .cl-card {
    transition: transform .7s cubic-bezier(.2, .7, .2, 1), opacity .3s;
    transition-delay: 0s;
}
.cl-ready.is-in.cl-settled .cl-stage.has-hot .cl-card:not(.is-hot) {
    opacity: .35;
}

/* phones: the middle card, then two endless rows of logos */
.cl-rows {
    display: none;
}
@media (max-width: 1023px) {
    .cl-stage {
        height: 540px;
    }
    .cl-core {
        width: 250px;
        min-height: 200px;
        padding: 20px 16px;
    }
    .cl-card {
        width: calc(124px - (var(--d) - 1) * 16px);
    }
    .cl-card-in img {
        height: 42px;
    }
}
@media (max-width: 767px) {
    .cl {
        padding: 12px 0 22px;
    }
    .cl-stage {
        height: auto;
        padding: 0 16px;
    }
    .cl-orbit,
    .cl-beam,
    .cl-card {
        display: none;
    }
    .cl-core {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        transform: none;
    }
    .cl-rows {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 20px;
        overflow: hidden;
        direction: ltr;
    }
    .cl-track {
        display: flex;
        gap: 12px;
        width: max-content;
        padding: 6px 0;
        animation: clMarquee 36s linear infinite;
    }
    .cl-row-2 .cl-track {
        animation-direction: reverse;
        animation-duration: 42s;
    }
    .cl-chip {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        width: 116px;
        padding: 12px 8px 10px;
        border: 1px solid rgba(17, 14, 45, .06);
        border-radius: 18px;
        background: #fff;
        box-shadow: 0 10px 22px -16px rgba(17, 14, 45, .45);
    }
    .cl-chip img {
        width: 70%;
        height: 40px;
        object-fit: contain;
    }
    .cl-chip span {
        max-width: 100%;
        overflow: hidden;
        color: rgba(17, 14, 45, .55);
        font-size: 10.5px;
        text-overflow: ellipsis;
        white-space: nowrap;
        direction: rtl;
    }
    :lang(en) .cl-chip span {
        direction: ltr;
    }
}
@keyframes clMarquee {
    to { transform: translateX(-33.333%); }
}
@media (prefers-reduced-motion: reduce) {
    .cl-card-in,
    .cl-core-pulse,
    .cl-track,
    .cl-beam line {
        animation: none;
    }
    .cl-card {
        transform: translate(-50%, -50%);
    }
}
