/* ═══════════ e'thix AI — Buddy ═══════════
   He lives on <body> as a fixed element so he can be dragged anywhere. All of
   his motion comes from JS (SVG attributes); CSS only handles the pick-up feel,
   the glow and the entrance. */

.buddy{
  position:fixed;left:0;top:0;z-index:60;
  width:64px;height:115px;
  cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;
  -webkit-tap-highlight-color:transparent;
  will-change:transform;
  animation:bd-in .8s var(--ios) both;
}
.buddy .bd-svg{
  width:100%;height:100%;display:block;overflow:visible;pointer-events:none;
  filter:drop-shadow(0 8px 14px color-mix(in srgb,#141922 22%,transparent));
  transition:filter .35s var(--ease),translate .45s var(--spring);
}

/* a soft light behind him, tinted by mood */
.buddy::before{
  content:"";position:absolute;inset:8% -34% 14%;border-radius:50%;z-index:-1;pointer-events:none;
  background:radial-gradient(closest-side,color-mix(in srgb,var(--accent-b) 30%,transparent),transparent 72%);
  opacity:.35;transition:opacity .5s var(--ease),background .6s var(--ease),scale .5s var(--spring);
}
/* hover: no swelling. The light wakes up and he waves (see buddy.js). */
@media (hover:hover){
  .buddy:hover::before{opacity:.85;scale:1.08}
}
.buddy[data-mood="working"]::before,.buddy[data-mood="thinking"]::before{opacity:.65}
.buddy[data-mood="sleepy"]::before{opacity:.15}
.buddy[data-mood="error"]::before{background:radial-gradient(closest-side,color-mix(in srgb,#C24A3C 36%,transparent),transparent 72%);opacity:.8}

/* picked up: lifts off the surface with a deeper shadow */
.buddy.lifted .bd-svg{translate:0 -6px;filter:drop-shadow(0 18px 18px color-mix(in srgb,#141922 30%,transparent))}
.buddy.dragging{cursor:grabbing}
.buddy.dragging::before{opacity:.9}

@keyframes bd-in{
  0%{opacity:0;scale:.8}
  100%{opacity:1;scale:1}
}
html.reduce-motion .buddy{animation:none}

/* N20: content under him → he steps away (buddy.js coversAt); never covering text or a control */
.buddy{transition:opacity .25s var(--ease)}
.buddy.bd-tucked{opacity:0;pointer-events:none}
.buddy.bd-tucked .bd-svg{translate:0 14px}
