/* Morpheus. One game pixel = --cat-px CSS px. Sprite sizes in game px: sit 38x48, tail 38x22, walk 52x46 (8 frames, legs rigged in code). */
.cabinet{--cat-px:3;--cat-x:.85}
/* 641-900 px: the desk is short and the icons sit low, so he sits at the phone size (clears "Message me" up to iPad portrait) */
@media(min-width:641px) and (max-width:900px){.cabinet{--cat-px:2}}
@media(max-width:640px){.cabinet{--cat-px:2;--cat-x:.3}}
.cat-walk{position:absolute;z-index:40;left:0;top:0;width:calc(52px * var(--cat-px));height:calc(46px * var(--cat-px));background:url("art/morpheus-walk.png") 0 0/calc(416px * var(--cat-px)) calc(46px * var(--cat-px)) no-repeat;image-rendering:pixelated;pointer-events:none}
.cat-walk.turned{transform:scaleX(-1)}
/* in the screen: same layer as the windows but before them, so windows cover him and the scanlines do not */
.cat-walk.in-screen{z-index:2}
.cat-perch{position:absolute;z-index:30;left:calc(var(--cat-x) * 100% - 19px * var(--cat-px));bottom:calc(-1px * var(--cat-px));width:calc(38px * var(--cat-px));height:calc(48px * var(--cat-px))}
.cat-body{position:absolute;inset:0;width:100%;height:100%;image-rendering:pixelated;cursor:pointer}
/* tail canvas = 44x22 game px (38 + 3 px of sway each side), hung from row 44 of the body; sized in CSS so a breakpoint change rescales it */
.cat-tail{position:absolute;left:calc(-3px * var(--cat-px));top:calc(44px * var(--cat-px));width:calc(44px * var(--cat-px));height:calc(22px * var(--cat-px));pointer-events:none;image-rendering:pixelated}
.cat-tail.still{left:0;width:calc(38px * var(--cat-px))}
.menu-pop .menu-rule{display:block;margin:4px 2px;border-top:1px solid var(--ink)}
.menu-check{min-width:10px;text-align:right}
#menu-cat[aria-pressed="true"] .menu-check::before{content:"\2713"}
/* Sound bubble: the desktop's own 1-bit style, so the sound belongs to the machine's world */
.cat-say{position:absolute;left:calc(25px * var(--cat-px));bottom:calc(100% + 4px);padding:5px 9px 6px;background:#fff;border:2px solid #000;box-shadow:2px 2px 0 #000;font-weight:700;font-size:12px;line-height:1;color:#000;white-space:nowrap;pointer-events:none}
.cat-say::before,.cat-say::after{content:"";position:absolute;background:#000}
.cat-say::before{left:6px;bottom:-6px;width:6px;height:4px}
.cat-say::after{left:2px;bottom:-10px;width:4px;height:4px}
@media(max-width:640px){.cat-say{font-size:11px;padding:4px 7px 5px}}
/* Tiger Lily: the light one, on the top edge. Same game pixels as Morpheus. --lily-x = centre of her perch across the cabinet,
   chosen per breakpoint so her body clears the ALKME mark and the SYSTEM READY label, and her tail clears the Desktop button
   and the Signal Desk label (and, from 901 px, the open Desktop menu). */
.cabinet{--lily-x:.36}
@media(min-width:641px) and (max-width:900px){.cabinet{--lily-x:.5}}
@media(max-width:640px){.cabinet{--lily-x:.53}}
#menu-lily[aria-pressed="true"] .menu-check::before{content:"\2713"}
/* her walk: a strip above the cabinet, clipped at its sides, so she comes in from behind the machine's left edge */
.cat-lane{position:absolute;z-index:41;left:0;right:0;bottom:100%;height:calc(47px * var(--cat-px));overflow:hidden;pointer-events:none}
.cat-walk.lily{background-image:url("art/tigerlily-walk.png")}
/* body above the top edge (bottom row on the frame), tail hung from row 44 over the menu bar; in front of the bar, behind an open menu */
.cat-perch.lily{z-index:51;left:calc(var(--lily-x) * 100% - 19px * var(--cat-px));top:calc(-48px * var(--cat-px));bottom:auto}
.cat-perch.lily.under-menu{z-index:49}
/* her tail canvas covers only the strip's first 12 columns (her tail is at 1-9), plus 3 px of sway each side */
.lily .cat-tail{left:calc(-3px * var(--cat-px));width:calc(18px * var(--cat-px))}
.lily .cat-tail.still{left:0;width:calc(38px * var(--cat-px))}
/* she faces right: the bubble sits beside her head, its steps pointing back at her */
.lily .cat-say{left:calc(34px * var(--cat-px));top:calc(5px * var(--cat-px));bottom:auto}
.lily .cat-say::before{left:-6px;bottom:5px;width:4px;height:6px}
.lily .cat-say::after{left:-10px;bottom:3px;width:4px;height:4px}
/* the cats are listed by face, not by name */
.menu-pop .menu-pet{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px}
.menu-pet img{display:block;image-rendering:pixelated}
/* until a face has loaded with pixels (cat.js adds .pic), its row names the cat instead, in the menu's own type (the same
   words as its label); a face that is slow, blocked or turned off leaves the name showing */
.menu-pet:not(.pic) img{display:none}
.menu-pet:not(.pic)::before{content:attr(aria-label)}
/* short desktop windows: both cats sit at the smaller size and the machine rides a little lower, so her ears stay on the page */
@media(min-width:901px) and (max-height:779px){.cabinet{--cat-px:2}.machine{margin-top:34px;margin-bottom:6px}}
/* short phones: while she is out the machine keeps at least 56 px above it (her 96 px sitting height less the 40 px of
   nameplate above the cabinet), so her ears stay on the page; with no cat out it is centred exactly as before */
@media(max-width:640px) and (min-height:560px) and (max-height:639px){
  body:has(.cat-perch.lily,.cat-walk.lily){height:100svh;grid-template-rows:minmax(56px,1fr) auto 1fr}
  body:has(.cat-perch.lily,.cat-walk.lily) .machine{grid-row:2}
}
