/* ════════════════════════════════════════════════════════
   Velocity hero figure — "live run" console · v2
   Bigger, better aligned, improved execution phase.
   ════════════════════════════════════════════════════════ */

/* widen the right hero column so the figure has room */
.pf-hero-grid { grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr) !important; }

.vhero {
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  background: var(--bg-elevated);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 36px 80px -52px rgba(9,9,11,0.30);
  font-feature-settings: "tnum" 1;
}

/* ── header ── */
.vhero-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 20px; border-bottom: 1px solid var(--border-subtle); background: var(--bg-subtle);
}
.vhero-head .ttl {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-primary);
}
.vhero-head .ttl .mut { color: var(--text-tertiary); font-weight: 500; }
.vhero-run {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--accent);
  padding: 5px 12px; border-radius: 999px; background: var(--accent-subtle);
}
.vhero-run .d {
  width: 7px; height: 7px; border-radius: 999px; background: var(--accent);
  animation: vhPulse 1.4s ease-in-out infinite;
}
@keyframes vhPulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.5; transform:scale(.85); }
}

/* ── body: rail + stage ── */
.vhero-body { display: grid; grid-template-columns: 148px 1fr; }
.vhero-rail {
  position: relative; border-right: 1px solid var(--border-subtle);
  padding: 20px 0; background: linear-gradient(180deg, var(--bg-subtle), var(--bg-elevated) 80%);
}
/* vertical connector */
.vh-rail-line {
  position: absolute; left: 25px; top: 0; bottom: 0; width: 2px;
  background: var(--border-subtle); border-radius: 999px;
}
.vh-rail-fill {
  position: absolute; left: 25px; top: 0; width: 2px; height: 0;
  background: linear-gradient(180deg, var(--accent), oklch(from var(--accent) l c calc(h - 15)));
  border-radius: 999px; transition: height .6s cubic-bezier(.4,.0,.2,1);
}

.vh-step {
  position: relative; display: grid; grid-template-columns: 28px 1fr;
  align-items: center; gap: 10px; padding: 12px 16px;
}
.vh-step .dot {
  position: relative; z-index: 1;
  width: 24px; height: 24px; border-radius: 999px;
  border: 2px solid var(--border-default); background: var(--bg-elevated);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--text-tertiary);
  transition: border-color .35s ease, background .35s ease, color .35s ease, box-shadow .35s ease;
}
.vh-step .dot svg { width: 12px; height: 12px; opacity: 0; transform: scale(.6); position: absolute; transition: opacity .28s ease, transform .28s cubic-bezier(.2,.7,.2,1); }
.vh-step .dot .num { transition: opacity .2s ease; font-size: 11px; }
.vh-step .nm {
  font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text-tertiary); white-space: nowrap;
  transition: color .35s ease;
}
/* done */
.vh-step.done .dot { border-color: var(--accent); background: var(--accent); color: #fff; }
.vh-step.done .dot .num { opacity: 0; }
.vh-step.done .dot svg { opacity: 1; transform: scale(1); color: #fff; }
.vh-step.done .nm { color: var(--text-secondary); }
/* active */
.vh-step.active .dot {
  border-color: var(--accent); background: var(--bg-elevated); color: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-subtle), 0 0 0 1px var(--accent-subtle);
}
.vh-step.active .nm { color: var(--text-primary); }

/* ── stage ── */
.vhero-stage { position: relative; padding: 20px 22px 16px; min-height: 308px; }
.vh-panel {
  position: absolute; inset: 20px 22px 16px;
  display: none; flex-direction: column;
}
.vh-panel.on {
  display: flex;
  animation: vhPanelIn .38s cubic-bezier(.2,.7,.2,1);
}
@keyframes vhPanelIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.vh-plabel {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-tertiary);
  margin-bottom: 14px; display: flex; align-items: center; gap: 7px;
}
.vh-plabel b { color: var(--accent); font-weight: 700; }
.vh-plabel .ph { color: var(--border-default); }

/* ─ Story ─ */
.vh-ticket {
  border: 1px solid var(--border-subtle); border-radius: 12px;
  overflow: hidden; flex: 1;
}
.vh-ticket-h {
  display: flex; align-items: center; gap: 9px; padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle); background: var(--bg-subtle);
}
.vh-ticket-h .tag {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--accent); letter-spacing: 0.04em;
}
.vh-ticket-h .invest {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.05em;
  color: var(--success); background: rgba(22,163,74,.1); border: 1px solid rgba(22,163,74,.22);
  padding: 3px 8px; border-radius: 999px;
}
.vh-ticket-h .invest svg { color: var(--success); }
.vh-ticket-b { padding: 14px 15px 16px; }
.vh-story-line {
  font-size: 15.5px; line-height: 1.5; color: var(--text-primary);
  letter-spacing: -0.012em; font-weight: 500;
}
.vh-story-line .cur {
  display: inline-block; width: 2px; height: 1.1em; background: var(--accent);
  vertical-align: -3px; margin-left: 1px; border-radius: 1px;
  animation: vhBlink 1s step-end infinite;
}
@keyframes vhBlink { 50% { opacity: 0; } }
.vh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.vh-chip {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  color: var(--text-secondary); border: 1px solid var(--border-subtle);
  border-radius: 999px; padding: 3px 10px; background: var(--bg-subtle);
}

