
/* ===== v2 step-accurate animations (local fix, not deployed) =====
   Open = lever ALONG the pipe, closed = lever ACROSS the pipe. Close = wheel turns CLOCKWISE. */
.flow-stops { stroke-dasharray: 6 8; }
.is-playing .flow-stops { animation: hx9v-flow 0.55s linear infinite, hx9v-fade-out 0.4s 0.8s forwards; }
.flow-starts { stroke-dasharray: 6 8; opacity: 0; }
.is-playing .flow-starts { animation: hx9v-flow 0.55s linear infinite, hx9v-fade-in 0.4s var(--d, .8s) forwards; }
.flow-gone { stroke-dasharray: 6 8; opacity: 0; }
@keyframes hx9v-flow { to { stroke-dashoffset: -28; } }
@keyframes hx9v-fade-in { to { opacity: 1; } }
@keyframes hx9v-fade-out { to { opacity: 0; } }

.is-playing .wheel-close { animation: hx9v-cw 1.1s cubic-bezier(.15,.7,.2,1) forwards; }
.is-playing .wheel-open { animation: hx9v-ccw 1.6s 0.1s cubic-bezier(.3,.1,.3,1) forwards; }
@keyframes hx9v-cw { from { transform: rotate(0deg); } to { transform: rotate(300deg); } }
@keyframes hx9v-ccw { from { transform: rotate(0deg); } to { transform: rotate(-300deg); } }

.lever-close { transform: rotate(90deg); }
.is-playing .lever-close { animation: hx9v-lever-close 0.7s cubic-bezier(.2,.7,.2,1) forwards; }
.is-playing .lever-open { animation: hx9v-lever-open 0.7s cubic-bezier(.2,.7,.2,1) forwards; }
.is-playing .lever-open-late { animation: hx9v-lever-open 0.7s 0.65s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes hx9v-lever-close { from { transform: rotate(90deg); } to { transform: rotate(0deg); } }
@keyframes hx9v-lever-open { from { transform: rotate(0deg); } to { transform: rotate(90deg); } }
.is-playing .lbl-open { animation: hx9v-fade-out 0.3s 0.5s forwards; }
.is-playing .lbl-closed { animation: hx9v-fade-in 0.3s 0.5s forwards; }
.glass-drain, .glass-fill { transform-box: view-box; }
.is-playing .glass-drain { animation: hx9v-drain 1.4s 0.7s ease forwards; }
.glass-fill { transform: scaleY(0.04); }
.is-playing .glass-fill { animation: hx9v-fill 1.2s 0.7s ease forwards; }
@keyframes hx9v-drain { to { transform: scaleY(0.03); } }
@keyframes hx9v-fill { to { transform: scaleY(1); } }

.bleed-open { transform: rotate(90deg); }
.is-playing .bleed-open { animation: hx9v-bleed-open 0.55s 0.75s cubic-bezier(.2,.7,.2,1) forwards; }
.is-playing .bleed-close { animation: hx9v-bleed-close 0.55s 0.1s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes hx9v-bleed-open { from { transform: rotate(90deg); } to { transform: rotate(0deg); } }
@keyframes hx9v-bleed-close { from { transform: rotate(0deg); } to { transform: rotate(90deg); } }
.bleed-close { transform: rotate(0deg); }
.lever-open-late { transform: rotate(0deg); }

.is-playing .needle-fall { animation: hx9v-needle-fall 1.2s 0.35s ease forwards; }
.is-playing .needle-fall-air { animation: hx9v-needle-fall 1.6s 0.9s ease forwards; }
.is-playing .needle-rise { animation: hx9v-needle-rise 1.8s 0.8s ease forwards; }
.is-playing .needle-rise-air { animation: hx9v-needle-rise 1.6s 1.3s ease forwards; }
.is-playing .needle-settle { animation: hx9v-needle-rise 0.01s forwards reverse; }
@keyframes hx9v-needle-fall { from { transform: rotate(0deg); } to { transform: rotate(-110deg); } }
@keyframes hx9v-needle-rise { from { transform: rotate(-110deg); } to { transform: rotate(0deg); } }

.is-playing .rotor-run { animation: hx9v-spin-up 0.9s ease-in forwards, hx9v-spin 0.5s 0.9s linear infinite; }
@keyframes hx9v-spin-up { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes hx9v-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.is-playing .stopped-ok { animation: hx9v-fade-in 0.3s 2.3s forwards; }

.pin-in-late { transform: translateX(70px); }
.is-playing .pin-in-late { animation: hx9v-pin-in 0.55s 2.2s cubic-bezier(.2,.8,.2,1) forwards; }
.pin-in { transform: translateX(70px); }
.is-playing .pin-in { animation: hx9v-pin-in 0.7s 0.3s cubic-bezier(.2,.8,.2,1) forwards; }
.is-playing .pin-out { animation: hx9v-pin-out 0.7s 0.8s cubic-bezier(.5,0,.8,.4) forwards; }
@keyframes hx9v-pin-in { from { transform: translateX(70px); } to { transform: translateX(0); } }
@keyframes hx9v-pin-out { from { transform: translateX(0); } to { transform: translateX(70px); } }
.chain-on { opacity: 0; }
.is-playing .chain-on { animation: hx9v-fade-in 0.5s 2.6s ease forwards; }
.chain-on-early { opacity: 0; }
.is-playing .chain-on-early { animation: hx9v-fade-in 0.5s 0.9s ease forwards; }
.is-playing .chain-off { animation: hx9v-fade-out 0.5s 0.2s ease forwards; }

.is-playing .cool-start { animation: hx9v-fade-out 0.4s 1.6s forwards; }
.is-playing .cool-end { animation: hx9v-fade-in 0.4s 1.8s forwards; }
.ppe-early { opacity: 0; }
.is-playing .ppe-early { animation: hx9v-fade-in 0.6s 0.3s ease forwards; }

.is-playing .tick { animation: hx9v-fade-in 0.3s 0.4s forwards; }
.is-playing .t2 { animation-delay: 0.9s; }
.is-playing .t3 { animation-delay: 1.4s; }
.is-playing .t4 { animation-delay: 1.9s; }
.is-playing .t5 { animation-delay: 2.4s; }

@media (prefers-reduced-motion: reduce) {
  .is-playing .tick, .is-playing .stopped-ok { animation-duration: .01ms !important; animation-delay: 0ms !important; }
}
