/* ==========================================================================
   components.css
   Blocks shared by several pages: cards, media, stats, the team carousel,
   the logo marquee and the closing CTA bands.
   ========================================================================== */

/* --------------------------------------------------------------------------
   9. Compliance badge strip
   -------------------------------------------------------------------------- */
/* Infinite logo marquee.
   ---------------------------------------------------------------------------
   The track is filled with enough copies of the badge set to span the viewport
   plus one whole set, then slides left by exactly one set width and restarts.
   That "+ one set" is the part that matters: with only two copies the track was
   narrower than a desktop viewport, so once it had travelled one set width the
   tail ran out and left a visible empty band before the loop snapped back.
   main.js measures a set and clones as many as the current width needs.

   Driven by a CSS animation rather than scroll position — tying it to scroll
   made it stutter on phones, where scroll events are coalesced and fling-driven. */
.marquee {
  overflow: hidden;
  /* Vertical breathing room so the hover lift is not clipped by overflow. */
  padding-block: 12px;
  /* The ends are faded by the two overlays below rather than by mask-image:
     a mask forces an extra compositing pass every frame, and this track never
     stops moving. */
  position: relative;
}

/* Flat fades in the strip's own background colour, so badges appear to enter
   and leave rather than being cut off at the edge. */
.marquee::before,
.marquee::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 9%;
  z-index: 1;
  pointer-events: none;
}
.marquee::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg-strip), transparent);
}
.marquee::after {
  right: 0;
  background: linear-gradient(270deg, var(--bg-strip), transparent);
}

.marquee__track {
  display: flex;
  width: max-content;
  /* Both set by main.js from the measured set width, so the travel distance is
     always exactly one set and the speed stays constant at any viewport. */
  animation: marquee-scroll var(--marquee-duration, 30s) linear infinite;
  will-change: transform;
}
.marquee:hover .marquee__track { animation-play-state: paused; }

.marquee__set {
  display: flex;
  align-items: center;
  gap: clamp(28px, 6vw, 76px);
  padding-right: clamp(28px, 6vw, 76px);
  margin: 0;
  list-style: none;
  flex: none;
}

@keyframes marquee-scroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(calc(-1 * var(--marquee-shift, 50%)), 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
  .marquee::before, .marquee::after { display: none; }
  .marquee__set:not(:first-child) { display: none; }
}

.badge {
  width: clamp(84px, 9vw, 140px);
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(12, 21, 32, 0.16);
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 14px;
  flex: none;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.badge:hover { border-color: var(--crimson); transform: translateY(-4px); }
.badge svg { width: 62%; height: auto; color: rgba(12, 21, 32, 0.62); }

/* --------------------------------------------------------------------------
   10. Cards
   -------------------------------------------------------------------------- */
.grid-2, .grid-3, .grid-4 {
  display: grid;
  gap: clamp(18px, 1.8vw, 26px);
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gap-lg { gap: clamp(26px, 3.4vw, 60px); }

.card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-card);
  padding: clamp(26px, 2.2vw, 38px) clamp(22px, 1.9vw, 32px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 24px rgba(12, 21, 32, 0.04);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 48px rgba(12, 21, 32, 0.1);
}
.card--navy { background: var(--navy); color: #fff; }
.card--navy .body { color: var(--on-dark); }

/* A light card sitting inside a dark section must not inherit the section's
   white text, or headings vanish against the card. */
.section--navy .card:not(.card--navy),
.section--dark .card:not(.card--navy),
.section--navy .numcard,
.section--dark .numcard { color: var(--ink); }

.card__title { margin-bottom: 14px; }
.card__body { flex: 1 1 auto; margin-bottom: 24px; }
.card .pill { align-self: flex-start; }

/* Crimson gradient icon tile */
.icon-tile {
  width: clamp(46px, 3.6vw, 58px);
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background: linear-gradient(150deg, #c92050, var(--crimson) 55%, #8f1234);
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  flex: none;
  box-shadow: 0 8px 18px rgba(179, 25, 66, 0.28);
}
.icon-tile svg { width: 54%; height: auto; color: #fff; }
.card--navy .icon-tile {
  background: linear-gradient(150deg, #fff, #e6ecf4);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}
.card--navy .icon-tile svg { color: var(--navy); }

/* Value card (centred) */
.card--value { text-align: center; align-items: center; }
.card--value .icon-tile { margin-inline: auto; }
.card--value .h3 { margin-bottom: 8px; }

/* Numbered card — Figma "01 / 02" pattern */
.numcard {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-card);
  padding: clamp(28px, 2.6vw, 44px);
  overflow: hidden;
  box-shadow: 0 2px 24px rgba(12, 21, 32, 0.04);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.numcard:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 48px rgba(12, 21, 32, 0.1);
}
.numcard__head {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding-right: clamp(60px, 7vw, 110px);
}
.numcard__head .icon-tile { margin-bottom: 0; }
.numcard__n {
  position: absolute;
  top: clamp(20px, 2vw, 34px);
  right: clamp(20px, 2.2vw, 38px);
  font-family: 'Kumbh Sans', sans-serif;
  font-size: clamp(42px, 4.4vw, 74px);
  font-weight: 500;
  line-height: 1;
  color: var(--ghost);
  pointer-events: none;
}
.numcard__body { margin-top: 26px; }

/* Feature row (navy sections) */
.feature__title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.feature__title::before {
  content: '';
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 4px;
  border-radius: 7px;
  border: 2px solid currentColor;
  opacity: 0.75;
}

/* --------------------------------------------------------------------------
   11. Split sections + media
   -------------------------------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(30px, 4.6vw, 92px);
  align-items: center;
}
.split--media-first > .split__media { order: -1; }

.media {
  position: relative;
  width: 100%;
  aspect-ratio: 6 / 5;
  border-radius: var(--radius-media);
  overflow: hidden;
  background: #dfe7ef;
  isolation: isolate;
}
.media--tall   { aspect-ratio: 4 / 5; }
.media--wide   { aspect-ratio: 16 / 10; }

/* Inner layer is oversized so it can be parallaxed inside the frame */
.media__layer {
  position: absolute;
  inset: -12% 0;
  background-size: cover;
  background-position: center;
}

/* Imagery
   ---------------------------------------------------------------
   Tiles live in assets/img and are set inline on the element:
     <div class="media__layer" style="background-image:url('...')"></div>
   Regenerate the demo tiles with: npm run build:images
   ---------------------------------------------------------------- */

/* Cell-nuclei stipple + film grain sit above the gradients */
.media::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(12, 21, 32, 0.16) 1.5px, transparent 2.2px),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.14) 1px, transparent 1.8px);
  background-size: 26px 26px, 17px 17px;
  background-position: 0 0, 9px 6px;
  mix-blend-mode: overlay;
  opacity: 0.9;
}
.media__grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: soft-light;
}

