/* Hachi mascot motion. Pair with hachi-mascot.js. Respects prefers-reduced-motion. */
/* ---------- Mascot ---------- */
.hm { display: block; overflow: visible; }
.hm .hm-all, .hm .hm-eyes { transform-box: view-box; }
.hm .hm-all { transform-origin: 500px 970px; }
.hm .hm-eyes { transform-origin: 500px 640px; }
.hm .hm-ear-l, .hm .hm-ear-r { transform-box: fill-box; transform-origin: 50% 100%; }

/* idle: breathe + blink */
.hm--idle .hm-all { animation: hm-breathe 4s ease-in-out infinite; }
.hm--idle .hm-eyes, .hm--listening .hm-eyes, .hm--needs-you .hm-eyes, .hm--working .hm-eyes { animation: hm-blink 5.2s ease-in-out infinite; }
/* listening: ears up, a curious lean */
.hm--listening .hm-all { animation: hm-lean 2.8s ease-in-out infinite; }
/* thinking: one ear folds (Hachiko), head already tilted, slow sway */
.hm--thinking .hm-all { animation: hm-breathe 3s ease-in-out infinite; }
/* working: ears flick in turn, gentle bob */
.hm--working .hm-ear-l { animation: hm-flick 1.8s ease-in-out infinite; }
.hm--working .hm-ear-r { animation: hm-flick 1.8s ease-in-out .9s infinite; }
.hm--working .hm-all { animation: hm-bob 1.2s ease-in-out infinite; }
/* needs you: perked, a small double hop every few seconds */
.hm--needs-you .hm-all { animation: hm-hop 2.6s cubic-bezier(.34,1.4,.64,1) infinite; }
/* stuck: ears folded down, slow sway */
.hm--stuck .hm-all { animation: hm-sway 3.6s ease-in-out infinite; }
/* done: one happy hop, then still */
.hm--done .hm-all { animation: hm-hop-once .7s cubic-bezier(.34,1.4,.64,1) 1; }
/* asleep: ears folded, slow breath */
.hm--asleep .hm-all { animation: hm-breathe 6s ease-in-out infinite; }

@keyframes hm-breathe { 0%,100% { transform: scale(1,1); } 50% { transform: scale(1.02,.985); } }
@keyframes hm-blink { 0%,93%,100% { transform: scaleY(1); } 96% { transform: scaleY(.08); } }
@keyframes hm-lean { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-2.5deg); } }
@keyframes hm-flick { 0%,70%,100% { transform: rotate(0); } 80% { transform: rotate(-9deg); } 90% { transform: rotate(3deg); } }
@keyframes hm-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes hm-hop { 0%,62%,100% { transform: translateY(0); } 70% { transform: translateY(-60px); } 78% { transform: translateY(0); } 85% { transform: translateY(-26px); } 92% { transform: translateY(0); } }
@keyframes hm-hop-once { 0%,100% { transform: translateY(0) scale(1); } 15% { transform: translateY(0) scale(1.04,.94); } 50% { transform: translateY(-70px) scale(.98,1.03); } }
@keyframes hm-sway { 0%,100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }

@media (prefers-reduced-motion: reduce) {
  .hm *, .hy-status__dot { animation: none !important; transition: none !important; }
}

