/* ─────────────────────────────────────────────────────────────────────
   Operforma — Loading stages / phases
   Four variants:
     A · Dimension stepper (paper, horizontal)
     B · Vertical timeline (paper)
     C · Pipeline runner   (paper, async with substeps + duration)
     D · Ink dimension     (ink, statement surface)
   Disciplines:
     · No transforms, no fades, no scale. Loading = background-position
       animation on a repeating indigo stripe — same family as surveyor tape.
     · States: is-done · is-current · is-upcoming.
     · Mono carries every number (Roman, elapsed time, durations).
     · prefers-reduced-motion is honoured (animation collapses).
   ───────────────────────────────────────────────────────────────────── */

/* Tokens come from tokens.css (loaded ahead of this sheet). The standalone
   demo's @import and global html/body reset are intentionally dropped so this
   can be linked as a component stylesheet alongside base.css/customer.css. */

/* ── The surveyor-tape primitive ──────────────────────────────────────
   A 1px horizontal rule whose fill is a repeating indigo dash that
   marches left-to-right via background-position. Used in the current
   state of every variant. NOT a transform — same animation register
   as the codebase's mk-prog-fill. */
@keyframes os-march {
  from { background-position: 0 0; }
  to   { background-position: 16px 0; }
}
.os-tape {
  height: 1px;
  background:
    repeating-linear-gradient(
      90deg,
      var(--accent) 0 6px,
      transparent 6px 16px
    ),
    linear-gradient(var(--line), var(--line));
  background-size: 16px 1px, 100% 1px;
  background-repeat: repeat-x, no-repeat;
  animation: os-march 0.9s linear infinite;
}
.os-tape--dark {
  background:
    repeating-linear-gradient(
      90deg,
      var(--indigo-soft) 0 6px,
      transparent 6px 16px
    ),
    linear-gradient(var(--line-dark), var(--line-dark));
  background-size: 16px 1px, 100% 1px;
  background-repeat: repeat-x, no-repeat;
}
@media (prefers-reduced-motion: reduce) {
  .os-tape { animation: none; }
}

/* The "you-are-here" indigo crosshair tick. 1px stroke, 8px tall,
   indigo. Sits above the current step. Rare; load-bearing. */
.os-here {
  display: block;
  width: 1px;
  height: 8px;
  background: var(--accent);
  margin: 0 auto 6px;
}

/* ─────────────────────────────────────────────────────────────────────
   VARIANT A · Dimension stepper (horizontal, paper)
   ───────────────────────────────────────────────────────────────────── */
.os-dim {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  flex-wrap: wrap;
  row-gap: 22px;
}
.os-dim-tick {
  width: 1px;
  height: 10px;
  background: var(--accent);
  flex-shrink: 0;
}
.os-dim-rule {
  flex: 1 1 16px;
  min-width: 8px;
  height: 1px;
  background: var(--line);
}
.os-dim-rule.is-done    { background: var(--soft); }
.os-dim-rule.is-current { background: transparent; padding: 0; }
.os-dim-rule.is-current .os-tape { width: 100%; }

.os-dim-step {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  flex-shrink: 0;
  position: relative;
}
.os-dim-step .os-dim-row {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}
.os-dim-num {
  font-weight: 500;
  letter-spacing: 0.20em;
  min-width: 18px;
  white-space: nowrap;
}
.os-dim-label {
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.os-dim-meta {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--soft);
  margin-left: 28px;
  white-space: nowrap;
}

.os-dim-step.is-done    { color: var(--soft); }
.os-dim-step.is-done    .os-dim-num { color: var(--soft); }
.os-dim-step.is-current { color: var(--ink); }
.os-dim-step.is-current .os-dim-num { color: var(--accent); }
.os-dim-step.is-current .os-dim-label {
  box-shadow: inset 0 -1px 0 0 var(--accent);
  padding-bottom: 2px;
}
.os-dim-step.is-current .os-dim-meta { color: var(--accent); }
.os-dim-step.is-upcoming { color: var(--soft); }
.os-dim-step.is-upcoming .os-dim-num { color: var(--soft); }
.os-dim-step.is-upcoming .os-dim-meta { color: var(--soft); }

