/* ============================================================================
   story.css — chapters 01 THE GAP, 02 WHO WE ARE, 03 PROOF WALL
   ========================================================================== */

/* -- 01 · THE GAP --------------------------------------------------------- */

.gap__grid {
  display: grid;
  gap: var(--chapter-gap);
  align-items: start;
}

@media (min-width: 960px) {
  .gap__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* Four vendors, deliberately out of alignment — the picture of the problem. */
.fragments {
  display: grid;
  gap: var(--space-3);
  position: relative;
  padding-left: var(--space-6);
}

/* The seam that never quite connects them. */
.fragments::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 42px;
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    var(--slate-200) 0 6px,
    transparent 6px 12px
  );
}

.fragment {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border: 1px dashed var(--page-border);
  border-radius: var(--radius-lg);
  background: var(--white);
}

.fragment:nth-child(1) { margin-left: 0; }
.fragment:nth-child(2) { margin-left: 6%; }
.fragment:nth-child(3) { margin-left: 2%; }
.fragment:nth-child(4) { margin-left: 9%; }

.fragment__tag {
  font-family: var(--font-mono);
  font-weight: var(--weight-medium);
  font-size: var(--text-xs);
  color: var(--slate-500);
  flex: none;
}

.fragment__name {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--weight-semibold);
  color: var(--navy-900);
}

/* The brand team, holding it together. */
.fragment--brand {
  margin-left: 0;
  border-style: solid;
  border-color: var(--navy-900);
  background: var(--navy-900);
  color: var(--white);
  box-shadow: var(--shadow-lg);
}

.fragment--brand .fragment__tag { color: var(--yellow-500); }
.fragment--brand .fragment__name { color: var(--white); }

.gap__toll {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-6);
  margin-top: var(--chapter-gap);
  padding-top: var(--space-8);
  border-top: 1px solid var(--page-border);
}

.gap__toll-num {
  font-family: var(--font-mono);
  font-size: var(--fs-h2);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.03em;
  color: var(--navy-900);
}

.gap__toll-lbl {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--slate-500);
}

.gap__turn {
  margin-top: var(--chapter-gap);
  font-family: var(--font-sans);
  font-weight: var(--weight-extrabold);
  font-size: var(--fs-display-3);
  line-height: 1.05;
  letter-spacing: var(--tracking-tight);
  color: var(--navy-900);
  max-width: 20ch;
}

/* -- 02 · WHO WE ARE ------------------------------------------------------ */

.who__grid {
  display: grid;
  gap: var(--chapter-gap);
  align-items: start;
}

@media (min-width: 960px) {
  .who__grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
}

.who__banner {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--navy-800);
  box-shadow: var(--page-shadow);
}

.who__banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.who__banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 10, 64, 0.55), transparent 55%);
}

.who__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-6);
}

/* -- 03 · PROOF WALL ------------------------------------------------------ */

.proof__head {
  text-align: center;
  max-width: 46ch;
  margin-inline: auto;
  margin-bottom: var(--chapter-gap);
}

.proof__head .eyebrow { justify-content: center; }

/* A full-bleed banner strip that surfs continuously. One row, all 21 brands,
   its own ground so it reads as a band rather than logos loose on the page. */
.marquee {
  position: relative;
  overflow: hidden;
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  background: var(--surface-lilac);
  border-block: 1px solid var(--border);
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}

.marquee__track {
  display: flex;
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  width: max-content;
  padding-block: var(--space-5);
  animation: marquee-run 64s linear infinite;
  will-change: transform;
}

/* Hover, keyboard focus and the explicit control all stop it. */
.marquee:hover .marquee__track,
.marquee:focus-within .marquee__track,
.marquee.is-paused .marquee__track { animation-play-state: paused; }

@keyframes marquee-run {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* WCAG 2.2.2 — auto-moving content needs a real stop, not just hover. */
.marquee__pause {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: 12px;
  transform: translateY(-50%);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--navy-900);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--dur-base) ease;
}

.marquee:hover .marquee__pause,
.marquee__pause:focus-visible,
.marquee.is-paused .marquee__pause { opacity: 1; }

.marquee__pause svg { width: 12px; height: 12px; }
.marquee__pause .icon-play { display: none; }
.marquee.is-paused .marquee__pause .icon-play { display: block; }
.marquee.is-paused .marquee__pause .icon-pause { display: none; }

.brand-logo {
  flex: none;
  display: grid;
  place-items: center;
  height: 58px;
  width: 148px;
}

/* The 21 logos arrive at wildly different lightness. grayscale alone leaves the
   pale ones invisible, so brightness+contrast pulls them to a comparable
   weight; hover restores the real artwork. */
.brand-logo img {
  max-height: 52px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  filter: grayscale(1) brightness(0.55) contrast(1.25);
  opacity: 0.78;
  transition: filter var(--dur-base) ease, opacity var(--dur-base) ease;
}

.brand-logo:hover img {
  filter: none;
  opacity: 1;
}

/* The banner keeps surfing even for reduced-motion visitors — it is the client's
   requirement, and the pause control above is the accessible way out. Motion is
   slowed so it is far less insistent. */
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation-duration: 140s; }
  .marquee__pause { opacity: 1; }
}

/* The banner is a full-bleed strip that already reads as a section break, so
   the chapter does not need its usual closing air underneath it. */
#ch-proof { padding-bottom: clamp(40px, 5vh, 80px); }
