/* Hydraulic-brakes-fail explainer: a truck on a road toward an uphill escape ramp, above a cutaway of its cab and
   chassis (pedal, master cylinder and gauge, leaking hydraulic lines, the separate parking brake lever and cable, and
   a gear indicator). Hero, film, course offer and return banner reuse spring-brakes.css (.sbp-*); this file styles
   only .hf-*. The script sets the stage's data-hf-stage, data-hf-gear, data-hf-psi, data-hf-park, data-hf-road,
   data-hf-pace and data-hf-skid states. Without script the picture shows 50 mph in 5th gear, 0 PSI and the pedal on
   the floor. */
.hf-page{--hf-fluid:#ef4444;--hf-go:#31d67b;--hf-amber:#fbbf24;--hf-sky:#38bdf8;--hf-console:#151b20}
.hf-page .sbp-hero-grid.is-no-film{grid-template-columns:minmax(0,1fr)}
.hf-demo{padding-block:64px 72px;background:var(--paper)}
.hf-demo-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);grid-template-areas:"head head" "stage panel";gap:24px 40px;align-items:start}
.hf-head{grid-area:head}
.hf-stage{grid-area:stage;margin:0;padding:10px;border-radius:16px;background:linear-gradient(170deg,#222a30,#0d1114 80%);box-shadow:0 30px 60px -34px rgb(0 0 0/.75),inset 0 1px 0 rgb(255 255 255/.06)}
.hf-svg{display:block;width:100%;height:auto;border-radius:10px;background:#0f1316}
.hf-panel{grid-area:panel;display:grid;gap:14px;min-width:0}

/* the HUD: speed, gear and hydraulic pressure; script on */
.hf-hud{display:none;align-items:center;gap:6px;flex-wrap:wrap;padding:0 2px 10px}
.hf-stage.is-js .hf-hud{display:flex}
.hf-chip{display:inline-flex;align-items:center;gap:7px;margin:0;padding:6px 10px 6px 8px;border-radius:8px;background:#080b0d;box-shadow:inset 0 0 0 1px rgb(255 255 255/.09);font-size:13px;line-height:1;white-space:nowrap}
.hf-chip i{flex:none;width:9px;height:9px;border-radius:50%;background:#3a4246;box-shadow:inset 0 0 0 1.5px #586166;transition:background .2s,box-shadow .2s}
.hf-chip span{color:#a9b3b8;font-weight:600}
.hf-chip b{color:#e8eef0;font-weight:800;font-variant-numeric:tabular-nums}
.hf-chip-speed i{background:var(--hf-fluid);box-shadow:0 0 0 2px rgb(239 68 68/.2),0 0 10px rgb(239 68 68/.8)}
.hf-stage[data-hf-stage="slowing"] .hf-chip-speed i,.hf-stage[data-hf-stage="ramp"] .hf-chip-speed i{background:var(--hf-amber);box-shadow:0 0 0 2px rgb(251 191 36/.2),0 0 10px rgb(251 191 36/.8)}
.hf-stage[data-hf-stage="stopped"] .hf-chip-speed i{background:var(--hf-go);box-shadow:0 0 0 2px rgb(49 214 123/.18),0 0 10px rgb(49 214 123/.8)}
.hf-stage[data-hf-stage="stopped"] .hf-chip-speed b{color:var(--hf-go)}
.hf-chip-gear i{background:var(--hf-sky);box-shadow:0 0 0 2px rgb(56 189 248/.18)}
.hf-chip-psi i{background:var(--hf-fluid);box-shadow:0 0 0 2px rgb(239 68 68/.2)}
.hf-chip-psi b{color:#fca5a5}
.hf-stage:not([data-hf-psi="0"]) .hf-chip-psi i{background:var(--hf-amber);box-shadow:0 0 0 2px rgb(251 191 36/.2),0 0 10px rgb(251 191 36/.8)}
.hf-stage:not([data-hf-psi="0"]) .hf-chip-psi b{color:#fde68a}

/* labels: every teaching label is at least 10px in the 360-wide picture */
.hf-label{fill:#c3ccd0;font-size:10px;font-weight:800;letter-spacing:.02em;paint-order:stroke;stroke:#0d1114;stroke-width:2.6px;stroke-linejoin:round}
.hf-label-mid{text-anchor:middle}
.hf-label-end{text-anchor:end}
.hf-label-strong{fill:#f2f6f7;font-size:10.5px}
.hf-label-warn{fill:#fca5a5}
.hf-label-amber{fill:#fde68a}

/* the road scene */
.hf-hill{fill:#24332d}
.hf-ramp-edge{fill:none;stroke:#f2e6c9;stroke-width:1.4}
.hf-road{fill:#2a2f33}
.hf-road-edge{fill:none;stroke:#e8eef0;stroke-opacity:.55;stroke-width:1.2}
.hf-dash{fill:none;stroke:#fbbf24;stroke-width:2;stroke-dasharray:12 10}
.hf-truck{transform-box:view-box;transform-origin:24px 97px;transition:transform 1.4s cubic-bezier(.3,.7,.3,1)}
.hf-stage[data-hf-road="ramp"] .hf-truck{transform:translate(214px,-16px) rotate(-22.4deg)}
.hf-truck-box{stroke:#5e696c;stroke-width:1}
.hf-truck-cab{stroke:#5f120c;stroke-width:1}
.hf-truck-glass{fill:#9bd5ea;opacity:.85}
.hf-truck-frame{fill:none;stroke:#11161a;stroke-width:3}
.hf-wheel-spoke{fill:none;stroke:#8e989b;stroke-width:1.4;stroke-linecap:round}
.hf-wheel{transform-box:fill-box;transform-origin:center}
.hf-speedlines{fill:none;stroke:#e8eef0;stroke-opacity:.6;stroke-width:1.6;stroke-linecap:round;transition:opacity .3s}
.hf-stage[data-hf-pace="stop"] .hf-speedlines,.hf-stage[data-hf-road="ramp"] .hf-speedlines{opacity:0}
.hf-brake-light{fill:#5f120c;transition:fill .2s}
.hf-stage[data-hf-park="on"] .hf-brake-light,.hf-stage:not([data-hf-psi="0"]) .hf-brake-light{fill:#ff3b30}

/* the cutaway */
.hf-divider{fill:none;stroke:#3d464b;stroke-width:1}
.hf-floor{fill:none;stroke:#59636a;stroke-width:3;stroke-linecap:round}
.hf-gears-box{fill:#080b0d;stroke:#59636a;stroke-width:1}
.hf-gear{fill:#1b2227;stroke:#3d464b;stroke-width:1;transition:fill .25s,stroke .25s}
.hf-gear-txt{fill:#8f9ba1;font-size:11px;font-weight:900;text-anchor:middle;transition:fill .25s}
.hf-stage[data-hf-gear="5"] .hf-gear-5,.hf-stage[data-hf-gear="4"] .hf-gear-4,
.hf-stage[data-hf-gear="3"] .hf-gear-3,.hf-stage[data-hf-gear="2"] .hf-gear-2,
.hf-stage[data-hf-gear="low"] .hf-gear-low{fill:var(--hf-sky);stroke:#bae6fd}
.hf-stage[data-hf-gear="5"] .hf-gear-txt-5,.hf-stage[data-hf-gear="4"] .hf-gear-txt-4,
.hf-stage[data-hf-gear="3"] .hf-gear-txt-3,.hf-stage[data-hf-gear="2"] .hf-gear-txt-2,
.hf-stage[data-hf-gear="low"] .hf-gear-txt-low{fill:#04131c}

.hf-pedal{transform-box:view-box;transform-origin:40px 146px;transition:transform .3s cubic-bezier(.3,1.4,.55,1)}
.hf-stage[data-hf-psi="low"] .hf-pedal{transform:rotate(5deg)}
.hf-stage[data-hf-psi="mid"] .hf-pedal{transform:rotate(9deg)}
.hf-stage[data-hf-psi="high"] .hf-pedal{transform:rotate(13deg)}
.hf-pedal-arm{fill:none;stroke:#b8c1c3;stroke-width:4;stroke-linecap:round}
.hf-pedal-pad{fill:#d7dddd;stroke:#3a4246;stroke-width:.8}
.hf-pedal-pin{fill:#59636a;stroke:#d7dddd;stroke-width:1}
.hf-rod{fill:none;stroke:#8e989b;stroke-width:2.4;stroke-linecap:round}
.hf-mc-tank{fill:#2e363a;stroke:#7d888c;stroke-width:1}
.hf-mc{stroke:#2a3133;stroke-width:1}
.hf-gauge-bezel{fill:#0b0d0e;stroke:#aeb7ba;stroke-width:2}
.hf-gauge-val{fill:#b91c1c;font-size:12px;font-weight:900;text-anchor:middle;font-variant-numeric:tabular-nums}
.hf-stage:not([data-hf-psi="0"]) .hf-gauge-val{fill:#1f1c19}
.hf-gauge-unit{fill:#4b4741;font-size:10.5px;font-weight:800;text-anchor:middle}

.hf-line{fill:none;stroke:#3d464b;stroke-width:4.5;stroke-linecap:round;stroke-linejoin:round}
.hf-line-fluid{fill:none;stroke:var(--hf-fluid);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:2 6;opacity:.45;transition:opacity .25s}
.hf-stage:not([data-hf-psi="0"]) .hf-line-fluid{stroke-dasharray:none;opacity:.95}
.hf-leak-crack{fill:none;stroke:#fca5a5;stroke-width:1.6;stroke-linecap:round}
.hf-drip{fill:var(--hf-fluid)}
.hf-drip-b{opacity:0}

.hf-lever{transform-box:view-box;transform-origin:196px 212px;transition:transform .3s ease}
.hf-stage[data-hf-park="on"] .hf-lever{transform:rotate(-18deg)}
.hf-stage[data-hf-skid="on"] .hf-lever{transform:rotate(-24deg)}
.hf-lever-arm{fill:none;stroke:#b8c1c3;stroke-width:4;stroke-linecap:round}
.hf-lever-grip{fill:#2e363a;stroke:#7d888c;stroke-width:1}
.hf-lever-button{fill:#7d888c;transition:fill .2s}
.hf-stage[data-hf-park="on"] .hf-lever-button{fill:var(--hf-amber)}
.hf-lever-base{fill:#3d464b}
.hf-held{opacity:0;transition:opacity .2s}
.hf-stage[data-hf-park="on"] .hf-held{opacity:1}
.hf-cable{fill:none;stroke:#8f7a3a;stroke-width:2;stroke-dasharray:5 3;stroke-linejoin:round;transition:stroke .25s}
.hf-stage[data-hf-park="on"] .hf-cable{stroke:var(--hf-amber);stroke-dasharray:none}

.hf-tire{stroke:#000;stroke-width:1}
.hf-drum{fill:#59636a;stroke:#aeb7ba;stroke-width:1.2;transition:fill .25s}
.hf-stage:not([data-hf-psi="0"]) .hf-drum{fill:#fb923c}
.hf-stage[data-hf-park="on"] .hf-drum-rear{fill:#f97316}
.hf-stage[data-hf-skid="on"] .hf-drum-rear{fill:#ef4444}

/* motion, script on: road dashes and wheels run at the truck's pace, the leak drips */
.hf-stage.is-js .hf-dash{animation:hf-road .35s linear infinite}
.hf-stage.is-js .hf-wheel{animation:hf-turn .4s linear infinite}
.hf-stage.is-js[data-hf-pace="mid"] .hf-dash{animation-duration:.6s}
.hf-stage.is-js[data-hf-pace="mid"] .hf-wheel{animation-duration:.7s}
.hf-stage.is-js[data-hf-pace="slow"] .hf-dash{animation-duration:1.2s}
.hf-stage.is-js[data-hf-pace="slow"] .hf-wheel{animation-duration:1.4s}
.hf-stage.is-js[data-hf-road="ramp"] .hf-dash,.hf-stage.is-js[data-hf-pace="stop"] .hf-dash,
.hf-stage.is-js[data-hf-pace="stop"] .hf-wheel{animation:none}
.hf-stage.is-js .hf-drip{animation:hf-drip 1.1s ease-in infinite}
.hf-stage.is-js .hf-drip-b{animation-delay:.55s}
.hf-stage.is-js[data-hf-skid="on"] .hf-wheel-rear{animation:none}
@keyframes hf-road{to{stroke-dashoffset:22}}
@keyframes hf-turn{to{transform:rotate(360deg)}}
@keyframes hf-drip{from{transform:translateY(0);opacity:1}to{transform:translateY(10px);opacity:0}}

/* controls: one dark console, every button the same dark face and white text, amber when pressed or focused */
.hf-ask{margin:0;color:var(--ink);font-size:20px;line-height:1.25}
.hf-ask[hidden],.hf-controls[hidden]{display:none}
.hf-ask b{font-weight:800}
.hf-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:14px;border-radius:16px;background:linear-gradient(180deg,#232b31,var(--hf-console));box-shadow:0 18px 40px -28px rgb(0 0 0/.8),inset 0 1px 0 rgb(255 255 255/.07);color:#e8eef0}
.hf-btn{position:relative;display:flex;align-items:center;gap:10px;min-width:0;min-height:64px;padding:10px 12px;border:0;border-radius:12px;background:linear-gradient(180deg,#303a41,#1b2227);box-shadow:inset 0 1px 0 rgb(255 255 255/.1),0 3px 0 #06090b,0 8px 16px -10px rgb(0 0 0/.7);color:#fff;font:inherit;font-size:16px;font-weight:700;line-height:1.2;text-align:left;cursor:pointer;transition:transform .08s,box-shadow .12s,background .12s}
.hf-btn:hover{background:linear-gradient(180deg,#38434b,#20282d)}
.hf-btn:active{transform:translateY(2px);box-shadow:inset 0 1px 0 rgb(255 255 255/.06),0 1px 0 #06090b}
.hf-btn[aria-pressed="true"]{transform:translateY(2px);box-shadow:inset 0 0 0 2px var(--sbp-amber,#ffb400),0 1px 0 #06090b}
.hf-btn:focus-visible{outline:3px solid var(--sbp-amber,#ffb400);outline-offset:3px}
.hf-name{display:grid;gap:3px;min-width:0}
.hf-name small{color:#a9b3b8;font-size:13px;font-weight:600}
.hf-icon{flex:none;width:30px;height:30px}
.hf-icon-gate{fill:none;stroke:#8f9a9d;stroke-width:2.2;stroke-linecap:round}
.hf-icon-knob{fill:#d7dddd}
.hf-icon-pad{fill:#d7dddd}
.hf-icon-lever{fill:none;stroke:#d7dddd;stroke-width:2.6;stroke-linecap:round}
.hf-icon-ramp{fill:#8a7a5c}
.hf-icon-arrow{fill:none;stroke:#e6f6ff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.hf-reset{grid-column:1/-1;justify-self:start;gap:8px;min-height:44px;padding:8px 16px 8px 12px;font-size:15px}
.hf-reset-icon{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.hf-status{display:block;min-height:7.3em;padding:12px 14px 12px 16px;border-left:5px solid var(--hf-fluid);border-radius:0 10px 10px 0;background:var(--white,#fffffc);color:var(--ink);font-size:16px;font-weight:600;line-height:1.45;transition:border-color .2s}
.hf-stage[data-hf-stage="slowing"]~.hf-panel .hf-status,.hf-stage[data-hf-stage="ramp"]~.hf-panel .hf-status{border-left-color:var(--hf-amber)}
.hf-stage[data-hf-stage="stopped"]~.hf-panel .hf-status{border-left-color:var(--hf-go)}
.hf-text{margin:0;max-width:40em;color:var(--ink);font-size:17px;line-height:1.6}

@media (min-width:761px){
  .hf-page .sbp-film-frame.is-wide{aspect-ratio:auto;padding-bottom:58px;background:#0b0d0f}
  .hf-page .sbp-film-frame.is-wide video{aspect-ratio:16/9;width:100%;height:auto}
  .hf-page .sbp-film-frame.is-wide .sbp-play{bottom:58px}
  .hf-page .sbp-film-frame.is-wide .sbp-sound-on{left:12px;right:auto;top:auto;bottom:10px}
  .hf-page .sbp-film-frame.is-wide .sbp-pause{right:12px;top:auto;bottom:10px}
}
@media (max-width:900px){
  .hf-demo-grid{grid-template-columns:minmax(0,1fr);grid-template-areas:"head" "stage" "panel";gap:16px}
}
@media (max-width:760px){
  .hf-page .sbp-answer-text{font-size:22px;line-height:1.18}
  .hf-demo{padding-block:36px 44px}
  .hf-stage{margin-inline:-8px;padding:8px 6px 6px;border-radius:14px}
  .hf-svg{border-radius:8px}
  .hf-hud{gap:5px;padding:0 0 8px}
  .hf-label{font-size:10.5px;letter-spacing:0}
  .hf-label-strong{font-size:11px}
  .hf-chip{padding:5px 7px 5px 6px;font-size:11.5px;gap:5px}
  .hf-chip i{width:8px;height:8px}
  .hf-panel{gap:10px}
  .hf-ask{font-size:18px}
  .hf-controls{gap:8px;margin-inline:-8px;padding:12px 10px}
  .hf-btn{min-height:60px;padding:8px 9px;gap:8px;font-size:15px}
  .hf-icon{width:26px;height:26px}
  .hf-name small{font-size:12px}
  .hf-status{min-height:8.8em;padding:10px 12px;font-size:15px}
  .hf-text{font-size:16px}
}
@media (max-width:380px){
  .hf-chip{padding:5px 6px;font-size:11px;gap:4px}
}
@media (prefers-reduced-motion:reduce){
  .hf-page .hf-demo *{transition:none!important;animation:none!important}
}
