/* Referanslar: iki sıra, ters yönlere sürekli akan logo şeridi (JavaScript gerekmez).
   Her sırada aynı liste iki kez var; ikisi de kendi genişliği kadar sola kayar → kesintisiz döngü. */
.refs {
  --k: 1;               /* logo boyut çarpanı (telefonda küçülür) */
  --slot: 190px;        /* her logonun yatay alanı */
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 34px 0;
  overflow: hidden;
}

.refs__row {
  display: flex;
  overflow: hidden;
  /* Kenarlarda logolar yumuşakça kaybolsun */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
}

.refs__track {
  display: flex;
  flex-shrink: 0;
  justify-content: space-around;
  align-items: center;
  min-width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  animation: refsScroll 48s linear infinite;
}

.refs__row--reverse .refs__track {
  animation-duration: 42s;
  animation-direction: reverse;
}

/* Bilgisayarda üzerine gelince akış dursun. Telefonda dokunma "hover" sayılıp akışı
   takılı bırakmasın diye bu sadece fareli cihazlarda; telefonda js/refs.js .is-paused ekler. */
@media (hover: hover) and (pointer: fine) {
  .refs__row:hover .refs__track {
    animation-play-state: paused;
  }
}

.refs__row.is-paused .refs__track {
  animation-play-state: paused;
}

@keyframes refsScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

.ref {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: var(--slot);
  height: 118px;
  flex-shrink: 0;
}

.ref img {
  display: block;
  width: calc(var(--w) * var(--k) * 1px);
  height: calc(var(--h) * var(--k) * 1px);
  object-fit: contain;
  transition: filter 0.35s ease, opacity 0.35s ease, transform 0.35s ease;
}

/* Firma adı: logonun ÜSTÜNDE küçük etiket; bilgisayarda üzerine gelince,
   telefonda dokununca (js/refs.js → .is-active) belirir */
.ref__name {
  position: absolute;
  left: 50%;
  top: 2px;
  z-index: 1;
  max-width: 260px; /* logo alanından taşabilir; uzun isimler kısalmasın */
  overflow: hidden;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #1c5169;
  font-size: 12.5px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: 0 4px 12px -6px rgba(14, 44, 59, 0.45);
  opacity: 0;
  transform: translate(-50%, -4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.ref.is-active .ref__name {
  opacity: 1;
  transform: translate(-50%, 0);
}

.ref.is-active img {
  transform: scale(1.06) translateY(5px);
}

/* Fare kullanılan cihazlarda (bilgisayar): siyah-beyaz, üzerine gelince renkli.
   Dokunmatik cihazlarda (telefon, tablet) logolar hep renkli kalır. */
@media (hover: hover) and (pointer: fine) {
  .ref img {
    filter: grayscale(1);
    opacity: 0.55;
  }

  .ref:hover img {
    filter: none;
    opacity: 1;
    transform: scale(1.08) translateY(6px); /* aşağı: üstteki isim etiketiyle çakışmasın */
  }

  .ref:hover .ref__name {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 640px) {
  .refs {
    --k: 0.72;
    --slot: 130px;
    gap: 6px;
    padding: 22px 0;
  }

  .ref {
    height: 96px;
  }

  .refs__track {
    animation-duration: 36s;
  }

  .refs__row--reverse .refs__track {
    animation-duration: 32s;
  }
}

/* "Hareketi azalt" açık ziyaretçiler: kayma yok, logolar düzenli ızgarada */
@media (prefers-reduced-motion: reduce) {
  .refs__row {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .refs__track {
    flex-wrap: wrap;
    justify-content: center;
    animation: none;
  }

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