/* Railroad-crossing-rules explainer: a top-down double-track crossing. The road runs left to right; Track 1 and Track 2
   run top to bottom. The lane carries the 15 to 50 ft stop zone, the red strip closer than 15 ft and the blue room to
   clear beyond the far rail. Hero, film, course offer and return banner reuse spring-brakes.css (.sbp-*); this file
   styles only .rr-*. The script sets the stage's data-cargo, data-stop, data-pos, data-t1, data-t2, data-check,
   data-gear and data-phase states, and every picture change follows from them here. Without script the picture shows
   a placarded tanker approaching while the train on Track 1 is leaving. */
.rr-page{--rr-go:#31d67b;--rr-amber:#fbbf24;--rr-red:#ef4444;--rr-air:#38bdf8;--rr-console:#151b20}
.rr-page .sbp-hero-grid.is-no-film{grid-template-columns:minmax(0,1fr)}
.rr-demo{padding-block:64px 72px;background:var(--paper)}
.rr-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}
.rr-head{grid-area:head}
.rr-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)}
.rr-svg{display:block;width:100%;height:auto;border-radius:10px;background:#121915}
.rr-panel-side{grid-area:panel;display:grid;gap:14px;min-width:0}

/* the HUD: stop zone, tracks checked and crossing gear; script on */
.rr-hud{display:none;align-items:center;gap:6px;flex-wrap:wrap;padding:0 2px 10px}
.rr-stage.is-js .rr-hud{display:flex}
.rr-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}
.rr-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}
.rr-chip span{color:#a9b3b8;font-weight:600}
.rr-chip b{color:#e8eef0;font-weight:800}
.rr-stage[data-stop="zone"] .rr-chip-stop i,.rr-stage[data-check="clear"] .rr-chip-tracks i,.rr-stage[data-gear="low"] .rr-chip-gear i{background:var(--rr-go);box-shadow:0 0 0 2px rgb(49 214 123/.18),0 0 10px rgb(49 214 123/.8)}
.rr-stage[data-stop="zone"] .rr-chip-stop b,.rr-stage[data-check="clear"] .rr-chip-tracks b,.rr-stage[data-gear="low"] .rr-chip-gear b{color:var(--rr-go)}
.rr-stage[data-check="t1"] .rr-chip-tracks i{background:var(--rr-amber);box-shadow:0 0 0 2px rgb(251 191 36/.2),0 0 10px rgb(251 191 36/.8)}
.rr-stage[data-check="t1"] .rr-chip-tracks b{color:#fde68a}
.rr-stage[data-stop="close"] .rr-chip-stop i,.rr-stage[data-check="t2"] .rr-chip-tracks i,.rr-stage[data-gear="missed"] .rr-chip-gear i{background:var(--rr-red);box-shadow:0 0 0 2px rgb(239 68 68/.2),0 0 10px rgb(239 68 68/.85)}
.rr-stage[data-stop="close"] .rr-chip-stop b,.rr-stage[data-check="t2"] .rr-chip-tracks b,.rr-stage[data-gear="missed"] .rr-chip-gear b{color:#fca5a5}

/* road, tracks and zones */
.rr-edge{fill:none;stroke:#e8eef0;stroke-opacity:.7;stroke-width:1.2}
.rr-center{fill:none;stroke:var(--rr-amber);stroke-width:1.2}
.rr-ties{fill:none;stroke:#6b5a48;stroke-width:24;stroke-dasharray:4 5}
.rr-panel{fill:#4a5157;stroke:#2a3035;stroke-width:1}
.rr-rail{fill:none;stroke:#c9d0d2;stroke-width:2.2}
.rr-zone-stop{fill:var(--rr-go);fill-opacity:.2;stroke:var(--rr-go);stroke-width:1.2;stroke-dasharray:4 3}
.rr-zone-close{stroke:var(--rr-red);stroke-width:1}
.rr-zone-clear{fill:var(--rr-air);fill-opacity:.16;stroke:var(--rr-air);stroke-width:1.2;stroke-dasharray:4 3}
.rr-tick{fill:none;stroke:#c3ccd0;stroke-width:1.2}
.rr-label{fill:#eef2f3;font-size:11.5px;font-weight:800;letter-spacing:.02em;paint-order:stroke;stroke:#0d1114;stroke-width:2.6px;stroke-linejoin:round}
.rr-mid{text-anchor:middle}
.rr-end{text-anchor:end}
.rr-label-go{fill:#86efac}
.rr-label-bad{fill:#fca5a5}
.rr-label-air{fill:#7dd3fc}
.rr-stage[data-stop="zone"] .rr-zone-stop{fill-opacity:.34;stroke-dasharray:none}
.rr-stage[data-stop="close"] .rr-zone-close{stroke-width:2.4}
.rr-stage[data-pos="across"] .rr-zone-clear{fill-opacity:.3;stroke-dasharray:none}

/* signs */
.rr-post{fill:none;stroke:#8d999e;stroke-width:2.4;stroke-linecap:round}
.rr-advance-face{fill:#facc15;stroke:#111;stroke-width:1.6}
.rr-advance-x{fill:none;stroke:#111;stroke-width:2.4;stroke-linecap:round}
.rr-advance-rr{fill:#111;font-size:10px;font-weight:900;text-anchor:middle}
.rr-buck-arm{fill:none;stroke:#111;stroke-width:8;stroke-linecap:round}
.rr-buck-face{fill:none;stroke:#fff;stroke-width:5.6;stroke-linecap:round}
.rr-plate{fill:#fff;stroke:#111;stroke-width:1}
.rr-plate-text{fill:#111;font-size:9.5px;font-weight:900;letter-spacing:.02em;text-anchor:middle}
.rr-track-tag rect{fill:#080b0d;stroke:#59636a;stroke-width:1}
.rr-track-tag text{fill:#fff;font-size:10px;font-weight:800;text-anchor:middle}

/* trains: the first leaves up the page, the second comes up from below once it is revealed */
.rr-train{transform-box:view-box}
.rr-car{fill:url(#rr-g-car);stroke:#111820;stroke-width:1}
.rr-car-roof{fill:none;stroke:#8fa3b5;stroke-width:1.2;stroke-dasharray:6 4}
.rr-loco{fill:url(#rr-g-loco);stroke:#5f1c0c;stroke-width:1}
.rr-loco-cab{fill:#1b2530;stroke:#fde68a;stroke-width:.8}
.rr-loco-light{fill:#fff7cc}
.rr-train-2{opacity:0;transform:translateY(232px)}
.rr-stage[data-t1="gone"] .rr-train-1{transform:translateY(-370px)}
.rr-stage[data-t2="coming"] .rr-train-2{opacity:1}
.rr-stage[data-t2="crossing"] .rr-train-2{opacity:1;transform:translateY(40px)}
.rr-stage[data-t2="gone"] .rr-train-2{opacity:1;transform:translateY(-400px)}
.rr-hidden-ring{fill:#080b0d;fill-opacity:.7;stroke:#fde68a;stroke-width:1.4;stroke-dasharray:3 2}
.rr-hidden-q{fill:#fde68a;font-size:13px;font-weight:900;text-anchor:middle}
.rr-stage:not([data-t2="hidden"]) .rr-hidden{opacity:0}
.rr-flag{opacity:0}
.rr-flag rect{fill:#b91c1c}
.rr-flag text{fill:#fff;font-size:10px;font-weight:900;letter-spacing:.03em;text-anchor:middle}
.rr-stage[data-t2="coming"] .rr-flag-train,.rr-stage[data-phase="stalled"] .rr-flag-stall{opacity:1}

/* the vehicle: tanker for a placarded load, box trailer for general freight; front of the cab at x 96 */
.rr-truck{transform-box:view-box;transform:translateX(0px)}
.rr-stage[data-pos="zone"] .rr-truck{transform:translateX(54px)}
.rr-stage[data-pos="close"] .rr-truck{transform:translateX(75px)}
.rr-stage[data-pos="tracks"] .rr-truck{transform:translateX(166px)}
.rr-stage[data-pos="across"] .rr-truck{transform:translateX(256px)}
.rr-shadow{fill:#000;opacity:.35}
.rr-tank{stroke:#3a4246;stroke-width:1}
.rr-tank-band{fill:none;stroke:#5e696c;stroke-width:1.4}
.rr-placard{fill:#dc2626;stroke:#fff;stroke-width:1}
.rr-box{stroke:#3a4246;stroke-width:1}
.rr-box-stripe{fill:none;stroke:#2563eb;stroke-width:2.4}
.rr-trailer-box{display:none}
.rr-stage[data-cargo="freight"] .rr-trailer-box{display:inline}
.rr-stage[data-cargo="freight"] .rr-trailer-tank{display:none}
.rr-hitch{fill:#2a3133}
.rr-cab{fill:#e8eef0;stroke:#3a4246;stroke-width:1}
.rr-glass{fill:#1e3a5f}
.rr-mirror{fill:none;stroke:#2a3133;stroke-width:1.6;stroke-linecap:round}
.rr-flashers{fill:#fbbf24;opacity:0}
.rr-stage[data-stop="zone"] .rr-flashers,.rr-stage[data-phase="stalled"] .rr-flashers{opacity:1}
.rr-stage[data-phase="stalled"] .rr-cab{fill:#fecaca;stroke:var(--rr-red);stroke-width:1.6}

/* motion, script on */
.rr-stage.is-js .rr-truck{transition:transform 1.1s cubic-bezier(.45,0,.3,1)}
.rr-stage.is-js .rr-train{transition:transform 1.1s cubic-bezier(.4,0,.6,1),opacity .25s}
.rr-stage.is-js .rr-hidden,.rr-stage.is-js .rr-flag{transition:opacity .2s}
.rr-stage.is-js[data-stop="zone"] .rr-flashers,.rr-stage.is-js[data-phase="stalled"] .rr-flashers{animation:rr-blink .9s steps(2,jump-none) infinite}
.rr-stage.is-js[data-t2="coming"] .rr-flag-train{animation:rr-pulse .8s ease-in-out infinite alternate}
@keyframes rr-blink{to{opacity:.15}}
@keyframes rr-pulse{to{opacity:.6}}

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

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