/* =====================================================================
   STORY ANIMATIONS — ported from the investor deck (Object Fingerprinting v15)
   1. .jcycle      — the CSSD cycle: OR → transport → wash → MANUAL ID (bottleneck) → autoclave
   2. .stagecard   — three play-once stages: manual (nurse) / assisted (scanner) / automated (conveyor)
   Scenes are pure CSS animation; .stagecard choreography is triggered by
   story.js adding .arm (hidden start) then .play when scrolled into view.
   ===================================================================== */

/* ===== Shared SVG palette for scenes ===== */
:root {
  --sc-ink:    oklch(0.78 0.02 240);
  --sc-mute:   oklch(0.48 0.012 240);
  --sc-dim:    oklch(0.30 0.010 240);
  --sc-accent: oklch(0.82 0.16 200);
  --sc-warm:   oklch(0.86 0.16 80);
  --sc-rose:   oklch(0.74 0.16 18);
  --sc-mint:   oklch(0.82 0.16 145);
  --sc-skin:   oklch(0.74 0.06 60);
  --sc-scrub:  oklch(0.40 0.045 220);
  --sc-hair:   oklch(0.28 0.02 60);
}

/* =====================================================================
   1 · THE CYCLE  (.jcycle)
   ===================================================================== */
.jcycle .cycle {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 22px 1fr 22px 1fr 22px 1fr 22px 1fr;
  align-items: stretch;
  gap: 0;
}
.jcycle .node {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 10px;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 10px;
  position: relative;
  overflow: hidden;
}
.jcycle .node.bottleneck { border-color: oklch(0.74 0.16 18 / 0.5); box-shadow: inset 0 0 0 1px oklch(0.74 0.16 18 / 0.25); }
.jcycle .node.bottleneck .badge {
  position: absolute; top: 10px; right: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
  background: oklch(0.74 0.16 18 / 0.16);
  color: var(--rose);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid oklch(0.74 0.16 18 / 0.4);
  z-index: 2;
}
.jcycle .node .scene {
  position: relative;
  width: 100%;
  height: clamp(130px, 14vw, 190px);
  border-radius: 10px;
  background: radial-gradient(ellipse at 50% 60%, oklch(0.20 0.014 240), oklch(0.10 0.010 240) 75%);
  overflow: hidden;
}
.jcycle .node .scene::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.25;
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 0%, transparent 80%);
          mask-image: radial-gradient(ellipse at 50% 50%, black 0%, transparent 80%);
  pointer-events: none;
}
.jcycle .node .scene svg {
  width: 100%; height: 100%;
  display: block;
  position: relative;
  z-index: 1;
}
.jcycle .node .lbl {
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--ink);
  text-align: center;
  padding: 2px 0 4px;
}
.jcycle .node .lbl .step {
  display: block;
  color: var(--accent);
  font-size: 9px;
  letter-spacing: 0.18em;
  margin-bottom: 3px;
}
.jcycle .node.bottleneck .lbl .step { color: var(--rose); }

.jcycle .arrow {
  display: grid; place-items: center;
  color: var(--accent);
  font-size: 18px;
  font-family: "JetBrains Mono", monospace;
  position: relative;
}
.jcycle .arrow::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  border-top: 1px dashed var(--accent);
  opacity: 0.35;
  transform: translateY(-50%);
  margin: 0 -4px;
}
.jcycle .arrow span {
  position: relative;
  background: var(--bg-0);
  padding: 2px 4px;
  z-index: 1;
}

.jcycle .loop {
  display: flex; align-items: center; justify-content: space-between;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  padding: 14px 4px 0;
}
.jcycle .loop .arrow-back {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  margin: 0 18px;
  opacity: 0.6;
}
.jcycle .loop b { color: var(--ink); font-weight: 500; }

