.clients {
  padding: 3rem 1rem;
  text-align: center;
}

.clients__title {
  color: var(--color-text);
  font-size: var(--font-3xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  margin: 0;
}

.clients__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 2rem;
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  align-items: center;
}

/* Fallback: fade-in on page load (used only where view() isn't supported) */
.clients__item {
  opacity: 0;
  transform: translateY(12px);
  animation: clients-fade-in 0.5s ease forwards;
}

.clients__item:nth-child(1) {
  animation-delay: 1s;
}

.clients__item:nth-child(2) {
  animation-delay: 2s;
}

.clients__item:nth-child(3) {
  animation-delay: 3s;
}

.clients__item:nth-child(4) {
  animation-delay: 4s;
}

.clients__item:nth-child(5) {
  animation-delay: 5s;
}

.clients__item:nth-child(6) {
  animation-delay: 6s;
}

.clients__item:nth-child(7) {
  animation-delay: 7s;
}
.clients__item:nth-child(8) {
  animation-delay: 8s;
}
.clients__item:nth-child(9) {
  animation-delay: 9s;
}
.clients__item:nth-child(10) {
  animation-delay: 10s;
}
.clients__item:nth-child(11) {
  animation-delay: 11s;
}
.clients__item:nth-child(12) {
  animation-delay: 12s;
}
.clients__item:nth-child(13) {
  animation-delay: 13s;
}
.clients__item:nth-child(14) {
  animation-delay: 14s;
}
.clients__item:nth-child(15) {
  animation-delay: 15s;
}

@keyframes clients-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Upgrade: real per-item scroll-triggered reveal where supported.
   No manual delay needed — each item animates exactly when it enters
   the viewport, so scrolling itself creates the stagger. */
@supports (animation-timeline: view()) {
  .clients__item {
    animation: clients-fade-in linear both;
    animation-delay: 0s;
    animation-timeline: view();
    animation-range: entry 0% cover 40%;
  }
}

.clients__link {
  display: block;
  border-radius: var(--radius-sm, 0.25rem);
}

.clients__link:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

.clients__logo {
  max-width: 100%;
  height: auto;
}

@media (hover: hover) and (pointer: fine) {
  .clients__logo {
    filter: grayscale(100%);
    opacity: 0.7;
    transition: filter var(--transition-fast), opacity var(--transition-fast);
  }

  .clients__logo:hover {
    filter: grayscale(0%);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .clients__item {
    animation: none;
    opacity: 1;
    transform: none;
  }
}