/* One chain of custody, drawn as a single line through four hand-offs (js/chain.js). Flat, one
   line weight, the words on the drawing. The accent marks only the line's drawn head and the task's
   branch; green marks only a verified node. */
.chain {
  --chain-ink: #F4F1EA;
  --chain-soft: rgba(244, 241, 234, .76);
  --chain-muted: rgba(244, 241, 234, .56);
  --chain-ok: #3FCF8E;
  --chain-in: cubic-bezier(.16, 1, .3, 1);
  --chain-state: cubic-bezier(.65, 0, .35, 1);
  --chain-out: cubic-bezier(.7, 0, .84, 0);
  position: relative;
  margin: 0;
  color: var(--chain-ink);
}
.chain .chain-stage { position: relative; }
.chain .chain-svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.chain .chain-list { position: relative; height: 100%; margin: 0; padding: 0; list-style: none; }
.chain .chain-node { position: absolute; margin: 0; }
.chain .chain-task { position: absolute; }

/* the lines */
.chain .chain-track { fill: none; stroke: rgba(244, 241, 234, .13); stroke-width: 1; }
.chain .chain-main { fill: none; stroke: rgba(244, 241, 234, .84); stroke-width: 1.4; }
.chain .chain-tail { fill: none; stroke: var(--accent, #FF9E1B); stroke-width: 1.4; }
.chain .chain-branch { fill: none; stroke: var(--accent, #FF9E1B); stroke-width: 1; stroke-linejoin: round; }
.chain .chain-dot { fill: var(--accent, #FF9E1B); }

/* the rings: open and faint until the line arrives, lit when it does, filled once verified */
.chain .chain-ring circle { transform-box: fill-box; transform-origin: center; }
.chain .r-base { fill: none; stroke: rgba(244, 241, 234, .24); stroke-width: 1.25; }
.chain .r-lit { fill: none; stroke: rgba(244, 241, 234, .92); stroke-width: 1.25; opacity: 0; transition: opacity 200ms var(--chain-out); }
.chain .r-fill { fill: var(--chain-ink); stroke: none; opacity: 0; transform: scale(.72); transition: opacity 200ms var(--chain-out), transform 200ms var(--chain-out); }
.chain .chain-ring.is-on .r-lit { opacity: 1; transition: opacity 280ms var(--chain-in); }
.chain .chain-ring.is-ok .r-fill { opacity: 1; transform: none; transition: opacity 260ms var(--chain-in), transform 380ms var(--chain-in); }
.chain .chain-tring .r-base { stroke: none; }
.chain .chain-tring .r-lit { stroke: var(--accent, #FF9E1B); stroke-width: 1; transform: scale(.82); transition: opacity 200ms var(--chain-out), transform 200ms var(--chain-out); }
.chain .chain-tring.is-open .r-lit { opacity: 1; transform: none; transition: opacity 280ms var(--chain-in), transform 380ms var(--chain-in); }
.chain .chain-tring .r-fill { fill: var(--accent, #FF9E1B); }
.chain .chain-tring.is-done .r-fill { opacity: 1; transform: none; transition: opacity 260ms var(--chain-in), transform 380ms var(--chain-in); }

/* the words */
.chain .chain-txt { position: relative; }
.chain .chain-label { margin: 0; font: 400 11px/14px "Theasi Caps", var(--text); letter-spacing: .22em; text-transform: uppercase; color: rgba(244, 241, 234, .9); }
.chain .chain-who { margin: 6px 0 0; font: 400 13px/1.45 var(--text); color: var(--chain-muted); }
.chain .chain-fact { margin: 12px 0 0; font: 500 16px/1.42 var(--text); letter-spacing: -.006em; color: var(--chain-ink); text-wrap: pretty; }
.chain .chain-time { margin: 8px 0 0; font: 400 13px/1.4 var(--text); color: var(--chain-muted); font-variant-numeric: tabular-nums; }
.chain time { font-variant-numeric: tabular-nums; }
.chain .chain-status { display: grid; margin: 12px 0 0; }
.chain .chain-st { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 8px; justify-self: start; font: 400 10.5px/14px "Theasi Caps", var(--text); letter-spacing: .22em; text-transform: uppercase; color: var(--chain-soft); white-space: nowrap; }
.chain .chain-st time { margin-left: -3px; font: 400 11.5px/14px var(--text); letter-spacing: .02em; text-transform: none; color: var(--chain-soft); }
.chain .chain-st-no { color: var(--chain-muted); }
.chain .chain-mk { width: 12px; height: 12px; flex: none; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.chain .chain-st-ok .chain-mk { stroke: var(--chain-ok); stroke-width: 1.7; }
.chain .chain-st-no .chain-mk { stroke: currentColor; stroke-width: 1.25; }

/* a node waiting for the line: its name and holder dimmed, its fact not yet written */
.chain .chain-label, .chain .chain-who { opacity: .42; transition: opacity 360ms var(--chain-out); }
.chain .chain-fact, .chain .chain-time, .chain .chain-st { opacity: 0; transform: translateY(6px); transition: opacity 260ms var(--chain-out), transform 260ms var(--chain-out); }
/* the line arrives: the ring leads, the fact follows, then its time, then its status */
.chain .is-on > .chain-txt .chain-label, .chain .is-on > .chain-txt .chain-who { opacity: 1; transition: opacity 420ms var(--chain-in); }
.chain .is-on > .chain-txt .chain-fact { opacity: 1; transform: none; transition: opacity 560ms var(--chain-in) 140ms, transform 640ms var(--chain-in) 140ms; }
.chain .is-on > .chain-txt .chain-time { opacity: 1; transform: none; transition: opacity 560ms var(--chain-in) 280ms, transform 640ms var(--chain-in) 280ms; }
.chain .is-on:not(.is-ok) > .chain-txt .chain-st-no,
.chain .is-ok > .chain-txt .chain-st-ok { opacity: 1; transform: none; transition: opacity 520ms var(--chain-in) 420ms, transform 600ms var(--chain-in) 420ms; }
/* storage, verified late: the decline steps aside and the verification takes its place */
.chain .chain-node--declined.is-ok > .chain-txt .chain-st-ok { transition-delay: 160ms; }

/* the task: named and held when the branch reaches it, answered when its answer is signed */
.chain .chain-task .chain-label, .chain .chain-task .chain-who { opacity: 0; transform: translateY(6px); transition: opacity 260ms var(--chain-out), transform 260ms var(--chain-out); }
.chain .chain-task.is-open .chain-label { opacity: 1; transform: none; transition: opacity 520ms var(--chain-in), transform 600ms var(--chain-in); }
.chain .chain-task.is-open .chain-who { opacity: 1; transform: none; transition: opacity 520ms var(--chain-in) 140ms, transform 600ms var(--chain-in) 140ms; }
.chain .chain-task.is-done .chain-fact { opacity: 1; transform: none; transition: opacity 560ms var(--chain-in), transform 640ms var(--chain-in); }
.chain .chain-task.is-done .chain-time { opacity: 1; transform: none; transition: opacity 560ms var(--chain-in) 140ms, transform 640ms var(--chain-in) 140ms; }

/* one soft light across a node as it is verified, once */
.chain .chain-glint { position: absolute; inset: -8px -14px; overflow: hidden; pointer-events: none; visibility: hidden; }
.chain .chain-glint-w, .chain .chain-glint-i { position: absolute; inset: 0; }
.chain .chain-glint-w { -webkit-mask-image: linear-gradient(104deg, transparent 32%, #000 50%, transparent 68%); mask-image: linear-gradient(104deg, transparent 32%, #000 50%, transparent 68%); transform: translateX(-100%); }
.chain .chain-glint-i { padding: 8px 14px; transform: translateX(100%); }
.chain .chain-glint .chain-txt * { opacity: 1 !important; transform: none !important; transition: none !important; color: #FFFFFF; text-shadow: 0 0 14px rgba(255, 246, 230, .55); }
.chain .chain-glint .chain-mk { stroke: #FFFFFF; }
.chain .is-glint > .chain-glint { visibility: visible; }
.chain .is-glint > .chain-glint .chain-glint-w { animation: chain-sweep 1100ms var(--chain-state) 300ms both; will-change: transform; }
.chain .is-glint > .chain-glint .chain-glint-i { animation: chain-sweep-back 1100ms var(--chain-state) 300ms both; will-change: transform; }
@keyframes chain-sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes chain-sweep-back { from { transform: translateX(100%); } to { transform: translateX(-100%); } }

.chain .chain-cap { margin-top: 32px; font: 400 13px/1.5 var(--text); color: rgba(244, 241, 234, .5); }

/* phone: the line runs down the left, each node's words to its right */
.chain.chain--col .chain-fact { font-size: 15px; line-height: 1.45; }
.chain.chain--col .chain-who { font-size: 13px; }
.chain.chain--col .chain-time { font-size: 12.5px; }
.chain.chain--col .chain-status { margin-top: 10px; }
.chain.chain--col .chain-cap { margin-top: 24px; }

/* reduced motion, or no motion library: the finished chain, drawn at once */
.chain.chain--still *, .chain.chain--still *::before, .chain.chain--still *::after { transition: none !important; animation: none !important; }
.chain.chain--still .chain-glint { display: none; }
@media (prefers-reduced-motion: reduce) {
  .chain *, .chain *::before, .chain *::after { transition: none !important; animation: none !important; }
  .chain .chain-glint { display: none; }
}

/* facts that belong together sit side by side, set apart by a hairline, never by commas. Every
   part carries its hairline on its left; the strip to the left of the text is clipped away, so a
   part that wraps to the start of a line never shows one */
.chain .facet-row { margin-left: -1.1em; clip-path: inset(0 0 0 1.1em); }
.chain .facet-row > .facet { display: inline-block; position: relative; margin-left: .55em; padding-left: .55em; }
.chain .facet-row > .facet::before { content: ""; position: absolute; left: 0; top: 50%; width: 1px; height: .8em; transform: translateY(-50%); background: currentColor; opacity: .3; }