@media (max-width: 920px) {
  .jcycle .cycle { grid-template-columns: 1fr 1fr; gap: 10px; }
  .jcycle .arrow { display: none; }
  .jcycle .node .scene { height: clamp(140px, 26vw, 200px); }
  .jcycle .node.bottleneck { grid-column: 1 / -1; }
  .jcycle .loop { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 560px) {
  .jcycle .cycle { grid-template-columns: 1fr; }
}

/* ─── Scene 01: Operating room ─────────────────────────── */
.sc-or .light-cone   { fill: var(--sc-warm); opacity: 0.10; animation: cone 4s ease-in-out infinite; transform-origin: 120px 70px; }
.sc-or .lamp-main    { fill: var(--sc-warm); animation: glow-main 4s ease-in-out infinite; }
.sc-or .lamp-rim     { fill: none; stroke: var(--sc-warm); stroke-width: 1.5; opacity: 0.7; }
.sc-or .lamp-sat     { fill: var(--sc-warm); animation: glow-sat 4s ease-in-out infinite; }
.sc-or .lamp-sat.s2  { animation-delay: 0.7s; }
.sc-or .lamp-arm     { stroke: var(--sc-dim); stroke-width: 2; }
.sc-or .drape        { fill: var(--sc-mute); }
.sc-or .body         { fill: var(--sc-mute); }
.sc-or .scalpel      {
  transform-box: fill-box;
  transform-origin: center;
  animation: scalpel-bob 2.8s ease-in-out infinite;
  filter: drop-shadow(0 0 4px var(--sc-accent));
}
.sc-or .ecg          { fill: none; stroke: var(--sc-mint); stroke-width: 1.4; stroke-dasharray: 200; stroke-dashoffset: 200; animation: ecg-scan 3s linear infinite; }
@keyframes glow-main { 0%,100% { opacity: 0.85; filter: drop-shadow(0 0 6px var(--sc-warm)); } 50% { opacity: 1; filter: drop-shadow(0 0 18px var(--sc-warm)); } }
@keyframes glow-sat  { 0%,100% { opacity: 0.6; } 50% { opacity: 0.95; } }
@keyframes cone      { 0%,100% { opacity: 0.06; } 50% { opacity: 0.16; } }
@keyframes ecg-scan  { 0% { stroke-dashoffset: 200; } 100% { stroke-dashoffset: -200; } }
@keyframes scalpel-bob {
  0%, 100% { transform: translateY(0)    rotate(132deg); }
  50%      { transform: translateY(-3px) rotate(138deg); }
}

/* ─── Scene 02: Conveyor (trays + falling instruments) ─── */
.sc-conveyor .belt        { fill: oklch(0.18 0.012 240); stroke: var(--sc-mute); stroke-width: 1.2; }
.sc-conveyor .belt-arrows .chev { fill: none; stroke: var(--sc-mute); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0.6; }
.sc-conveyor .belt-arrows { animation: belt-scroll 1s linear infinite; }
.sc-conveyor .roller      { fill: oklch(0.30 0.012 240); stroke: var(--sc-mute); stroke-width: 1.2; }
.sc-conveyor .tray-shape  { fill: oklch(0.22 0.012 240); stroke: var(--sc-mute); stroke-width: 1.4; stroke-linejoin: round; }
.sc-conveyor .tray .inst  { stroke: var(--sc-ink); stroke-width: 1.6; stroke-linecap: round; opacity: 0.85; }
.sc-conveyor .tray        { animation: tray-travel 3s linear infinite; }
.sc-conveyor .tray.t2     { animation-delay: -1s; }
.sc-conveyor .tray.t3     { animation-delay: -2s; }
.sc-conveyor .fall        { animation: drop-inst 3s linear infinite; }
.sc-conveyor .fall.f1     { animation-delay: 0s;    --fx: 118px; }
.sc-conveyor .fall.f2     { animation-delay: -0.1s; --fx: 124px; }
.sc-conveyor .fall.f3     { animation-delay: -1.0s; --fx: 116px; }
.sc-conveyor .fall.f4     { animation-delay: -1.1s; --fx: 122px; }
.sc-conveyor .fall.f5     { animation-delay: -2.0s; --fx: 120px; }
.sc-conveyor .fall.f6     { animation-delay: -2.1s; --fx: 126px; }
@keyframes belt-scroll { from { transform: translateX(0); } to { transform: translateX(16px); } }
@keyframes tray-travel {
  0%   { transform: translateX(-64px); }
  100% { transform: translateX(240px); }
}
@keyframes drop-inst {
  0%   { transform: translate(var(--fx,120px), -30px)  rotate(0deg);   opacity: 0; }
  2%   { opacity: 1; }
  14%  { transform: translate(var(--fx,120px), 110px)  rotate(280deg); opacity: 1; }
  17%  { transform: translate(var(--fx,120px), 132px)  rotate(360deg); opacity: 0; }
  100% { transform: translate(var(--fx,120px), -30px)  rotate(0deg);   opacity: 0; }
}

/* ─── Scene 03: Washer (rotating spray) ────────────────── */
.sc-washer .chamber   { fill: none; stroke: var(--sc-mute); stroke-width: 1.6; }
.sc-washer .spray-hub { fill: var(--sc-accent); }
.sc-washer .spray-arm-g {
  transform-origin: 120px 80px;
  animation: spray-spin 2.6s linear infinite;
}
.sc-washer .spray-arm { stroke: var(--sc-accent); stroke-width: 2.6; stroke-linecap: round; }
.sc-washer .nozzle    { fill: var(--sc-accent); }
.sc-washer .drop      {
  fill: var(--sc-accent);
  animation: drop-fall 1.2s linear infinite;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.sc-washer .drop.d1 { animation-delay: 0.0s; }
.sc-washer .drop.d2 { animation-delay: 0.3s; }
.sc-washer .drop.d3 { animation-delay: 0.6s; }
.sc-washer .drop.d4 { animation-delay: 0.9s; }
.sc-washer .drop.d5 { animation-delay: 0.15s; }
.sc-washer .drop.d6 { animation-delay: 0.45s; }
.sc-washer .drop.d7 { animation-delay: 0.75s; }
.sc-washer .inst    { stroke: var(--sc-mute); stroke-width: 2; stroke-linecap: round; fill: none; }
.sc-washer .rod     { stroke: var(--sc-ink); stroke-width: 2.4; stroke-linecap: round; opacity: 0.7; }
@keyframes spray-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes drop-fall {
  0%   { transform: translateY(0);   opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(70px); opacity: 0; }
}

/* ─── Scene 04: Manual ID — face + hand + checklist ────── */
.sc-hand .face .head     { fill: var(--sc-mute); }
.sc-hand .face .brow     { animation: brow-furrow 4s ease-in-out infinite; transform-origin: 66px 56px; }
.sc-hand .face .eye-white { fill: var(--sc-ink); }
.sc-hand .face .pupil    {
  fill: var(--sc-rose);
  animation: eye-scan 2s ease-in-out infinite;
  transform-box: fill-box; transform-origin: center;
}
.sc-hand .gaze           {
  stroke: var(--sc-rose);
  stroke-width: 1.2;
  stroke-dasharray: 3 5;
  opacity: 0.55;
  animation: gaze-scan 1.4s linear infinite;
}
.sc-hand .hand           { fill: var(--sc-mute); }
.sc-hand .inst-held      {
  transform-box: fill-box;
  transform-origin: center;
  animation: inspect-rotate 4s ease-in-out infinite;
}
.sc-hand .inst-held .body-r { stroke: var(--sc-ink); stroke-width: 2.6; stroke-linecap: round; fill: none; }
.sc-hand .inst-held .qr  { animation: qr-flicker 4s ease-in-out infinite; }
.sc-hand .checklist .sheet { fill: var(--sc-dim); stroke: var(--sc-mute); stroke-width: 1; opacity: 0.85; }
.sc-hand .checklist .check { opacity: 0; animation: tick-cycle 4s ease-in-out infinite; }
.sc-hand .checklist .row.r1 .check { animation-delay: 0.4s; }
.sc-hand .checklist .row.r2 .check { animation-delay: 1.3s; }
.sc-hand .checklist .row.r3 .check { animation-delay: 2.2s; }
.sc-hand .checklist .row.r3 .check.active { stroke: var(--sc-rose); }
@keyframes eye-scan {
  0%, 100% { transform: translate(0, 0); }
  30%      { transform: translate(-1.5px, 0); }
  60%      { transform: translate(1.5px, 0); }
}
@keyframes gaze-scan {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: 16; }
}
@keyframes inspect-rotate {
  0%, 100% { transform: rotate(-8deg); }
  35%      { transform: rotate(28deg); }
  65%      { transform: rotate(-18deg); }
}
@keyframes brow-furrow {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-1.5px); }
}
@keyframes qr-flicker { 0%,100% { opacity: 0.35; } 50% { opacity: 0.9; } }
@keyframes tick-cycle {
  0%, 10%  { opacity: 0; transform: scale(0.6); }
  20%      { opacity: 1; transform: scale(1.15); }
  30%, 85% { opacity: 1; transform: scale(1); }
  100%     { opacity: 0; transform: scale(0.6); }
}

