/* reviews / testimonials — floating cards that type themselves out */

#reviews {
  --ink: #f5f2ec;
  --ink-2: rgba(245,242,236,.78);
  --ink-3: rgba(245,242,236,.48);
  --card-bg: rgba(128,122,114,.26);
  --green: #93b87e;

  position: relative;
  overflow: hidden;
  padding: 120px 0 110px;
  isolation: isolate;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
#reviews * { box-sizing: border-box; }

.reviews__inner { max-width: 1408px; margin: 0 auto; padding: 0 64px; } /* 1280 content, lines up with the other sections */
.reviews__frame { position: relative; height: 600px; }
.reviews__copy { max-width: 380px; }

.reviews__eyebrow { margin: 0 0 28px; font-size: 11px; letter-spacing: .2em; color: rgba(255,255,255,.6); }
#reviews h2 { margin: 0; font-weight: 400; font-size: 3rem; line-height: 1; letter-spacing: 0; }
#reviews h2 em { font-family: var(--serif); font-style: italic; display: block; line-height: 1; }
@media (min-width: 768px) {
  #reviews h2 { font-size: 3.7rem; }
}
.reviews__sub {
  position: absolute;
  z-index: 3;
  top: 46px;
  left: calc(69.3% + 340px - 360px);   /* right edge lines up with slot 2 */
  width: 360px;
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  color: rgba(255,255,255,.8);
}

.reviews__stage { position: absolute; inset: 0; z-index: 2; }
.reviews__slot { position: absolute; }
.reviews__slot[data-slot="0"] { top: 225px; left: 45.5%; }
.reviews__slot[data-slot="1"] { top: 304px; left: 22.2%; }
.reviews__slot[data-slot="2"] { top: 367px; left: 69.3%; }
.reviews__slot[data-slot="3"] { top: 454px; left: 1.4%; }
.reviews__slot[data-slot="4"] { top: 458px; left: 52.5%; }


.review {
  position: relative;
  width: 340px;
  padding: 20px 22px 22px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  border-radius: 12px;
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(26px) saturate(115%);
  backdrop-filter: blur(26px) saturate(115%);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.65);
  opacity: 0;
  transform: translateY(18px);
  filter: blur(6px);
  transition: opacity 1.1s var(--ease-out), transform 1.4s var(--ease-out), filter 1.1s var(--ease-out);
}
.review.is-in { opacity: 1; transform: none; filter: none; }
.review.is-out {
  opacity: 0;
  transform: translateY(-10px);
  filter: blur(6px);
  transition: opacity .9s ease, transform 1s ease, filter .9s ease;
}

.review__avatar { position: relative; flex: none; width: 52px; height: 52px; }
.review__face {
  position: absolute;
  inset: 5px;
  overflow: hidden;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: italic 500 17px/1 var(--serif);
  color: var(--ink);
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.28), rgba(255,255,255,.06));
}
.review__face img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.85); }

/* ring draws itself, 151 ≈ circumference of r=24 */
.review__ring { position: absolute; inset: 0; width: 52px; height: 52px; transform: rotate(-90deg); }
.review__ring circle { fill: none; stroke: var(--green); stroke-width: 1.3; stroke-linecap: round; stroke-dasharray: 151; stroke-dashoffset: 151; }
.review.is-playing .review__ring circle { transition: stroke-dashoffset 1.2s var(--ease-out) .3s; stroke-dashoffset: 0; }

.review__check {
  position: absolute;
  right: -2px;
  top: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--green);
  color: #1a1612;
  display: grid;
  place-items: center;
  transform: scale(0);
}
.review__check svg { width: 9px; height: 9px; }
.review.is-playing .review__check { transition: transform .6s cubic-bezier(.3,1.6,.5,1) 1.1s; transform: scale(1); }

.review__body { flex: 1; min-width: 0; }
.review__name { margin-top: 4px; font-size: 12px; font-weight: 500; letter-spacing: .01em; color: var(--ink); }
.review__name b { display: block; margin-top: 2px; font-weight: 400; font-size: 11.5px; color: var(--ink-3); }
.review__quote { margin-top: 10px; font-size: 13px; line-height: 1.55; font-weight: 300; color: var(--ink-2); }

/* invisible full copy holds the height so the card doesn't grow while typing */
.typed { position: relative; display: block; }
.typed__ghost { visibility: hidden; }
.typed__live { position: absolute; left: 0; top: 0; right: 0; }


@media (max-width: 900px) {
  #reviews { padding: 84px 0 70px; }
  .reviews__inner { padding: 0 20px; }
  .reviews__frame { height: auto; }
  .reviews__copy { max-width: none; }
  .reviews__sub { position: static; width: auto; max-width: none; margin-top: 26px; }
  .reviews__stage { position: relative; inset: auto; height: auto; margin-top: 36px; display: flex; flex-direction: column; gap: 14px; }
  .reviews__slot { position: relative; inset: auto !important; min-height: 150px; }
  .reviews__slot[data-slot="3"],
  .reviews__slot[data-slot="4"] { display: none; }
  .reviews__slot[data-slot="1"] { align-self: flex-end; }
  .review { width: min(340px, 100%); }
}
@media (prefers-reduced-motion: reduce) {
  .review, .review.is-out { transform: none; filter: none; transition: opacity .4s; }
}
