/* Pose transforms live below the camera, so rotation and articulation compose. */
.motion-body,.motion-anchor,.body-segment{position:absolute;transform-style:preserve-3d;pointer-events:none}
.motion-body,.motion-anchor{inset:0;width:100%;height:100%}
.motion-body{transform-origin:50% 100%}
.motion-anchor,.body-segment{transition:none}
.body-segment{left:0;top:0;width:var(--segment-w);height:var(--segment-h);transform-origin:0 0}
.motion-body[data-axis="y"]>.body-segment{top:calc(var(--segment-index)*var(--unit))}
.motion-body[data-axis="x"]>.body-segment{left:calc(var(--segment-index)*var(--unit))}
.body-segment>.face.front,.body-segment>.face.back{width:var(--segment-w);height:var(--segment-h)}
.body-segment>.face.left,.body-segment>.face.right{width:var(--depth);height:var(--segment-h);left:calc((var(--segment-w) - var(--depth))/2)}
.body-segment>.face.left{transform:rotateY(-90deg) translateZ(calc(var(--segment-w)/2))}
.body-segment>.face.right{transform:rotateY(90deg) translateZ(calc(var(--segment-w)/2))}
.body-segment>.face.top,.body-segment>.face.bottom{width:var(--segment-w);height:var(--depth);top:calc((var(--segment-h) - var(--depth))/2)}
.body-segment>.face.top{transform:rotateX(90deg) translateZ(calc(var(--segment-h)/2))}
.body-segment>.face.bottom{transform:rotateX(-90deg) translateZ(calc(var(--segment-h)/2))}
.motion-body .arm,.motion-body .forearm,.motion-body .foot,.motion-body .shin{--limb-width:clamp(2px,calc(var(--face-size)*.055),10px);position:absolute;border:0;border-radius:999px;background:var(--limb);transform-style:preserve-3d;transition:none;backface-visibility:visible;box-shadow:inset 0 -1px 1px #00000018}
.motion-body .arm:is(.left,.right),.motion-body .foot:is(.left,.right){animation:none}
.motion-body .arm{top:51%;width:calc(var(--face-size)*.23);height:var(--limb-width);transform-origin:0 50%}
.motion-body .arm.left{left:0;right:auto}
.motion-body .arm.right{left:auto;right:calc(var(--face-size)*-.23)}
.motion-body .arm.extra-arm.upper{top:15%}
.motion-body .arm.extra-arm.lower{top:77%}
.motion-body .arm:after,.motion-body .foot:after{display:none}
.motion-body .forearm{left:100%;top:0;width:calc(var(--face-size)*.20);height:100%;transform-origin:0 50%}
.motion-body .hand{position:absolute;left:calc(100% - var(--face-size)*.035);top:50%;margin-top:calc(var(--face-size)*-.053);width:calc(var(--face-size)*.106);height:calc(var(--face-size)*.106);border-radius:45%;background:var(--limb);box-shadow:inset 0 -1px 1px #00000018}
.motion-body .foot{top:100%;bottom:auto;width:var(--limb-width);height:calc(var(--face-size)*.10);margin-left:calc(var(--limb-width)/-2);transform-origin:50% 0}
.motion-body .foot.left{left:22%;right:auto}
.motion-body .foot.right{left:78%;right:auto}
.motion-body .shin{left:0;top:100%;width:100%;height:calc(var(--face-size)*.10);transform-origin:50% 0}
.motion-body .shoe{position:absolute;left:-35%;bottom:calc(var(--face-size)*-.02);width:calc(var(--face-size)*.14);height:calc(var(--face-size)*.07);border-radius:55% 55% 35% 35%;background:var(--limb);box-shadow:inset 0 -1px 1px #00000018}
[data-character="two"] .motion-body .shoe{background:#fff1cb;border-bottom:2px solid #d78e2a}
.creature-button.is-idle:not(.dragging):not(.has-unit-blocks) .creature:has(>.motion-body),.creature-button.greeting .creature:has(>.motion-body){animation:none}
.creature-button.is-idle:not([data-action]):not(.dragging):not(.has-unit-blocks) .motion-body{animation:rig-breathe 3.6s ease-in-out infinite}
@keyframes rig-breathe{0%,100%{scale:1 1}50%{scale:1.008 .988}}
/* ponytail: system speech has no waveform; use one gentle beat without phoneme alignment. */
.creature-button.is-speaking:not(.has-unit-blocks) .expression:not(.expression-previous) .mouth{transform-origin:50% 35%;overflow:hidden;animation:rig-talk .56s ease-in-out infinite}
.creature-button.is-speaking.has-voice-envelope:not(.has-unit-blocks) .expression:not(.expression-previous) .mouth{animation:none;scale:1 var(--talk-open,.16)}
@keyframes rig-talk{0%,100%{scale:1 .2}40%,55%{scale:.96 .8}}
@media(prefers-reduced-motion:reduce){.motion-body{animation:none!important}.creature-button.is-speaking .mouth{scale:none!important}}