/* Optional label that marks a placeholder while assets are pending */
.media__tag {
  position: absolute;
  z-index: 4;
  left: 14px;
  bottom: 14px;
  font-family: 'Kumbh Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(12, 21, 32, 0.42);
  backdrop-filter: blur(6px);
  padding: 5px 11px;
  border-radius: 999px;
}

/* --------------------------------------------------------------------------
   12. Stats
   -------------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3.4vw, 62px);
  margin-top: clamp(36px, 4.4vw, 70px);
}
.stat {
  position: relative;
  padding-left: clamp(22px, 2.2vw, 38px);
  border-left: 1px solid var(--line);
}
/* crimson accent segment, staggered per column as in the Figma layout */
.stat::after {
  content: '';
  position: absolute;
  left: -2px;
  width: 3px;
  background: var(--crimson);
  border-radius: 2px;
  transform-origin: 50% 0;
  /* Driven by ScrollTrigger via a custom property (pseudo-elements cannot be
     tweened directly by GSAP). Defaults to fully drawn when JS is absent. */
  transform: var(--seg-transform, scaleY(1));
}
.stat:nth-child(1)::after { top: 0;   height: 32%; }
.stat:nth-child(2)::after { top: 30%; height: 44%; }
.stat:nth-child(3)::after { top: 46%; height: 40%; }

.stat__n {
  font-family: 'Kumbh Sans', sans-serif;
  font-size: clamp(40px, 4.2vw, 68px);
  font-weight: 400;
  line-height: 1.1;
  display: block;
  font-variant-numeric: tabular-nums;
}
.stat__label {
  display: block;
  font-family: 'Kumbh Sans', sans-serif;
  font-size: clamp(18px, 1.6vw, 28px);
  font-weight: 500;
  line-height: 1.35;
  margin: 8px 0 14px;
}

/* --------------------------------------------------------------------------
   13. Team carousel
   -------------------------------------------------------------------------- */
.team { position: relative; }
.team__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 3 * 22px) / 4);
  gap: 22px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.team__track::-webkit-scrollbar { display: none; }

.teamcard {
  position: relative;
  scroll-snap-align: start;
  border-radius: var(--radius-media);
  overflow: hidden;
  background: linear-gradient(170deg, #eaf3fc, #d5e6f6);
  min-height: clamp(360px, 34vw, 470px);
  display: flex;
  flex-direction: column;
  isolation: isolate;
}
.teamcard__info { padding: 26px 26px 0; position: relative; z-index: 2; }
.teamcard__name {
  font-family: 'Kumbh Sans', sans-serif;
  font-size: clamp(17px, 1.3vw, 20px);
  font-weight: 500;
  color: #23304a;
}
.teamcard__role {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(35, 48, 74, 0.7);
  margin-top: 4px;
}
.teamcard__cta {
  display: inline-flex;
  margin-top: 16px;
  padding: 9px 16px;
  border-radius: 12px;
  background: var(--crimson);
  color: #fff;
  font-family: 'Kumbh Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.25s var(--ease);
}
.teamcard__cta:hover { background: var(--ink); }

.teamcard__li {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--crimson);
  display: grid;
  place-items: center;
  color: #fff;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease);
}
.teamcard__li:hover { transform: scale(1.08); background: var(--ink); }
.teamcard__li svg { width: 17px; height: 17px; }