/* ─────────────────────────────────────────────────────────────────────
   VARIANT B · Vertical timeline (paper)
   Phase column with description, mono duration, indigo "you are here".
   ───────────────────────────────────────────────────────────────────── */
.os-tl {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: 20px;
}
.os-tl-row {
  display: contents;
}
.os-tl-rail {
  position: relative;
  width: 28px;
}
.os-tl-rail::before {
  /* connector line from this node to the next, top-aligned */
  content: '';
  position: absolute;
  left: 13.5px;
  top: 18px;
  bottom: -28px;
  width: 1px;
  background: var(--line);
}
.os-tl-row:last-child .os-tl-rail::before { display: none; }
.os-tl-rail .os-tl-node {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--mid);
  margin: 6px 0 0 8px;
  position: relative;
  z-index: 1;
}

/* States · vertical */
.os-tl-row.is-done .os-tl-node {
  background: var(--accent);
  border-color: var(--accent);
}
.os-tl-row.is-done .os-tl-rail::before {
  background: var(--soft);
}
.os-tl-row.is-current .os-tl-node {
  background: var(--paper);
  border: 1px solid var(--accent);
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 6px var(--accent);
}
.os-tl-row.is-current .os-tl-rail::before {
  /* the marching surveyor line points to the next, upcoming phase */
  background:
    repeating-linear-gradient(
      0deg,
      var(--accent) 0 6px,
      transparent 6px 16px
    );
  background-size: 1px 16px;
  animation: os-march-v 0.9s linear infinite;
}
@keyframes os-march-v {
  from { background-position: 0 0; }
  to   { background-position: 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .os-tl-row.is-current .os-tl-rail::before { animation: none; }
}
.os-tl-row.is-upcoming .os-tl-node {
  background: var(--paper);
  border: 1px solid var(--mid);
  opacity: 0.7;
}

.os-tl-body {
  padding: 0 0 28px;
}
.os-tl-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}
.os-tl-titlewrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}
.os-tl-num {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--soft);
  flex-shrink: 0;
}
.os-tl-row.is-current .os-tl-num { color: var(--accent); }
.os-tl-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.os-tl-row.is-upcoming .os-tl-title { color: var(--soft); }
.os-tl-row.is-done .os-tl-title { color: var(--soft); }
.os-tl-meta {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--soft);
  white-space: nowrap;
}
.os-tl-row.is-current .os-tl-meta { color: var(--accent); }
.os-tl-desc {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.55;
  color: var(--soft);
  margin-top: 6px;
  max-width: 56ch;
}
.os-tl-row.is-upcoming .os-tl-desc { color: var(--soft); }
.os-tl-here {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.os-tl-here::before {
  content: '';
  width: 16px;
  height: 1px;
  background: var(--accent);
}

/* ─────────────────────────────────────────────────────────────────────
   VARIANT C · Pipeline runner (paper)
   Async multi-phase job. Current phase expanded with substeps.
   ───────────────────────────────────────────────────────────────────── */
.os-pipe {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.os-pipe-phase {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
.os-pipe-phase:last-child { border-bottom: none; }

.os-pipe-id {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 22px;
  color: var(--accent);
}
.os-pipe-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.os-pipe-phase.is-done .os-pipe-name,
.os-pipe-phase.is-upcoming .os-pipe-name {
  color: var(--soft);
}
.os-pipe-phase.is-upcoming .os-pipe-id { color: var(--soft); }
.os-pipe-phase.is-done .os-pipe-id     { color: var(--soft); }

.os-pipe-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--soft);
}
.os-pipe-status .os-pipe-dur {
  color: var(--soft);
  letter-spacing: 0.04em;
}
.os-pipe-phase.is-done .os-pipe-status { color: var(--soft); }
.os-pipe-phase.is-done .os-pipe-status::before {
  content: '──';
  letter-spacing: -0.05em;
  color: var(--accent);
  font-weight: 500;
}
.os-pipe-phase.is-current .os-pipe-status { color: var(--accent); }
.os-pipe-phase.is-current .os-pipe-dur { color: var(--accent); }

/* Expanded body — only present on the current phase */
.os-pipe-body {
  grid-column: 2 / 4;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--ash);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.os-pipe-tape {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
}
.os-pipe-tape .os-tape { width: 100%; }
.os-pipe-pct {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.02em;
  min-width: 44px;
  text-align: right;
}
.os-pipe-subs {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.os-pipe-sub {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--soft);
}
.os-pipe-sub .os-pipe-sub-mark {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--soft);
}
.os-pipe-sub.is-done    .os-pipe-sub-mark { color: var(--accent); }
.os-pipe-sub.is-current .os-pipe-sub-mark { color: var(--accent); }
.os-pipe-sub.is-current { color: var(--ink); }
.os-pipe-sub.is-upcoming { color: var(--soft); }
.os-pipe-sub-time {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--soft);
}
.os-pipe-sub.is-current .os-pipe-sub-time { color: var(--accent); }

