/* Air-compressor-governor explainer: a cutaway engine-bay workbench. The crank pulley drives the compressor by a V-belt,
   the governor senses the first tank and signals the unloader, and the tank carries a 0 to 160 PSI dial and the 150 PSI
   safety valve. Hero, film, course offer and return banner reuse spring-brakes.css (.sbp-*); this file styles only
   .cg-*. The script sets the stage's data-rpm, data-gov, data-fault, data-pump, data-vent and data-mode states, turns
   the dial needle (1.6875 degrees per PSI) and sizes the tank fill. Without script the picture shows the engine idling,
   the governor cut out and the tank at 125 PSI. */
.cg-page{--cg-air:#38bdf8;--cg-go:#31d67b;--cg-sig:#fbbf24;--cg-red:#ef4444;--cg-console:#151b20}
.cg-page .sbp-hero-grid.is-no-film{grid-template-columns:minmax(0,1fr)}
.cg-demo{padding-block:64px 72px;background:var(--paper)}
.cg-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}
.cg-head{grid-area:head}
.cg-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)}
.cg-svg{display:block;width:100%;height:auto;border-radius:10px;background:#0f1316}
.cg-panel{grid-area:panel;display:grid;gap:14px;min-width:0}

/* the HUD: belt, governor and tank; script on */
.cg-hud{display:none;align-items:center;gap:6px;flex-wrap:wrap;padding:0 2px 10px}
.cg-stage.is-js .cg-hud{display:flex}
.cg-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}
.cg-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}
.cg-chip span{color:#a9b3b8;font-weight:600}
.cg-chip b{color:#e8eef0;font-weight:800}
.cg-stage:not([data-rpm="off"]) .cg-chip-belt i{background:var(--cg-go);box-shadow:0 0 0 2px rgb(49 214 123/.18),0 0 10px rgb(49 214 123/.8)}
.cg-stage:not([data-rpm="off"]) .cg-chip-belt b{color:var(--cg-go)}
.cg-stage[data-gov="out"] .cg-chip-gov i{background:var(--cg-sig);box-shadow:0 0 0 2px rgb(251 191 36/.2),0 0 10px rgb(251 191 36/.8)}
.cg-stage[data-gov="out"] .cg-chip-gov b{color:#fde68a}
.cg-stage[data-pump="on"] .cg-chip-gov i{background:var(--cg-go);box-shadow:0 0 0 2px rgb(49 214 123/.18),0 0 10px rgb(49 214 123/.8)}
.cg-stage[data-pump="on"] .cg-chip-gov b{color:var(--cg-go)}
.cg-stage[data-fault="stuck"] .cg-chip-gov i{background:var(--cg-red);box-shadow:0 0 0 2px rgb(239 68 68/.2),0 0 10px rgb(239 68 68/.85)}
.cg-stage[data-fault="stuck"] .cg-chip-gov b{color:#fca5a5}
.cg-chip-tank i{background:var(--cg-air);box-shadow:0 0 0 2px rgb(56 189 248/.18)}
.cg-stage[data-vent="on"] .cg-chip-tank i{background:#fb7c3c;box-shadow:0 0 0 2px rgb(251 124 60/.2),0 0 10px rgb(251 124 60/.85)}

/* parts and labels */
.cg-part{fill:#a9b3b8;font-size:6.6px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;paint-order:stroke;stroke:#0d1114;stroke-width:2.4px;stroke-linejoin:round}
.cg-part-mid{text-anchor:middle}
.cg-part-end{text-anchor:end}
.cg-part-strong{fill:#e8eef0;font-size:7.4px}
.cg-block{stroke:#0a0d0f;stroke-width:1.2}
.cg-block-fins{fill:none;stroke:#11161a;stroke-width:3;stroke-linecap:round;opacity:.8}
.cg-shaft{fill:#5e696c;stroke:#2a3133;stroke-width:.8}
.cg-cyl,.cg-case,.cg-head{stroke:#2a3133;stroke-width:1}
.cg-fins{fill:none;stroke:#8e989b;stroke-width:2.4;stroke-linecap:round}
.cg-bore{fill:#14191c;stroke:#000;stroke-width:.6}
.cg-case-window{fill:#0e1215;stroke:#3a4246;stroke-width:1}
.cg-crank-disc{fill:#4a555b;stroke:#7d888c;stroke-width:1}
.cg-crank-pin{fill:#d7dddd}
.cg-crank{transform-box:view-box;transform-origin:101px 113px}
.cg-piston{transform-box:view-box}
.cg-rod{fill:none;stroke:#b8c1c3;stroke-width:3.2;stroke-linecap:round}
.cg-piston-top{fill:#c9d0d2;stroke:#3a4246;stroke-width:.8}
.cg-piston-rings{fill:none;stroke:#4f5a5e;stroke-width:.7}
.cg-valve-in,.cg-valve-out{fill:#2a3133}
.cg-valve-in{transform-box:view-box;transition:transform .25s}
.cg-unloader{fill:#4f5a5e;transform-box:view-box;transition:transform .25s,fill .25s}
.cg-unloader-link{fill:none;stroke:#4f5a5e;stroke-width:1.2;transition:stroke .25s}
.cg-stage[data-gov="out"] .cg-unloader{fill:var(--cg-sig);transform:translateY(2.5px)}
.cg-stage[data-gov="out"] .cg-unloader-link{stroke:var(--cg-sig)}
.cg-stage[data-gov="out"] .cg-valve-in{fill:var(--cg-sig);transform:translateY(2.5px)}
.cg-intake{fill:#2e363a;stroke:#7d888c;stroke-width:1}
.cg-intake-grid{fill:none;stroke:#7d888c;stroke-width:.8}
.cg-breath{opacity:0;transition:opacity .2s}
.cg-breath-puff{fill:#e6f6ff;opacity:.5}

/* pulleys and belt */
.cg-pulley-face{stroke:#1a2024;stroke-width:1.4}
.cg-belt{fill:none;stroke:#0b0d0e;stroke-width:5.4;stroke-linejoin:round}
.cg-belt-ribs{fill:none;stroke:#5d676c;stroke-width:1.5;stroke-dasharray:2.5 4}
.cg-spokes{fill:none;stroke:#2a3133;stroke-width:3.4;stroke-linecap:round}
.cg-hub{fill:url(#cg-g-cap);stroke:#2a3133;stroke-width:.8}
.cg-mark{fill:var(--cg-sig)}
.cg-spin{transform-box:view-box}
.cg-spin-crank{transform-origin:52px 228px}
.cg-spin-comp{transform-origin:52px 113px}

/* lines: discharge pulses green, tank pressure in blue, the unloader signal in amber */
.cg-line{fill:none;stroke:#3d464b;stroke-width:4;stroke-linecap:round;stroke-linejoin:round}
.cg-line-pulse{fill:none;stroke:var(--cg-go);stroke-width:2;stroke-dasharray:4 7;stroke-linecap:round;opacity:0;transition:opacity .2s}
.cg-stage[data-pump="on"] .cg-line-pulse{opacity:1}
.cg-line-sense{fill:none;stroke:var(--cg-air);stroke-width:1.6;opacity:.85}
.cg-line-signal{fill:none;stroke:#59636a;stroke-width:1.6;stroke-linejoin:round;transition:stroke .25s}
.cg-stage[data-gov="out"] .cg-line-signal{stroke:var(--cg-sig)}

/* the mode card */
.cg-card-box{fill:#080b0d;stroke:#59636a;stroke-width:1;transition:stroke .2s}
.cg-card-cap{fill:#8f9ba1;font-size:6.4px;font-weight:800;letter-spacing:.12em;text-anchor:middle;text-transform:uppercase}
.cg-card-big{font-size:12px;font-weight:900;letter-spacing:.05em;text-anchor:middle}
.cg-card-sub{fill:#c3ccd0;font-size:6.4px;font-weight:700;text-anchor:middle}
.cg-mode{display:none}
.cg-stage[data-mode="unloaded"] .cg-mode-unloaded,.cg-stage[data-mode="pumping"] .cg-mode-pumping,
.cg-stage[data-mode="stopped"] .cg-mode-stopped,.cg-stage[data-mode="stuck"] .cg-mode-stuck{display:inline}
.cg-mode-unloaded .cg-card-big{fill:var(--cg-sig)}
.cg-mode-pumping .cg-card-big{fill:var(--cg-go)}
.cg-mode-stopped .cg-card-big{fill:#a9b3b8}
.cg-mode-stuck .cg-card-big{fill:#fca5a5}
.cg-stage[data-mode="unloaded"] .cg-card-box{stroke:var(--cg-sig)}
.cg-stage[data-mode="pumping"] .cg-card-box{stroke:var(--cg-go)}
.cg-stage[data-mode="stuck"] .cg-card-box{stroke:var(--cg-red)}

/* the governor: at cut-out tank air lifts the piston and compresses the spring */
.cg-gov-body{stroke:#2a3133;stroke-width:1.2;transition:stroke .2s}
.cg-gov-window{fill:#0e1215;stroke:#000;stroke-width:.6}
.cg-gov-air{fill:var(--cg-air);opacity:.45}
.cg-gov-spring{fill:none;stroke:#d7dddd;stroke-width:1.4;stroke-linejoin:round;transform-box:view-box;transform-origin:190px 158px;transition:transform .3s}
.cg-gov-piston{transform-box:view-box;transition:transform .3s cubic-bezier(.3,1.4,.55,1)}
.cg-gov-piston-face{fill:#c9d0d2;stroke:#3a4246;stroke-width:.8}
.cg-stage[data-gov="out"] .cg-gov-piston{transform:translateY(-8px)}
.cg-stage[data-gov="out"] .cg-gov-spring{transform:scaleY(.6)}
.cg-gov-jam{fill:none;stroke:var(--cg-red);stroke-width:2.4;stroke-linecap:round;opacity:0}
.cg-gov-flag{opacity:0;transition:opacity .2s}
.cg-gov-flag rect{fill:#b91c1c}
.cg-gov-flag text{fill:#fff;font-size:7px;font-weight:900;letter-spacing:.1em;text-anchor:middle}
.cg-stage[data-fault="stuck"] .cg-gov-jam,.cg-stage[data-fault="stuck"] .cg-gov-flag{opacity:1}
.cg-stage[data-fault="stuck"] .cg-gov-body{stroke:var(--cg-red);stroke-width:2}

/* the dial */
.cg-dial-shade{fill:#000;opacity:.45}
.cg-dial-bezel{fill:#0b0d0e;stroke:url(#cg-g-chrome);stroke-width:4}
.cg-dial-ok{fill:none;stroke:#16a34a;stroke-width:4}
.cg-dial-hot{fill:none;stroke:#dc2626;stroke-width:4}
.cg-dial-major{fill:none;stroke:#1d1916;stroke-width:1.6;stroke-linecap:round}
.cg-dial-minor{fill:none;stroke:#6a615a;stroke-width:.8;stroke-linecap:round}
.cg-dial-num{fill:#1f1c19;font-size:5.6px;font-weight:800;text-anchor:middle}
.cg-dial-unit{fill:#4b4741;font-size:5px;font-weight:800;letter-spacing:.1em;text-anchor:middle}
.cg-needle{transform-box:view-box;transform-origin:0 0;transform:rotate(75.9deg)}
.cg-stage.is-js .cg-needle{transition:transform .18s linear}
.cg-needle-blade{fill:#c2410c;stroke:#7c2d12;stroke-width:.4}
.cg-needle-shadow{fill:#1c140c;opacity:.24}
.cg-dial-cap{fill:url(#cg-g-cap);stroke:#3b4446;stroke-width:.6}
.cg-dial-glass{fill:#fff;opacity:.34;pointer-events:none}

/* the tank and its safety valve */
.cg-tank-body{stroke:#0b0e10;stroke-width:1.2}
.cg-tank-well{fill:#0c1013}
.cg-tank-fill{fill:url(#cg-g-air)}
.cg-stage.is-js .cg-tank-fill{transition:y .18s linear,height .18s linear}
.cg-stage[data-fault="stuck"] .cg-tank-fill{fill:url(#cg-g-hot)}
.cg-mark-line{fill:none;stroke:#fff;stroke-opacity:.55;stroke-width:.8;stroke-dasharray:3 2}
.cg-mark-relief{stroke:#fca5a5;stroke-opacity:.9}
.cg-mark-txt{fill:#f2f6f7;font-size:6px;font-weight:800;text-anchor:end;paint-order:stroke;stroke:#0b1214;stroke-width:2.2px;stroke-linejoin:round}
.cg-mark-txt-relief{fill:#fca5a5}
.cg-tank-val{fill:#fff;font-size:15px;font-weight:900;text-anchor:middle;paint-order:stroke;stroke:#0b1214;stroke-width:3px;stroke-linejoin:round}
.cg-drain{fill:none;stroke:#8d999e;stroke-width:3;stroke-linecap:round}
.cg-relief-top{fill:#b91c1c;stroke:#5f0f0f;stroke-width:.8}
.cg-relief-ring{fill:none;stroke:#d7dddd;stroke-width:1.4;stroke-linecap:round}
.cg-relief-body{stroke:#3a4246;stroke-width:.8}
.cg-relief-cap{transform-box:view-box;transition:transform .2s}
.cg-stage[data-vent="on"] .cg-relief-cap{transform:translateY(-3px)}
.cg-vent{opacity:0;transition:opacity .2s}
.cg-stage[data-vent="on"] .cg-vent{opacity:1}
.cg-vent-stream{fill:none;stroke:#e6f6ff;stroke-width:1.5;stroke-linecap:round;stroke-dasharray:4 4;opacity:.85}
.cg-vent-puff{fill:#e6f6ff;opacity:.5}

/* motion, script on: belt, pulleys, crank and piston run whenever the engine runs */
.cg-stage.is-js .cg-belt-ribs{animation:cg-belt .9s linear infinite}
.cg-stage.is-js .cg-spin-crank{animation:cg-turn 1.4s linear infinite}
.cg-stage.is-js .cg-spin-comp,.cg-stage.is-js .cg-crank{animation:cg-turn .85s linear infinite}
.cg-stage.is-js .cg-piston{animation:cg-stroke .85s ease-in-out infinite}
.cg-stage.is-js[data-rpm="highway"] .cg-belt-ribs{animation-duration:.3s}
.cg-stage.is-js[data-rpm="highway"] .cg-spin-crank{animation-duration:.46s}
.cg-stage.is-js[data-rpm="highway"] .cg-spin-comp,.cg-stage.is-js[data-rpm="highway"] .cg-crank,.cg-stage.is-js[data-rpm="highway"] .cg-piston{animation-duration:.28s}
.cg-stage.is-js[data-rpm="off"] .cg-belt-ribs,.cg-stage.is-js[data-rpm="off"] .cg-spin,.cg-stage.is-js[data-rpm="off"] .cg-crank,.cg-stage.is-js[data-rpm="off"] .cg-piston{animation:none}
.cg-stage.is-js[data-pump="on"] .cg-line-pulse{animation:cg-flow .45s linear infinite}
.cg-stage.is-js[data-mode="unloaded"] .cg-breath{opacity:1}
.cg-stage.is-js[data-mode="unloaded"] .cg-breath-puff{transform-box:fill-box;transform-origin:center;animation:cg-puff .85s ease-out infinite}
.cg-stage.is-js[data-mode="unloaded"][data-rpm="highway"] .cg-breath-puff{animation-duration:.3s}
.cg-stage.is-js .cg-puff-b{animation-delay:.3s}
.cg-stage.is-js .cg-puff-c{animation-delay:.6s}
.cg-stage.is-js .cg-vent-stream{animation:cg-flow .35s linear infinite}
.cg-stage.is-js .cg-vent-puff{transform-box:fill-box;transform-origin:center;animation:cg-puff .9s ease-out infinite}
@keyframes cg-turn{to{transform:rotate(360deg)}}
@keyframes cg-belt{to{stroke-dashoffset:-13}}
@keyframes cg-flow{to{stroke-dashoffset:-11}}
@keyframes cg-stroke{0%,100%{transform:translateY(-9px)}50%{transform:translateY(7px)}}
@keyframes cg-puff{from{transform:scale(.4);opacity:.75}to{transform:scale(1.8);opacity:0}}

/* controls: one dark console, every button the same dark face and white text, amber when active or focused */
.cg-ask{margin:0;color:var(--ink);font-size:20px;line-height:1.25}
.cg-ask[hidden],.cg-controls[hidden]{display:none}
.cg-ask b{font-weight:800}
.cg-controls{display:grid;gap:10px;padding:14px;border-radius:16px;background:linear-gradient(180deg,#232b31,var(--cg-console));box-shadow:0 18px 40px -28px rgb(0 0 0/.8),inset 0 1px 0 rgb(255 255 255/.07);color:#e8eef0}
.cg-btn{position:relative;display:flex;align-items:center;gap:12px;min-width:0;min-height:48px;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}
.cg-btn:hover{background:linear-gradient(180deg,#38434b,#20282d)}
.cg-btn:active{transform:translateY(2px);box-shadow:inset 0 1px 0 rgb(255 255 255/.06),0 1px 0 #06090b}
.cg-btn[aria-pressed="true"]{transform:translateY(2px);box-shadow:inset 0 0 0 2px var(--sbp-amber,#ffb400),0 1px 0 #06090b}
.cg-btn:focus-visible{outline:3px solid var(--sbp-amber,#ffb400);outline-offset:3px}
.cg-btn-wide{min-height:64px}
.cg-name{display:grid;gap:3px;min-width:0}
.cg-name small{color:#a9b3b8;font-size:13px;font-weight:600}
.cg-rpm{display:grid;gap:6px}
.cg-label{margin:0;color:#a9b3b8;font-size:13px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.cg-seg{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.cg-btn-seg{justify-content:center;padding:8px 6px;text-align:center;font-size:15px}
.cg-icon{flex:none;width:44px;height:30px}
.cg-icon-floor{fill:#3d464b}
.cg-icon-valve{fill:#8f9a9d}
.cg-icon-plate{fill:#d7dddd}
.cg-icon-pin{fill:#e9eef0}
.cg-icon-air{fill:none;stroke:#e6f6ff;stroke-width:1.6;stroke-linecap:round}
.cg-icon-tank{fill:#4a555b}
.cg-icon-x{fill:none;stroke:#fca5a5;stroke-width:2.2;stroke-linecap:round}
.cg-reset{justify-self:start;gap:8px;min-height:44px;padding:8px 16px 8px 12px;font-size:15px}
.cg-reset-icon{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.cg-status{display:block;min-height:7.3em;padding:12px 14px 12px 16px;border-left:5px solid var(--cg-sig);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}
.cg-stage[data-pump="on"]~.cg-panel .cg-status{border-left-color:var(--cg-go)}
.cg-stage[data-rpm="off"]~.cg-panel .cg-status{border-left-color:#8f9ba1}
.cg-stage[data-fault="stuck"]~.cg-panel .cg-status{border-left-color:var(--cg-red)}
.cg-text{margin:0;max-width:40em;color:var(--ink);font-size:17px;line-height:1.6}

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