/* Portrait stand-in: monogram on a soft brand gradient */
.teamcard__photo {
  margin-top: auto;
  position: relative;
  height: 62%;
  display: grid;
  place-items: end center;
  overflow: hidden;
}
.teamcard__avatar {
  width: 72%;
  aspect-ratio: 1 / 1;
  border-radius: 50% 50% 0 0;
  background:
    radial-gradient(60% 50% at 50% 22%, rgba(255, 255, 255, 0.55), transparent 60%),
    linear-gradient(165deg, #4a6f9c, #0a3161 70%);
  display: grid;
  place-items: center;
  font-family: 'Kumbh Sans', sans-serif;
  font-size: clamp(30px, 3.4vw, 48px);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.02em;
}

.team__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 5;
  transition: background-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.team__nav:hover { background: var(--crimson); }
.team__nav--prev { left: calc(var(--gutter) * -0.5); }
.team__nav--next { right: calc(var(--gutter) * -0.5); }
.team__nav svg { width: 18px; height: 18px; }

/* --------------------------------------------------------------------------
   15. Marketplace CTA band
   -------------------------------------------------------------------------- */
.marketplace {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: linear-gradient(120deg, var(--navy) 0%, #10457f 52%, var(--crimson) 130%);
  color: #fff;
  padding: clamp(30px, 3.4vw, 56px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(20px, 3vw, 48px);
  justify-content: space-between;
}
.marketplace__copy { max-width: 62ch; min-width: min(100%, 300px); }
.marketplace__eyebrow {
  font-family: 'Kumbh Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 12px;
}
.marketplace .body { color: var(--on-dark); margin-top: 12px; }
.marketplace__ring {
  position: absolute;
  right: -60px;
  top: -80px;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  pointer-events: none;
}
.marketplace__ring::after {
  content: '';
  position: absolute;
  inset: 46px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
}

/* --------------------------------------------------------------------------
   16. Dark CTA banner
   -------------------------------------------------------------------------- */
.cta-banner {
  position: relative;
  background: var(--ink);
  color: #fff;
  padding-block: clamp(70px, 8vw, 130px);
  text-align: center;
  overflow: hidden;
}
.cta-banner__inner { position: relative; z-index: 2; }
.cta-banner .lead { margin: 20px auto 32px; max-width: 62ch; color: var(--on-dark); }
.cta-banner__arcs {
  position: absolute;
  right: -6%;
  top: 50%;
  translate: 0 -50%;
  width: min(70vw, 760px);
  aspect-ratio: 1 / 1;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
}
.cta-banner__arcs span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
}
.cta-banner__arcs span:nth-child(2) { inset: 12%; }
.cta-banner__arcs span:nth-child(3) { inset: 24%; }
.cta-banner__arcs span:nth-child(4) { inset: 36%; }

.tagline-1 {
  font-family: 'Kumbh Sans', sans-serif;
  color: var(--crimson);
  font-weight: 600;
  font-size: clamp(15px, 1.15vw, 18px);
  letter-spacing: 0.04em;
}
.tagline-2 {
  font-family: 'Kumbh Sans', sans-serif;
  font-weight: 600;
  font-size: clamp(15px, 1.15vw, 18px);
  margin-top: 6px;
}
.equation {
  text-align: center;
  font-family: 'Kumbh Sans', sans-serif;
  font-weight: 500;
  color: var(--muted);
  margin-top: clamp(30px, 3.4vw, 52px);
}

/* Stacked media pair used in the navy "Our Vision" block */
.media-stack {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: start;
}
.media-stack__card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-media);
  padding: 22px;
  color: var(--ink);
  margin-top: clamp(30px, 4vw, 68px);
}
.media-stack__card .small { color: var(--muted); }
.media-stack__card .media { margin-top: 18px; aspect-ratio: 16 / 11; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team__track { grid-auto-columns: calc((100% - 2 * 22px) / 3); }
  .team__nav--prev { left: 6px; }
  .team__nav--next { right: 6px; }
}

@media (max-width: 900px) {
  /* Two-column splits stack; the media block leads so a phone sees the picture
     before the copy. */
  .split { grid-template-columns: 1fr; }
  .split--media-first > .split__media { order: 0; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: 1fr; }
  .stat::after { display: none; }
  .team__track { grid-auto-columns: calc((100% - 22px) / 2); }
  .media-stack { grid-template-columns: 1fr; }
  .media-stack__card { margin-top: 0; }
}

@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .team__track { grid-auto-columns: 82%; }
  .team__nav { display: none; }
  .badge { width: 84px; }
  .numcard__head { padding-right: 0; flex-direction: column; gap: 16px; }
  .numcard__n { position: static; display: block; margin-bottom: 4px; }
  .marketplace { flex-direction: column; align-items: flex-start; }
}
