/* FROM — About, section 2: four promises. The cards stick near the top as you scroll, and each new one slides up
   over the last, which steps back a little (js/promises.js sets --p on each card as it is covered). */

.promises {
  padding: clamp(88px, 11vw, 160px) 0;
  background: var(--paper-warm);
}

.promises__head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: end;
  gap: 24px clamp(40px, 6vw, 96px);
}

.promises__title {
  max-width: 14ch;
  margin: 0;
  font-size: clamp(36px, 4.6vw, 72px);
  line-height: 1.02;
  font-weight: 760;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.promises__lede {
  max-width: 40ch;
  font-size: clamp(17px, 1.3vw, 20px);
  line-height: 1.55;
  color: var(--ink-2);
}

/* ---------- The stack ---------- */

.promises__list {
  display: grid;
  gap: clamp(64px, 14vh, 140px);
  margin: clamp(48px, 6vw, 80px) 0 0;
  padding: 0;
  list-style: none;
}

.promise {
  --p: 0;
  position: sticky;
  top: calc(104px + var(--i) * 18px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 32px clamp(32px, 5vw, 80px);
  min-height: min(560px, calc(100vh - 180px));
  padding: clamp(28px, 4vw, 64px);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow:
    inset 0 0 0 1px rgba(7, 13, 23, 0.06),
    0 -12px 40px rgba(7, 13, 23, 0.05);
  transform: scale(calc(1 - var(--p) * 0.05));
  transform-origin: 50% 0;
  will-change: transform;
}

.promise:nth-child(2) {
  background: var(--orange-wash);
}

.promise:nth-child(3) {
  background: var(--orange);
}

.promise:nth-child(4) {
  background: var(--orange-tint);
}

.promise__count {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px currentColor;
  font-size: 14px;
  font-weight: 650;
}

.promise__title {
  margin: 28px 0 0;
  font-size: clamp(34px, 4vw, 64px);
  line-height: 1.02;
  font-weight: 760;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.promise__text {
  max-width: 34ch;
  margin-top: 20px;
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.55;
  color: var(--ink-2);
}

.promise:nth-child(3) .promise__text {
  color: rgba(7, 13, 23, 0.82);
}

.promise__art {
  width: 100%;
  max-width: 520px;
  height: auto;
  justify-self: end;
}

/* ---------- Tablet and phone ---------- */

@media (max-width: 860px) {
  .promises__head {
    grid-template-columns: 1fr;
  }

  .promise {
    top: calc(88px + var(--i) * 12px);
    grid-template-columns: 1fr;
    align-content: start;
    min-height: 0;
  }

  .promise__title {
    margin-top: 20px;
  }

  .promise__art {
    max-width: 360px;
    justify-self: center;
  }
}

@media (max-width: 480px) {
  .promise {
    padding: 24px 22px 12px;
  }

  .promise__text {
    margin-top: 14px;
  }
}
