.story {
  --stage-top: 64px;
  --stage-height: 404px;
  --band-top: calc(var(--stage-top) + var(--stage-height));
  padding-top: var(--space-14);
  timeline-scope: --s1, --s2, --s3, --s4, --s5, --steps;
}

.story-grid {
  display: grid;
  margin-top: var(--space-8);
}

.rail {
  display: none;
}

.stage {
  position: sticky;
  top: var(--stage-top);
  z-index: 5;
  order: -1;
  display: grid;
  place-items: center;
  height: var(--stage-height);
  padding-block: var(--space-2) var(--space-3);
  background: var(--canvas);
}

.steps {
  view-timeline: --steps block;
}

.step {
  display: flex;
  align-items: flex-end;
  min-height: clamp(300px, calc(100svh - var(--band-top)), 520px);
  padding-block: var(--space-6);
  view-timeline-axis: block;
  view-timeline-inset: var(--band-top) 0px;
}

.step-1 {
  view-timeline-name: --s1;
}

.step-2 {
  view-timeline-name: --s2;
}

.step-3 {
  view-timeline-name: --s3;
}

.step-4 {
  view-timeline-name: --s4;
}

.step-5 {
  view-timeline-name: --s5;
}

.step-card {
  display: grid;
  gap: var(--space-3);
  max-width: 30rem;
}

.step-kicker {
  color: var(--accent);
  font: var(--type-label-small);
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.step h3 {
  font: var(--type-headline-medium);
  font-size: clamp(24px, 3.4vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.step-body {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  text-wrap: pretty;
}

.rail-inner {
  position: relative;
}

.rail ol {
  display: grid;
  gap: var(--space-10);
}

.rail-track {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 11px;
  width: 2px;
  border-radius: 1px;
  background: var(--line);
}

.rail-fill {
  position: absolute;
  inset: 0;
  border-radius: 1px;
  background: var(--accent);
  transform-origin: top;
  transform: scaleY(0);
}

.rail-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--faint);
  font: var(--type-label-large);
  text-decoration: none;
}

.rail-link:hover {
  color: var(--ink);
}

.rail-node {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--canvas);
  font: var(--type-label-small);
  font-size: 10px;
  font-weight: 700;
}

@media (min-width: 960px) {
  .story {
    --stage-height: calc(100svh - var(--stage-top));
    --band-top: 0px;
  }

  .story-grid {
    grid-template-columns: 148px minmax(0, 1fr) minmax(0, 460px);
    gap: var(--space-10);
  }

  .rail {
    position: sticky;
    top: var(--stage-top);
    display: flex;
    align-items: center;
    height: min(var(--stage-height), 860px);
  }

  .stage {
    order: 3;
    height: min(var(--stage-height), 860px);
    padding: 0;
    background: none;
  }

  .step {
    align-items: center;
    min-height: clamp(480px, 100svh, 960px);
    padding-block: 0;
  }

  .step h3 {
    font-size: clamp(28px, 3vw, 40px);
  }

  .step-body {
    font-size: 17px;
  }
}
