@layer components {
    /* endless logo strip. the script fills the track until one loop spans the screen plus the widest
       logo, then gives every logo its own offset and delay; each logo travels the loop length and
       wraps only once it is fully off-screen on the left */
    @scope (.clients) {
        :scope {
            margin-block-start: 109px;
            border-block-start: var(--border);
            padding-block: 20px;
            overflow: hidden;
        }

        .clients-track {
            --clients-gap: 48px;
            position: relative; /* the script measures logo offsets against the track */
            display: flex;
            align-items: center;
            gap: var(--clients-gap);
            width: max-content;
            padding-inline-end: var(--clients-gap);
        }

        .clients-logo {
            flex: none;
            animation: clients-loop var(--clients-duration) linear var(--clients-delay) infinite;
            will-change: translate;
        }
    }

    /* from just past the right end of the loop to just past the left edge, relative to the logo's
       own place in the row; the distance is always one loop, so every logo moves at the same speed */
    @keyframes clients-loop {
        from {
            translate: calc(var(--clients-loop) - var(--clients-widest) - var(--clients-offset));
        }
        to {
            translate: calc(-1 * var(--clients-widest) - var(--clients-offset));
        }
    }
}
