/* Drift Check shared art: animation hooks for js/art.js (window.Art).
   Every animated group carries an invisible box centred on its pivot, so
   transform-box: fill-box + transform-origin: center always rotates about the pivot. */
.wheel, .wheel-rot, .person .leg, .person .arm, .person .forearm, .person .head-g { transform-box: fill-box; transform-origin: center; }

/* wheels: add class "spin" to a .wheel, or "rolling" to the .car. --spin-dur sets the speed. */
.wheel.spin .wheel-rot, .car.rolling .wheel-rot { animation: art-spin var(--spin-dur, 0.7s) linear infinite; }
.wheel.spin.reverse .wheel-rot, .car.rolling.reverse .wheel-rot { animation-direction: reverse; }
@keyframes art-spin { to { transform: rotate(360deg); } }

/* car body: "idle" gives an engine shake, "bounce" a suspension bob */
.car.idle .body { animation: art-idle 0.16s steps(2, end) infinite; }
@keyframes art-idle { 0% { transform: translateY(0); } 100% { transform: translateY(1.5px); } }
.car.bounce .body { animation: art-bounce 0.5s ease-in-out infinite alternate; }
@keyframes art-bounce { from { transform: translateY(-3px); } to { transform: translateY(3px); } }

/* people, side pose: add class "walking" to the .person. --walk-dur sets one step. */
.person.walking .leg-a { animation: art-swing-a var(--walk-dur, 0.45s) ease-in-out infinite alternate; }
.person.walking .leg-b { animation: art-swing-b var(--walk-dur, 0.45s) ease-in-out infinite alternate; }
.person.walking .arm-a { animation: art-arm-b var(--walk-dur, 0.45s) ease-in-out infinite alternate; }
.person.walking .arm-b { animation: art-arm-a var(--walk-dur, 0.45s) ease-in-out infinite alternate; }
.person.walking .bob { animation: art-bob calc(var(--walk-dur, 0.45s) / 2) ease-in-out infinite alternate; }
@keyframes art-swing-a { from { transform: rotate(-24deg); } to { transform: rotate(24deg); } }
@keyframes art-swing-b { from { transform: rotate(24deg); } to { transform: rotate(-24deg); } }
@keyframes art-arm-a { from { transform: rotate(-20deg); } to { transform: rotate(20deg); } }
@keyframes art-arm-b { from { transform: rotate(20deg); } to { transform: rotate(-20deg); } }
@keyframes art-bob { from { transform: translateY(0); } to { transform: translateY(-5px); } }

/* bay roller door: toggle is-open / is-closed on #bay-door-shutter */
.bay-shutter { transition: transform 1.4s linear; }
.bay-shutter.is-open { transform: translateY(-560px); }
.bay-shutter.is-closed { transform: translateY(0); }

/* small loops for props */
.art-flash { animation: art-flash 0.5s steps(1, end) infinite; }
@keyframes art-flash { 0% { visibility: visible; } 50% { visibility: hidden; } }
