/* ================================================================
   Bobby Kertanegara — mascot behaviour
   ================================================================
   The mark itself is in templates/fragments/bobby.html. This file
   only carries motion and per-pose adjustments.

   Every animation is inside @media (prefers-reduced-motion:
   no-preference). A user who has asked their OS to stop moving things
   gets the static pose, which is why each pose has to read correctly
   with no animation at all.
   ================================================================ */

.bobby {
    display: block;
    flex-shrink: 0;
}

/* The tail pivots from where it meets the body, not from the canvas
   corner, so a flick reads as a tail rather than a rotation. */
.bobby-tail {
    transform-origin: 46px 52px;
}

/* ---- thinking: a slow tail flick while the model is generating ---- */
@media (prefers-reduced-motion: no-preference) {
    .bobby--thinking .bobby-tail {
        animation: bobby-tail-flick 1.6s ease-in-out infinite;
    }

    .bobby--sitting .bobby-eyes {
        animation: bobby-blink 6s infinite;
    }
}

@keyframes bobby-tail-flick {
    0%, 100% { transform: rotate(0deg); }
    50%      { transform: rotate(-16deg); }
}

@keyframes bobby-blink {
    0%, 92%, 100% { transform: scaleY(1); }
    95%           { transform: scaleY(0.1); }
}

.bobby-eyes {
    transform-origin: 32px 20px;
}

/* ---- alert: used on the error state, deliberately motionless ---- */
.bobby--alert .bobby-tail {
    transform: rotate(-28deg);
}
