* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: #ffffff;
  color: #171717;
}

.onboarding {
  padding: 4rem 1rem;
}

.intro {
  max-width: 36rem;
  margin: 0 auto;
  text-align: center;
}

.heading {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #171717;
}

.copy {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  line-height: 1.625;
  color: #737373;
}

.board {
  position: relative;
  margin: 3.5rem auto 0;
  max-width: 72rem;
}

.track {
  display: none;
}

.steps {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 1rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e5e5;
  background: #ffffff;
  padding: 1rem;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 300ms ease,
    background-color 300ms ease,
    box-shadow 300ms ease;
}

.step:focus-visible {
  outline: 2px solid #15803d;
  outline-offset: 2px;
}

.step--upcoming {
  background: #fafafa;
}

.step--active {
  border-color: #15803d;
  box-shadow: 0 6px 16px -8px rgba(21, 128, 61, 0.15);
}

.icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  transition:
    border-color 300ms ease,
    background-color 300ms ease,
    color 300ms ease;
}

.icon--completed {
  background: #171717;
  color: #ffffff;
}

.icon--completed svg {
  width: 1rem;
  height: 1rem;
}

.icon--active {
  border: 2px solid #15803d;
  background: rgba(21, 128, 61, 0.1);
  color: #15803d;
}

.icon--upcoming {
  border: 2px solid #e5e5e5;
  background: #ffffff;
  color: #a3a3a3;
}

.step__body {
  display: block;
}

.step__state {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: color 300ms ease;
}

.step__state--completed {
  color: #a3a3a3;
}

.step__state--active {
  color: #15803d;
}

.step__state--upcoming {
  color: #d4d4d4;
}

.step__title {
  display: block;
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #171717;
}

.step__desc {
  display: block;
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  line-height: 1.6;
  color: #737373;
}

@media (min-width: 1024px) {
  /* Runs the full 0%–100% width behind a gap-free row of 5 equal-width
     step wrappers, each with its icon centered — so step `i`'s icon sits
     at exactly `(i + 0.5) / 5` of the track's width regardless of viewport
     size, and a fill of that same fraction always lands exactly on the
     selected step's icon. `overflow: hidden` on the track keeps the fill
     from ever visually overshooting it. */
  .track {
    display: block;
    position: absolute;
    top: 1.125rem;
    left: 0;
    right: 0;
    height: 2px;
    overflow: hidden;
    background: #e5e5e5;
  }

  .track__fill {
    height: 100%;
    transform-origin: left;
    background: #171717;
  }

  .steps {
    flex-direction: row;
    gap: 0;
  }

  .step-wrap {
    flex: 1;
  }

  .step {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem;
    text-align: center;
  }
}

/*
 * Timeline 04 — "sequential state activation" animation identity. Same
 * canonical keyframes as `Timeline04.tailwind.css`; see script.js for the
 * IntersectionObserver that adds `is-visible` once, and for the click/
 * keyboard handling that re-derives every step's state and re-triggers
 * the `.track__fill` width transition below. Border/background/label
 * color transitions on `.step`/`.icon`/`.step__state` are plain, ungated
 * transitions declared alongside those rules earlier in this file —
 * direct interaction feedback, so they stay on regardless of motion
 * preference, the same convention as a hover state elsewhere in this
 * library. Respecting reduced motion here only means the connector's
 * *width* change becomes instant rather than animated.
 */
@keyframes al-timeline04-activate {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes al-timeline04-grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.al-timeline04-progress {
  transform: scaleX(1);
}

@media (prefers-reduced-motion: no-preference) {
  .al-timeline04.al-timeline04-js .step {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }

  .al-timeline04.al-timeline04-js.is-visible .step {
    animation: al-timeline04-activate 500ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .al-timeline04.al-timeline04-js .al-timeline04-progress {
    transform: scaleX(0);
  }

  .al-timeline04.al-timeline04-js.is-visible .al-timeline04-progress {
    animation: al-timeline04-grow 900ms cubic-bezier(0.16, 1, 0.3, 1) 300ms both;
  }

  /* Click-driven fill changes, independent of the mount-time reveal above
     — `width` (a plain CSS property, not `transform`) so it can never
     compete with the entrance animation's held `scaleX` value. */
  .al-timeline04-progress {
    transition: width 500ms cubic-bezier(0.16, 1, 0.3, 1);
  }
}
