/* Designing the pipeline for you (js/flow.js). Load after css/site.css.
   Every class starts with wl- (workflow line). */

.wl-fig { position: relative; margin: 0 0 44px; }
.wl-stage {
  position: relative; height: 268px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2);
}
.wl-stage.wl-v { height: 560px; }
.wl-cap { margin-top: 12px; font: 400 .78rem/1.5 var(--f-mono); color: var(--muted); }

/* ---------------------------------------------------------------- the line */
.wl-line { position: absolute; background: var(--line-2); }
.wl-box {
  position: absolute; display: flex; align-items: flex-start; justify-content: center;
  padding: 9px 8px 0; border: 1px solid var(--line-2); border-radius: 4px; background: var(--bg);
  font: 400 15px/1.2 var(--f-body); color: var(--ink); text-align: center;
  transition: border-color .3s, box-shadow .3s, color .3s, opacity .5s;
}
.wl-v .wl-box { align-items: center; justify-content: flex-start; padding: 0 10px 0 34px; text-align: left; }
.wl-box.is-scan { border-color: var(--ocean); box-shadow: 0 0 0 1px var(--ocean); }
.wl-box.is-cut { border-style: dashed; color: var(--muted); }
.wl-box.is-cut span { text-decoration: line-through; text-decoration-color: var(--bark); }
.wl-box.is-gone { opacity: 0; }
.wl-box.is-neck { border-color: var(--bark); box-shadow: 0 0 0 1px var(--bark); }
.wl-box.is-fixed { border-color: var(--forest); box-shadow: 0 0 0 1px var(--forest); }
.wl-box.is-mend { border-color: var(--ocean); box-shadow: 0 0 0 1px var(--ocean); }
.wl-box.is-auto { border-color: var(--ocean); }

/* quality check after each workflow */
.wl-gate {
  position: absolute; left: 0; top: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border: 1.5px solid var(--forest); border-radius: 50%; background: var(--bg);
  z-index: 2; /* jobs pass behind the check, so the circle stays readable */
  opacity: 0; scale: .3; transition: opacity .3s, scale .45s var(--ease-out), background-color .2s, border-color .2s;
}
.wl-checks .wl-gate { opacity: 1; scale: 1; }
.wl-gate.is-pass { background: var(--forest); }
.wl-gate.is-fail { background: var(--bark); border-color: var(--bark); scale: 1.3; }
.wl-stage .wl-gate.is-gone { opacity: 0; }

/* jobs */
.wl-job {
  position: absolute; left: 0; top: 0; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  z-index: 1; border-radius: 2px; background: var(--ocean); will-change: translate;
  transition: background-color .25s, opacity .3s; animation: wl-in .35s var(--ease-out) both;
}
.wl-job.is-bad { background: var(--bark); }
.wl-job.is-out { opacity: 0; }
@keyframes wl-in { from { opacity: 0; scale: .3; } }
.wl-still .wl-job { animation: none; }

