@keyframes logo-marquee-scroll {
    to { transform: translateX(-50%); }
}

.logo-marquee {
    position: relative;
    display: flex;
    align-items: center;
    border-block: 1px solid var(--line);
    /* Band (white, borders) full width; logos scroll within the page container only, like .section-shell. */
    padding-inline: max(1.5rem, calc((100% - var(--max)) / 2));
    background: #fff;
    overflow: hidden;
}

.logo-marquee__label {
    flex: none;
    margin: 0;
    padding: 0 2rem 0 0;
    color: var(--muted);
    font: 400 .68rem/1.4 var(--font-mono);
    letter-spacing: .12em;
    text-transform: uppercase;
}

.logo-marquee__mask {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    padding: 1.15rem 0;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 92%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 12%, #000 92%, transparent);
}

.logo-marquee__track {
    display: flex;
    width: max-content;
    animation: logo-marquee-scroll 40s linear infinite;
}

.logo-marquee:hover .logo-marquee__track { animation-play-state: paused; }

.logo-marquee__set {
    display: flex;
    flex: none;
    align-items: center;
}

.logo-marquee__set > span {
    position: relative;
    display: grid;
    place-items: center;
    /* An explicit width, not only a flex-basis: Safari sizes the sets from the logos' own widths otherwise, and the
       second set then slides over the first. */
    flex: none;
    width: 170px;
    height: 48px;
}

.logo-marquee__set > span::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    width: 4px;
    height: 4px;
    margin-top: -2px;
    border-radius: 50%;
    background: var(--line-strong);
}

.logo-marquee img {
    display: block;
    max-width: 112px;
    max-height: 40px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: grayscale(1) contrast(1.15);
    opacity: .55;
    transition: filter .3s ease, opacity .3s ease;
}

.logo-marquee__set > span:hover img { filter: none; opacity: 1; }

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

@media (max-width: 900px) {
    .logo-marquee__label { display: none; }
    .logo-marquee__mask { -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent); }
}

@media (max-width: 640px) {
    .logo-marquee { padding-inline: 1rem; }
    .logo-marquee__set > span { width: 140px; height: 42px; }
}
