/* ============================================================
   REVIEWS — AFMBP-2310 (the owner's simpler design; before it: AFMBP-2250, 2265, 2267, 2269, 2283,
   2284, 2285, 2299)
   Figma 2251:139 (desktop, 1920x277) and 2778:3435 (mobile, 402x300): "Trusted by pros across the
   country" over a US-map outline on the dark photo band, and one quote card at a time growing in
   with a small bounce, holding, and shrinking away — to the right of the title on desktop, below it
   on phones. Nothing moves until the section is on screen (review-carousel.js adds .reviews--on),
   so the first card, Gus's, is what a visitor arriving at the section sees.

   Everything is placed in Figma pixels: --u is one Figma pixel, set on the stage (.reviews__inner).
     desktop: the title + card group (1481x277, centered), --u <= 1px so it keeps 24px from the
              page edges (1440: 0.94);
     phones:  the 402x300 mobile frame, --u = the screen's width / 402, at most 1.5px (tablets).

   AFMBP-2324 (owner): the title's type is the How It Works band title's ("More jobs. Less
   hassle.": the band__title classes, so it follows that title's sizes at every width), and the
   quotes are 18px / 1.4 like the cards' body text ("You worked your ass off all day..."). Text no
   longer scales with --u, so each card is at least its Figma size and grows taller when its quote
   needs the room; the stage grows with the tallest card.
   ============================================================ */

/* ===== Background, every width (AFMBP-2345, owner: "removed the background image"): no photo.
   styles.css fills the section with #1E1E1E and Figma's 77% black overlay takes it to #070707; the
   US-map outline is all that shows behind the title and the card. */
.reviews { padding: 0; }
.reviews__overlay { background: rgba(0, 0, 0, 0.77); }

/* ===== The stage: the Figma frame (mobile) or the title + card group (desktop) =====
   It forms no stacking layer of its own (z-index auto, not styles.css's 1), so the cards can sit
   above the How It Works band below it: see .rq-list. Desktop: the Figma band, 277 tall, with the
   card list 40.5 from its top and bottom and centered between them; a card taller than Figma's
   makes the band taller by as much. */
.reviews__inner {
  --u: min(1px, calc((100cqw - 48px) / 1481));
  position: relative; z-index: auto;
  display: flex; align-items: center; max-width: none;
  width: calc(1481 * var(--u)); min-height: calc(277 * var(--u)); height: auto;
  margin: 0 auto; padding: calc(40.5 * var(--u)) 0;
}

/* The US-map outline (white at 33%), cropped by the section (.reviews overflow). Desktop: centered
   on the band (AFMBP-2345, owner: "the outline of the united states centered"); phones: Figma's
   place (2778:3435). */
.rv-map {
  position: absolute; pointer-events: none; max-width: none;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: calc(1853.97 * var(--u)); height: calc(1045.04 * var(--u));
}

/* "Trusted by pros / across the country" (AFMBP-2324): the type is the How It Works band
   title's — the band__title / marker band__title__hl classes in index.html give it that title's
   sizes at every width (hiw-phone.css) and "TRUSTED" in the marker's capitals like "MORE JOBS.".
   This keeps the Reviews look: "Trusted" in yellow and inline, so the title stays two lines, and
   its place: centered over x 209 of the group and in the band's height (desktop), centered on
   top (phones). Line 1 keeps Figma's trailing space after "pros" (the &nbsp;). */
