.steps {
  --steps-accent: #0e7fa3;
  --steps-circle-bg: #e3f1f6;
  --steps-circle-border: rgba(14, 127, 163, .25);
  --steps-track: rgba(14, 127, 163, .15);
  --steps-text: #1d2433;
  --steps-muted: #5f6b7d;
  --steps-circle: 4.5rem;
  --steps-line: 2px;
  --steps-stagger: .6s;

  container-type: inline-size;
  margin-block: 2.5rem 3.5rem;
}

.steps__list {
  display: grid;
  grid-template-columns: repeat(var(--steps-count, 5), minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps__item {
  position: relative;
  padding-inline: .75rem;
}

/* ---------- Step ---------- */
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}

.step__circle {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: var(--steps-circle);
  height: var(--steps-circle);
  border: 1px solid var(--steps-circle-border);
  border-radius: 50%;
  background: var(--steps-circle-bg);
  color: var(--steps-accent);
}

.step__glyph {
  width: 42%;
  height: 42%;
  background-color: currentColor;
  -webkit-mask: var(--step-icon) center / contain no-repeat;
          mask: var(--step-icon) center / contain no-repeat;
}

.step__number {
  font-size: 1.3rem;
  font-weight: 700;
}

.step__title {
  margin: 0 0 .4rem;
  color: var(--steps-text);
  font-size: clamp(1.15rem, 1rem + .5vw, 1.4rem);
  font-weight: 700;
  line-height: 1.25;
}

.step__text {
  margin: 0;
  color: var(--steps-muted);
  line-height: 1.55;
}

/* ---------- Connecting line (track + animated fill) ---------- */
.steps__item:not(:last-child)::before,
.steps__item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(var(--steps-circle) / 2 - var(--steps-line) / 2);
  left: calc(50% + var(--steps-circle) / 2);
  width: calc(100% - var(--steps-circle));
  height: var(--steps-line);
}

.steps__item:not(:last-child)::before {
  background: var(--steps-track);
}

.steps__item:not(:last-child)::after {
  background: var(--steps-accent);
  transform-origin: left center;
}

/* ---------- Narrow: vertical timeline ---------- */
@container (max-width: 48rem) {
  .steps__list {
    --steps-circle: 3.5rem;
    grid-template-columns: minmax(0, 1fr);
  }

  .steps__item {
    padding: 0 0 2rem;
  }

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

  .step {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
  }

  .step__body {
    padding-top: calc(var(--steps-circle) / 2 - .8rem);
  }

  .steps__item:not(:last-child)::before,
  .steps__item:not(:last-child)::after {
    top: var(--steps-circle);
    left: calc(var(--steps-circle) / 2 - var(--steps-line) / 2);
    width: var(--steps-line);
    height: calc(100% - var(--steps-circle));
  }

  .steps__item:not(:last-child)::after {
    transform-origin: center top;
  }
}

/* ---------- Animation (only once JS has added .is-animated) ---------- */
.steps.is-animated .step__circle {
  opacity: 0;
  transform: scale(.6);
  transition: opacity .4s ease, transform .5s cubic-bezier(.34, 1.56, .64, 1);
  transition-delay: calc(var(--i) * var(--steps-stagger));
}

.steps.is-animated .step__body {
  opacity: 0;
  transform: translateY(.75rem);
  transition: opacity .45s ease, transform .45s ease;
  transition-delay: calc(var(--i) * var(--steps-stagger) + .15s);
}

.steps.is-animated .steps__item::after {
  scale: 0 1;
  transition: scale .4s ease-in-out;
  transition-delay: calc(var(--i) * var(--steps-stagger) + .2s);
}

@container (max-width: 48rem) {
  .steps.is-animated .steps__item::after {
    scale: 1 0;
  }
}

.steps.is-visible .step__circle,
.steps.is-visible .step__body {
  opacity: 1;
  transform: none;
}

.steps.is-visible .steps__item::after {
  scale: 1 1;
}