.brand-gallery-section {
  overflow: hidden;
  background: linear-gradient(180deg, rgba(53, 95, 209, .045), rgba(53, 95, 209, 0) 72%);
}

.brand-gallery-section .section-head > div {
  max-width: 650px;
}

.brand-gallery-section .section-head p {
  max-width: 520px;
}

.brand-gallery-viewport {
  overflow: hidden;
  padding: 5px 0 18px;
  border-radius: 22px;
}

.brand-gallery-track {
  display: flex;
  width: max-content;
  animation: brand-gallery-scroll 95s linear infinite;
  animation-play-state: paused;
  will-change: transform;
}

.brand-gallery-track.is-active {
  animation-play-state: running;
}

.brand-gallery-viewport:hover .brand-gallery-track,
.brand-gallery-viewport:focus-within .brand-gallery-track {
  animation-play-state: paused;
}

.brand-gallery-group {
  display: flex;
  flex: none;
  gap: 20px;
  padding-right: 20px;
}

.brand-gallery-card {
  display: flex;
  flex: 0 0 clamp(240px, calc((100vw - 140px) / 3), 380px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.brand-gallery-image-wrap {
  display: grid;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  place-items: center;
  background: #eef0f5;
}

.brand-gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}

.brand-gallery-card:hover .brand-gallery-image {
  transform: scale(1.035);
}

.brand-gallery-image.is-portrait {
  object-fit: contain;
}

.brand-gallery-copy {
  flex: 1;
  padding: 19px 20px 21px;
}

.brand-gallery-category {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: .71rem;
  font-weight: 750;
  letter-spacing: .09em;
  line-height: 1.4;
  text-transform: uppercase;
}

.brand-gallery-copy h3 {
  margin: 0 0 7px;
  font-size: 1.12rem;
  letter-spacing: -.025em;
}

.brand-gallery-copy p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.65;
}

@keyframes brand-gallery-scroll {
  to {
    transform: translateX(-50%);
  }
}

@media (max-width: 880px) {
  .brand-gallery-card {
    flex-basis: clamp(240px, 42vw, 340px);
  }
}

@media (max-width: 640px) {
  .brand-gallery-section .section-head {
    margin-bottom: 26px;
  }

  .brand-gallery-group {
    gap: 16px;
    padding-right: 16px;
  }

  .brand-gallery-card {
    flex-basis: min(84vw, 340px);
  }

  .brand-gallery-copy {
    padding: 16px 17px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-gallery-viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .brand-gallery-track {
    animation: none !important;
    transform: none !important;
    will-change: auto;
  }

  .brand-gallery-group[aria-hidden="true"] {
    display: none;
  }

  .brand-gallery-card {
    scroll-snap-align: start;
  }
}