.reviews .rv-title {
  position: absolute; left: calc(209 * var(--u)); top: 50%; transform: translate(-50%, -50%);
  margin: 0; white-space: nowrap; text-align: center;
}
.reviews .rv-title .rv-title__hl { display: inline; margin: 0; color: #fcbd11; }

/* ===== Quote cards (Figma Quote 1 2776:3354: 919x196, white, 12px radius) =====
   One card at a time, 919 wide and at least 196 tall (taller when its quote needs it), at x 562 of
   the group, centered in the band:

     card:  Quote 1  Quote 2    Quote 3     Quote 4    (animation-delay = its turn's start)
     turn:  0-7.96s  8.0-15.9s  15.9-23.9s  23.9-31.8s (from the section's start)

   In its turn a card fades in as it grows from 80% to 104% (0.075s-0.525s, eased out), settles
   to 100% (to 0.775s) — the owner's "20% larger, then 5% smaller" bounce around the Figma size —
   holds until 6.175s, and shrinks back to 80% as it fades (eased in): shown 6.7s, then 1.26s
   before the next one.

   The list sits above the How It Works band (z-index 4 over its 3, hiw-phone.css; still under the
   sticky header's 100): on desktop that band's 3D phone pokes up into this section, and between
   about 1280px and 1440px wide it would otherwise draw over the card's bottom-left corner (up to
   12px at the top of the bounce). The map and the title stay under the phone, as before. */
.rq-list {
  position: relative; z-index: 4; margin: 0 0 0 calc(562 * var(--u)); padding: 0; list-style: none;
  display: grid; align-items: center;
}
.rq {
  --rq-s0: 0.8;
  grid-area: 1 / 1;
  position: relative;
  /* The quote is the card's one in-flow child, centered between the header (84 from the top)
     and 22 from the bottom like Figma's (on y 129); a longer quote makes the card taller. */
  display: flex; flex-direction: column; justify-content: center;
  width: calc(919 * var(--u));
  min-height: calc(196 * var(--u));
  padding: calc(84 * var(--u)) calc(46 * var(--u)) calc(22 * var(--u)) calc(260 * var(--u));
  background: #fff;
  border-radius: calc(12 * var(--u));
  box-shadow: 0 calc(5 * var(--u)) calc(7.5 * var(--u)) rgba(0, 0, 0, 0.19);
  opacity: 0;
  transform: scale(var(--rq-s0));
  animation: rq-pop 31.84444s linear infinite backwards;
  will-change: transform, opacity;
}
.rq--1 { animation-delay: 0s; }
.rq--2 { animation-delay: 7.96111s; }
.rq--3 { animation-delay: 15.92222s; }
.rq--4 { animation-delay: 23.88333s; }

@keyframes rq-pop {
  0%, 0.2355% {                        /* 0s-0.075s: hidden */
    opacity: 0; transform: scale(var(--rq-s0));
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);      /* grows: eased out */
  }
  1.6486% {                            /* 0.525s: the top of the bounce */
    opacity: 1; transform: scale(1.04348);
    animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1);      /* settles: eased in and out */
  }
  2.4337%, 19.3911% {                  /* 0.775s-6.175s: the Figma size */
    opacity: 1; transform: scale(1);
    animation-timing-function: cubic-bezier(0.64, 0, 0.78, 0);      /* shrinks: eased in */
  }
  21.2753%, 100% {                     /* 6.775s on: hidden */
    opacity: 0; transform: scale(var(--rq-s0));
  }
}

/* Until review-carousel.js sees the section, every card waits at its first frame; without
   JavaScript a <noscript> rule in index.html lets them run from page load instead. */
.reviews:not(.reviews--on) .rq { animation-play-state: paused; }

/* Quote-mark watermarks (navy at 16%, Figma 2776:3384 / 2776:3382: the closing one is the opening
   glyph mirrored), above the quote like in Figma; the closing one keeps its distance from the
   card's bottom, so it stays by the quote's end when the card grows. */
.rq::before, .rq::after {
  content: ""; position: absolute; z-index: 1; pointer-events: none;
  background: no-repeat center / 100% 100%;
}
.rq::before { background-image: url("assets/reviews/quote-open.svg"); left: calc(216 * var(--u)); top: calc(85 * var(--u)); width: calc(58 * var(--u)); height: calc(48 * var(--u)); }
.rq::after { background-image: url("assets/reviews/quote-close.svg"); left: calc(815 * var(--u)); bottom: calc(28 * var(--u)); width: calc(56 * var(--u)); height: calc(46 * var(--u)); transform: scaleX(-1); }

/* Figma geometry, card-relative, in Figma pixels (--u). Quote 1 is Figma 2776:3354; Quotes 2-4
   keep their earlier desktop photo and logo places until the owner draws them. */
.rq__photo { position: absolute; display: block; object-fit: cover; }
.rq--1 .rq__photo { left: calc(37 * var(--u)); top: calc(10 * var(--u)); width: calc(161 * var(--u)); height: calc(161 * var(--u)); border-radius: calc(41 * var(--u)); }
.rq--2 .rq__photo { left: calc(17 * var(--u)); top: calc(16 * var(--u)); width: calc(189 * var(--u)); height: calc(160 * var(--u)); border-radius: calc(47 * var(--u)); }
.rq--3 .rq__photo { left: calc(22 * var(--u)); top: calc(7 * var(--u));  width: calc(161 * var(--u)); height: calc(167 * var(--u)); border-radius: calc(26 * var(--u)); }
.rq--4 .rq__photo { left: calc(31 * var(--u)); top: calc(18 * var(--u)); width: calc(161 * var(--u)); height: calc(158 * var(--u)); border-radius: calc(34 * var(--u)); }

