/* Client logo carousel. Scrolls continuously and pauses on hover, when each
   card shows a link to that client's website. */

.client-marquee {
  /* Matches the section behind, so the blended logo loses its white */
  background: var(--paper);
  overflow: hidden;
  margin-top: 40px;
  padding: 8px 0 16px;
  position: relative;
}

/* Two identical sets sit side by side. Moving the row by one set's width
   makes the loop seamless. */
.client-row {
  display: flex;
  width: max-content;
  animation: client-scroll 20s ease-in-out infinite;
}

.client-marquee:hover .client-row,
.client-marquee:focus-within .client-row {
  animation-play-state: paused;
}

@keyframes client-scroll {
  0% {
    transform: translateX(0);
  }

  /* Each logo holds, then glides to the next position over the last quarter
     of its step. Six steps make one loop over the 24s duration. */
  12.5% {
    transform: translateX(0);
    animation-timing-function: ease-in-out;
  }

  16.6667% {
    transform: translateX(-8.3333%);
  }

  29.1667% {
    transform: translateX(-8.3333%);
    animation-timing-function: ease-in-out;
  }

  33.3333% {
    transform: translateX(-16.6667%);
  }

  45.8333% {
    transform: translateX(-16.6667%);
    animation-timing-function: ease-in-out;
  }

  50% {
    transform: translateX(-25%);
  }

  62.5% {
    transform: translateX(-25%);
    animation-timing-function: ease-in-out;
  }

  66.6667% {
    transform: translateX(-33.3333%);
  }

  79.1667% {
    transform: translateX(-33.3333%);
    animation-timing-function: ease-in-out;
  }

  83.3333% {
    transform: translateX(-41.6667%);
  }

  95.8333% {
    transform: translateX(-41.6667%);
    animation-timing-function: ease-in-out;
  }

  100% {
    transform: translateX(-50%);
  }
}

.client-set {
  list-style: none;
  margin: 0;
  padding: 0 64px 0 0;
  display: flex;
  gap: 64px;
}

.client-item {
  flex: 0 0 auto;
}

.client-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 220px;
  padding: 18px 22px 20px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}

.client-link:hover,
.client-link:focus-visible {
  color: var(--ink);
  background: var(--white);
  border-color: var(--line);
  box-shadow: 0 18px 36px -24px rgba(12, 24, 44, 0.4);
  transform: translateY(-2px);
}

.client-link .client-name {
  margin-top: 16px;
}

/* The link text appears on hover or keyboard focus */
.client-visit {
  display: block;
  margin-top: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--teal);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s var(--ease);
}

.client-link:hover .client-visit,
.client-link:focus-visible .client-visit {
  opacity: 1;
  transform: none;
}

@media (max-width: 600px) {
  .client-link {
    width: 200px;
  }
}

/* Visitors who ask for less motion get a scrollable row instead */
@media (prefers-reduced-motion: reduce) {
  .client-marquee {
    overflow-x: auto;
  }

  .client-marquee::before,
  .client-marquee::after {
    display: none;
  }

  .client-row {
    animation: none;
  }

  .client-visit {
    opacity: 1;
    transform: none;
  }
}

/* Edge fades. These are overlays rather than a mask, because a mask would
   stop the logos blending into the background. */
.client-marquee::before,
.client-marquee::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 90px;
  z-index: 2;
  pointer-events: none;
}

.client-marquee::before {
  left: 0;
  background: linear-gradient(90deg, var(--paper), transparent);
}

.client-marquee::after {
  right: 0;
  background: linear-gradient(270deg, var(--paper), transparent);
}
