/* Styles for home/brands (app/sections/).
   Every rule is scoped to .logos-section, so none of it reaches other
   parts of the page.

   A quiet band, not a full section: a fine line above and below, the
   heading on the left, and the logos drifting past on the right, all in
   white so no one brand's colour takes over. */

.logos-section {
  --logos-navy: #001e53;
  --logos-gold: #feca16;
  --logos-line: rgba(243, 238, 226, 0.14);

  position: relative;
  padding: 0 clamp(20px, 6vw, 96px);
  /* from the navy Our Work ends on, into the navy of the section below */
  background: linear-gradient(180deg, #00153d 0%, var(--logos-navy) 100%);
  color: #fff;
  overflow: hidden;
}

.logos-section *,
.logos-section *::before,
.logos-section *::after {
  box-sizing: border-box;
}

.logos-section .logos__wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 44px) 0;
  border-top: 1px solid var(--logos-line);
  border-bottom: 1px solid var(--logos-line);
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
}

/* ---------- Heading ---------- */
.logos-section h2 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(1.5rem, 2.4vw, 2.125rem);
  font-weight: 400;
  line-height: 1.12;
  color: #fff;
}

.logos-section h2 span {
  color: var(--logos-gold);
}

/* ---------- The moving strip ---------- */
/* Two copies of the logos side by side; both slide left by one copy's
   width, then start again, so the loop has no seam. The edges fade out. */
.logos-section .logos__marquee {
  display: flex;
  overflow: hidden;
  user-select: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
}

.logos-section .marquee__logos {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  min-width: 100%;
  animation: logos-loop 48s linear infinite;
}

/* the mouse stops it, to read a name */
.logos-section .logos__marquee:hover .marquee__logos {
  animation-play-state: paused;
}

.logos-section .marquee__logos img {
  display: block;
  flex-shrink: 0;
  height: 40px;
  width: auto;
  max-width: 190px;
  margin-inline: clamp(22px, 2.8vw, 44px);
  object-fit: contain;
  /* every logo in white */
  filter: brightness(0) invert(1);
  opacity: 0.78;
  transition: opacity 0.3s ease;
}

.logos-section .marquee__logos img:hover {
  opacity: 1;
}

@keyframes logos-loop {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* ---------- Coming into view (home-brands.js adds .active) ---------- */
.logos-section.scroll-animate {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.logos-section.scroll-animate.active {
  opacity: 1;
  transform: none;
}

/* ---------- Tablets and phones: the heading above the strip ---------- */
@media (max-width: 767px) {
  .logos-section .logos__wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .logos-section h2 {
    max-width: none;
  }

  .logos-section .marquee__logos img {
    height: 32px;
    max-width: 150px;
  }

  .logos-section .marquee__logos {
    animation-duration: 36s;
  }
}

/* No movement asked for: the logos simply sit in rows */
@media (prefers-reduced-motion: reduce) {
  .logos-section .logos__marquee {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .logos-section .marquee__logos {
    animation: none;
    flex-wrap: wrap;
    justify-content: flex-start;
    row-gap: 22px;
    min-width: 0;
  }

  .logos-section .marquee__logos[aria-hidden="true"] {
    display: none;
  }

  .logos-section.scroll-animate {
    transition: none;
  }
}
