/* The reviews carousel with the glass cards that stack: the reviews of Quillmark, a docs app for product teams, on a
   black page. Behind the deck a soft glow (violet and cyan) gives the frosted glass something to blur; every card is
   a layer of glass with a light edge, a grain and a sheen that follows the hand. The cards all sit in the same grid
   cell and GSAP moves them (x, y, scale, rotation): the CSS only draws them. */
:root {
  --page: #000000;            /* the page */
  --ink: #f2f1f7;             /* the words */
  --muted: rgba(236, 234, 246, 0.56); /* the small words */
  --glass: rgba(255, 255, 255, 0.075); /* the body of the glass */
  --glass-low: rgba(255, 255, 255, 0.03); /* the glass at the bottom of the card */
  --edge: rgba(255, 255, 255, 0.13); /* the edge of the glass */
  --violet: #7b61ff;          /* the first glow */
  --cyan: #3cd6e8;            /* the second glow */
  --star: #ffc95c;            /* the stars */
  --frost: 22px;              /* the blur of the glass (the script sets it from BLUR) */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px 12px;
  overflow: hidden;
}

.reviews {
  --w: min(420px, 88vw);
  position: relative;
  width: var(--w);
  display: grid;
  gap: clamp(14px, 3.2vh, 26px);
  opacity: 0;
}

/* ---------------------------------------------------------------- the glow behind the glass */
.reviews__aura {
  position: absolute;
  inset: 4% -6% 22%;
  pointer-events: none;
  filter: blur(34px);
}

.aura {
  position: absolute;
  border-radius: 50%;
  opacity: 0.8;
}

.aura--violet {
  width: 62%;
  aspect-ratio: 1;
  left: 2%;
  top: 6%;
  background: radial-gradient(circle at 50% 50%, var(--violet), rgba(123, 97, 255, 0) 68%);
}

.aura--cyan {
  width: 54%;
  aspect-ratio: 1;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 50%, var(--cyan), rgba(60, 214, 232, 0) 66%);
  opacity: 0.62;
}

/* ---------------------------------------------------------------- the deck */
.deck {
  position: relative;
  display: grid;
  padding-top: var(--peek, 30px);
  outline: none;
  perspective: 1100px;
}

.deck:focus-visible::after {
  content: '';
  position: absolute;
  inset: calc(var(--peek, 30px) - 6px) -6px -6px;
  border-radius: 30px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

.card {
  grid-area: 1 / 1;
  position: relative;
  border-radius: 24px;
  padding: clamp(16px, min(5vw, 3.4vh), 24px);
  background: linear-gradient(168deg, var(--glass), var(--glass-low));
  -webkit-backdrop-filter: blur(var(--frost)) saturate(150%);
  backdrop-filter: blur(var(--frost)) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03),
    0 1px 1px rgba(0, 0, 0, 0.4),
    0 12px 24px -10px rgba(0, 0, 0, 0.55),
    0 34px 64px -26px rgba(0, 0, 0, 0.75);
  transform-origin: 50% 0%;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  will-change: transform;
  /* the cards behind show only their top edge: the rest fades out so it never draws lines through the glass in front */
  --keep: 100%;
  -webkit-mask-image: linear-gradient(180deg, #000 var(--keep), transparent calc(var(--keep) + 22%));
  mask-image: linear-gradient(180deg, #000 var(--keep), transparent calc(var(--keep) + 22%));
}

.card.is-held {
  cursor: grabbing;
}

/* the edge: one pixel of light, brighter on the top left, fading on the way down */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.08) 38%, rgba(255, 255, 255, 0.04) 70%, rgba(255, 255, 255, 0.16));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

/* the grain of the glass */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.07;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* the darker glass of the cards further back */
.card__shade {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(4, 3, 10, 0.18), rgba(4, 3, 10, 0.62));
  opacity: 0;
  pointer-events: none;
}

/* the sheen: a soft band of light that slides with the hand (--sx from -1 to 1) */
.card__sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}

.card__sheen::before {
  content: '';
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: 50%;
  width: 46%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.09) 45%, rgba(255, 255, 255, 0.13) 50%, rgba(255, 255, 255, 0));
  transform: translateX(calc(-50% + var(--sx, -0.55) * 150%)) rotate(14deg);
  opacity: var(--so, 0.7);
}

