:root {
  --pulse-red: #d92521;
  --pulse-amber: #e79b12;
  --pulse-blue: #216fca;
  --pulse-violet: #6554d9;
  --pulse-green: #12945f;
  --pulse-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.command-progress {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 80;
  width: 4px;
  max-width: 4px;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(217, 37, 33, 0.16), rgba(33, 111, 202, 0.12), rgba(18, 148, 95, 0.12));
}

.command-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleY(var(--scroll-progress, 0));
  transform-origin: 50% 0;
  background: linear-gradient(180deg, var(--pulse-red), var(--pulse-blue) 54%, var(--pulse-green));
  box-shadow: 0 0 18px rgba(217, 37, 33, 0.44);
}

.hero {
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 42%, rgba(255, 255, 255, 0.1) 47%, transparent 53% 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 84px);
  opacity: 0;
}

.overdrive-ready .hero::after {
  animation: command-scan 1400ms var(--pulse-ease) 180ms both;
}

.stage-btn,
.stage,
.card,
.step,
.path-step,
.program-card,
.director-card,
.authority-item,
.result-card,
.diagnosis-result,
.scorecard-panel {
  position: relative;
}

.stage-btn::after,
.stage::after,
.result-card::after,
.diagnosis-result::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--stage, var(--result-accent, var(--pulse-red))) 38%, transparent), 0 0 34px color-mix(in srgb, var(--stage, var(--result-accent, var(--pulse-red))) 28%, transparent);
  transition: opacity 220ms var(--pulse-ease);
}

.stage-btn.active::after,
.stage:hover::after,
.result-card.result-pulse::after,
.diagnosis-result.result-pulse::after {
  opacity: 1;
}

.stage-btn.active {
  animation: active-stage-settle 520ms var(--pulse-ease) both;
}

.diagnosis-result.result-pulse,
.result-card.result-pulse {
  animation: panel-pulse 540ms var(--pulse-ease) both;
}

.severity-fill,
.bar span {
  box-shadow: 0 0 18px color-mix(in srgb, var(--stage, var(--result-accent, var(--pulse-red))) 52%, transparent);
}

.severity-number.bump {
  text-shadow: 0 0 18px color-mix(in srgb, var(--stage, var(--pulse-red)) 44%, transparent);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover,
  .stage-btn:hover,
  .card:hover,
  .stage:hover,
  .step:hover,
  .path-step:hover,
  .program-card:hover,
  .director-card:hover,
  .authority-item:hover {
    filter: saturate(1.04);
  }
}

@keyframes command-scan {
  0% {
    opacity: 0;
    transform: translate3d(-18%, 0, 0);
  }
  35% {
    opacity: 0.72;
  }
  100% {
    opacity: 0;
    transform: translate3d(18%, 0, 0);
  }
}

@keyframes active-stage-settle {
  0% {
    transform: translateY(-1px) scale(0.992);
  }
  55% {
    transform: translateY(-3px) scale(1.012);
  }
  100% {
    transform: translateY(-3px) scale(1);
  }
}

@keyframes panel-pulse {
  0% {
    box-shadow: 0 0 0 rgba(217, 37, 33, 0);
  }
  45% {
    box-shadow: 0 0 34px color-mix(in srgb, var(--stage, var(--result-accent, var(--pulse-red))) 24%, transparent);
  }
  100% {
    box-shadow: 0 0 0 rgba(217, 37, 33, 0);
  }
}

@media (max-width: 860px) {
  .command-progress {
    width: 3px;
    max-width: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .command-progress {
    display: none;
  }

  .overdrive-ready .hero::after,
  .stage-btn.active,
  .diagnosis-result.result-pulse,
  .result-card.result-pulse {
    animation: none !important;
  }

  .hero::after,
  .stage-btn::after,
  .stage::after,
  .result-card::after,
  .diagnosis-result::after {
    display: none;
  }
}
