/* The stepper (15.3000): a circle a step with its name under it, the steps in equal columns, a line from circle to
   circle that fills with the accent as the work passes it */
.stage-steps {
  --stage-dot: calc(var(--h-btn-sm) + var(--sp-050));
  --stage-gap: var(--sp-100);
  flex: none;
  display: grid;
  grid-template-columns: repeat(var(--stage-count, 3), minmax(0, 1fr));
  padding-block: var(--sp-050) var(--sp-100);
}
.stage-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-075);
  min-width: 0;
  padding: 0 var(--sp-050);
  border: none;
  background: none;
  color: var(--ink2);
  font: inherit;
}
button.stage-step { cursor: pointer; }
div.stage-step { cursor: default; }
/* the line into a step: from the previous circle's edge to this one's, a gap at each end */
.stage-step:not(:first-child)::before,
.stage-step:not(:first-child)::after {
  content: "";
  position: absolute;
  top: calc(var(--stage-dot) / 2 - var(--bw));
  left: calc(-50% + var(--stage-dot) / 2 + var(--stage-gap));
  right: calc(50% + var(--stage-dot) / 2 + var(--stage-gap));
  height: calc(var(--bw) * 2);
  border-radius: var(--r-full);
}
.stage-step:not(:first-child)::before { background: var(--line); }
.stage-step:not(:first-child)::after {
  background: var(--acc-btn);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-fold) var(--ease-out);
}
.stage-step:is(.now, .done):not(:first-child)::after { transform: scaleX(1); }
.stage-dot {
  position: relative;
  z-index: 1;
  flex: none;
  display: grid;
  place-items: center;
  width: var(--stage-dot);
  height: var(--stage-dot);
  border: calc(var(--bw) * 1.5) solid var(--line2);
  border-radius: var(--r-full);
  background: var(--card);
  color: var(--ink2);
  font-size: var(--fs-s);
  font-weight: var(--fw-semi);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition: background-color var(--dur-fold) var(--ease-out) calc(var(--dur-fold) * .6),
              border-color var(--dur-fold) var(--ease-out) calc(var(--dur-fold) * .6),
              color var(--dur-fold) var(--ease-out) calc(var(--dur-fold) * .6),
              box-shadow var(--dur-fold) var(--ease-out) calc(var(--dur-fold) * .6);
}
.stage-step.now .stage-dot {
  border-color: var(--acc-btn);
  background: var(--acc-btn);
  color: var(--acc-btn-ink);
  box-shadow: 0 0 0 var(--sp-050) var(--acc-weak);
}
.stage-step.done .stage-dot { border-color: var(--acc-btn); background: var(--acc-btn); color: var(--acc-btn-ink); }
.stage-step.done .stage-dot > .ic {
  transition: opacity var(--dur-fold) var(--ease-out), transform var(--dur-fold) var(--ease-out);
}
@starting-style {
  .stage-step.done .stage-dot > .ic { opacity: 0; transform: scale(.5); }
}
.stage-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-s);
  line-height: var(--lh-s);
}
.stage-step.now .stage-label { color: var(--ink); font-weight: var(--fw-semi); }
.stage-step.done .stage-label { color: var(--ink); }
button.stage-step:hover .stage-dot { border-color: var(--acc-btn); }
.stage-step:focus-visible { outline: none; }
.stage-step:focus-visible .stage-dot { box-shadow: 0 0 0 calc(var(--bw) * 2) var(--acc); }
html[data-motion="calm"] :is(.stage-dot, .stage-step.done .stage-dot > .ic),
html[data-motion="calm"] .stage-step::after { transition: none; }
:has(> .stage-steps) { container-type: inline-size; }
/* a narrow column (Atom's side, 248-304px): the names a step smaller; narrower still, only the step in hand keeps its
   name */
@container (max-width: 320px) {
  .stage-steps { --stage-gap: var(--sp-050); }
  .stage-step { padding-inline: 0; }
  .stage-label { font-size: var(--fs-xs); line-height: var(--lh-xs); }
}
@container (max-width: 200px) {
  .stage-step:not(.now) > .stage-label { visibility: hidden; }
}
