/* Homepage testimonials carousel. */

.testimonials-section {
  padding: clamp(28px, 3.5vw, 48px) 0;
}

.testimonials-section h2 {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto var(--space-16, 16px);
  padding-inline: 24px;
  text-align: center;
}

.testimonial-carousel-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  width: min(100% - 48px, var(--container-2xl, 1360px));
  margin: 0 auto var(--space-16, 16px);
}

.testimonial-carousel-wrapper::before,
.testimonial-carousel-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 4;
  width: 72px;
  pointer-events: none;
}

.testimonial-carousel-wrapper::before {
  left: 0;
  background: linear-gradient(90deg, #0b1118, transparent);
}

.testimonial-carousel-wrapper::after {
  right: 0;
  background: linear-gradient(270deg, #0b1118, transparent);
}

.testimonials-carousel {
  display: flex;
  gap: var(--space-14, 14px);
  width: 100%;
  overflow-x: auto;
  padding: 4px 4px var(--space-16);
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.testimonials-carousel::-webkit-scrollbar {
  display: none;
}

.scroll-btn {
  position: absolute;
  top: 50%;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  color: var(--home-text);
  background: rgba(15, 23, 32, 0.88);
  border: 1px solid rgba(205, 235, 255, 0.16);
  border-radius: var(--radius-full);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  cursor: pointer;
  font-size: 0;
  transform: translateY(-50%);
  transition:
    transform var(--duration-normal) var(--ease-standard),
    box-shadow var(--duration-normal) var(--ease-standard),
    border-color var(--duration-normal) var(--ease-standard),
    background var(--duration-normal) var(--ease-standard);
}

.scroll-btn::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.scroll-left {
  left: -12px;
}

.scroll-left::before {
  transform: rotate(180deg);
}

.scroll-right {
  right: -12px;
}

.scroll-btn:hover {
  background: rgba(18, 28, 39, 0.96);
  border-color: rgba(18, 218, 209, 0.34);
  box-shadow: 0 20px 58px rgba(18, 218, 209, 0.13), 0 18px 46px rgba(0, 0, 0, 0.36);
}

.scroll-left:hover {
  transform: translateY(-50%) translateX(-2px);
}

.scroll-right:hover {
  transform: translateY(-50%) translateX(2px);
}

.testimonial-card {
  position: relative;
  flex: 0 0 min(300px, calc(100vw - 72px));
  min-height: 200px;
  padding: 16px;
  scroll-snap-align: start;
  transition:
    transform var(--duration-normal) var(--ease-standard),
    box-shadow var(--duration-normal) var(--ease-standard),
    border-color var(--duration-normal) var(--ease-standard);
}

.testimonial-card::before {
  content: "";
  position: absolute;
  top: 18px;
  right: 20px;
  width: 30px;
  height: 30px;
  opacity: 0.14;
  background: var(--home-cyan);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M7.17 6A5.17 5.17 0 0 0 2 11.17V18h7v-7H5.08A2.09 2.09 0 0 1 7.17 8.92V6Zm10 0A5.17 5.17 0 0 0 12 11.17V18h7v-7h-3.92a2.09 2.09 0 0 1 2.09-2.08V6Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.testimonial-card:hover {
  transform: translateY(-5px);
}

.testimonial-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: var(--space-12);
  padding-right: 40px;
}

.testimonial-name {
  color: var(--home-text);
  font-size: 0.98rem;
  font-weight: 790;
  line-height: 1.2;
}

.testimonial-role {
  width: fit-content;
  color: rgba(245, 248, 251, 0.58);
  font-size: 0.78rem;
  font-weight: 640;
  line-height: 1.35;
}

.testimonial-rating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  margin-bottom: var(--space-12);
  color: transparent;
  font-size: 0;
}

.testimonial-rating::before {
  content: "";
  display: inline-block;
  width: 104px;
  height: 18px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='%23FFAD5C' stroke='%23FFAD5C' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 2 3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2Z'/%3E%3C/svg%3E")
    left center / 18px 18px repeat-x;
}

.testimonial-rating span {
  display: none;
}

.testimonial-rating::after {
  content: "5/5";
  color: rgba(245, 248, 251, 0.56);
  font-size: 0.78rem;
  font-weight: 720;
}

.testimonial-card p {
  margin: 0;
  color: rgba(245, 248, 251, 0.76);
  font-size: 0.84rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.client-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-10, 10px);
  width: min(100% - 48px, 860px);
  margin: 0 auto;
}

.client-stat {
  padding: 12px 14px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.045)),
    rgba(15, 23, 32, 0.70);
  border: 1px solid rgba(205, 235, 255, 0.13);
  border-radius: var(--radius-xl);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.22);
}

.client-stat h3 {
  margin: 0 0 4px;
  color: var(--home-cyan);
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  font-weight: 830;
  line-height: 1;
  letter-spacing: -0.04em;
}

.client-stat span {
  color: rgba(245, 248, 251, 0.70);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .testimonial-carousel-wrapper,
  .client-stats {
    width: min(100% - 32px, var(--container-2xl, 1360px));
  }

  .testimonial-carousel-wrapper::before,
  .testimonial-carousel-wrapper::after,
  .scroll-btn {
    display: none;
  }

  .client-stats {
    grid-template-columns: 1fr;
    max-width: 520px;
  }
}

@media (max-width: 560px) {
  .testimonials-section {
    padding: 44px 0;
  }

  .testimonial-carousel-wrapper {
    width: 100%;
    padding-left: 12px;
  }

  .testimonials-carousel {
    padding-right: 12px;
  }

  .testimonial-card {
    flex-basis: min(330px, calc(100vw - 42px));
    padding: 20px;
  }
}
