/* See ./steps.md for design notes and rationale. */

.steps__heading {
  margin: 0;
  padding-block: var(--ll-space-6) var(--ll-space-9);
  color: var(--ll-color-text-secondary);
  font-family: var(--ll-text-h6-family);
  font-size: var(--ll-text-h6-size);
  line-height: var(--ll-text-h6-line-height);
  letter-spacing: var(--ll-text-h6-letter-spacing);
  font-weight: var(--ll-text-h6-weight);
  text-align: left;
}

.steps__list {
  display: flex;
  flex-direction: column;
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps__step {
  display: flex;
  align-items: stretch;
  gap: var(--ll-space-5);
  position: relative;
  margin-block: 0;
  padding-bottom: var(--ll-space-6);
}

.steps__step:last-child {
  padding-bottom: 0;
}

/* Connector */
.steps__connector {
  position: absolute;
  left: 20px;
  top: 40px;
  bottom: 0;
  width: 1px;
  background: var(--ll-color-bg-muted);
  overflow: hidden;
  pointer-events: none;
}

.steps__connector::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ll-color-brand-primary);
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform 3000ms var(--ll-motion-enter-easing);
}

.steps__step[data-state='active'] .steps__connector::before {
  transform: scaleY(1);
}

.steps__rail {
  flex: 0 0 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.steps__bullet {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  border-radius: var(--ll-radius-pill);
  background: var(--ll-color-bg-muted);
  border: var(--ll-border-width-xs) solid var(--ll-color-bg-muted);
  color: var(--ll-color-text-secondary);
  font-family: var(--ll-text-body-base-family);
  font-size: var(--ll-text-body-base-size);
  line-height: var(--ll-text-body-base-line-height);
  letter-spacing: var(--ll-text-body-base-letter-spacing);
  font-weight: var(--ll-text-body-base-weight);
  transition:
    background-color var(--ll-motion-interactive-state-duration) var(--ll-motion-interactive-state-easing),
    border-color var(--ll-motion-interactive-state-duration) var(--ll-motion-interactive-state-easing),
    color var(--ll-motion-interactive-state-duration) var(--ll-motion-interactive-state-easing);
}

.steps__step[data-state='active'] .steps__bullet {
  background: color-mix(in srgb, var(--ll-color-bg-brand-light) 40%, transparent);
  border-color: var(--ll-color-border-on-brand);
}

.steps__card {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--ll-space-3);
  box-sizing: border-box;
  padding: var(--ll-space-5);
  border-radius: var(--ll-radius-card);
  background: var(--ll-color-bg-brand-lighter);
  border: var(--ll-border-width-xs) solid var(--ll-color-bg-brand-lighter);
  transition:
    background-color var(--ll-motion-interactive-state-duration) var(--ll-motion-interactive-state-easing),
    border-color var(--ll-motion-interactive-state-duration) var(--ll-motion-interactive-state-easing);
}

.steps__step[data-state='active'] .steps__card {
  background: var(--ll-color-bg-brand-light);
  border-color: var(--ll-color-border-on-brand);
}

.steps__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  color: var(--ll-color-text-primary);
}

.steps__icon-img {
  display: block;
  max-width: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.steps__copy {
  display: flex;
  flex-direction: column;
  gap: var(--ll-space-2);
}

.steps__title {
  margin: 0;
  color: var(--ll-color-text-secondary);
  font-family: var(--ll-text-body-base-family);
  font-size: var(--ll-text-body-base-size);
  line-height: var(--ll-text-body-base-line-height);
  letter-spacing: var(--ll-text-h6-letter-spacing);
  font-weight: var(--ds-font-weight-medium);
}

.steps__desc {
  margin: 0;
  color: var(--ll-color-text-secondary);
  font-family: var(--ll-text-body-sm-family);
  font-size: var(--ll-text-body-sm-size);
  line-height: var(--ll-text-body-sm-line-height);
  letter-spacing: var(--ll-text-body-sm-letter-spacing);
  font-weight: var(--ll-text-body-sm-weight);
}

/* Snap-reset frame: kill transitions for one frame when the cycle wraps from
 * "all lit" back to neutral, so step 1 re-ignites cleanly on the next loop. */
.steps[data-reset] .steps__bullet,
.steps[data-reset] .steps__card,
.steps[data-reset] .steps__connector::before {
  transition: none;
}

@media (width >= 768px) {
  .steps__step {
    gap: var(--ll-space-5);
  }

  .steps__connector {
    left: 25px;
    top: 50px;
  }

  .steps__rail {
    flex-basis: 50px;
  }

  .steps__bullet {
    width: 50px;
    height: 50px;
    font-size: var(--ll-text-body-lg-size);
    line-height: var(--ll-text-body-lg-line-height);
  }

  .steps__icon {
    width: 40px;
    height: 40px;
  }

  .steps__title {
    font-size: var(--ll-text-body-lg-size);
    line-height: var(--ll-text-body-lg-line-height);
  }

  .steps__desc {
    font-size: var(--ll-text-body-base-size);
    line-height: var(--ll-text-body-base-line-height);
    letter-spacing: var(--ll-text-body-base-letter-spacing);
  }
}

@media (prefers-reduced-motion: reduce) {
  .steps__bullet,
  .steps__card,
  .steps__connector::before {
    transition: none;
  }
}