.card__mark {
  position: absolute;
  right: clamp(16px, min(5vw, 3.4vh), 24px);
  bottom: clamp(14px, min(4vw, 3vh), 22px);
  width: clamp(36px, min(11vw, 7vh), 48px);
  height: auto;
  fill: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.card__body {
  position: relative;
  display: grid;
  gap: clamp(12px, min(3.6vw, 2.4vh), 18px);
}

.card__top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stars {
  display: inline-flex;
  gap: 3px;
}

.star {
  position: relative;
  width: clamp(15px, min(4.4vw, 3vh), 18px);
  aspect-ratio: 1;
  display: block;
}

.star svg {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(15px, min(4.4vw, 3vh), 18px);
  height: clamp(15px, min(4.4vw, 3vh), 18px);
  display: block;
}

.star__base path {
  fill: rgba(255, 255, 255, 0.1);
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 0.8;
  stroke-linejoin: round;
}

.star__clip {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  overflow: hidden;
  display: block;
}

.star__fill {
  filter: drop-shadow(0 0 4px rgba(255, 201, 92, 0.45));
}

.star__fill path {
  fill: var(--star);
  stroke: #ffe3a3;
  stroke-width: 0.6;
  stroke-linejoin: round;
}

.card__score {
  font-size: 13px;
  font-weight: 620;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.card__verified {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 520;
  font-stretch: 110%;
  color: var(--muted);
  padding: 4px 9px 4px 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.card__verified svg {
  width: 14px;
  height: 14px;
}

.card__seal {
  fill: rgba(60, 214, 232, 0.2);
  stroke: rgba(130, 232, 244, 0.7);
  stroke-width: 0.9;
  stroke-linejoin: round;
}

.card__tick {
  fill: none;
  stroke: #c9f6fb;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card__quote {
  margin: 0;
  font-size: clamp(15px, min(4.3vw, 3.1vh), 18px);
  line-height: 1.45;
  font-weight: 430;
  font-stretch: 96%;
  letter-spacing: -0.006em;
  color: var(--ink);
  text-wrap: pretty;
}

.card__who {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: clamp(10px, min(3vw, 2vh), 14px);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.avatar {
  position: relative;
  flex: none;
  width: clamp(34px, min(10vw, 6.4vh), 40px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 680;
  font-stretch: 112%;
  letter-spacing: 0.02em;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 6px 14px -6px rgba(0, 0, 0, 0.7);
}

.avatar span {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.avatar--a { background: linear-gradient(140deg, #9a86ff, #5a3fd8); }
.avatar--b { background: linear-gradient(140deg, #5fe3f0, #237fa8); }
.avatar--c { background: linear-gradient(140deg, #b48cff, #3b7be0); }
.avatar--d { background: linear-gradient(140deg, #7cecd6, #4b57d6); }
.avatar--e { background: linear-gradient(140deg, #8f7bff, #2fb1cc); }

.card__names {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.card__mask {
  display: block;
  overflow: hidden;
  padding-bottom: 1px;
}

.card__name,
.card__role {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__name {
  font-size: 14px;
  font-weight: 620;
  font-stretch: 104%;
}

.card__role {
  font-size: 12.5px;
  font-weight: 450;
  color: var(--muted);
}

/* ---------------------------------------------------------------- the arrows and the dashes */
.controls {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.arrow {
  position: relative;
  width: clamp(38px, min(11vw, 7vh), 44px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.arrow__face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 8px 18px -10px rgba(0, 0, 0, 0.9);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arrow:focus-visible {
  outline: none;
}

.arrow:focus-visible .arrow__face {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 0 2px rgba(255, 255, 255, 0.6);
}

@media (hover: hover) {
  .arrow:hover .arrow__face {
    background: linear-gradient(170deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 10px 22px -10px rgba(123, 97, 255, 0.55);
  }
}

.dashes {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash {
  position: relative;
  width: 8px;
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.dash::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.16);
}

.dash__fill {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 3px;
  background: linear-gradient(90deg, #ffffff, #d9d2ff);
  box-shadow: 0 0 10px rgba(160, 140, 255, 0.45);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.dash:focus-visible {
  outline: none;
}

.dash:focus-visible::before {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
}
