/* ==========================================================================
   Section 2 — Proof in the Numbers, with Section 3 — Client Success Stories
   nested at its foot.
   Source of truth: design_handoff_sections/README.md ("Section 2", "Section 3").
   ========================================================================== */

.proof {
  --glow: radial-gradient(52% 40% at 50% 74%,
    rgba(168, 112, 28, .14) 0%, rgba(6, 5, 4, 0) 72%);
  --rd: 1.1s;   /* this section's reveals run slower than the 1s default */

  background: var(--black-proof);
  /* No bottom padding — the video wall below supplies the section's foot. */
  padding: var(--space-132) var(--gutter) 0;
}

/* --- Header --------------------------------------------------------------- */

.proof__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-26);
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.proof__lede { max-width: 60ch; }

/* --- Score columns -------------------------------------------------------- */

.proof__scores {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: var(--space-44);
  align-items: start;
  margin-top: 76px;
}

.proof__figure {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 82px;
  line-height: .86;
  letter-spacing: -.03em;
  /* Tabular as well as lining: the digits change during the count-up and would
     otherwise jitter as their widths differ. */
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: 'lnum' 1, 'onum' 0, 'tnum' 1;
}

.proof__rule {
  height: 1px;
  margin: 22px 0 16px;
  background: linear-gradient(90deg,
    rgba(217, 169, 58, .5) 0%, rgba(217, 169, 58, .08) 100%);
}

.proof__bureau {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(240, 233, 220, .8);
}

.proof__detail {
  margin-top: 7px;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(217, 169, 58, .8);
}

/* --- Screenshot frames ---------------------------------------------------
   The three source screenshots are different shapes and carry app chrome, so
   each is scaled and offset individually to make the row read as one. The
   window is a fixed height with the image overflowing it.

   These offsets are hand-tuned. Changing the window height, the frame padding
   or the image widths will re-expose the chrome they exist to hide. */

.proof__frame {
  margin-top: 30px;
  padding: 13px;
  background: var(--black-bar);
  border: 1px solid rgba(217, 169, 58, .34);
  box-shadow: var(--shadow-frame);
}

.proof__window {
  position: relative;
  height: 340px;
  overflow: hidden;
  background: #FFFFFF;
}

.proof__shot {
  position: absolute;
  display: block;
  filter: brightness(.96) contrast(1.03);
}

.proof__shot--1 { left: 1.5%; top: -64px; width: 97%; }
.proof__shot--3 { left: 8%;   top: -39px; width: 84%; }

/* Column 2 needs a second clip inside the window. The source screenshot has a
   third-party lender advertisement across rows 102–316; this inner box cuts it
   out while keeping the white margin balanced above and below. It cannot be
   flattened into a single offset — one box sets the visible band, the other
   positions the image within it. */
.proof__clip {
  position: absolute;
  left: 0;
  right: 0;
  top: 57px;
  height: 226px;
  overflow: hidden;
}

.proof__shot--2 { left: -9%; top: -98px; width: 118%; }

/* --- Caption -------------------------------------------------------------- */

.proof__caption {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 900px;
  margin: var(--space-56) auto 0;
}

.proof__caption::before,
.proof__caption::after {
  content: '';
  flex: 1;
  height: 1px;
}

.proof__caption::before {
  background: linear-gradient(90deg,
    rgba(217, 169, 58, 0) 0%, rgba(217, 169, 58, .28) 100%);
}

.proof__caption::after {
  background: linear-gradient(90deg,
    rgba(217, 169, 58, .28) 0%, rgba(217, 169, 58, 0) 100%);
}

.proof__caption span {
  /* Was flex: none, which forced the row to the text's full unwrapped width —
     624px inside a 390px viewport, and the whole document scrolled sideways. */
  flex: 0 1 auto;
  min-width: 0;
  font-family: var(--font-ui);
  font-weight: 300;
  /* 17px / 1.75 is the site's body scale — the handoff's 12.5px read as fine
     print under a row of 82px figures. */
  font-size: 17px;
  line-height: 1.75;
  color: rgba(246, 241, 230, .82);
  text-align: center;
  text-wrap: pretty;
}

/* ==========================================================================
   Section 3 — Client Success Stories (video wall)
   Nested at the foot of Proof and bled to both page edges.
   ========================================================================== */

.stories {
  /* The 1px grid gap over the parent's background is the hairline grid. */
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 100px calc(var(--gutter) * -1) 0;
  background: rgba(217, 169, 58, .26);
  border-top: 1px solid rgba(217, 169, 58, .26);
}

.stories__cell {
  position: relative;
  height: 640px;
  background: var(--black-card);
  overflow: hidden;
  cursor: pointer;
}

