/* ==========================================================================
   The ScoreLabs Advantage: stacking cards
   Each stage sticks to the screen; the next one slides up and stacks over it.
   The earlier card shrinks and dims a little as it gets covered (--p set by animations.js),
   and the photo settles from a slight zoom as a card arrives (--in).
   ========================================================================== */
.sx-stack {
  position: relative;
}

.sx-stack-card {
  --p: 0;
  --in: 1;
  position: sticky;
  top: calc(96px + var(--i, 0) * 18px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 440px;
  margin-bottom: 36px;
  background: #ffffff;
  border: 1px solid var(--sx-line);
  border-radius: 28px;
  box-shadow: 0 30px 70px rgba(6, 17, 36, 0.14), 0 2px 6px rgba(6, 17, 36, 0.05);
  overflow: hidden;
  transform-origin: 50% 0;
  transform: scale(calc(1 - var(--p) * 0.06));
  filter: brightness(calc(1 - var(--p) * 0.1));
  will-change: transform;
}

.sx-stack-card:last-child {
  margin-bottom: 0;
}

/* text side */
.sx-sc-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px 46px;
}

.sx-sc-body > * {
  translate: 0 calc((1 - var(--in)) * 26px);
  opacity: calc(0.15 + var(--in) * 0.85);
}

.sx-sc-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.sx-sc-num {
  font-family: var(--font-heading);
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(120deg, #00a635 0%, #059669 50%, #1945f4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sx-sc-label {
  padding: 6px 14px;
  border-radius: 999px;
  background: #ecfdf3;
  border: 1px solid rgba(5, 150, 105, 0.25);
  color: #047857;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sx-sc-body h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--sx-ink);
  margin-bottom: 14px;
}

.sx-sc-body p {
  line-height: 1.65;
  color: var(--sx-body);
  margin-bottom: 20px;
}

/* photo side */
.sx-sc-media {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: #dfe7f1;
}

.sx-sc-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(calc(1.16 - var(--in) * 0.16)) translateY(calc(var(--p) * -3%));
  transform-origin: 50% 50%;
  will-change: transform;
}

/* soft edge so the photo blends into the white card */
.sx-sc-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 22%),
              linear-gradient(0deg, rgba(6, 17, 36, 0.18) 0%, rgba(6, 17, 36, 0) 40%);
  pointer-events: none;
}

@media (max-width: 900px) {
  .sx-stack-card {
    grid-template-columns: 1fr;
    min-height: 0;
    top: calc(84px + var(--i, 0) * 12px);
    margin-bottom: 26px;
    border-radius: 22px;
  }

  .sx-sc-body {
    padding: 28px 24px 22px;
  }

  .sx-sc-num {
    font-size: 2.4rem;
  }

  .sx-sc-media {
    height: 170px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sx-stack-card {
    position: relative;
    top: auto;
    transform: none;
    filter: none;
  }

  .sx-sc-body > * {
    translate: 0 0;
    opacity: 1;
  }

  .sx-sc-media img {
    transform: none;
  }
}
