/* Crack-the-whip explainer: an overhead view of a tractor pulling a single trailer, doubles or triples through a lane
   change or around a ramp curve, with a bar per unit for its sideways snap. Hero, film, course offer and return banner
   reuse spring-brakes.css (.sbp-*); this file styles only .cw-*. The script sets the stage's data-rig (single, doubles,
   triples), data-scene (lane, ramp), data-steer, data-speed and data-rear (steady, lean, roll), moves the units and
   bars and marks the last trailer with data-tip="yes". Without script the picture shows doubles after a quick swerve,
   the last trailer rolling over. Every SVG text label is at least 11.5px in the 360-wide viewBox. */
.cw-page{--cw-go:#31d67b;--cw-warn:#fbbf24;--cw-red:#ef4444;--cw-swing:#fbbf24;--cw-console:#151b20}
.cw-page .sbp-hero-grid.is-no-film{grid-template-columns:minmax(0,1fr)}
.cw-demo{padding-block:64px 72px;background:var(--paper)}
.cw-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}
.cw-head{grid-area:head}
.cw-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)}
.cw-svg{display:block;width:100%;height:auto;border-radius:10px;background:#0f1316}
.cw-panel{grid-area:panel;display:grid;gap:14px;min-width:0}

/* the HUD: combination, last trailer and move; script on */
.cw-hud{display:none;align-items:center;gap:6px;flex-wrap:wrap;padding:0 2px 10px}
.cw-stage.is-js .cw-hud{display:flex}
.cw-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}
.cw-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}
.cw-chip span{color:#a9b3b8;font-weight:600}
.cw-chip b{color:#e8eef0;font-weight:800}
.cw-chip-rig i{background:#d3dade}
.cw-chip-move i{background:var(--cw-swing)}
.cw-stage[data-rear="steady"] .cw-chip-rear i{background:var(--cw-go);box-shadow:0 0 0 2px rgb(49 214 123/.18),0 0 10px rgb(49 214 123/.8)}
.cw-stage[data-rear="steady"] .cw-chip-rear b{color:var(--cw-go)}
.cw-stage[data-rear="lean"] .cw-chip-rear i{background:var(--cw-warn);box-shadow:0 0 0 2px rgb(251 191 36/.2),0 0 10px rgb(251 191 36/.8)}
.cw-stage[data-rear="lean"] .cw-chip-rear b{color:#fde68a}
.cw-stage[data-rear="roll"] .cw-chip-rear i{background:var(--cw-red);box-shadow:0 0 0 2px rgb(239 68 68/.2),0 0 10px rgb(239 68 68/.85)}
.cw-stage[data-rear="roll"] .cw-chip-rear b{color:#fca5a5}

/* labels: every label 11.5px or larger */
.cw-cap{fill:#b6c0c5;font-size:12px;font-weight:800;letter-spacing:.1em;text-transform:uppercase}
.cw-part{fill:#d3dade;font-size:11.5px;font-weight:800;paint-order:stroke;stroke:#0d1114;stroke-width:2.6px;stroke-linejoin:round}
.cw-part-end{text-anchor:end}
.cw-part-roll{fill:#fca5a5}
.cw-travel{fill:none;stroke:#d3dade;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.cw-key-path{fill:none;stroke:#e8eef0;stroke-width:1.6;stroke-dasharray:4 3}
.cw-key-wave{fill:none;stroke:var(--cw-swing);stroke-width:2.4;stroke-linecap:round}
.cw-scene{display:none}
.cw-stage[data-scene="lane"] .cw-scene-lane,.cw-stage[data-scene="ramp"] .cw-scene-ramp{display:inline}

/* the road: two lanes for a lane change, one curved lane for the ramp */
.cw-road{display:none}
.cw-stage[data-scene="lane"] .cw-road-lane,.cw-stage[data-scene="ramp"] .cw-road-ramp{display:inline}
.cw-asphalt{fill:#2c3136}
.cw-edge{fill:none;stroke:#e8eef0;stroke-opacity:.75;stroke-width:1.6}
.cw-lane{fill:none;stroke:#fde68a;stroke-opacity:.7;stroke-width:1.6;stroke-dasharray:12 10}
.cw-path{fill:none;stroke:#e8eef0;stroke-opacity:.8;stroke-width:1.6;stroke-dasharray:4 3}

/* the rig: steel units, the last trailer outlined amber; it fills amber when it leans and red when it rolls over */
.cw-hitch{fill:none;stroke:#8f9a9d;stroke-width:2.2;stroke-linecap:round}
.cw-body{fill:url(#cw-g-box);stroke:#4f5a5e;stroke-width:1;transition:fill .2s,stroke .2s}
.cw-axle{fill:none;stroke:#0a0c0e;stroke-width:3;stroke-linecap:round}
.cw-frame{fill:#4f5a5e;stroke:#2a3133;stroke-width:1}
.cw-fifth{fill:#1b2227;stroke:#8f9a9d;stroke-width:1}
.cw-cab{fill:#38bdf8;stroke:#0c4a6e;stroke-width:1}
.cw-hood{fill:#0ea5e9;stroke:#0c4a6e;stroke-width:1}
.cw-unit[data-tip="yes"] .cw-body{stroke:var(--cw-swing);stroke-width:2.2}
.cw-stage[data-rear="lean"] .cw-unit[data-tip="yes"] .cw-body{fill:#fde68a}
.cw-stage[data-rear="roll"] .cw-unit[data-tip="yes"] .cw-body{fill:#fca5a5;stroke:var(--cw-red)}
.cw-wave{fill:none;stroke:var(--cw-swing);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;opacity:.95}

/* which units the rig has */
.cw-stage[data-rig="single"] .cw-u-t1,.cw-stage[data-rig="single"] .cw-u-t2,.cw-stage[data-rig="single"] .cw-u-t3,
.cw-stage[data-rig="doubles"] .cw-u-s,.cw-stage[data-rig="doubles"] .cw-u-t3,
.cw-stage[data-rig="triples"] .cw-u-s{display:none}
.cw-stage:not([data-rig="doubles"]) .cw-fac-doubles{display:none}

/* the tip of the whip */
.cw-badge{fill:#080b0d;fill-opacity:1;stroke:#59636a;stroke-width:1.2;transition:stroke .2s}
.cw-badge-txt{display:none;font-size:12.5px;font-weight:900;letter-spacing:.06em;text-anchor:middle}
.cw-stage[data-rear="steady"] .cw-rear-steady,.cw-stage[data-rear="lean"] .cw-rear-lean,.cw-stage[data-rear="roll"] .cw-rear-roll{display:inline}
.cw-rear-steady{fill:var(--cw-go)}
.cw-rear-lean{fill:var(--cw-warn)}
.cw-rear-roll{fill:#fca5a5}
.cw-stage[data-rear="steady"] .cw-badge{stroke:var(--cw-go)}
.cw-stage[data-rear="lean"] .cw-badge{stroke:var(--cw-warn)}
.cw-stage[data-rear="roll"] .cw-badge{fill:#7f1d1d;stroke:var(--cw-red)}

/* the sideways snap bars */
.cw-floor{fill:none;stroke:#59636a;stroke-width:1.2}
.cw-limit{fill:none;stroke:var(--cw-red);stroke-width:1.6;stroke-dasharray:6 4}
.cw-bar{fill:var(--cw-go);transition:fill .2s}
.cw-bar[data-level="lean"]{fill:var(--cw-warn)}
.cw-bar[data-level="roll"]{fill:var(--cw-red)}
.cw-name{fill:#e8eef0;font-size:11.5px;font-weight:800;text-anchor:middle}
.cw-fac{fill:#fde68a;font-size:12.5px;font-weight:900;text-anchor:middle}

/* motion, script on: the rolling trailer's badge pulses its border only; the fill stays opaque so the lane line never shows through */
.cw-stage.is-js[data-rear="roll"] .cw-badge{animation:cw-pulse 1s ease-in-out infinite}
@keyframes cw-pulse{50%{stroke:#fecaca;stroke-width:2.6}}

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

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