/* notes on the stage */
.wl-tag {
  position: absolute; font: 500 10.5px/1.3 var(--f-mono); white-space: nowrap; color: var(--muted);
  opacity: 0; transition: opacity .3s, color .3s;
}
.wl-h .wl-tag { translate: -50% 0; }
.wl-v .wl-tag { right: 8px; white-space: normal; }
.wl-tag.is-on { opacity: 1; }
.wl-tag[data-k="ocean"] { color: var(--ocean); }
.wl-tag[data-k="forest"] { color: var(--forest); }
.wl-tag[data-k="bark"] { color: var(--bark); }
.wl-now { position: absolute; top: 15px; left: 44px; right: 12px; margin: 0; font: 500 .72rem/1.3 var(--f-mono); color: var(--ink); white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.wl-h .wl-now { display: none; }

/* sketch intro (js/flow.js): a rough pen drawing of the line, then a check mark, then the clean line snaps in */
.wl-sketching .wl-box, .wl-sketching .wl-line { opacity: 0; transition: none; }
.wl-sk { position: absolute; left: 0; top: 0; z-index: 2; overflow: visible; pointer-events: none; transform-origin: 50% 50%; }
.wl-sk path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.wl-sk .wl-sk-s { stroke: var(--ink); stroke-width: 1.6; }
.wl-sk .wl-sk-g { stroke: var(--accent); stroke-width: 1.4; }
.wl-sk .wl-sk-h { stroke: var(--moss); stroke-width: 1.2; opacity: .5; }
.wl-sk .wl-sk-a { stroke: var(--muted); stroke-width: 1.5; }
.wl-sk text {
  font: 400 15px/1 var(--f-body); fill: var(--ink); text-anchor: middle; dominant-baseline: central;
  paint-order: stroke; stroke: var(--bg-2); stroke-width: 4px; stroke-linejoin: round;
}
.wl-sk .wl-sk-start { text-anchor: start; }
.wl-sk .wl-sk-title { font: 500 11px/1 var(--f-mono); letter-spacing: .06em; fill: var(--muted); text-anchor: start; }
.wl-ok { position: absolute; z-index: 3; overflow: visible; pointer-events: none; }
.wl-ok circle { fill: var(--bg); stroke: var(--accent); stroke-width: 3; }
.wl-ok path { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }

.wl-replay {
  position: absolute; top: 10px; right: 10px; display: none; padding: 6px 11px;
  border: 1px solid var(--line-2); border-radius: 4px; background: var(--bg); cursor: pointer;
  font: 500 .72rem/1 var(--f-mono); color: var(--ink);
}
.wl-replay:hover { border-color: var(--ink); }
.wl-done .wl-replay { display: block; }

/* ---------------------------------------------------------------- five principles */
.wl-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px; }
/* Each step has a line on top. The step the line has reached (is-on, set by js/flow.js on the same clock as the
   stage) turns green: the line sweeps across, then the green grows down over the text and the text turns light.
   A thin bar along the bottom of the green fills while the step runs. Finished steps keep a full green line. */
.wl-steps li { position: relative; padding: 16px 12px 18px; border-top: 1px solid var(--line-2); transition: opacity .4s; }
.wl-steps li > * { position: relative; z-index: 1; }
.wl-steps li::before, .wl-steps li::after { content: ""; position: absolute; left: 0; right: 0; top: -1px; }
.wl-steps li::before {
  z-index: 1; height: 3px; background: var(--accent); transform-origin: left; scale: 0 1;
  transition: scale .35s var(--ease-out);
}
.wl-steps li::after {
  bottom: 0; border-radius: 0 0 8px 8px; transform-origin: top; scale: 1 0;
  background: linear-gradient(var(--accent-side), var(--accent-side)) left bottom / calc(var(--wl-p, 0) * 100%) 3px no-repeat, var(--accent);
  transition: scale .3s var(--ease-out);
}
.wl-steps li.is-on::before, .wl-steps li.is-done::before { scale: 1 1; }
.wl-steps li.is-on::after { scale: 1 1; transition: scale .45s var(--ease-out) .25s; }
.wl-run .wl-steps li:not(.is-on):not(.is-done) { opacity: .42; }
.wl-n { display: block; margin-bottom: 10px; font: 500 .74rem/1 var(--f-mono); color: var(--muted); }
.wl-steps h3 { margin: 0 0 6px; font-size: 1.08rem; font-weight: 600; line-height: 1.25; }
.wl-steps p { margin: 0; font-size: .95rem; color: var(--muted); }
.wl-n, .wl-steps h3, .wl-steps p { transition: color .2s ease; }
.wl-steps li.is-on .wl-n, .wl-steps li.is-on h3, .wl-steps li.is-on p { transition: color .3s ease .35s; }
.wl-steps li.is-on h3 { color: var(--accent-ink); }
.wl-steps li.is-on .wl-n { color: color-mix(in oklab, var(--accent-ink) 72%, transparent); }
.wl-steps li.is-on p { color: color-mix(in oklab, var(--accent-ink) 88%, transparent); }

@media (max-width: 1000px) {
  .wl-steps { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .wl-steps li { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); padding: 14px 12px 16px; }
  .wl-n { grid-row: 1 / 3; margin: 4px 0 0; }
  .wl-steps h3, .wl-steps p { grid-column: 2; }
}