.rq__who { position: absolute; inset: 0; }
/* Name and stars share a row: the stars sit at Figma's x unless the name is wider than Figma's
   Roboto renders it (Macs and iPhones fall back to Inter), then a gap after it. */
.rq {
  --rq-x: 260; --rq-name-top: 18; --rq-name-h: 34; --rq-name-size: 26; --rq-name-lh: 20.8;
  --rq-name-min: 86; --rq-name-gap: 8; --rq-stars-top: 22; --rq-stars-w: 105; --rq-stars-h: 21;
}
.rq--2 { --rq-name-top: 15; }
.rq__head { position: absolute; left: calc(var(--rq-x) * var(--u)); top: calc(var(--rq-name-top) * var(--u)); margin: 0; display: flex; align-items: flex-start; }
.rq__name {
  min-width: calc(var(--rq-name-min) * var(--u)); height: calc(var(--rq-name-h) * var(--u)); margin-right: calc(var(--rq-name-gap) * var(--u));
  display: flex; align-items: center;
  font-family: 'Roboto', var(--font); font-size: calc(var(--rq-name-size) * var(--u)); font-weight: 400; line-height: calc(var(--rq-name-lh) * var(--u));
  color: var(--navy); white-space: nowrap;
}
.rq__stars { display: block; flex: none; margin-top: calc((var(--rq-stars-top) - var(--rq-name-top)) * var(--u)); width: calc(var(--rq-stars-w) * var(--u)); height: calc(var(--rq-stars-h) * var(--u)); }
/* The trade, state line: Inter, 2px (2pt) larger than Figma's Poppins size (owner, AFMBP-2327). At
   that size a long one ("General Contractor, Massachusetts") no longer fits on one line of a phone
   card, so it wraps inside the card: on desktop before the logo (605), on phones at the quote's
   right inset. */
.rq__meta {
  position: absolute; left: calc(259.78 * var(--u)); top: calc(51 * var(--u)); margin: 0;
  max-width: calc((605 - 259.78 - 16) * var(--u));
  font-family: var(--font); font-size: calc(14 * var(--u) + 2px); line-height: 1.5; color: var(--gray);
}
.rq__logo { position: absolute; object-fit: contain; }
.rq--1 .rq__logo { left: calc(605 * var(--u)); top: calc(28 * var(--u)); width: calc(268 * var(--u)); height: calc(32.11 * var(--u)); }
.rq--2 .rq__logo { left: calc(798 * var(--u)); top: calc(20 * var(--u)); width: calc(71 * var(--u));  height: calc(55 * var(--u)); }
.rq--4 .rq__logo { left: calc(689 * var(--u)); top: calc(20 * var(--u)); width: calc(179.785 * var(--u)); height: calc(20 * var(--u)); }

/* The quote (AFMBP-2324): 18px / 1.4 navy Inter, the size of the cards' body text (.card__body,
   styles.css); phones Figma's 12.5 (below). One phrase in semibold; Gus's in bold, as his phone card
   draws it. Every card says the same at every width (AFMBP-2345: the owner, "fix the desktop
   quotes"). */
.rq__text {
  position: relative; margin: 0;
  font-family: var(--font); font-size: 18px; line-height: 1.4; color: var(--navy);
}
.rq__text p { margin: 0; }
.rq__text strong { font-weight: 600; }
.rq__text .rq__b { font-weight: 700; }   /* Gus: Figma sets "real opportunities" in Inter Bold */

/* ===== Phones and tablets: the Figma mobile frame (2778:3435, 402x300) and Mobile Quote 1-4
   (2778:3642, 2778:3795, 2778:3685, 2778:3726: 243.42x177.98), the title on top and the card
   centered below it. ===== */
