/* What I bring, the four stages (Figma 2147-320): a large Clarity → Direction → Capability → Momentum line over four touching numbered cards. */
/* The pinned stage and the rise are the How I work mechanics, moved here: the cards seat one after another on scroll. */
.stages {
  --g: max(clamp(16px, 6.9vw, 100px), env(safe-area-inset-left, 0px));
  --w: min(1240px, calc(100vw - 2 * var(--g)));
  height: 260vh;
  position: relative;
  width: 100vw;
  margin-left: calc(-1 * var(--g));
  margin-right: calc(-1 * var(--g));
}
.stages-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 50px;
  overflow: hidden;
}
.stages-head {
  font-weight: 400;
  width: var(--w);
  margin: 0;
  font-family: var(--font-utility);
  font-size: 14px;
  line-height: 1.4;
}
/* the stage line is a ticker (Figma 2147-320 draws it running off both edges): one group of the four stages, repeated, drifting left */
.stages-line-wrap {
  width: 100%;
  padding-bottom: 50px;
  overflow-x: clip;
}
.stages-line {
  --gap: 100px;
  margin: 0;
  display: flex;
  width: max-content;
  font-weight: 400;
  font-size: 80px;
  line-height: 1.4;
  letter-spacing: -0.8px;
  white-space: nowrap;
  animation: stages-tick 25s linear infinite;
}
.stages-group {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding-right: var(--gap);
}
.stages-line svg {
  flex: none;
  width: 55px;
  height: 47.89px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@keyframes stages-tick {
  to {
    transform: translateX(-50%);
  }
}
.stages-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  width: var(--w);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.stage-card {
  box-sizing: border-box;
  aspect-ratio: 7 / 8;
  border: 2px solid var(--line);
  border-radius: 32px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  margin-left: -2px;
  background: var(--bg);
}
.stage-card:first-child {
  margin-left: 0;
  /* two px narrower (no overlap), so it takes the row height from its neighbours instead of its own ratio */
  aspect-ratio: auto;
}
.stage-card .n {
  font-family: var(--font-utility);
  font-size: 14px;
  line-height: 1.4;
  margin: 0 0 8px;
}
.stage-card h3 {
  margin: 0;
  font-weight: 400;
  font-size: 34px;
  line-height: 1.4;
}
.stage-card p {
  margin: 0;
  font-family: var(--font-utility);
  font-size: 14px;
  line-height: 1.4;
}
.js .stage-card {
  transform: translateY(calc((1 - var(--t, 0)) * var(--rise, 110vh)));
}
/* the moment the cards are released (see stages.js), ease them up to where the scroll has got to */
.js .stages.is-catchup:not(.is-flow) .stage-card {
  transition: transform 0.6s var(--ease);
}
@media (max-width: 1100px) {
  .stage-card {
    aspect-ratio: auto;
    min-height: 445px;
  }
  .stages-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stage-card:nth-child(odd) {
    margin-left: 0;
  }
  .stage-card:nth-child(even) {
    margin-left: -2px;
  }
  .stage-card:nth-child(n + 3) {
    margin-top: -2px;
  }
}
@media (max-width: 900px) {
  .stages-line {
    --gap: 0.9em;
    font-size: clamp(40px, 9vw, 64px);
  }
  .stages-line svg {
    width: 0.69em;
    height: 0.6em;
  }
}
@media (max-width: 900px) {
  .stages {
    height: auto;
    padding-block: 64px;
    --rise: 16vh;
  }
  .stages-stage {
    position: static;
    height: auto;
    overflow: visible;
  }
}
@media (max-width: 560px) {
  .stages-cards {
    grid-template-columns: 1fr;
  }
  .stage-card:nth-child(n) {
    margin-left: 0;
  }
  .stage-card:nth-child(n + 2) {
    margin-top: -2px;
  }
  .stage-card {
    min-height: 320px;
    padding: 28px;
  }
}
.stages.is-flow {
  height: auto;
  padding-block: 64px;
  --rise: 16vh;
}
/* the ticker stays put under the heading; only the cards rise.
   stacked: cards lifted until they first appear, then a short rise (see stages.js, seatOnEntry) */
.js .stages.is-flow .stage-card {
  transform: translateY(var(--rise));
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.js .stages.is-flow .stage-card.is-seated {
  transform: none;
}
.stages.is-flow .stages-stage {
  position: static;
  height: auto;
  overflow: visible;
}
@media (prefers-reduced-motion: reduce) {
  .js .stage-card {
    transform: none;
  }
  .stages-line {
    animation: none;
    width: var(--w);
    margin: 0 auto;
    white-space: normal;
  }
  .stages-group {
    flex-wrap: wrap;
    padding-right: 0;
  }
  .stages-group[data-copy],
  .stages-group svg:last-of-type {
    display: none;
  }
  .stages {
    height: auto;
    padding-block: 96px;
  }
  .stages-stage {
    position: static;
    height: auto;
    overflow: visible;
  }
}
