/* =========================================================
   Marquee logos — défilement fluide + spotlight centre
   ========================================================= */

.marquee {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(28px, 5vw, 42px);
  border-block: 1px solid transparent;
  border-image: linear-gradient(
    90deg,
    transparent,
    rgba(97, 177, 188, 0.22) 18%,
    rgba(97, 177, 188, 0.22) 82%,
    transparent
  ) 1;
  background:
    radial-gradient(ellipse 70% 140% at 50% 50%, rgba(97, 177, 188, 0.1), transparent 68%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, transparent 48%, rgba(255, 255, 255, 0.03) 100%);
  --marquee-gap: clamp(36px, 6.5vw, 72px);
  --marquee-logo-h: clamp(28px, 4.8vw, 36px);
  --marquee-duration: 45s;
  --marquee-lit: 0;
}

/* Faisceau lumineux fixe au centre — les logos « passent dans la lumière » */
.marquee-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 38% 130% at 50% 50%,
      rgba(97, 177, 188, 0.2) 0%,
      rgba(97, 177, 188, 0.06) 42%,
      transparent 72%
    );
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}

/* Balayage aurora subtil sur toute la bande */
.marquee::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(97, 177, 188, 0.04) 42%,
    rgba(255, 255, 255, 0.09) 50%,
    rgba(97, 177, 188, 0.04) 58%,
    transparent 100%
  );
  background-size: 220% 100%;
  animation: marquee-aurora 9s ease-in-out infinite;
  opacity: 0.85;
}

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

.marquee-viewport {
  position: relative;
  z-index: 2;
  overflow: hidden;
  width: 100%;
  mask-image: linear-gradient(90deg, transparent, black 7%, black 93%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 7%, black 93%, transparent);
}

.marquee-track {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  width: max-content;
  gap: 0;
  will-change: transform;
  animation: marquee-scroll var(--marquee-duration, 45s) linear infinite;
}

.marquee-set {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  flex-shrink: 0;
  gap: var(--marquee-gap);
  padding-right: var(--marquee-gap);
}

.marquee-item {
  --marquee-lit: 0;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--marquee-logo-h);
  transform: translateZ(0);
  text-decoration: none;
  color: inherit;
  border-radius: 4px;
}

.marquee-item:focus-visible {
  outline: 2px solid var(--accent-soft, #9ad4dc);
  outline-offset: 4px;
}

.marquee-item img {
  display: block;
  height: 100%;
  width: auto;
  max-width: clamp(96px, 20vw, 168px);
  object-fit: contain;
  opacity: calc(0.28 + var(--marquee-lit) * 0.72);
  transform: scale(calc(0.92 + var(--marquee-lit) * 0.1));
  filter: brightness(0) invert(1)
    drop-shadow(0 0 calc(2px + var(--marquee-lit) * 20px) rgba(97, 177, 188, calc(var(--marquee-lit) * 0.65)));
  transition:
    opacity 0.12s linear,
    transform 0.12s linear,
    filter 0.12s linear;
  will-change: opacity, transform, filter;
}

.marquee-item img:hover {
  opacity: 1;
  transform: scale(1.06);
  filter: brightness(0) invert(1) drop-shadow(0 0 18px rgba(97, 177, 188, 0.55));
}

@keyframes marquee-scroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(calc(-1 * var(--marquee-shift, 0px)), 0, 0);
  }
}

@keyframes marquee-aurora {
  0%,
  100% {
    background-position: 180% 0;
  }
  50% {
    background-position: -80% 0;
  }
}

.marquee[data-reveal] {
  opacity: 1;
  transform: none;
}

@media (max-width: 719px) {
  .marquee {
    --marquee-gap: clamp(28px, 7vw, 44px);
    --marquee-logo-h: clamp(26px, 6.5vw, 32px);
    padding-block: clamp(22px, 5vw, 30px);
  }

  .marquee-glow {
    background: radial-gradient(
      ellipse 52% 120% at 50% 50%,
      rgba(97, 177, 188, 0.22) 0%,
      rgba(97, 177, 188, 0.07) 45%,
      transparent 74%
    );
  }

  .marquee-viewport {
    mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
  }

  .marquee-item img {
    max-width: clamp(88px, 28vw, 140px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee::before {
    animation: none;
    opacity: 0.35;
  }

  .marquee-track {
    animation: none;
    transform: none;
  }

  .marquee-item img {
    opacity: 0.65;
    transform: none;
    filter: brightness(0) invert(1);
  }

  .marquee-viewport {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .marquee-viewport::-webkit-scrollbar {
    display: none;
  }
}
