/* Landing-gear-checking-coupling explainer: the Step 11 landing gear safety catch simulator.
   Side view of a coupled tractor-semitrailer: fifth wheel, kingpin, telescoping landing gear and a clearance ruler
   (4 SVG units to the inch). The stage's data attributes carry the state: lock, height, outcome and inspect. */
.lg-page{--lg-ok:#31d67b;--lg-warn:#ffb400;--lg-bad:#ef4444;--lg-console:#10161b}
.lg-page .sbp-hero-grid.is-no-film{grid-template-columns:minmax(0,1fr)}
.lg-demo{padding-block:64px 72px;background:var(--paper)}
.lg-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}
.lg-head{grid-area:head}
.lg-stage{grid-area:stage;margin:0;padding:10px;border-radius:16px;background:linear-gradient(170deg,#1d262d,#0b0f12 80%);box-shadow:0 30px 60px -34px rgb(0 0 0/.75),inset 0 1px 0 rgb(255 255 255/.06)}
.lg-svg{display:block;width:100%;height:auto;border-radius:10px;background:#0b0f12;overflow:hidden}
.lg-panel{grid-area:panel;display:grid;gap:14px;min-width:0}

/* step lamps: light up as Steps 11, 13 and 15 are done */
.lg-hud{display:none;align-items:center;gap:6px;flex-wrap:wrap;padding:0 2px 10px}
.lg-stage.is-js .lg-hud{display:flex}
.lg-lamp{display:inline-flex;align-items:center;gap:7px;margin:0;padding:6px 10px 6px 8px;border-radius:8px;background:#0b0f12;box-shadow:inset 0 0 0 1px rgb(255 255 255/.09);line-height:1;white-space:nowrap}
.lg-lamp i{flex:none;width:9px;height:9px;border-radius:50%;background:#3a444b;box-shadow:inset 0 0 0 1.5px #56626a}
.lg-lamp span{color:#8c979e;font-weight:700;letter-spacing:.02em;text-transform:uppercase;font-size:12px}
.lg-lamp.is-on i{background:var(--lg-ok);box-shadow:0 0 0 2px rgb(49 214 123/.2),0 0 10px rgb(49 214 123/.8)}
.lg-lamp.is-on span{color:#e9fff2}
.lg-lamp.is-fail i{background:var(--lg-bad);box-shadow:0 0 0 2px rgb(239 68 68/.2),0 0 10px rgb(239 68 68/.8)}
.lg-lamp.is-fail span{color:#ffe4e4}
.lg-stage.is-live .lg-lamp :is(i,span){transition:background .25s,box-shadow .25s,color .25s}

/* yard */
.lg-wall-roof{fill:#8f9590}
.lg-wall-ribs{stroke:#b1b6b2;stroke-width:1}
.lg-lot-edge{stroke:#2b2e2d;stroke-width:1}
.lg-lot-line{stroke:#d9b84a;stroke-opacity:.6;stroke-width:1.6;stroke-dasharray:16 12}
.lg-lot-joint{stroke:#2e3130;stroke-width:.8}
.lg-shadow{fill:#000;opacity:.3}
.lg-shadow-shoe{opacity:.16}
.lg-stage[data-height="ground"] .lg-shadow-shoe,.lg-stage:is([data-outcome="caught"],[data-outcome="crash"]) .lg-shadow-shoe{opacity:.4}
.lg-tag{fill:#c9d0d5;font-size:8px;font-weight:800;letter-spacing:.08em}

/* tractor */
.lg-cab-seam{fill:none;stroke:#10253a;stroke-opacity:.6;stroke-width:1}
.lg-stack-cap{fill:#3a4146}
.lg-deck{fill:#5a646b;stroke:#2a3035;stroke-width:.6}
.lg-frame{fill:#1c2024}
.lg-fw-mount{fill:#2b3237;stroke:#1a1f23;stroke-width:.6}
.lg-fw-plate{stroke:#1f252a;stroke-width:.8}
.lg-fw-top{stroke:#ffffff;stroke-opacity:.6;stroke-width:.8}
.lg-fw-throat{fill:#0c1013;opacity:.55}
.lg-fw-handle{fill:none;stroke:#c9d2d8;stroke-width:1.6;stroke-linecap:round}
.lg-fender{fill:none;stroke:#1c2024;stroke-width:3.4;stroke-linecap:round}
.lg-mudflap{fill:#16191c}
.lg-hubs{fill:#39424a}
.lg-air-blue,.lg-air-red{fill:none;stroke-width:2.2;stroke-linecap:round}
.lg-air-blue{stroke:#3b82f6}
.lg-air-red{stroke:#ef4444}

/* trailer */
.lg-box-ribs{stroke:#cfcbc1;stroke-width:1.2}
.lg-box-rail{fill:#b9b5ab}
.lg-tape-w{stroke:#f8fafc;stroke-width:2.6}
.lg-tape-r{stroke:#dc2626;stroke-width:2.6;stroke-dasharray:9 9}
.lg-post{fill:#a9a59b}
.lg-gladhand{fill:#3a4148;stroke:#1f2428;stroke-width:.6}
.lg-apron{fill:#2a2f33}
.lg-pin,.lg-pin-head{stroke:#2a1a04;stroke-width:.7}
.lg-outer{stroke:#1d2226;stroke-width:.8}
.lg-inner{stroke:#1d2226;stroke-width:.7}
.lg-shoe{fill:#2f363b;stroke:#14181b;stroke-width:.8}
.lg-shoe-ear{fill:#4b545b;stroke:#14181b;stroke-width:.6}
.lg-shoe-pin{fill:#a6afb3}
.lg-brace{stroke:#3a4046;stroke-width:2.4;stroke-linecap:round}
.lg-gearbox{fill:#3b444a;stroke:#1d2226;stroke-width:.8}
.lg-crank-arm{fill:none;stroke:#1f2428;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.lg-crank-knob{fill:#d4a017;stroke:#5c4304;stroke-width:.6}
.lg-cracks{fill:none;stroke:var(--lg-bad);stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;opacity:0}
.lg-jaw{fill:#8c969c;stroke:#0f172a;stroke-width:.8}

/* pavement effects */
.lg-scuff{fill:none;stroke:#e7e3d8;stroke-opacity:.85;stroke-width:1.4;stroke-linecap:round;opacity:0}
.lg-dust circle{fill:#c8c2b4}
.lg-dust{opacity:0}
.lg-burst{opacity:0}
.lg-burst path{fill:none;stroke:#ffd27a;stroke-width:2;stroke-linecap:round}

/* ruler */
.lg-ruler-card{fill:#fffffc;fill-opacity:.88;stroke:#1f2933;stroke-opacity:.18}
.lg-ruler-bar{fill:#1f2933}
.lg-ruler-ticks{stroke:#1f2933;stroke-width:1}
.lg-ruler-major{stroke:#1f2933;stroke-width:1.6}
.lg-r-n{fill:#1b232b;font-size:10px;font-weight:900}
.lg-r-c{fill:#3f4a54;font-size:8.2px;font-weight:700}
.lg-stage[data-height="ground"] .lg-r-ground :is(.lg-r-n,.lg-r-c),.lg-stage[data-height="up"] .lg-r-up :is(.lg-r-n,.lg-r-c){fill:#b45309}
.lg-stage[data-height="raised"] .lg-r-raised :is(.lg-r-n,.lg-r-c){fill:#15803d}
.lg-mark-lead{stroke:var(--lg-warn);stroke-width:1.2;stroke-dasharray:2 1.5}
.lg-mark-tri{fill:var(--lg-warn);stroke:#7a4b00;stroke-width:.6}

/* the three heights: the inner leg and shoe telescope; the ruler marker follows */
.lg-leg,.lg-mark{transform:translateY(0)}
.lg-stage[data-height="raised"] :is(.lg-leg,.lg-mark){transform:translateY(-8px)}
.lg-stage[data-height="up"] :is(.lg-leg,.lg-mark){transform:translateY(-56px)}
.lg-stage:is([data-outcome="caught"],[data-outcome="crash"]) .lg-mark{transform:translateY(0)}
.lg-crank{transform-box:view-box;transform-origin:234px 157.5px}
.lg-stage.is-cranking .lg-crank{animation:lg-crank .9s cubic-bezier(.4,0,.4,1)}
@keyframes lg-crank{to{transform:rotate(720deg)}}

/* hidden bad lock: the jaws closed together behind the kingpin instead of around its shank */
.lg-jaw{transform:translateX(0)}
.lg-stage[data-lock="bad"] .lg-jaw-a{transform:translateX(14px)}

/* the tug with the trailer held: the tractor leans forward and springs back */
.lg-stage.is-tugging .lg-tractor{animation:lg-tug 1.4s cubic-bezier(.4,0,.3,1)}
.lg-stage.is-tugging .lg-trailer{animation:lg-hold 1.4s ease-in-out}
@keyframes lg-tug{0%{transform:translateX(0)}30%{transform:translateX(-6px)}45%{transform:translateX(-4.5px)}62%{transform:translateX(-6px)}100%{transform:translateX(0)}}
@keyframes lg-hold{0%,100%{transform:translateX(0)}30%,62%{transform:translateX(-.8px)}}
/* feet on the ground: the trailer drags along and the legs flex */
.lg-bend{transform-box:view-box;transform-origin:248px 177px}
.lg-stage.is-dragging .lg-tractor{animation:lg-drag 1.4s cubic-bezier(.4,0,.3,1)}
.lg-stage.is-dragging .lg-trailer{animation:lg-drag-t 1.4s cubic-bezier(.4,0,.3,1)}
.lg-stage.is-dragging .lg-bend{animation:lg-flex 1.4s cubic-bezier(.4,0,.3,1)}
.lg-stage.is-dragging .lg-dust{animation:lg-dust 1.4s ease-out}
@keyframes lg-drag{0%,100%{transform:translateX(0)}35%,65%{transform:translateX(-8px)}}
@keyframes lg-drag-t{0%,100%{transform:translateX(0)}35%,65%{transform:translateX(-5px)}}
@keyframes lg-flex{0%,100%{transform:rotate(0)}35%,65%{transform:rotate(-5deg)}}
@keyframes lg-dust{0%{opacity:0;transform:translateY(0)}30%{opacity:.7}100%{opacity:0;transform:translateY(-8px)}}
.lg-stage[data-outcome="masked"] .lg-scuff{opacity:1}

/* the jaws missed: the tractor pulls out from under, the trailer tips forward about its rear tires */
.lg-trailer{transform-box:view-box;transform-origin:760px 150px}
.lg-stage:is([data-outcome="caught"],[data-outcome="crash"]) .lg-tractor{transform:translateX(-110px)}
.lg-stage:is([data-outcome="caught"],[data-outcome="crash"]) .lg-lines{opacity:0}
.lg-stage[data-outcome="caught"] .lg-trailer{transform:rotate(-.9deg)}
.lg-stage[data-outcome="crash"] .lg-trailer{transform:rotate(-6.24deg)}
.lg-stage[data-outcome="crash"] .lg-bend{transform:rotate(7deg)}
.lg-stage[data-outcome="crash"] .lg-cracks{opacity:1}
.lg-stage[data-outcome="crash"] .lg-burst{opacity:1}
.lg-stage[data-outcome="caught"] .lg-dust{opacity:.55}

/* Step 13 inset */
.lg-inset{opacity:0}
.lg-stage[data-inspect="ok"] .lg-inset{opacity:1}
.lg-inset-lead{fill:none;stroke:var(--lg-warn);stroke-width:1.4;stroke-dasharray:3 2.5}
.lg-inset-card{fill:#0d1216;stroke:var(--lg-warn);stroke-width:1.4;filter:drop-shadow(0 3px 8px rgb(0 0 0/.45))}
.lg-inset-t{fill:#ffd27a;font-size:8px;font-weight:900;letter-spacing:.05em}
.lg-inset-plate{stroke:#0f172a;stroke-width:.8}
.lg-inset-seam{stroke:var(--lg-ok);stroke-width:2;stroke-linecap:round}
.lg-inset-head{stroke:#2a1a04;stroke-width:.8}
.lg-inset-jaw{fill:#8c969c;stroke:var(--lg-ok);stroke-width:1.8}
.lg-inset-latch{fill:#b8c1c7;stroke:var(--lg-ok);stroke-width:1.6}
.lg-inset-lever{stroke:#c9d2d8;stroke-width:3;stroke-linecap:round}
.lg-inset-ticks{fill:none;stroke:var(--lg-ok);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.lg-inset-c{fill:#f1f5f4;font-size:8.6px;font-weight:800}

/* result banners */
.lg-pill{opacity:0}
.lg-stage[data-outcome="answer"] .lg-pill-answer,.lg-stage[data-outcome="hold"] .lg-pill-hold,
.lg-stage[data-outcome="masked"] .lg-pill-masked,.lg-stage[data-outcome="caught"] .lg-pill-caught,
.lg-stage[data-outcome="crash"] .lg-pill-crash,.lg-stage[data-outcome="lucky"] .lg-pill-lucky,
.lg-stage[data-outcome="done"] .lg-pill-done{opacity:1}
.lg-pill rect{stroke-width:1.4;filter:drop-shadow(0 2px 6px rgb(0 0 0/.45))}
.lg-pill-answer rect,.lg-pill-hold rect,.lg-pill-done rect{fill:#14532d;stroke:#86efac}
.lg-pill-masked rect,.lg-pill-caught rect,.lg-pill-lucky rect{fill:#7c4a03;stroke:#fcd34d}
.lg-pill-crash rect{fill:#991b1b;stroke:#fecaca}
.lg-pill-a{fill:#fff;font-size:11.5px;font-weight:900;letter-spacing:.04em;text-anchor:middle}
.lg-pill-b{fill:#f3f4ef;font-size:8.6px;font-weight:700;text-anchor:middle}

/* transitions once the simulator is live */
.lg-stage.is-live :is(.lg-leg,.lg-mark){transition:transform .9s cubic-bezier(.4,0,.3,1)}
.lg-stage.is-live :is(.lg-pill,.lg-inset,.lg-scuff,.lg-cracks,.lg-dust,.lg-lines){transition:opacity .35s}
.lg-stage.is-live .lg-tractor{transition:transform .7s cubic-bezier(.5,0,.3,1)}
.lg-stage.is-live .lg-jaw{transition:transform .4s ease}
.lg-stage.is-live .lg-trailer{transition:transform .45s cubic-bezier(.55,0,.6,1)}
.lg-stage.is-live:is([data-outcome="caught"],[data-outcome="crash"]) .lg-trailer{transition:transform .45s cubic-bezier(.55,0,1,.45) .55s}
.lg-stage.is-live .lg-bend{transition:transform .3s ease}
.lg-stage.is-live[data-outcome="crash"] .lg-bend{transition:transform .25s ease 1s}
.lg-stage.is-live[data-outcome="crash"] .lg-burst{animation:lg-burst 1.6s ease-out 1s both}
.lg-stage.is-live[data-outcome="crash"] .lg-pill-crash rect{animation:lg-alarm 1.1s ease-in-out 1s 2}
.lg-stage.is-live[data-outcome="crash"] .lg-svg{animation:lg-shake .45s ease-out 1s}
@keyframes lg-burst{0%{opacity:0;transform:scale(.6)}15%{opacity:1}100%{opacity:.85;transform:scale(1)}}
.lg-burst{transform-box:view-box;transform-origin:248px 238px}
@keyframes lg-alarm{50%{fill:#dc2626}}
@keyframes lg-shake{20%{transform:translate(-3px,2px)}40%{transform:translate(3px,-1px)}60%{transform:translate(-2px,1px)}80%{transform:translate(1px,0)}}

/* controls: one dark console, every button the same colour */
.lg-ask{margin:0;color:var(--ink);font-size:20px;line-height:1.25}
.lg-ask b{font-weight:800}
.lg-ask[hidden],.lg-controls[hidden]{display:none}
.lg-controls{display:grid;gap:14px;padding:14px;border-radius:16px;background:linear-gradient(180deg,#1c252c,var(--lg-console));box-shadow:0 18px 40px -28px rgb(0 0 0/.8),inset 0 1px 0 rgb(255 255 255/.07);color:#e6edf1}
.lg-group{display:grid;gap:7px;min-width:0}
.lg-legend{margin:0;color:#9fb0ba;font-size:12.5px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}
.lg-row{display:grid;gap:6px}
.lg-row-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.lg-row-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.lg-actions{gap:8px}
.lg-btn{position:relative;min-width:0;min-height:52px;padding:9px 11px;border:0;border-radius:12px;background:linear-gradient(180deg,#26313a,#182027);box-shadow:inset 0 1px 0 rgb(255 255 255/.09),0 3px 0 #05080a,0 8px 16px -10px rgb(0 0 0/.7);color:#fff;font:inherit;font-size:15px;font-weight:700;line-height:1.2;text-align:center;cursor:pointer;transition:transform .08s,box-shadow .12s,background .12s}
.lg-btn:hover{background:linear-gradient(180deg,#2d3943,#1c252d)}
.lg-btn:active{transform:translateY(2px);box-shadow:inset 0 1px 0 rgb(255 255 255/.06),0 1px 0 #05080a}
.lg-btn[aria-pressed="true"],.lg-btn.is-active{box-shadow:inset 0 0 0 2px var(--sbp-amber,#ffb400),0 3px 0 #05080a,0 0 16px -5px rgb(255 180 0/.55)}
.lg-btn:focus-visible{outline:3px solid var(--sbp-amber,#ffb400);outline-offset:3px}
.lg-act{display:flex;align-items:center;gap:12px;width:100%;min-height:58px;text-align:left}
.lg-act span{min-width:0;flex:1}
.lg-reset{width:auto;justify-self:start;min-height:48px;padding-right:16px}
.lg-icon{flex:none;width:40px;height:28px}
.lg-icon-truck{fill:#7fb2de}
.lg-icon-wheel{fill:#0b0f12;stroke:#c9d2d8;stroke-width:1.2}
.lg-icon-line{fill:none;stroke:#c9d2d8;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.lg-icon-beam{fill:#ffe2a8;opacity:.55}
.lg-icon-torch{fill:#c9d2d8}
.lg-status{display:block;min-height:7.3em;padding:12px 14px 12px 16px;border-left:5px solid #94a3b8;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,background .2s}
.lg-status[data-tone="ok"]{border-left-color:#1f9d55}
.lg-status[data-tone="refuse"]{border-left-color:#d97706;background:#fff7e6}
.lg-status[data-tone="bad"]{border-left-color:#dc2626;background:#fff1f1}

@media (prefers-reduced-motion:reduce){
  .lg-stage *,.lg-stage *::before,.lg-stage *::after{animation:none!important;transition:none!important}
}
@media (min-width:761px){
  .lg-page .sbp-film-frame.is-wide{aspect-ratio:auto;padding-bottom:58px;background:#0b0d0f}
  .lg-page .sbp-film-frame.is-wide video{aspect-ratio:16/9;width:100%;height:auto}
  .lg-page .sbp-film-frame.is-wide .sbp-play{bottom:58px}
  .lg-page .sbp-film-frame.is-wide .sbp-sound-on{left:12px;right:auto;top:auto;bottom:10px}
  .lg-page .sbp-film-frame.is-wide .sbp-pause{right:12px;top:auto;bottom:10px}
}
@media (max-width:900px){
  .lg-demo-grid{grid-template-columns:minmax(0,1fr);grid-template-areas:"head" "stage" "panel";gap:16px}
}
@media (max-width:760px){
  .lg-demo{padding-block:36px 44px}
  .lg-stage{margin-inline:-8px;padding:8px 6px 6px;border-radius:14px}
  .lg-svg{border-radius:8px}
  .lg-hud{gap:4px;padding:0 0 8px;flex-wrap:nowrap}
  .lg-lamp{padding:5px 6px 5px 5px;gap:4px}
  .lg-lamp span{font-size:10px;letter-spacing:0}
  .lg-lamp i{width:8px;height:8px}
  .lg-r-n{font-size:11px}
  .lg-r-c{font-size:9px}
  .lg-pill-b{font-size:9.2px}
  .lg-inset-t{font-size:8.8px}
  .lg-inset-c{font-size:9.2px}
  .lg-panel{gap:10px}
  .lg-ask{font-size:18px}
  .lg-controls{padding:12px}
  .lg-btn{font-size:14px;padding:8px 7px}
  .lg-act{font-size:15px;padding:9px 11px}
}
