.references {
  position: relative;
  height: 630px;
  overflow: hidden;
  background-color: var(--color-background);
}

.references__heading {
  position: relative;
  z-index: 4;
  width: max-content;
  height: 42px;
  margin: 0 auto;
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  line-height: 42px;
}

.references__viewport {
  position: absolute;
  top: 90px;
  left: 0;
  width: 100%;
  height: 460px;
  overflow: hidden;
}

.references__track {
  --track-offset: 0px;
  position: absolute;
  top: 0;
  left: calc(50% - 316px);
  display: flex;
  align-items: center;
  gap: 64px;
  width: max-content;
  height: 460px;
  transform: translateX(var(--track-offset));
  transition: transform 300ms ease-in;
  will-change: transform;
}

.references__track.references__track--no-transition {
  transition: none;
}

.references__track--no-transition .references__card {
  transition: none !important;
}

.references__card {
  display: flex;
  flex: 0 0 632px;
  flex-direction: column;
  gap: 12px;
  width: 632px;
  height: 434px;
  padding: 48px 40px;
  border: 1px solid var(--color-primary);
  border-radius: 32px;
  overflow: hidden;
  background-color: rgb(var(--color-primary-rgb) / 10%);
  transition:
    height 300ms ease-in,
    background-color 300ms ease-in,
    opacity 350ms ease-out;
}

.references__track--reveal-ready .references__card {
  opacity: 0;
  pointer-events: none;
}

.references__track--reveal-ready .references__card--visible {
  opacity: 1;
  pointer-events: auto;
}

.references__card:not(.is-active) {
  cursor: pointer;
}

.references__card.is-active {
  height: 460px;
  background-color: rgb(var(--color-primary-rgb) / 30%);
}

.references__text {
  flex: 1 1 auto;
  width: 552px;
  height: auto;
  margin: 0;
  font-size: 20px;
  line-height: 24px;
}

.references__author-row {
  display: flex;
  flex: 0 0 22px;
  align-items: center;
  gap: 16px;
  width: 552px;
  height: 22px;
}

.references__author-line {
  flex: 1;
  border-top: 1px solid var(--color-text);
}

.references__author {
  flex: none;
  font-size: 18px;
  line-height: 22px;
  white-space: nowrap;
}

.references__fade {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(
    90deg,
    var(--color-background) 0%,
    rgb(28 28 28 / 0%) 10%,
    rgb(28 28 28 / 0%) 90%,
    var(--color-background) 100%
  );
  pointer-events: none;
}

.references__quote {
  position: absolute;
  top: 82px;
  left: calc(50% - 371px);
  z-index: 4;
  width: 89.08px;
  height: 64px;
}

.references__navigation {
  position: absolute;
  top: 590px;
  left: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 20px;
  width: max-content;
  height: 40px;
  transform: translateX(-50%);
}

.references__arrow {
  position: relative;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
}

.references__arrow::before {
  position: absolute;
  background-color: currentcolor;
  content: "";
  transition:
    top 100ms ease-in,
    left 100ms ease-in,
    width 100ms ease-in,
    height 100ms ease-in,
    background-color 100ms ease-in;
}

.references__arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.references__arrow--previous::before {
  top: 10.94px;
  left: 11.1px;
  width: 18.23px;
  height: 18.14px;
  -webkit-mask: url("../assets/icons/reference-arrow-back.svg") center / 100% 100% no-repeat;
  -webkit-mask: url("../assets/icons/reference-arrow-back.svg") center / 100% 100% no-repeat;
  mask: url("../assets/icons/reference-arrow-back.svg") center / 100% 100% no-repeat;
}

.references__arrow--next::before {
  top: 10.92px;
  left: 10.67px;
  width: 18.23px;
  height: 18.14px;
  -webkit-mask: url("../assets/icons/reference-arrow-forward.svg") center / 100% 100% no-repeat;
  -webkit-mask: url("../assets/icons/reference-arrow-forward.svg") center / 100% 100% no-repeat;
  mask: url("../assets/icons/reference-arrow-forward.svg") center / 100% 100% no-repeat;
}

.references__arrow--previous:not(:disabled):hover::before,
.references__arrow--previous:focus-visible::before {
  top: 10.42px;
  left: 6.5px;
  width: 19.5px;
  height: 19.18px;
  background-color: var(--color-primary);
}

.references__arrow--next:not(:disabled):hover::before,
.references__arrow--next:focus-visible::before {
  top: 10.4px;
  left: 14px;
  width: 19.5px;
  height: 19.18px;
  background-color: var(--color-primary);
}

.references__dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: var(--color-text);
}

.references__dot.is-active {
  background-color: var(--color-primary);
}

.references__status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .references__track {
    transition-duration: 300ms !important;
  }

  .references__card {
    transition-duration: 300ms, 300ms, 350ms !important;
  }

  .references__arrow::before {
    transition-duration: 100ms !important;
  }
}

@media (max-width: 990px) {
  .references {
    height: 750px;
    margin-bottom: 100px;
  }

  .references__heading {
    width: calc(100% - 32px);
    height: 62px;
    font-size: 24px;
    line-height: 31px;
    text-align: center;
  }

  .references__viewport {
    top: 94px;
    height: 600px;
  }

  .references__track {
    top: 0;
    left: max(16px, calc(50% - 179px));
    align-items: center;
    gap: 8px;
    height: 600px;
  }

  .references__card {
    flex-basis: min(358px, calc(100vw - 32px));
    gap: 0;
    width: min(358px, calc(100vw - 32px));
    height: 564px;
    padding: 40px;
  }

  .references__card.is-active {
    height: 600px;
  }

  .references__text {
    display: flex;
    align-items: center;
    width: 100%;
    height: auto;
    flex: 1 1 auto;
    font-size: clamp(16px, calc(2.857vw + 6.857px), 18px);
    line-height: clamp(19px, calc(4.286vw + 5.286px), 22px);
  }

  .references__author-row {
    width: 100%;
    height: 19px;
    flex-basis: 19px;
  }

  .references__author {
    font-size: clamp(14px, calc(2.857vw + 4.857px), 16px);
    line-height: 19px;
  }

  .references__fade {
    display: none;
  }

  .references__quote {
    top: 82px;
    left: max(16px, calc(50% - 179px));
    width: 66.81px;
    height: 48px;
  }

  .references__navigation {
    top: 710px;
  }
}