/* ─── Scene 05: Autoclave (steam + bacteria) ───────────── */
.sc-auto .chamber  { fill: none; stroke: var(--sc-mute); stroke-width: 1.8; }
.sc-auto .door     { fill: var(--sc-dim); opacity: 0.4; }
.sc-auto .gauge    { fill: none; stroke: var(--sc-warm); stroke-width: 1.4; }
.sc-auto .temp     { fill: var(--sc-warm); font-family: "JetBrains Mono", monospace; font-size: 14px; font-weight: 600; letter-spacing: 0.08em; }
.sc-auto .heat-wave { fill: none; stroke: var(--sc-warm); stroke-width: 1.2; opacity: 0; animation: heat 2.2s ease-out infinite; }
.sc-auto .heat-wave.h2 { animation-delay: 0.7s; }
.sc-auto .heat-wave.h3 { animation-delay: 1.4s; }
.sc-auto .puff     { fill: var(--sc-ink); opacity: 0; animation: puff 2.4s ease-out infinite; }
.sc-auto .puff.p2  { animation-delay: 0.5s; }
.sc-auto .puff.p3  { animation-delay: 1.0s; }
.sc-auto .puff.p4  { animation-delay: 1.5s; }
.sc-auto .puff.p5  { animation-delay: 0.2s; }
.sc-auto .bact     {
  transform-box: fill-box;
  transform-origin: center;
  animation: bact-pop 2.2s ease-in infinite;
}
.sc-auto .bact.b2  { animation-delay: 0.6s; }
.sc-auto .bact.b3  { animation-delay: 1.2s; }
.sc-auto .bact.b4  { animation-delay: 1.8s; }
.sc-auto .bact .cell    { fill: var(--sc-rose); }
.sc-auto .bact .flag    { stroke: var(--sc-rose); stroke-width: 1; fill: none; }
@keyframes heat {
  0%   { opacity: 0; transform: translateY(0); }
  20%  { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-50px); }
}
@keyframes puff {
  0%   { opacity: 0; transform: translateY(0) scale(0.5); }
  15%  { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(-90px) scale(1.6); }
}
@keyframes bact-pop {
  0%, 60%  { transform: scale(1); opacity: 1; }
  75%      { transform: scale(1.4); opacity: 0.7; }
  85%      { transform: scale(0.2); opacity: 0; }
  100%     { transform: scale(1); opacity: 1; }
}

