/* ==========================================================================
   Trusted By section: eyebrow label, infinite logo marquee, stats row.
   The marquee is a single flex track holding two identical logo sets back
   to back — animating it exactly -50% loops seamlessly with no visible
   seam, since the second set picks up pixel-for-pixel where the first
   left off. Edge fade is a mask-image (no extra DOM) so it survives any
   track width.
   ========================================================================== */

.trusted {
  padding-block: var(--space-8);
}

.trusted__eyebrow {
  text-align: center;
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--color-ink-soft);
  margin-bottom: var(--space-6);
}

/* ---- Marquee ---- */
.trusted-marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
  mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
  margin-bottom: var(--space-7);
}

.trusted-marquee__track {
  display: flex;
  align-items: center;
  width: max-content;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  /* Duration is long because the track holds 40 logos (20 real + 20
     duplicated) end to end — this keeps the per-logo scroll speed calm
     instead of racing through a much longer strip in the same time a
     shorter one would take. */
  animation: trusted-marquee-scroll 90s linear infinite;
  will-change: transform;
}

.trusted-marquee:hover .trusted-marquee__track,
.trusted-marquee:focus-within .trusted-marquee__track {
  animation-play-state: paused;
}

.trusted-marquee__item {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: clamp(1.75rem, 3.4vw, 2.375rem);
}

.trusted-marquee__item img {
  height: 100%;
  width: auto;
  filter: grayscale(1) opacity(0.5);
  transition: filter var(--duration-base) var(--ease-signature), transform var(--duration-base) var(--ease-signature);
}

.trusted-marquee__item:hover img {
  filter: grayscale(0) opacity(1);
  transform: scale(1.04);
}

@keyframes trusted-marquee-scroll {
  from {
    transform: translateX(0);
  }
  to {
    /* Track holds two identical logo sets, so -50% is exactly one set's width */
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .trusted-marquee__track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
  }

  .trusted-marquee__item[aria-hidden="true"] {
    display: none;
  }
}

/* ---- Stats row ---- */
.trusted-stats {
  display: flex;
  border-top: 1px solid var(--color-line);
  padding-top: var(--space-6);
}

.trusted-stats__item {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding-inline: var(--space-2);
  border-right: 1px solid var(--color-line);
}

.trusted-stats__item:last-child {
  border-right: none;
}

.trusted-stats__number {
  display: block;
  font-family: var(--font-body);
  font-weight: var(--fw-extrabold);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  line-height: 1;
  letter-spacing: var(--ls-tight);
  color: var(--color-ink);
}

.trusted-stats__label {
  margin-top: var(--space-2);
  margin-inline-start: 0;
  font-size: clamp(0.75rem, 1.6vw, 0.9375rem);
  font-weight: var(--fw-medium);
  color: var(--color-ink-soft);
}

/* ---- Reveal-on-scroll (see scripts/main.js) ---- */
.trusted [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--duration-slow) var(--ease-signature), transform var(--duration-slow) var(--ease-signature);
}

.trusted [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

.trusted-stats__item {
  transition-delay: calc(var(--reveal-index, 0) * 80ms);
}

@media (prefers-reduced-motion: reduce) {
  .trusted [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
