.track {
  display: flex;
  align-items: flex-start;
  margin-top: 64px;
}

.track-main {
  flex: 1;
  min-width: 0;
}

.learn-track {
  --fill: 0%;
  position: relative;
}

.stages-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
  padding: 0;
  list-style: none;
}

.rail,
.rail-fill {
  position: absolute;
  top: 22px;
  inset-inline-start: 0;
  height: 4px;
}

.rail {
  width: 100%;
  background: var(--line);
}

.rail-fill {
  width: var(--fill);
  background: var(--current);
  box-shadow: 0 0 8px rgb(10 132 255 / 0.5);
}

.stage-col {
  position: relative;
}
.stage-col h3 {
  margin-top: 16px;
  color: var(--muted);
  font-size: clamp(1.125rem, 1.5vw, 1.375rem);
  font-weight: 400;
  line-height: 1.35;
  transition: color 0.3s;
}
.stage-col.reached h3 {
  color: var(--ink);
}
.stage-col > p {
  margin-top: 6px;
  color: var(--muted);
}
.stage-col ul {
  display: grid;
  gap: 14px;
  padding: 0;
  margin-top: 20px;
  list-style: none;
}
.stage-col li {
  border-inline-start: 3px solid var(--line);
  padding-inline-start: 14px;
  transition: border-color 0.3s;
}
.stage-col.reached li {
  border-color: var(--current);
}

.stop-ring {
  display: block;
  width: 48px;
  height: 48px;
  border: 5px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}
.stage-col.reached .stop-ring {
  border-color: var(--current);
  box-shadow: 0 0 0 7px rgb(10 132 255 / 0.14);
}

.always {
  margin-top: 44px;
}

.always-line {
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--current) 40%, #8cc8ff 50%, var(--current) 60%) 0 0 / 200%
    100%;
  animation: flow 3.2s linear infinite;
}

.always p {
  margin-top: 14px;
  font-size: clamp(1.0625rem, 1.3vw, 1.25rem);
  font-weight: 300;
  line-height: 1.3;
}

@keyframes flow {
  to {
    background-position-x: -200%;
  }
}

.track-mark {
  flex: none;
  width: 128px;
  margin-top: -44px;
}
.track-mark svg {
  max-width: none;
  stroke-width: 22;
}

@media (max-width: 899px) {
  .track {
    flex-direction: column;
    align-items: stretch;
  }
  .track-mark {
    order: -1;
    width: 110px;
    margin: 0 auto 28px;
  }
  /* On phones the stages stack and the rail runs down beside them. */
  .stages-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
    padding-inline-start: 58px;
  }
  .rail,
  .rail-fill {
    top: 0;
    inset-inline-start: 18px;
    width: 4px;
    height: 100%;
  }
  .rail-fill {
    height: var(--fill);
  }
  .stop-ring {
    position: absolute;
    top: -6px;
    inset-inline-start: -58px;
    width: 40px;
    height: 40px;
  }
  .stage-col h3 {
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .always-line {
    animation: none;
  }
}
