/* ================================================
   OUR CLIENTS — JS-driven infinite scroll
   scrollLeft loop + scroll buttons + hover pause
   ================================================ */

/* ── Section ── */
.clients-section {
  padding: 80px 0 70px;
  background: linear-gradient(180deg, #f7fafc 0%, #ffffff 100%);
}

.clients-section__sub {
  text-align: center;
  color: #666;
  font-size: clamp(15px, 3.5vw, 17px);
  margin-bottom: 48px;
}

/* ── Outer: positions the buttons relative to the viewport ── */
.marquee-outer {
  position: relative;
}

/* ── Scroll buttons — sit on top of the viewport edges ── */
.marquee-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(30, 58, 70, 0.18);
  background: #ffffff;
  color: #1E3A46;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0,0,0,0.12);
  transition:
    background   0.25s ease,
    color        0.25s ease,
    border-color 0.25s ease,
    box-shadow   0.25s ease,
    transform    0.25s cubic-bezier(0.34,1.56,0.64,1);
  /* keep them above the fade mask */
}

.marquee-btn--left  { left: 0; }
.marquee-btn--right { right: 0; }

.marquee-btn:hover {
  background: #1E3A46;
  color: #ffffff;
  border-color: #1E3A46;
  transform: translateY(-50%) scale(1.12);
  box-shadow: 0 8px 28px rgba(30,58,70,0.30);
}
.marquee-btn:active {
  transform: translateY(-50%) scale(0.95);
  transition-duration: 0.1s;
}

/* icon bounce */
.marquee-btn--left:hover  i { animation: bLeft  0.55s ease infinite; }
.marquee-btn--right:hover i { animation: bRight 0.55s ease infinite; }
@keyframes bLeft  { 0%,100%{transform:translateX(0)} 50%{transform:translateX(-3px)} }
@keyframes bRight { 0%,100%{transform:translateX(0)} 50%{transform:translateX( 3px)} }

/* ── Viewport: clips the scrolling strip, padded so buttons don't cover cards ── */
.marquee-viewport {
  overflow: hidden;
  margin: 0 56px;          /* gap for buttons */
  cursor: grab;
  /* Soft fade at edges — INSIDE the padded area only */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 5%,
    black 95%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 5%,
    black 95%,
    transparent 100%
  );
}
.marquee-viewport:active { cursor: grabbing; }

/* ── Strip: SET A + SET B laid out side by side ──
   JS scrolls scrollLeft and resets at the halfway point */
.marquee-strip {
  display: flex;
  gap: 28px;
  width: max-content;
  padding: 24px 0 28px;
  /* NO CSS animation here — JS drives scrollLeft */
  will-change: transform;
}

/* ── Individual logo tile ── */
.client-tile {
  flex: 0 0 auto;
  width: 240px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 18px;
  border: 1.5px solid rgba(30,58,70,0.08);
  box-shadow: 0 3px 14px rgba(0,0,0,0.06);
  padding: 28px 32px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform    0.35s cubic-bezier(0.34,1.56,0.64,1),
    box-shadow   0.35s ease,
    border-color 0.35s ease;
}

/* Accent top bar */
.client-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent,#ffc107), var(--accent-dark,#ff9800));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
  border-radius: 18px 18px 0 0;
}
.client-tile:hover::before { transform: scaleX(1); }

/* Shine sweep */
.client-tile__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg,
    transparent 38%,
    rgba(255,255,255,0.58) 50%,
    transparent 62%
  );
  transform: translateX(-120%);
  pointer-events: none;
  transition: none;
}
.client-tile:hover .client-tile__shine {
  transform: translateX(220%);
  transition: transform 0.55s ease;
}

.client-tile:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow:
    0 18px 42px rgba(30,58,70,0.15),
    0 5px 12px rgba(0,0,0,0.06);
  border-color: rgba(255,193,7,0.40);
}

/* ── Logo image ── */
.client-tile img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: grayscale(100%) opacity(0.65);
  transition:
    filter    0.4s ease,
    transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
  user-select: none;
  display: block;
}
.client-tile:hover img {
  filter: grayscale(0%) opacity(1) brightness(1.05);
  transform: scale(1.1);
}

/* ── Section title entrance ── */
.clients-section .section-title,
.clients-section .clients-section__sub {
  opacity: 0;
  transform: translateY(22px);
  animation: fadeUp 0.65s ease forwards;
}
.clients-section .clients-section__sub { animation-delay: 0.15s; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .client-tile { width: 210px; height: 134px; padding: 24px 26px; }
}
@media (max-width: 768px) {
  .clients-section { padding: 60px 0 50px; }
  .marquee-viewport { margin: 0 48px; }
  .marquee-btn      { width: 40px; height: 40px; font-size: 17px; }
  .client-tile      { width: 180px; height: 116px; padding: 20px 22px; border-radius: 14px; }
  .marquee-strip    { gap: 20px; }
}
@media (max-width: 480px) {
  .marquee-viewport { margin: 0 40px; }
  .marquee-btn      { width: 36px; height: 36px; font-size: 15px; }
  .client-tile      { width: 148px; height: 96px; padding: 16px 18px; border-radius: 12px; }
  .marquee-strip    { gap: 14px; }
}

/* Reduced-motion: no scroll, just a static grid */
@media (prefers-reduced-motion: reduce) {
  .marquee-strip {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }
  /* hide the duplicate set */
  .client-tile[aria-hidden="true"] { display: none; }
}