/* ─────────────────────────────────────────────────────────────────────
   VARIANT D · Ink dimension line (statement surface)
   Single editorial horizontal line for marketing/email/cold-reach.
   ───────────────────────────────────────────────────────────────────── */
.os-ink-wrap {
  background: var(--ink);
  color: var(--paper);
  padding: 48px 40px;
}
.os-ink-eyebrow {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--indigo-soft);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.os-ink-eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: currentColor;
}
.os-ink-line {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.os-ink-tick {
  width: 1px;
  height: 12px;
  background: var(--indigo-soft);
  flex-shrink: 0;
}
.os-ink-rule {
  flex: 1 1 24px;
  height: 1px;
  background: var(--line-dark);
}
.os-ink-rule.is-done { background: var(--grey-mid); }
.os-ink-rule.is-current {
  background: transparent;
}
.os-ink-rule.is-current .os-tape { width: 100%; }
.os-ink-step {
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  flex-shrink: 0;
}
.os-ink-row { display: inline-flex; align-items: baseline; gap: 10px; }
.os-ink-num {
  font-weight: 500;
  letter-spacing: 0.20em;
  min-width: 22px;
}
.os-ink-step.is-done    { color: var(--grey); }
.os-ink-step.is-done    .os-ink-num { color: var(--grey-mid); }
.os-ink-step.is-current { color: var(--white); }
.os-ink-step.is-current .os-ink-num { color: var(--indigo-soft); }
.os-ink-step.is-current .os-ink-label {
  box-shadow: inset 0 -1px 0 0 var(--indigo-soft);
  padding-bottom: 2px;
}
.os-ink-step.is-upcoming { color: var(--grey-mid); }
.os-ink-step.is-upcoming .os-ink-num { color: var(--grey-mid); opacity: 0.7; }

.os-ink-headline {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--white);
  margin-top: 28px;
  max-width: 28ch;
}
.os-ink-headline em {
  font-style: normal;
  color: var(--indigo-soft);
}
.os-ink-coords {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--grey-mid);
  display: flex;
  gap: 24px;
}
.os-ink-coords strong {
  font-weight: 500;
  color: var(--white);
}

/* ─────────────────────────────────────────────────────────────────────
   Specimen card scaffolding for the canvas artboards
   ───────────────────────────────────────────────────────────────────── */
.os-card {
  background: var(--paper);
  padding: 40px 44px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100%;
}
.os-card--ink { background: var(--ink); padding: 0; }
.os-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ash);
}
.os-card-head .os-card-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.os-card-head .os-card-id {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.os-card-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--ash);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--soft);
  display: flex;
  gap: 18px;
}
.os-card--ink .os-card-head { border-bottom-color: var(--line-dark); padding: 0 40px 16px; }
.os-card--ink .os-card-head .os-card-title { color: var(--white); }
.os-card--ink .os-card-head .os-card-id { color: var(--indigo-soft); }
.os-card--ink .os-card-foot {
  border-top-color: var(--line-dark);
  color: var(--grey-soft);
  padding: 16px 40px 0;
}
