/* P18, timeline. Steps on a thin line: the heading beside the steps on a
   desktop, above them on a phone. The line is an element, not a border, so
   no box carries a one-sided stripe; the dots are 18px marks, not numbers.
   Printed, the line is whole and every dot filled. The script measures the
   line (--vl-h, px), how long it takes to draw (--vl-dur) and when it
   reaches each dot (--vl-d on each step). Audited against the design tells:
   no capitals, no numbering, no lift. */
.vl-m.vl-p18 {
  padding: 72px 0;
}
.vl-m .vl-p18__in {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  max-width: 1100px;
}
.vl-m .vl-p18__title {
  margin: 0;
  color: var(--vl-fg);
  font-family: var(--vl-f-display);
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: var(--vl-display-weight, 800);
  line-height: 1.08;
}
.vl-m .vl-p18__sub {
  margin: 16px 0 0;
  color: rgba(var(--vl-fg-rgb), 0.74);
  font-size: 18px;
  line-height: 1.6;
}
.vl-m .vl-p18__track {
  position: relative;
}
.vl-m .vl-p18__steps {
  margin: 0;
  padding: 0;
  list-style: none;
}
.vl-m .vl-p18__step {
  position: relative;
  margin: 0;
  padding: 0 0 34px 44px;
}
.vl-m .vl-p18__step:last-child {
  padding-bottom: 0;
}
.vl-m .vl-p18__dot {
  position: absolute;
  top: 5px;
  left: 0;
  z-index: 1;
  width: 18px;
  height: 18px;
  border: 2px solid var(--vl-acc);
  border-radius: 50%;
  background: var(--vl-acc);
  box-shadow: 0 0 0 5px var(--vl-bg);
}
/* The track: a 2px rule from the first dot's centre down, and the drawn part
   over it in the accent. --vl-h is the script's measured length; without it
   the rule runs the list's height less the last step's padding. */
.vl-m .vl-p18__line {
  position: absolute;
  top: 14px;
  left: 8px;
  width: 2px;
  height: var(--vl-h, calc(100% - 28px));
  background: rgba(var(--vl-fg-rgb), 0.16);
}
.vl-m .vl-p18__fill {
  position: absolute;
  inset: 0;
  background: var(--vl-acc);
  transform-origin: top;
}
.vl-m .vl-p18__name {
  margin: 0;
  color: var(--vl-fg);
  font-family: var(--vl-f-display);
  font-size: clamp(22px, 2.3vw, 28px);
  font-weight: var(--vl-display-weight, 700);
  line-height: 1.25;
}
.vl-m .vl-p18__text {
  margin: 8px 0 0;
  color: rgba(var(--vl-fg-rgb), 0.78);
  font-size: 17px;
  line-height: 1.65;
}
.vl-m .vl-p18__body > .vl-btns {
  margin: 36px 0 0 44px;
}

@media (min-width: 801px) {
  .vl-m.vl-p18 {
    padding: 104px 0;
  }
  .vl-m .vl-p18__in {
    grid-template-columns: 0.75fr 1.25fr;
    gap: 64px;
    align-items: start;
  }
  .vl-m .vl-p18__head {
    position: sticky;
    top: 96px;
  }
  .vl-m .vl-p18__step {
    padding: 0 0 44px 52px;
  }
  .vl-m .vl-p18__text {
    font-size: 18px;
  }
  .vl-m .vl-p18__body > .vl-btns {
    margin-left: 52px;
  }
}

/* Under motion only: the line starts undrawn, a dot is hollow and its step
   dimmed. Once in view (is-in) the line draws down at an even speed over
   --vl-dur, and each dot fills, and its step comes up, at --vl-d: the moment
   the line reaches it, which the script measures. Every change is one CSS
   transition, so the whole sequence is running until it is finished. */
@media (prefers-reduced-motion: no-preference) {
  .vl-p18.is-motion .vl-p18__fill {
    transform: scaleY(0);
  }
  .vl-p18.is-motion.is-in .vl-p18__fill {
    transform: scaleY(1);
    transition: transform var(--vl-dur, 2s) linear 0.2s;
  }
  .vl-p18.is-motion .vl-p18__dot {
    background: var(--vl-bg);
  }
  .vl-p18.is-motion.is-in .vl-p18__dot {
    background: var(--vl-acc);
    transition: background-color 0.3s ease calc(var(--vl-d, 0s) + 0.2s);
  }
  .vl-p18.is-motion .vl-p18__name,
  .vl-p18.is-motion .vl-p18__text {
    opacity: 0.35;
  }
  .vl-p18.is-motion.is-in .vl-p18__name,
  .vl-p18.is-motion.is-in .vl-p18__text {
    opacity: 1;
    transition: opacity 0.5s ease calc(var(--vl-d, 0s) + 0.2s);
  }
}