.stories__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--black-card);
}

/* --- Idle state ----------------------------------------------------------
   Sits over the poster frame until the cell is played; js/video-wall.js hides
   it on play and restores it on pause or on a rejected play() promise. */

.stories__idle {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(64% 44% at 50% 42%,
    rgba(168, 112, 28, .16) 0%, rgba(10, 8, 6, 0) 72%);
}

.stories__play {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  width: 74px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* The one rounded thing in the entire design. */
  border-radius: 50%;
  border: 1px solid rgba(217, 169, 58, .55);
  background: rgba(6, 5, 4, .42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* Triangle from borders rather than an asset or an icon font. */
.stories__play::before {
  content: '';
  margin-left: 6px;
  border-left: 19px solid var(--gold-figure);
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
}

/* --- Caption -------------------------------------------------------------- */

.stories__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 80px 26px 28px;
  pointer-events: none;
  /* Firmer than the handoff's: the title and body sit over moving footage that
     can be bright anywhere, so the base has to hold on its own. */
  background: linear-gradient(to top,
    rgba(6, 5, 4, .98) 0%,
    rgba(6, 5, 4, .94) 30%,
    rgba(6, 5, 4, .72) 58%,
    rgba(6, 5, 4, 0) 100%);
}

/* Its own opaque plate. The kicker sits at the top of the caption block where
   the scrim is still transparent, so gold-on-video was unreadable whatever the
   footage happened to be doing behind it. */
.stories__kicker {
  align-self: flex-start;
  padding: 8px 13px;
  background: var(--black-bar);
  border-left: 2px solid var(--gold-diamond);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-figure);
}

.stories__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.14;
  letter-spacing: -.012em;
  color: var(--bone);
  text-wrap: pretty;
}

.stories__body {
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(246, 241, 230, .62);
  text-wrap: pretty;
}

/* The clickable surface is a real button rather than a click handler on the
   cell: it is reachable by keyboard, announced, and picks up the focus ring
   for free. Transparent and sized to the whole cell. */
.stories__hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius);
}

.stories__hit:focus-visible {
  outline: var(--focus-ring);
  outline-offset: calc(var(--focus-offset) * -3);
}

/* Once playing, the native controls need the pointer, so the hit area steps
   back to the top strip only. */
.stories__cell.is-playing .stories__hit { bottom: 25%; }

/* While a cell is playing its overlay is out of the way entirely. */
.stories__cell.is-playing .stories__idle,
.stories__cell.is-playing .stories__caption { display: none; }

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 1024px) {
  /* Score columns hold 3-up until ~900px; the frames scale with them. */
  .proof__figure { font-size: 64px; }
  .proof__window { height: 280px; }

  /* Video wall: 2-up with the third full width beneath. */
  .stories { grid-template-columns: repeat(2, 1fr); }
  .stories__cell { height: 520px; }
  .stories__cell:last-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .proof__scores {
    grid-template-columns: 1fr;
    row-gap: var(--space-72);
  }

  /* The crops are tuned to the 340px window — keep it when they stack. */
  .proof__window { height: 340px; }
  .proof__figure { font-size: 72px; }
  .proof__frame { max-width: 460px; }
}

@media (max-width: 768px) {
  .proof { padding-top: var(--space-88); }

  /* The rules either side eat width the sentence needs. */
  .proof__caption {
    margin-top: var(--space-38);
    padding: 0 var(--space-10);
  }
  .proof__caption::before,
  .proof__caption::after { display: none; }
  .proof__caption span { font-size: 15px; }
  .proof__figure { font-size: 58px; }

  /* Centred, not left-ranged. Three columns side by side read as columns and
     want a common left edge; one card at a time in a rail is its own object,
     and a left-ranged number over a full-width screenshot just looks adrift. */
  .proof__col { text-align: center; }

  /* The rule fades left-to-right, which only reads as deliberate when it
     starts at a left edge the type shares. Centred, it becomes symmetrical. */
  .proof__rule {
    width: 72%;
    margin-inline: auto;
    background: linear-gradient(90deg,
      rgba(217, 169, 58, .08) 0%,
      rgba(217, 169, 58, .5) 50%,
      rgba(217, 169, 58, .08) 100%);
  }

  /* The crops are tuned to a 340px window, so the frame keeps its height and
     the row tightens elsewhere instead. */
  .proof__frame { margin-top: var(--space-22); max-width: none; }
  .proof__scores { row-gap: var(--space-56); }
  .proof__rule { margin: 16px 0 12px; }

  .stories { grid-template-columns: 1fr; }
  .stories__cell { height: 460px; }
  .stories__cell:last-child { grid-column: auto; }
}