/* =====================================================================
   2 · STAGE CARDS  (.stagecard) — manual / assisted / automated
   ===================================================================== */
.stagecard { margin-top: 56px; }
.stagecard .stage-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
}
.stagecard .stage-eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent);
}
.stagecard.tone-pain .stage-eyebrow { color: var(--rose); }
.stagecard .stage-head h3 {
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.02; letter-spacing: -0.02em;
  margin-top: 10px;
  color: var(--ink);
}
.stagecard .stage-metric {
  text-align: right;
  font-family: "JetBrains Mono", monospace;
  flex-shrink: 0;
}
.stagecard .stage-metric .n { font-size: clamp(34px, 4.6vw, 54px); font-weight: 600; line-height: 0.9; letter-spacing: -0.02em; }
.stagecard .stage-metric .n small { font-size: 0.45em; margin-left: 2px; }
.stagecard .stage-metric .u {
  font-size: 11px; color: var(--ink-dim); letter-spacing: 0.1em;
  text-transform: uppercase; margin-top: 8px; max-width: 260px; margin-left: auto;
}
.stagecard.tone-pain .stage-metric .n { color: var(--rose); }
.stagecard.tone-sol  .stage-metric .n { color: var(--mint); }

.stagecard .stage-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1280 / 540;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: radial-gradient(ellipse at 50% 58%, oklch(0.19 0.014 240), oklch(0.09 0.010 240) 78%);
}
.stagecard.tone-pain .stage-wrap { box-shadow: inset 0 0 0 1px oklch(0.74 0.16 18 / 0.18); }
.stagecard .stage-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.22;
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 0%, transparent 82%);
          mask-image: radial-gradient(ellipse at 50% 50%, black 0%, transparent 82%);
}
.stagecard .scene-svg { position: relative; z-index: 1; width: 100%; height: 100%; display: block; }

.stagecard .stage-note {
  margin-top: 14px;
  color: var(--ink-mute);
  font-size: 15px;
  max-width: 720px;
}
.stagecard .stage-note b { color: var(--ink); font-weight: 500; }