/* ─ Design (test-case rows) ─ */
.vh-tcs { display: flex; flex-direction: column; gap: 8px; }
.vh-tc {
  display: grid; grid-template-columns: auto 1fr 20px; align-items: center; gap: 11px;
  border: 1px solid var(--border-subtle); border-radius: 10px; padding: 10px 13px;
  background: var(--bg-elevated);
  opacity: 0; transform: translateY(7px);
}
.vh-panel.on .vh-tc { animation: vhRowIn .42s cubic-bezier(.2,.7,.2,1) forwards; }
.vh-panel.on .vh-tc:nth-child(1) { animation-delay: .05s; }
.vh-panel.on .vh-tc:nth-child(2) { animation-delay: .20s; }
.vh-panel.on .vh-tc:nth-child(3) { animation-delay: .35s; }
.vh-panel.on .vh-tc:nth-child(4) { animation-delay: .50s; }
@keyframes vhRowIn { to { opacity: 1; transform: none; } }
.vh-tc .id {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: var(--accent); letter-spacing: 0.03em;
}
.vh-tc .d {
  font-size: 13px; color: var(--text-secondary); letter-spacing: -0.005em;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.vh-tc .ck {
  width: 20px; height: 20px; border-radius: 999px; background: var(--success);
  display: grid; place-items: center; color: #fff; flex: 0 0 auto;
}
.vh-tc .ck svg { width: 11px; height: 11px; }

/* ─ Automation (code) ─ */
.vh-code {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.8; color: var(--text-secondary);
  border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-subtle);
  padding: 14px 16px; flex: 1;
}
.vh-code .ln { display: block; white-space: pre; opacity: 0; transform: translateX(-5px); }
.vh-panel.on .vh-code .ln { animation: vhLnIn .3s ease forwards; }
.vh-panel.on .vh-code .ln:nth-child(1) { animation-delay: .03s; }
.vh-panel.on .vh-code .ln:nth-child(2) { animation-delay: .18s; }
.vh-panel.on .vh-code .ln:nth-child(3) { animation-delay: .33s; }
.vh-panel.on .vh-code .ln:nth-child(4) { animation-delay: .48s; }
.vh-panel.on .vh-code .ln:nth-child(5) { animation-delay: .63s; }
@keyframes vhLnIn { to { opacity: 1; transform: none; } }
.vh-code .k { color: var(--accent); font-weight: 600; }
.vh-code .s { color: var(--success); }
.vh-code .c { color: var(--text-tertiary); }
.vh-code .fn { color: oklch(0.65 0.16 215); }

/* ─ Execution ─ */
.vh-runs { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.vh-trun {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--text-secondary);
  opacity: 0; transform: translateX(-4px);
  transition: opacity .28s ease, transform .28s ease;
}
.vh-trun.show { opacity: 1; transform: none; }
.vh-trun .tc { color: var(--text-tertiary); }
.vh-trun .ok { color: var(--success); font-weight: 700; }
.vh-trun .w  { color: #CA8A04; font-weight: 700; }

.vh-run-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 8px;
}
.vh-run-row .lbl { font-size: 13.5px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.01em; }
.vh-run-row .pct { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--accent); }
.vh-bar { height: 10px; border-radius: 999px; background: var(--bg-surface); overflow: hidden; }
.vh-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, oklch(from var(--accent) l c calc(h + 30)) 100%);
  border-radius: 999px;
  transition: width .1s linear;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}

.vh-result {
  margin-top: 14px; display: grid;
  grid-template-columns: auto 1fr; align-items: start; gap: 12px;
  opacity: 0; transform: translateY(6px);
  transition: opacity .4s ease, transform .4s ease;
}
.vh-result.show { opacity: 1; transform: none; }
.vh-pass {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 14px; font-weight: 800; letter-spacing: 0.04em;
  color: var(--success); background: rgba(22,163,74,.10);
  border: 1.5px solid rgba(22,163,74,.28); padding: 7px 14px; border-radius: 999px;
  box-shadow: 0 0 16px rgba(22,163,74,.14);
}
.vh-pass .ic { width: 18px; height: 18px; border-radius: 999px; background: var(--success); display: grid; place-items: center; color: #fff; }
.vh-pass .ic svg { width: 11px; height: 11px; }
.vh-stats { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.vh-stat { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-tertiary); letter-spacing: 0.02em; }
.vh-stat.w { color: #CA8A04; }
.vh-stat b { color: var(--text-secondary); font-weight: 600; }

/* footer */
.vhero-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 20px; border-top: 1px solid var(--border-subtle); background: var(--bg-subtle);
  font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); letter-spacing: 0.02em;
}
.vhero-foot .sep { color: var(--border-default); }
.vhero-foot b { color: var(--text-secondary); font-weight: 600; }

@media (max-width: 1040px) {
  .pf-hero-grid { grid-template-columns: 1fr !important; }
  .vhero { max-width: 580px; }
}
@media (prefers-reduced-motion: reduce) {
  .vhero-run .d { animation: none; }
  .vh-story-line .cur { animation: none; }
  .vh-panel.on { animation: none; }
  .vh-panel.on .vh-tc, .vh-panel.on .vh-code .ln { animation: none; opacity: 1; transform: none; }
  .vh-trun { opacity: 1; transform: none; }
}
