.references {
  position: relative;
  z-index: 3;
  width: 100%;
  margin-top: -48px;
  padding: 88px;
  border-radius: 56px;
  background: linear-gradient(var(--color-dark-50), var(--color-dark-50)), var(--color-light-1000);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.references__circle {
  position: absolute;
  left: calc(50% + 737.53px);
  top: 50%;
  transform: translate(-50%, -50%);
  width: 682.008px;
  height: 682.008px;
  pointer-events: none;
}

.references__header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 1264px;
  margin-inline: auto;
}

.references__title {
  position: relative;
  margin: 0;
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 600;
  line-height: 56px;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--color-dark-1000);
  white-space: nowrap;
}

.references__title-underline {
  position: absolute;
  left: -4px;
  top: 35.86px;
  width: 304.729px;
  height: 19.135px;
  background: var(--color-dark-100);
  z-index: -1;
}

.references__row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 40px;
  width: 100%;
  max-width: 1264px;
  margin-inline: auto;
}

.references__viewport {
  display: flex;
  flex: 1 0 0;
  min-width: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  transition: opacity 0.35s ease, filter 0.35s ease;
}

.references__viewport::-webkit-scrollbar {
  display: none;
}

#referencesViewport.is-transitioning {
  opacity: 0;
  filter: blur(10px);
}

.references__slide {
  display: flex;
  width: 100%;
  flex-shrink: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  align-items: center;
  gap: 48px;
}

.references__images {
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex-shrink: 0;
  width: 316px;
  height: 512px;
}

.references__photo {
  width: 316px;
  height: 363px;
  border-radius: 32px;
  overflow: hidden;
  background: var(--color-dark-50);
}

.references__photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.references__logo {
  position: relative;
  flex: 1 0 0;
  min-height: 0;
  border-radius: 32px;
  background: var(--color-dark-50);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Точные пропорции/позиция каждого лого — из Figma (per-логотип inline
   style на <img>, см. разметку), тут только общее для всех: blend-режим,
   чтобы белый фон вырезки сливался с плашкой. */
.references__logo img {
  position: absolute;
  display: block;
  mix-blend-mode: darken;
}

.references__logo-text {
  margin: 0;
  padding: 0 24px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--color-dark-700);
}

.references__content {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 40px;
  height: 512px;
}

.references__pagination {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-dark-700);
}

.references__quote {
  margin: 0;
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 600;
  line-height: 52px;
  letter-spacing: -0.06em;
  color: var(--color-dark-1000);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
}

.references__attribution {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.references__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.05em;
  color: var(--color-dark-1000);
}

.references__location {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-dark-700);
}

.references__nav {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.references__nav-btn {
  width: 80px;
  height: 133px;
  border-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.references__nav-btn img {
  width: 32px;
  height: 32px;
  display: block;
}

.references__nav-btn img.is-mirrored {
  transform: scaleX(-1);
}

/* Figma 92:347 — активная: без обводки, Dark/100 поверх Light/1000;
   неактивная: обводка Dark/100, Dark/50 поверх Light/1000, стрелка блёклая */
.references__nav-btn {
  border: none;
  background: linear-gradient(var(--color-dark-100), var(--color-dark-100)), var(--color-light-1000);
}

.references__nav-btn--next img {
  transform: rotate(180deg);
}

.references__nav-btn:not(:disabled):hover {
  transform: scale(1.06);
}

.references__nav-btn:not(:disabled):active {
  transform: scale(0.94);
}

.references__nav-btn:disabled {
  border: 1px solid var(--color-dark-100);
  background: linear-gradient(var(--color-dark-50), var(--color-dark-50)), var(--color-light-1000);
  cursor: default;
}

/* ============ Mobile ≤767px — Figma 283:3303 ============ */
@media (max-width: 767px) {
  .references {
    border-radius: 40px;
    padding: 48px 0 16px;
    gap: 0;
  }

  /* Декоративного круга в мобильном макете нет */
  .references__circle {
    display: none;
  }

  .references__title {
    font-size: 32px;
    line-height: 40px;
    letter-spacing: -2.24px;
  }

  .references__title-underline {
    left: 50%;
    top: 24.01px;
    width: 196.212px;
    height: 13.973px;
    margin-left: -98.106px;
  }

  .references__row {
    display: block;
  }

  /* Слайд: фото → текст → лого. Обёртка фото/лого раскрывается через
     display: contents, чтобы перемешать порядок без правки разметки */
  .references__slide {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 16px;
  }

  .references__images {
    display: contents;
  }

  .references__photo {
    order: 1;
    width: 100%;
    height: 168px;
    border-radius: 24px;
    margin: 32px 0;
  }

  .references__content {
    order: 2;
    height: auto;
    gap: 24px;
    /* Жёсткий минимум до лого-плашки: auto-margin на самой плашке на самом
       высоком слайде схлопывается в ноль и плашка наезжала на текст */
    margin-bottom: 32px;
  }

  /* Лого прижато к низу слайда (слайды в ряду равной высоты),
     боковые 60px — место под стрелки */
  .references__logo {
    order: 3;
    flex: none !important;
    height: 104px;
    min-height: 104px;
    border-radius: 24px;
    margin: auto 60px 32px;
  }

  .references__quote {
    font-size: 24px;
    line-height: 32px;
    letter-spacing: -1.44px;
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
  }

  .references__name {
    line-height: 28px;
    letter-spacing: -0.9px;
  }

  /* Стрелки 60×104 по бокам от лого-плашки. Якорь — .references__row
     (он position: relative с десктопа), низ плашки = 32px от низа ряда */
  .references__nav {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 32px;
    height: 104px;
    justify-content: space-between;
    pointer-events: none;
    z-index: 2;
  }

  .references__nav-btn {
    pointer-events: auto;
    width: 60px;
    height: 104px;
    border-radius: 24px;
  }

  .references__nav-btn:disabled {
    background: var(--color-light-1000);
  }
}
