/* Brand emblems (artwork: templates/_logo_sprites.html).
   Every moving layer is its own element and only `transform` / `opacity` animate, so the
   browser composites them on the GPU without repainting the artwork — smooth on weak devices.
   Small instances stay still unless `.is-live` is set (e.g. while the AI is answering). */
.bbl,.wl{position:relative;display:inline-block;flex:none;width:var(--logo,48px);height:var(--logo,48px);contain:layout;isolation:isolate}
.bbl-float,.wl-float{position:absolute;inset:0}
.bbl-l,.wl-l{position:absolute;inset:0;width:100%;height:100%;display:block}

/* ---------- BldBox AI emblem ---------- */
.bbl-lg{--logo:150px}
.bbl-sm{--logo:30px}
.bbl-lg .bbl-float{animation:bblFloat 2.6s ease-in-out infinite}
.bbl-lg .bbl-ring,.bbl-lg .bbl-halo,.bbl.is-live .bbl-ring{animation:bblSpin 5.8s linear infinite;will-change:transform}
.bbl-lg .bbl-halo{opacity:.22;animation:bblSpin 5.8s linear infinite,bblPulse 2.6s ease-in-out infinite}
.bbl.is-live .bbl-ring{animation-duration:1.6s}
@keyframes bblSpin{to{transform:rotate(360deg)}}
@keyframes bblFloat{0%,100%{transform:translateY(-1.3%)}50%{transform:translateY(1.3%)}}
@keyframes bblPulse{0%,100%{opacity:.12}50%{opacity:.34}}

/* ---------- World Builder / BldBox Code emblem ---------- */
.wl-lg{--logo:220px}
.wl-sm{--logo:30px}
.wl-lg::before{content:"";position:absolute;inset:-8%;border-radius:50%;background:radial-gradient(circle,rgba(0,119,255,.16),rgba(112,0,255,.08) 48%,transparent 70%);pointer-events:none}
.wl-lg .wl-float{animation:wlFloat 3.8s ease-in-out infinite}
.wl-lg .wl-ring,.wl.is-live .wl-ring{animation:bblSpin 9s linear infinite;will-change:transform}
.wl-sm .wl-ring{animation:bblSpin 24s linear infinite}
.wl-lg .wl-orbit-a{animation:bblSpin 52s linear infinite;will-change:transform}
.wl-lg .wl-orbit-b{animation:bblSpin 42s linear infinite reverse;will-change:transform}
.wl-lg .wl-sparks{animation:bblSpin 70s linear infinite,wlTwinkle 3.2s ease-in-out infinite;will-change:transform,opacity}
.wl-lg .wl-glints{animation:bblSpin 12.6s linear infinite,wlTwinkle 1.6s ease-in-out infinite;will-change:transform,opacity}
.wl-lg .wl-cubes{animation:wlBob 4.4s ease-in-out infinite}
@keyframes wlFloat{0%,100%{transform:translateY(-.7%) scale(.988)}50%{transform:translateY(.7%) scale(1.012)}}
@keyframes wlTwinkle{0%,100%{opacity:.45}50%{opacity:1}}
@keyframes wlBob{0%,100%{transform:translateY(-.6%)}50%{transform:translateY(.6%)}}

@media (prefers-reduced-motion:reduce){
  .bbl *,.wl *{animation:none!important}
}

/* in context */
.logo-who .bbl{--logo:100%;width:100%;height:100%}
.who.logo-who:has(.bbl){background:transparent!important;border:0!important;box-shadow:none!important;overflow:visible}
.msg.streaming .logo-who .bbl-ring{animation:bblSpin 1.6s linear infinite;will-change:transform}
.cm-hero-logo:has(.bbl){width:auto;height:auto;overflow:visible;border-radius:0}
.cm-hero-logo .bbl-lg{--logo:clamp(110px,18vh,150px)}
.sh-who .bbl{--logo:24px}
.cx-badge:has(.wl){background:transparent!important;box-shadow:none!important;width:30px;height:30px}
.cx-emblem{display:flex;justify-content:center;margin-bottom:6px}
.cx-emblem .wl-lg{--logo:clamp(120px,20vh,170px)}
/* the cube stays fixed: neutralise the old "spin the whole avatar" rules */
.msg .logo-who:has(.bbl),.msg.streaming .logo-who:has(.bbl){animation:none!important;box-shadow:none!important}
.logo-who .bbl,.logo-who .bbl-float,.msg.streaming .logo-who .bbl,.msg.streaming .logo-who .bbl-float{animation:none!important}
