/* -------------------- Results section pin (desktop) --------------------
   Pins the "Why it matters" section briefly so users can't fast-scroll
   past the "4 out of 5" headline animation. Same pattern as how-it-works:
   tall outer .results-pin + sticky inner .results-sticky that fills the
   viewport. Mobile keeps natural scroll because the content stack is
   taller than 100vh on phones. */
.results-pin {
  position: relative;
}
.results-sticky {
  position: relative;
}
@media (min-width: 992px) {
  .results-pin {
    /* ~1.75 viewport heights of scroll travel. Enough time for the
       staggered reveal (~3s) to play before user can scroll past. */
    height: 175vh;
  }
  .results-sticky {
    position: sticky;
    top: 72px;
    height: calc(100vh - 72px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Breathing space so the framed card doesn't kiss the viewport edges */
    padding: 1.5rem 0;
    overflow: visible;
  }
  /* The container becomes a rounded "video frame" card — gives the
     section the look of an embedded player so users instinctively read
     it as the focal panel rather than just another page section. */
  .results-sticky > .container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    height: 100%;
    background:
      radial-gradient(circle at 20% 0%, rgba(45, 212, 191, 0.07) 0%, transparent 55%),
      radial-gradient(circle at 85% 100%, rgba(15, 118, 110, 0.05) 0%, transparent 55%),
      linear-gradient(180deg, #FFFFFF 0%, #FBFCFB 100%);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow:
      0 30px 60px -20px rgba(15, 23, 42, 0.18),
      0 12px 24px -8px rgba(15, 23, 42, 0.08),
      var(--hi-top);
    /* Inner padding gives the headline + content room from the frame edges */
    padding: clamp(2rem, 5vh, 3.5rem) clamp(1.5rem, 5vw, 3.5rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    position: relative;
  }
  /* The section's own vertical padding is redundant when pinned —
     the sticky already fills 100vh. Trim it. */
  .section--cream#results { padding: 0; }

  /* -------------------- Tighten content inside the framed pin --------
     The headline + h2 + two scene cards must all fit comfortably
     inside the 100vh frame at any common desktop height (720–1440).

     IMPORTANT: shrink overrides are scoped to `.is-revealed` so the
     INITIAL state keeps the big centered "4 out of 5" curtain.
     Sequence is: big & centered → shrink + move to top → content
     fades in below. */

  /* Shrunken-headline size (only after .is-revealed) — slightly
     smaller than the original 2-3.25rem so there's room for content */
  .results-sticky .results-stage.is-revealed .results-headline strong {
    font-size: clamp(1.6rem, 3.2vw, 2.5rem);
  }
  .results-sticky .results-stage.is-revealed .results-headline {
    margin-bottom: 1.25rem;
  }
  /* Everything inside .results-content only exists once .is-revealed
     fires (it has opacity:0 initially), so these scoped overrides
     don't need an .is-revealed prefix but it's harmless to add. */
  .results-sticky .results-content .section-head {
    margin-bottom: 1.25rem;
  }
  .results-sticky .results-content .section-head h2 {
    font-size: clamp(1.2rem, 2.2vw, 1.9rem);
    line-height: 1.18;
    margin: 0.5rem 0 0;
  }
  .results-sticky .results-flip {
    gap: 1rem;
    margin: 0 auto 1rem;
    max-width: 900px;
  }
  .results-sticky .results-scene {
    padding: 1.1rem 1.1rem;
    gap: 0.55rem;
  }
  .results-sticky .results-scene-tag {
    margin-bottom: 0.1rem;
    font-size: 0.7rem;
    padding: 0.18rem 0.6rem;
  }
  .results-sticky .results-scene p {
    font-size: 0.85rem;
    line-height: 1.45;
  }
  .results-sticky .results-people {
    transform: scale(0.85);
    transform-origin: center;
    margin: -0.25rem 0;
  }
  .results-sticky .results-flip-arrow {
    transform: scale(0.85);
  }
  .results-sticky .results-source {
    font-size: 0.65rem;
    margin-top: 0.25rem;
  }

  /* Short laptops (<=800px tall) — squeeze a bit more */
  @media (max-height: 800px) {
    .results-sticky > .container {
      padding: clamp(1.5rem, 3vh, 2.25rem) clamp(1.25rem, 4vw, 2.5rem);
    }
    .results-sticky .results-stage.is-revealed .results-headline strong {
      font-size: clamp(1.4rem, 2.6vw, 2rem);
    }
    .results-sticky .results-content .section-head h2 {
      font-size: clamp(1.05rem, 1.9vw, 1.55rem);
    }
    .results-sticky .results-content .section-head { margin-bottom: 0.85rem; }
    .results-sticky .results-stage.is-revealed .results-headline { margin-bottom: 0.85rem; }
    .results-sticky .results-flip { gap: 0.75rem; margin-bottom: 0.65rem; }
    .results-sticky .results-scene { padding: 0.85rem 0.95rem; gap: 0.4rem; }
    .results-sticky .results-scene p { font-size: 0.8rem; line-height: 1.4; }
    .results-sticky .results-people { transform: scale(0.75); margin: -0.5rem 0; }
  }
}

/* -------------------- Results stage (headline shrink reveal) -------------------- */
/* The "Why it matters" section opens with the "4 out of 5" headline at full
   size, vertically centered. After ~1.8s it shrinks to a smaller persistent
   stat at the top and the rest of the section fades in below. */
.results-stage {
  position: relative;
  text-align: center;
  /* Initial state: tall + big top padding so the (only visible) headline
     lands near vertical center. Both shrink together on reveal. */
  min-height: min(70vh, 540px);
  padding-top: clamp(6rem, 24vh, 14rem);
  transition:
    min-height 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    padding-top 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.results-stage.is-revealed {
  min-height: 0;
  padding-top: 0;
}
@media (max-width: 767px) {
  .results-stage {
    min-height: min(58vh, 460px);
    padding-top: clamp(4.5rem, 20vh, 10rem);
  }
}

.results-headline {
  font-family: var(--serif-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--heading);
  line-height: 1.05;
  max-width: 920px;
  margin: 0 auto;
}
.results-headline strong {
  display: block;
  /* Initial (curtain) size — the hero stat */
  font-size: clamp(3rem, 11vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  margin-bottom: 0.85rem;
  transition:
    font-size 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    margin-bottom 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Red "4" — emphasizes the magnitude of the stat (4 out of every 5
   customers won't be yours unless you respond first). */
.rh-num {
  display: inline-block;
  background: linear-gradient(135deg, #DC2626 0%, #EF4444 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  /* background-clip:text paints exactly up to the glyph bounding box;
     italic-leaning numerals + negative letter-spacing on the parent can
     visually clip the right edge. Tiny padding gives the glyph room. */
  padding: 0 0.06em;
  margin: 0 -0.06em; /* keep visual layout the same */
}
/* "out of" — solid heading color so the eye is drawn to the numbers */
.rh-of {
  display: inline-block;
  margin: 0 0.32em; /* whitespace between adjacent inline-blocks collapses */
  color: var(--heading);
}
/* "5" — teal gradient, mirroring the red "4" treatment */
.rh-five {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-bright) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  padding: 0 0.06em;
  margin: 0 -0.06em;
}
.results-headline .rh-sub {
  display: block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(1.05rem, 2.4vw, 1.75rem);
  line-height: 1.3;
  color: var(--muted-strong);
  letter-spacing: -0.005em;
  max-width: 22ch;
  margin: 0 auto;
  transition:
    font-size 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    max-width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Three-beat staggered reveal — parts start hidden, fade + slide in once
   the stage enters viewport (gets .is-active). Animation only runs on
   the curtain phase; .is-revealed shrink uses the existing transitions. */
.rh-num,
.rh-of,
.rh-five,
.results-headline .rh-sub {
  opacity: 0;
  transform: translateY(14px);
}
.results-stage.is-active .rh-num,
.results-stage.is-active .rh-of,
.results-stage.is-active .rh-five,
.results-stage.is-active .results-headline .rh-sub {
  animation: rhAppear 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.results-stage.is-active .rh-num            { animation-delay: 0.15s; }
.results-stage.is-active .rh-of             { animation-delay: 0.85s; }
.results-stage.is-active .rh-five           { animation-delay: 0.85s; }
.results-stage.is-active .results-headline .rh-sub { animation-delay: 1.55s; }

@keyframes rhAppear {
  to { opacity: 1; transform: none; }
}

/* Shrunken persistent state — same elements, just smaller */
.results-stage.is-revealed .results-headline {
  margin-bottom: 2.25rem;
}
.results-stage.is-revealed .results-headline strong {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  margin-bottom: 0.4rem;
}
.results-stage.is-revealed .results-headline .rh-sub {
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  max-width: 36ch;
}

.results-content {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.7s ease 0.3s,
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
}
.results-stage.is-revealed .results-content {
  opacity: 1;
  transform: none;
}

/* Two-scene "flip" layout — Without RBS (4 lost) vs With RBS (4 won).
   Same visual on both sides, colors reversed; the arrow between hammers
   home the transformation that RBS provides. */
.results-flip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  align-items: stretch;
  max-width: 980px;
  margin: 0 auto 2rem;
}
@media (min-width: 900px) {
  .results-flip {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 1.5rem;
    align-items: center;
  }
}

.results-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 1.75rem 1.5rem;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--hi-top), var(--shadow);
}
.results-scene--problem {
  background: linear-gradient(180deg, #FEF2F2 0%, #FFFFFF 75%);
  border-color: #FECACA;
}
.results-scene--solution {
  background: linear-gradient(180deg, var(--tint-soft) 0%, #FFFFFF 75%);
  border-color: rgba(45, 212, 191, 0.45);
}
.results-scene-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
}
.results-scene-tag--bad  { background: #FEE2E2; color: #991B1B; }
.results-scene-tag--good { background: var(--tint); color: var(--primary-darker); }
.results-scene p {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted-strong);
  margin: 0;
  max-width: 38ch;
}
.results-scene em { font-style: normal; color: var(--primary-dark); font-weight: 700; }

/* Person-icon row inside each scene */
.results-people {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.85rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.results-person {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  flex-shrink: 0;
}
.results-person svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.results-person--lost {
  background: linear-gradient(135deg, #DC2626 0%, #EF4444 100%);
  box-shadow: 0 3px 8px rgba(220, 38, 38, 0.22);
}
.results-person--won {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-bright) 100%);
  box-shadow: 0 3px 8px rgba(15, 118, 110, 0.28);
}
.results-person--neutral {
  background: #FFFFFF;
  border: 1.5px dashed var(--border-strong);
  color: var(--muted);
}
.results-people-split {
  width: 1.5px;
  height: 24px;
  background: var(--border-strong);
  margin: 0 0.3rem;
  flex-shrink: 0;
}

/* Center "flip the script" connector */
.results-flip-arrow {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  justify-self: center;
}
.results-flip-arrow svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(90deg); /* down arrow on mobile (stacked) */
}
@media (min-width: 900px) {
  .results-flip-arrow svg { transform: none; } /* right arrow on desktop */
}

.results-source {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* Section background ornament — subtle teal + red glows in opposite corners
   matching the headline's two-color story. Adds depth without competing.
   Note: NO overflow: hidden on the section itself — that would create a
   scrolling context and break the .results-sticky pin pattern. The
   decorative ::before stays inside via inset: 0 alone. */
#results { position: relative; }
#results::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 360px at 90% 100%, rgba(45, 212, 191, 0.10) 0%, transparent 65%),
    radial-gradient(700px 280px at 0% 0%, rgba(220, 38, 38, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
#results > .container { position: relative; z-index: 1; }

/* Mobile: shrink the icon pill so all 5 + divider still fit on one line */
@media (max-width: 480px) {
  .results-scene { padding: 1.4rem 1.1rem; }
  .results-people { gap: 0.3rem; padding: 0.45rem 0.65rem; }
  .results-person { width: 28px; height: 28px; }
  .results-person svg { width: 16px; height: 16px; }
  .results-people-split { height: 20px; margin: 0 0.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .results-stage,
  .results-headline,
  .results-headline strong,
  .results-headline .rh-sub,
  .results-content { transition: opacity 0.2s ease; }
  .rh-num,
  .rh-of,
  .rh-five,
  .results-headline .rh-sub { opacity: 1; transform: none; animation: none; }
}