@media (max-width: 720px) {
  .stagecard .stage-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .stagecard .stage-metric { text-align: left; }
  .stagecard .stage-metric .u { margin-left: 0; }
}

/* ─── Stage 02a — Nurse, manual (rose / pain) ─────────────── */
.sc-nurse .hn-qr { opacity: 0.85; }
.sc-nurse .hn-gaze {
  stroke: var(--sc-rose); stroke-width: 2.4; stroke-dasharray: 5 8;
  opacity: 0.7; stroke-linecap: round;
}
/* RESTING state = final, complete frame */
.sc-nurse .hn-held-rot { transform-box: fill-box; transform-origin: center; }
.sc-nurse .hn-mag { opacity: 0.9; transform: translate(220px, 120px); }
.sc-nurse .hn-clip { transform: translate(220px, 120px); }
.sc-nurse .hn-pen { transform: translate(1200px, 256px); }
.sc-nurse .hn-sheet { fill: oklch(0.26 0.010 240); stroke: var(--sc-mute); stroke-width: 1.5; }
.sc-nurse .hn-tick { opacity: 0; }
.sc-nurse .hn-tick.done { opacity: 0.45; }
.sc-nurse .hn-tick-new { stroke-dasharray: 48; stroke-dashoffset: 0; opacity: 1; }
.sc-nurse .hn-held { opacity: 1; }
.sc-nurse .hn-next { opacity: 0.7; transform: translate(470px, 430px); }

/* ARMED state = hidden start (added before play → no flash) */
.stagecard.arm .sc-nurse .hn-gaze     { opacity: 0; }
.stagecard.arm .sc-nurse .hn-mag      { opacity: 0; transform: translate(40px, 30px); }
.stagecard.arm .sc-nurse .hn-clip     { transform: translate(40px, 30px); }
.stagecard.arm .sc-nurse .hn-pen      { transform: translate(1252px, 200px); }
.stagecard.arm .sc-nurse .hn-tick-new { stroke-dashoffset: 48; opacity: 0; }
.stagecard.arm .sc-nurse .hn-held     { opacity: 0; }
.stagecard.arm .sc-nurse .hn-next     { opacity: 0; transform: translate(470px, 486px); }

/* play-once choreography (≈ 7s) */
.stagecard.play .sc-nurse .hn-held      { animation: hn-rise 1.1s ease-out 0.2s both; }
.stagecard.play .sc-nurse .hn-held-rot  { animation: hn-inspect 2.0s ease-in-out 1.3s both; }
.stagecard.play .sc-nurse .hn-gaze      { animation: hn-gaze-in 0.6s ease-out 0.8s both, hn-gaze-dash 1.2s linear 0.8s infinite; }
.stagecard.play .sc-nurse .hn-mag       { animation: hn-mag-sweep 1.6s ease-in-out 2.6s both; }
.stagecard.play .sc-nurse .hn-clip      { animation: hn-clip-sweep 1.6s ease-in-out 2.6s both; }
.stagecard.play .sc-nurse .hn-pen       { animation: hn-pen-write 1.0s ease-in-out 4.3s both; }
.stagecard.play .sc-nurse .hn-tick-new  { animation: hn-draw 0.7s ease-out 5.0s both; }
.stagecard.play .sc-nurse .hn-next      { animation: hn-next-lift 1.2s ease-out 5.8s both; }
.stagecard.play .hn-clock-hand          { animation: hn-tick-slow 7s linear both; }

