/* Base */
#partnerships {
  color: #0b1220;
}

/* marquee container */
.partner-marquee {
  position: relative;
  overflow: hidden;
  padding: 0.75rem 0;
}

/* track: flex row that will be animated */
.marquee-track {
  display: flex;
  gap: 1rem;
  align-items: center;
  will-change: transform;
  /* animation will be applied dynamically by JS */
}

/* partner items */
.partner-item {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  max-width: 320px;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  overflow: hidden;
  cursor: default;

  /* base card visuals */
  background: var(--glass);
  border: 1px solid rgba(11, 18, 32, 0.04);
  box-shadow: var(--shadow);

  color: #fff;
  font-weight: 700;
  text-align: center;

  /* text safety */
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

/* animated gradient layer (pseudo-element) */
.partner-item::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;

  /* cyclic warm→cool palette */
  background: linear-gradient(
    120deg,
    rgba(244, 197, 66, 0.95) 0%,
    rgba(255, 125, 64, 0.92) 20%,
    rgba(99, 102, 241, 0.92) 45%,
    rgba(34, 197, 94, 0.92) 70%,
    rgba(244, 197, 66, 0.95) 100%
  );
  background-size: 200% 200%;
  filter: saturate(1.05) contrast(1.02);
  transform: translateZ(0);

  animation: partnerGradientShift 12s linear infinite;
  opacity: 0.98;
  mix-blend-mode: screen;
}

/* small translucent multiplier to keep text readable */
.partner-item::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(11, 18, 32, 0.06),
    rgba(11, 18, 32, 0.12)
  );
  mix-blend-mode: multiply;
}

/* staggered animation delays create the cyclic wave effect */
.partner-item:nth-child(1)::before {
  animation-delay: 0s;
}
.partner-item:nth-child(2)::before {
  animation-delay: -1.6s;
}
.partner-item:nth-child(3)::before {
  animation-delay: -3.2s;
}
.partner-item:nth-child(4)::before {
  animation-delay: -4.8s;
}
.partner-item:nth-child(5)::before {
  animation-delay: -6.4s;
}
.partner-item:nth-child(6)::before {
  animation-delay: -8s;
}
.partner-item:nth-child(7)::before {
  animation-delay: -9.6s;
}
.partner-item:nth-child(8)::before {
  animation-delay: -11.2s;
}

/* ensure content sits above the animated layers */
.partner-item > * {
  position: relative;
  z-index: 1;
}

/* hover / focus (keyboard accessible) */
.partner-item:focus,
.partner-item:hover {
  transform: translateY(-6px);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 20px 44px rgba(11, 18, 32, 0.08);
}

/* CSS keyframes used by JS animation name "marqueeScroll" */
@keyframes marqueeScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(var(--marquee-translate, -100%));
  }
}

/* reduced motion: disable animations, allow horizontal scroll */
@media (prefers-reduced-motion: reduce) {
  .partner-item::before {
    animation: none !important;
  }
  .partner-item::before,
  .partner-item::after {
    opacity: 1 !important;
  }
  .marquee-track {
    animation: none !important;
    display: inline-flex;
  }
  .partner-marquee {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .marquee-controls {
    display: none;
  }
}

/* responsive sizing */
@media (max-width: 767.98px) {
  .partner-item {
    min-width: 140px;
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
  }
}

/* small polish for controls */
.marquee-controls .marquee-toggle {
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-weight: 600;
}
