/* Alma sleeps and wakes (2026-12-02, Josh: "sleeping Sabujo ... the same could apply to Alma"). Two places, both optional:
   1. the avatar in the top bar dozes off (eyes closed, ears drooped, zzz) after about two minutes without mouse or keyboard and wakes with a hop on the next move;
   2. every hub tile (home, Settings areas, Safenet areas) carries a small sleeping Alma that wakes while you point at the tile or press it.
   mascot-wake.js adds the pieces; every movement stops for people who asked their system for reduced motion. */

.mc-av[data-state='sleep'] .mc-eye { display: none; }
.mc-av[data-state='sleep'] .mc-eye-happy { display: inline; transform-box: fill-box; transform-origin: center; transform: scaleY(-1); }
.mc-av[data-state='sleep'] .mc-ear-l { animation: none; transform-box: fill-box; transform-origin: 70% 10%; transform: rotate(-8deg); }
.mc-av[data-state='sleep'] .mc-ear-r { animation: none; transform-box: fill-box; transform-origin: 30% 10%; transform: rotate(8deg); }
.mc-av[data-state='sleep'] .mc-tongue, .mc-av[data-state='sleep'] .mc-heart, .mc-av[data-state='sleep'] .mc-dots { display: none; }
.mc-av[data-state='sleep'] { filter: saturate(.6) brightness(.95); }
.mw-z { display: none; }
.mc-av[data-state='sleep'] .mw-z { display: inline; }
.mw-z text { font: 800 15px system-ui, sans-serif; fill: #fff; stroke: rgba(0,0,0,.5); stroke-width: .8px; paint-order: stroke; opacity: 1; }

/* the small Alma on a hub tile */
.mw-pet { position: absolute; left: 8px; top: 8px; width: 38px; height: 38px; z-index: 2; pointer-events: none; line-height: 0; }
.mw-pet .mc-av { width: 100%; height: 100%; display: block; overflow: visible; }

@keyframes mwSnore { 0% { opacity: 0; transform: translate(0, 6px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -12px); } }
@keyframes mwBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }
@media (prefers-reduced-motion: no-preference) {
  .mc-av[data-state='sleep'] .mw-z text { opacity: 0; animation: mwSnore 3s ease-in-out infinite; }
  .mc-av[data-state='sleep'] .mw-z text:nth-child(2) { animation-delay: 1s; }
  .mc-av[data-state='sleep'] .mw-z text:nth-child(3) { animation-delay: 2s; }
  .mc-av[data-state='sleep'] .mc-body { transform-box: fill-box; transform-origin: 50% 100%; animation: mwBreathe 3.4s ease-in-out infinite; }
}

/* the small Alma in the header of a card (home and desk pages): in the flow, at the right end of the header row */
.mw-pet.mw-pet-h { position: static; left: auto; top: auto; margin-left: auto; width: 30px; height: 30px; flex: none; }

/* the one Alma of a page: inline, right after the page title (never inside a card or tile) */
.mw-pet.mw-pet-t { user-select: none; position: static; display: inline-block; vertical-align: middle; width: 34px; height: 34px; margin: -6px 0 -6px 12px; left: auto; top: auto; }
