/* ════════════════════════════════════════════════════════
   Velocity Workflow Map — animated serpentine QE pipeline.
   Scoped under .vmap-board; namespaced keyframes (vmap*).
   Fixed 1040×560 design canvas, scaled to fit via JS.
   ════════════════════════════════════════════════════════ */
.vmap-board {
  --map-line: #C5CBF0;
  --map-flow: #4F46E5;
  --map-node-bg: #FFFFFF;
  --map-node-bd: #E4E4E7;
  --map-node-ink: #3F3F46;
  --map-hl-bg: #EEF1FF;
  --map-hl-bd: #C3CCFF;
  --map-sub-bd: #ECECF1;
  --map-hl-ink: #3730A3;
  background: #FBFBFD;
  border: 1px solid #E4E4E7;
  border-radius: 18px;
  padding: 24px 28px 28px;
  box-shadow: 0 24px 60px -30px rgba(15, 16, 24, 0.55);
  box-sizing: border-box;
  margin-top: 44px;
}
.vmap-cap {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin: 0 4px 12px;
}
.vmap-cap .t {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: #6366F1;
}
.vmap-cap .s { font-size: 12.5px; color: #A1A1AA; font-family: var(--font-mono, 'JetBrains Mono', monospace); }

.vmap-wrap { position: relative; width: 100%; }
.vmap-canvas {
  position: absolute; top: 0; left: 0;
  width: 1040px; height: 560px;
  transform-origin: top left;
}
.vmap-svg { position: absolute; inset: 0; width: 1040px; height: 560px; overflow: visible; }

/* ── connectors ── */
.vmap-board .conn { fill: none; stroke: var(--map-line); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.vmap-board .flow {
  fill: none; stroke: var(--map-flow); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 7 13; opacity: 0;
}
.vmap.is-live .flow { opacity: 0.95; animation: vmapDash 1.05s linear infinite; }
@keyframes vmapDash { to { stroke-dashoffset: -40; } }

.vmap-board .pulse { fill: var(--map-flow); opacity: 0; }
.vmap.is-live .pulse { opacity: 1; }

/* ── nodes ── */
.vmap-board .node {
  position: absolute; box-sizing: border-box;
  background: var(--map-node-bg);
  border: 1px solid var(--map-node-bd);
  border-radius: 11px;
  padding: 11px 11px;
  display: flex; flex-direction: column;
  opacity: 0;
  transition: box-shadow .35s ease, border-color .35s ease;
}
.vmap.is-live .node {
  animation: vmapNodeIn .55s cubic-bezier(.2,.7,.2,1) both;
  animation-delay: var(--d, 0s);
}
@keyframes vmapNodeIn {
  from { opacity: 0; transform: translateY(11px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.vmap-board .node .ico {
  width: 22px; height: 22px; border-radius: 6px;
  background: #F1F1F6; border: 1px solid #E4E4E7;
  display: grid; place-items: center; margin-bottom: 9px;
}
.vmap-board .node .ico i { width: 9px; height: 9px; border-radius: 2px; background: #A8AEE5; display: block; }
.vmap-board .node .lbl {
  font-size: 11.5px; font-weight: 600; letter-spacing: -0.015em;
  line-height: 1.15; color: var(--map-node-ink); padding-right: 2px;
}
.vmap-board .node .go {
  position: absolute; right: 7px; bottom: 7px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 1px solid #D4D4D8;
  display: grid; place-items: center; color: #71717A;
}
.vmap-board .node .go svg { width: 10px; height: 10px; }

/* highlighted nodes */
.vmap-board .node.hl { background: var(--map-hl-bg); border-color: var(--map-hl-bd); }
.vmap-board .node.hl .ico { background: #fff; border-color: var(--map-hl-bd); }
.vmap-board .node.hl .ico i { background: var(--map-flow); }
.vmap-board .node.hl .lbl { color: var(--map-hl-ink); }
.vmap-board .node.hl .go { background: var(--map-flow); border-color: var(--map-flow); color: #fff; }
.vmap-board .node.hl::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit;
  pointer-events: none; box-shadow: 0 0 0 0 rgba(79,70,229,0); opacity: 0;
}
.vmap.is-live .node.hl::after { animation: vmapGlow 3.4s ease-in-out infinite; animation-delay: 1.6s; }
@keyframes vmapGlow {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(79,70,229,0); }
  50%      { opacity: 1; box-shadow: 0 0 0 5px rgba(79,70,229,0.12); }
}

/* group cards */
.vmap-board .node.group { padding: 0; }
.vmap-board .group .gh { display: flex; align-items: center; gap: 8px; padding: 11px 12px 10px; }
.vmap-board .group .gh .ico { margin-bottom: 0; flex: 0 0 auto; }
.vmap-board .group .gh .lbl { flex: 1; padding-right: 0; font-size: 12px; line-height: 1.12; }
.vmap-board .group.hl .gh { border-bottom: 1px solid var(--map-hl-bd); }
.vmap-board .group .grow {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-top: 1px solid var(--map-sub-bd);
  font-size: 10px; color: #8A8A93; white-space: nowrap;
}
.vmap-board .group .grow .dot { width: 12px; height: 12px; border-radius: 3px; background: #EDEDF2; flex: 0 0 auto; }
.vmap-board .group .grow .gt { flex: 1; letter-spacing: -0.01em; }
.vmap-board .group .grow .ga { color: #B6B6BE; flex: 0 0 auto; }
.vmap-board .group .grow .ga svg { width: 9px; height: 9px; display: block; }

/* mobile fallback list (shown < 760px) */
.vmap-fallback { display: none; }

@media (max-width: 760px) {
  .vmap-board { display: none; }
  .vmap-fallback {
    display: grid; gap: 10px; margin-top: 32px;
    grid-template-columns: repeat(2, 1fr);
  }
  .vmap-fallback .vf {
    border: 1px solid var(--border-subtle); border-radius: 11px;
    background: var(--bg-subtle); padding: 13px 14px;
  }
  .vmap-fallback .vf.hl { background: var(--accent-subtle); border-color: var(--accent); }
  .vmap-fallback .vf .n { font-family: var(--font-mono, monospace); font-size: 11px; color: var(--accent); font-weight: 600; }
  .vmap-fallback .vf .m { margin-top: 5px; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; color: var(--text-primary); }
}

@media (prefers-reduced-motion: reduce) {
  .vmap-board .node, .vmap.is-live .node { opacity: 1; transform: none; animation: none; }
  .vmap-board .flow { opacity: .9 !important; animation: none; }
  .vmap.is-live .node.hl::after { animation: none; }
  .vmap-board .pulse { opacity: 1; }
}
