/* Motion for the machine (controls pass): see web/decay-motion.js for the rules. Only transform, opacity and filter
   animate. Reduced motion and the calm setting switch everything here off (instant state changes). */
@property --pow{syntax:'<number>';inherits:false;initial-value:1}

/* ---------- windows: a CRT powering on (a bright line opens into the picture); closing is in juice.js ---------- */
@keyframes pk-crt-on{
 0%{transform:scale(.04,.006);filter:brightness(4) saturate(0)}
 30%{transform:scale(1,.006);filter:brightness(3.2) saturate(0)}
 62%{transform:scale(1,1.008);filter:brightness(1.7) contrast(1.25)}
 82%{transform:scale(1,.998);filter:brightness(1.12)}
 100%{transform:none;filter:none}}
html.th-signal body.rx-design .window-layer:not([hidden]) .window{animation:pk-crt-on 260ms cubic-bezier(.2,.7,.3,1) both!important}

/* ---------- numbers: odometer wheels (readouts keep to one line: some have a fixed width) ---------- */
:is(#pill-coins,#win-coins-n,.topbar .chip b,.sp-readouts b){white-space:nowrap}
.odo-d{display:inline-block;position:relative;overflow:hidden;line-height:1;height:1em;vertical-align:-.16em}   /* a wheel window the height of one digit */
.odo-r{display:inline-block;position:relative;animation:pk-odo 240ms cubic-bezier(.25,.8,.3,1) both}
.odo-r::before{content:attr(data-o);position:absolute;left:0;right:0;top:-100%;text-align:center}
.odo-dn .odo-r{animation-name:pk-odo-dn}.odo-dn .odo-r::before{top:100%}
@keyframes pk-odo{from{transform:translateY(100%)}to{transform:translateY(0)}}
@keyframes pk-odo-dn{from{transform:translateY(-100%)}to{transform:translateY(0)}}
html.th-signal body.rx-design .chip.bump{animation:none!important}   /* the old pop is replaced by the odometer */

/* ---------- toasts: terminal lines, typed (decay-motion.js), switched off like a tube ---------- */
@keyframes pk-line-on{0%{filter:brightness(2.4);transform:scaleY(.08)}35%{filter:brightness(1.6);transform:scaleY(1)}100%{filter:none;transform:none}}
@keyframes pk-line-off{0%{transform:none;filter:none}60%{transform:scaleY(.06);filter:brightness(2.2)}100%{transform:scaleY(.06);filter:brightness(2);opacity:0}}
html.th-signal body.rx-design .toast{animation:pk-line-on 160ms linear both!important;transform-origin:50% 50%}
html.th-signal body.rx-design .toast.out{animation:pk-line-off 170ms linear both!important;transition:none!important}
.pk-cur{display:inline-block;width:.55em;height:1em;margin-left:2px;vertical-align:-.12em;background:currentColor;box-shadow:0 0 6px currentColor}

/* ---------- MORE SYSTEMS: the tray slides out from behind the drawer front ---------- */
html.th-signal body.rx-design details.rx-more{overflow:hidden}
html.th-signal body.rx-design details.rx-more>summary{position:relative;z-index:2}

/* ---------- quick keys before your data arrives: unlit hardware ---------- */
html.th-signal body.rx-design .dk-ops.dk-unlit .kc{--pow:.5}
html.th-signal body.rx-design .dk-ops.dk-unlit .kc .kc-lamp::before{opacity:0!important}

/* ---------- sticky notes: a tiny flutter on hover; on press they lift off the bezel, then press back ---------- */
@keyframes pk-flutter{0%,100%{rotate:0deg}30%{rotate:.7deg}65%{rotate:-.45deg}}
@media(hover:hover){html.th-signal body.rx-design .dk-note:hover{animation:pk-flutter 420ms ease-out}}
html.th-signal body.rx-design .dk-note{transition:translate 90ms ease-out,scale 90ms ease-out!important}
html.th-signal body.rx-design .dk-note.dk-down{translate:0 -3px!important;scale:1.02!important}

/* ---------- idle screens: a very slow scanline drift (HI only) ---------- */
.dk-drift{display:none}
html[data-quality=high]:not([data-motion=calm]) body.rx-design .dk-drift{display:block;position:absolute;left:0;right:0;top:-30%;height:30%;pointer-events:none;z-index:4;
 background:linear-gradient(180deg,transparent,rgb(160 255 200/.035) 45%,rgb(160 255 200/.05) 50%,rgb(160 255 200/.035) 55%,transparent);animation:pk-drift 11s linear infinite}
@keyframes pk-drift{from{transform:translateY(0)}to{transform:translateY(433%)}}

/* ---------- reduced motion / calm: no movement, just states ---------- */
@media(prefers-reduced-motion:reduce){
 html.th-signal body.rx-design .window-layer:not([hidden]) .window,html.th-signal body.rx-design .toast,html.th-signal body.rx-design .toast.out,.odo-r,html.th-signal body.rx-design .dk-note:hover{animation:none!important}
 .dk-drift{display:none!important}}
html[data-motion=calm] body.rx-design :is(.window-layer:not([hidden]) .window,.toast,.toast.out,.dk-note:hover),html[data-motion=calm] .odo-r{animation:none!important}