@keyframes hn-rise {
  0%   { opacity: 0; transform: translate(470px, 410px); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translate(470px, 250px); }
}
@keyframes hn-inspect {
  0%   { transform: rotate(-10deg); }
  40%  { transform: rotate(22deg); }
  70%  { transform: rotate(-14deg); }
  100% { transform: rotate(0deg); }
}
@keyframes hn-gaze-in  { from { opacity: 0; } to { opacity: 0.7; } }
@keyframes hn-gaze-dash { to { stroke-dashoffset: -26; } }
@keyframes hn-mag-sweep {
  0%   { opacity: 0; transform: translate(40px, 30px); }
  20%  { opacity: 1; }
  100% { opacity: 0.9; transform: translate(220px, 120px); }
}
@keyframes hn-clip-sweep {
  0%   { transform: translate(40px, 30px); }
  100% { transform: translate(220px, 120px); }
}
@keyframes hn-pen-write {
  0%   { transform: translate(1252px, 200px); }
  60%  { transform: translate(1200px, 256px); }
  78%  { transform: translate(1205px, 250px); }
  100% { transform: translate(1200px, 256px); }
}
@keyframes hn-draw { from { stroke-dashoffset: 48; opacity: 0; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes hn-next-lift {
  0%   { opacity: 0; transform: translate(470px, 486px); }
  100% { opacity: 0.7; transform: translate(470px, 430px); }
}
@keyframes hn-tick-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* slow-clock status pill */
.stagecard .hn-status {
  position: absolute; left: 2.2%; bottom: 4.4%; z-index: 2;
  display: flex; align-items: center; gap: 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(10px, 1.3vw, 14px); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--rose);
}
.stagecard .hn-status .hn-clock { width: clamp(24px, 3.4vw, 40px); height: auto; }
.stagecard .hn-clock-hand { transform-box: fill-box; transform-origin: 24px 24px; }

/* ─── Shared flat orderly figure (02b / 02c) ──────────────── */
.fig-scrub  { fill: var(--sc-scrub); }
.fig-collar { fill: var(--sc-scrub); }
.fig-arm    { fill: var(--sc-skin); }
.fig-cuff   { fill: var(--sc-scrub); }
.fig-hand   { fill: var(--sc-skin); }

/* ─── Stage 02b — Technician + scanner plate (cyan/mint) ──── */
.sc-cook .ck-plate {
  fill: oklch(0.27 0.05 200); stroke: var(--sc-accent); stroke-width: 2.5;
  animation: ck-glow 3s ease-in-out infinite;
}
@keyframes ck-glow {
  0%,100% { filter: drop-shadow(0 0 4px oklch(0.82 0.16 200 / 0.4)); }
  50%     { filter: drop-shadow(0 0 14px oklch(0.82 0.16 200 / 0.8)); }
}
.sc-cook .ck-scan {
  fill: var(--sc-accent); opacity: 0.85;
  filter: drop-shadow(0 0 8px var(--sc-accent));
  animation: ck-sweep 1.7s ease-in-out infinite alternate;
}
@keyframes ck-sweep { from { transform: translateX(0); } to { transform: translateX(278px); } }
.sc-cook .hb-link {
  stroke: var(--sc-accent); stroke-width: 2; stroke-dasharray: 4 7; opacity: 0.5;
  animation: bl-flow 1s linear infinite;
}
.sc-cook .hb-dot { transform-box: fill-box; transform-origin: center; animation: sc-pulse-dot 1.6s ease-in-out infinite; }
@keyframes sc-pulse-dot {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

/* RESTING = complete frame */
.sc-cook .scr-tick { stroke-dasharray: 30; stroke-dashoffset: 0; opacity: 1; }
.sc-cook .hb-instA { opacity: 1; transform: translate(1002px, 458px) rotate(14deg); }
.sc-cook .hb-instB { opacity: 1; transform: translate(1058px, 442px) rotate(14deg); }

/* ARMED = hidden start */
.stagecard.arm .sc-cook .scr-tick.t1,
.stagecard.arm .sc-cook .scr-tick.t2 { stroke-dashoffset: 30; opacity: 0; }
.stagecard.arm .sc-cook .hb-instA,
.stagecard.arm .sc-cook .hb-instB { opacity: 0; transform: translate(612px, 300px) rotate(-8deg); }

.stagecard.play .sc-cook .hb-instA  { animation: hb-place-a 6.6s ease-in-out 0.2s both; }
.stagecard.play .sc-cook .hb-instB  { animation: hb-place-b 3.8s ease-in-out 2.9s both; }
.stagecard.play .sc-cook .scr-tick.t1 { animation: scr-draw 0.5s ease-out 1.7s both; }
.stagecard.play .sc-cook .scr-tick.t2 { animation: scr-draw 0.5s ease-out 4.5s both; }
@keyframes scr-draw { from { stroke-dashoffset: 30; opacity: 0; } to { stroke-dashoffset: 0; opacity: 1; } }

@keyframes hb-place-a {
  0%   { opacity: 0; transform: translate(612px, 300px) rotate(-8deg); }
  8%   { opacity: 1; }
  20%  { transform: translate(712px, 372px) rotate(0deg); }
  44%  { transform: translate(712px, 372px) rotate(0deg); }
  62%  { transform: translate(1002px, 458px) rotate(14deg); }
  100% { opacity: 1; transform: translate(1002px, 458px) rotate(14deg); }
}
@keyframes hb-place-b {
  0%   { opacity: 0; transform: translate(612px, 300px) rotate(-8deg); }
  10%  { opacity: 1; }
  26%  { transform: translate(712px, 372px) rotate(0deg); }
  52%  { transform: translate(712px, 372px) rotate(0deg); }
  72%  { transform: translate(1058px, 442px) rotate(14deg); }
  100% { opacity: 1; transform: translate(1058px, 442px) rotate(14deg); }
}
@keyframes bl-flow { to { stroke-dashoffset: -22; } }

/* ─── Stage 02c — Conveyor over scanner (cyan/mint) ───────── */
.sc-belt .bl-belt   { fill: oklch(0.18 0.012 240); stroke: var(--sc-mute); stroke-width: 1.4; }
.sc-belt .bl-glow rect {
  fill: oklch(0.30 0.05 200); opacity: 0.5;
  animation: ck-glow 3s ease-in-out infinite;
}
.sc-belt .bl-chev   { fill: none; stroke: var(--sc-mute); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0.6; }
.sc-belt .bl-arrows { animation: bl-belt-scroll 1.4s linear infinite; }
@keyframes bl-belt-scroll { from { transform: translateX(0); } to { transform: translateX(24px); } }
.sc-belt .bl-roller { fill: oklch(0.30 0.012 240); stroke: var(--sc-mute); stroke-width: 1.4; }
.sc-belt .bl-scan {
  fill: var(--sc-accent); opacity: 0.85;
  filter: drop-shadow(0 0 8px var(--sc-accent));
  animation: bl-sweep 1.5s ease-in-out infinite alternate;
}
@keyframes bl-sweep { from { transform: translateX(0); } to { transform: translateX(114px); } }
.sc-belt .bl-link {
  stroke: var(--sc-accent); stroke-width: 2; stroke-dasharray: 4 7; opacity: 0.5;
  animation: bl-flow 1s linear infinite;
}
.sc-belt .bl-dot { transform-box: fill-box; transform-origin: center; animation: sc-pulse-dot 1.6s ease-in-out infinite; }

/* RESTING = complete frame */
.sc-belt .bl-tick { stroke-dasharray: 30; stroke-dashoffset: 0; opacity: 1; }
.sc-belt .bl-inst { opacity: 1; transform: translate(var(--tx, 700px), 352px) rotate(16deg); }

/* ARMED = hidden start */
.stagecard.arm .sc-belt .bl-tick { stroke-dashoffset: 30; opacity: 0; }
.stagecard.arm .sc-belt .bl-inst { opacity: 0; transform: translate(-40px, 176px); }

.stagecard.play .sc-belt .bl-inst.i1 { animation: hc-flow 3.8s ease-in-out 0.2s both; }
.stagecard.play .sc-belt .bl-inst.i2 { animation: hc-flow 3.8s ease-in-out 2.1s both; }
.stagecard.play .sc-belt .bl-inst.i3 { animation: hc-flow 3.8s ease-in-out 4.0s both; }
.stagecard.play .sc-belt .bl-tick.t1 { animation: scr-draw 0.5s ease-out 1.2s both; }
.stagecard.play .sc-belt .bl-tick.t2 { animation: scr-draw 0.5s ease-out 3.1s both; }
.stagecard.play .sc-belt .bl-tick.t3 { animation: scr-draw 0.5s ease-out 5.0s both; }

@keyframes hc-flow {
  0%   { opacity: 0; transform: translate(-40px, 176px) rotate(0deg); }
  6%   { opacity: 1; }
  20%  { transform: translate(310px, 176px) rotate(0deg); }
  34%  { transform: translate(310px, 176px) rotate(0deg); }
  54%  { transform: translate(580px, 176px) rotate(0deg); }
  64%  { transform: translate(var(--tx, 700px), 320px) rotate(16deg); }
  100% { opacity: 1; transform: translate(var(--tx, 700px), 352px) rotate(16deg); }
}

/* ─── Reduced motion: hold the complete resting frames ────── */
@media (prefers-reduced-motion: reduce) {
  .jcycle svg *, .stagecard svg *,
  .stagecard .hn-clock-hand { animation: none !important; }
}