@media (max-width: 1023px) {
  /* The title on top (14 down), the card 14 below it, 25.57 to the bottom like Figma's; the frame
     is at least Figma's 300 tall and grows with the tallest card. */
  .reviews__inner {
    --u: min(1.5px, calc(100cqw / 402));
    flex-direction: column; align-items: center;
    width: calc(402 * var(--u)); min-height: calc(300 * var(--u));
    padding: calc(14 * var(--u)) 0 calc(25.57 * var(--u));
  }
  .rv-map { left: calc(-325 * var(--u)); top: calc(-154.47 * var(--u)); transform: none; width: calc(875.79 * var(--u)); height: calc(493.66 * var(--u)); }
  .reviews .rv-title { position: relative; left: auto; top: auto; transform: none; }
  .rq-list { margin: calc(14 * var(--u)) 0 0; align-items: start; }   /* every card's top stays put */
  /* The quote between the photo (99.8 from the top) and 17 from the bottom, centered on Figma's
     y 130.4 when it fits. */
  .rq {
    width: calc(243.42 * var(--u)); min-height: calc(177.98 * var(--u));
    padding: calc(99.8 * var(--u)) calc(14.37 * var(--u)) calc(17 * var(--u)) calc(23.8 * var(--u));
    border-radius: calc(5.949 * var(--u));
    box-shadow: 0 calc(2.479 * var(--u)) calc(3.718 * var(--u)) rgba(0, 0, 0, 0.19);
    --rq-x: 114.03; --rq-name-top: 6.94; --rq-name-h: 16.856; --rq-name-size: 12.89; --rq-name-lh: 10.312;
    --rq-name-min: 37.67; --rq-name-gap: 3.97; --rq-stars-top: 10.91; --rq-stars-w: 52.06; --rq-stars-h: 10.41;
  }
  .rq::before { left: calc(12.37 * var(--u)); top: calc(100.22 * var(--u)); width: calc(28.75 * var(--u)); height: calc(23.8 * var(--u)); }
  .rq::after { left: calc(197.79 * var(--u)); bottom: calc(12.81 * var(--u)); width: calc(27.76 * var(--u)); height: calc(22.81 * var(--u)); }
  .rq--1 .rq__photo { left: calc(18 * var(--u)); top: calc(8 * var(--u)); width: calc(80 * var(--u)); height: calc(80 * var(--u)); border-radius: calc(20.33 * var(--u)); }
  .rq--2 .rq__photo { left: calc(17.85 * var(--u)); top: calc(7.93 * var(--u)); width: calc(98.69 * var(--u)); height: calc(83.26 * var(--u)); border-radius: calc(23.3 * var(--u)); }
  .rq--3 .rq__photo { left: calc(18 * var(--u)); top: calc(8 * var(--u)); width: calc(85 * var(--u)); height: calc(88 * var(--u)); border-radius: calc(12.89 * var(--u)); }
  .rq--4 .rq__photo { left: calc(24 * var(--u)); top: calc(13 * var(--u)); width: calc(80 * var(--u)); height: calc(78 * var(--u)); border-radius: calc(16.86 * var(--u)); }
  /* AFMBP-2345 (Mobile Quote 1-4, 10-19): the trade over the state, Inter 10 / 9, no comma; the
     stars at Figma's fixed place (x 161, y 9, 66.33 x 13.27; here from the name row at 114.03,
     6.94, and free of the global img max-width, which would squeeze them to that row's width),
     not after the name. */
  .rq__meta { left: calc(114.03 * var(--u)); top: calc(25.29 * var(--u)); max-width: none; white-space: nowrap; }
  .rq__meta .rq__trade, .rq__meta .rq__state { display: block; }
  .rq__meta .rq__sep { display: none; }
  .rq__trade { font-size: calc(10 * var(--u)); line-height: calc(10.411 * var(--u)); }
  .rq__state { font-size: calc(9 * var(--u)); line-height: calc(13 * var(--u)); }
  .rq__stars { position: absolute; margin: 0; max-width: none; left: calc((161 - 114.03) * var(--u)); top: calc((9 - 6.94) * var(--u)); width: calc(66.33 * var(--u)); height: calc(13.266 * var(--u)); }
  .rq--1 .rq__logo { left: calc(114.03 * var(--u)); top: calc(68.5 * var(--u)); width: calc(114.52 * var(--u)); height: calc(13.88 * var(--u)); }
  .rq--2 .rq__logo { left: calc(146 * var(--u)); top: calc(53.55 * var(--u)); width: calc(51 * var(--u)); height: calc(40 * var(--u)); }
  .rq--4 .rq__logo { left: calc(114.03 * var(--u)); top: calc(58 * var(--u)); width: calc(111.55 * var(--u)); height: calc(12.39 * var(--u)); }
  .rq--4 { padding-left: calc(24 * var(--u)); padding-right: calc(11.42 * var(--u)); }
  /* The quote at Figma's 12.5 (scaling with the frame like the rest of the card, AFMBP-2345: the
     owner's phone cards replace AFMBP-2324's 18px here), normal line height; it fits Figma's card. */
  .rq__text { font-size: calc(12.5 * var(--u)); line-height: normal; }
}

/* respect users who prefer less motion: the cards only fade */
@media (prefers-reduced-motion: reduce) {
  .rq { transform: none !important; }
}
