/* ==========================================================================
   testimonials.css — Sticky background + scroll-driven chat reveal
   - Face photo background stays fixed
   - Title + chat messages scroll naturally inside the sticky viewport
   - Messages animate in as they enter the viewport (chat-like feel)
   ========================================================================== */

:root {
  --testimonials-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.testimonials-section {
  position: relative;
  /* height is set by JS to match content — no extra empty scrolling */
  background: var(--black);
  color: var(--white);
  overflow: visible;
}

/* ── Sticky stage: background stays fixed, content scrolls inside ── */
.testimonials-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

/* ── Fixed face photo background ── */
.testimonials-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.testimonials-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 30% center;
  opacity: 0.55;
  filter: contrast(1.1) brightness(0.7) hue-rotate(15deg) saturate(0.9);
}

.testimonials-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(13, 13, 13, 0.5) 0%, rgba(13, 13, 13, 0.88) 100%),
    linear-gradient(180deg, rgba(13, 13, 13, 0.4) 0%, rgba(13, 13, 13, 0.7) 100%);
}

/* ── Track: auto height, translates up by JS based on scroll progress ── */
.testimonials-track {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  will-change: transform;
}

/* ── Title (first viewport) ── */
.testimonials-title {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: clamp(56px, 10vw, 160px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  text-align: center;
}

.testimonials-title .line-red { color: var(--red); display: block; }
.testimonials-title .line-white { color: var(--white); display: block; }

/* ── Chat list ── */
.testimonials-chat {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 0 120px;
}

/* ── Each message: hidden, slides up + fades in when in view ── */
.chat-msg {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 75%;
  opacity: 0;
  transform: translate3d(0, 40px, 0) scale(0.92);
  filter: blur(4px);
  transition:
    opacity 0.75s var(--testimonials-ease),
    transform 0.75s var(--testimonials-ease),
    filter 0.75s var(--testimonials-ease);
  transition-delay: var(--msg-delay, 0s);
  will-change: transform, opacity, filter;
}

.chat-msg.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}

/* Client messages (left-aligned) */
.chat-msg--client {
  align-self: flex-start;
  transform-origin: bottom left;
}

/* Designer replies (right-aligned) */
.chat-msg--designer {
  align-self: flex-end;
  align-items: flex-end;
  transform-origin: bottom right;
}

/* ── Chat bubble styling ── */
.chat-bubble {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--white);
}

.chat-msg--client .chat-bubble {
  border-left: 2px solid var(--red);
  border-radius: 4px 18px 18px 18px;
}

.chat-msg--designer .chat-bubble {
  border-radius: 18px 4px 18px 18px;
  background: rgba(255, 255, 255, 0.05);
}

/* ── Meta info (avatar + name + role) ── */
.chat-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  margin-top: 6px;
}

.chat-msg--designer .chat-meta {
  justify-content: flex-end;
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.chat-author {
  font-weight: 600;
  color: var(--white);
  font-size: 13px;
}

.chat-role {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .testimonials-section { height: 420vh; }
  .testimonials-track { height: 420vh; }
}

@media (max-width: 640px) {
  .testimonials-section { height: auto; }
  .testimonials-sticky {
    position: relative;
    height: auto;
  }
  .testimonials-track {
    height: auto;
    transform: none !important;
  }
  .testimonials-title {
    height: auto;
    padding: 60px 0 20px;
    font-size: clamp(40px, 12vw, 72px);
  }
  .testimonials-chat {
    padding: 20px 0 60px;
  }
  .chat-msg { max-width: 92%; }
  .chat-bubble { padding: 14px 18px; font-size: 13px; }
  .testimonials-bg img { object-position: center center; }
}
