/* ──────────────────────────────────────────────────────────────────
 * chat-bee.css — fixed floating helper bee with speech bubble
 * Companion to /assets/chat-bee.js
 * ────────────────────────────────────────────────────────────────── */

.chat-bee{
  position:fixed;
  right:24px;
  bottom:24px;
  width:64px;
  height:64px;
  z-index:9999;
  cursor:pointer;
  transition:transform .25s cubic-bezier(.2,.7,.2,1.05);
  filter:drop-shadow(0 8px 22px rgba(0,0,0,.5));
}
.chat-bee:hover,
.chat-bee:focus-visible{
  transform:translateY(-3px) scale(1.06);
  outline:none;
}
.chat-bee:focus-visible{
  outline:2px solid #FFB800;
  outline-offset:6px;
  border-radius:50%;
}

.chat-bee__img{
  width:100%;
  height:100%;
  display:block;
  object-fit:contain;
  pointer-events:none;
  animation:chat-bee-flutter 4.2s ease-in-out infinite;
}

@keyframes chat-bee-flutter{
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(-4px)}
}

/* gold pulse ring around the bee — signals it's interactive */
.chat-bee__pulse{
  position:absolute;
  inset:6px;
  border-radius:50%;
  border:2px solid #FFB800;
  opacity:0;
  animation:chat-bee-pulse 3s ease-out infinite;
  pointer-events:none;
}
@keyframes chat-bee-pulse{
  0%{transform:scale(.85);opacity:0}
  20%{opacity:.9}
  100%{transform:scale(1.55);opacity:0}
}

/* ping animation when context changes */
.chat-bee--ping .chat-bee__img{
  animation:chat-bee-ping .9s ease-out;
}
@keyframes chat-bee-ping{
  0%{transform:scale(1)}
  30%{transform:scale(1.18) rotate(-8deg)}
  60%{transform:scale(1.06) rotate(4deg)}
  100%{transform:scale(1) rotate(0)}
}

/* ── Speech bubble ── */
.chat-bee__bubble{
  position:absolute;
  bottom:calc(100% + 14px);
  right:0;
  width:320px;
  max-width:calc(100vw - 48px);
  background:rgba(20,18,12,.96);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  border:1px solid rgba(255,184,0,.45);
  border-radius:14px;
  padding:0;
  opacity:0;
  visibility:hidden;
  transform:translateY(8px) scale(.96);
  transform-origin:bottom right;
  transition:opacity .2s, transform .25s cubic-bezier(.2,.7,.2,1.05), visibility .2s;
  box-shadow:0 24px 60px -16px rgba(0,0,0,.7), 0 0 0 1px rgba(255,184,0,.12);
}
.chat-bee.is-open .chat-bee__bubble{
  opacity:1;
  visibility:visible;
  transform:translateY(0) scale(1);
}

/* speech-bubble tail pointing at the bee */
.chat-bee__bubble::after{
  content:'';
  position:absolute;
  right:18px;
  bottom:-7px;
  width:14px;
  height:14px;
  background:rgba(20,18,12,.96);
  border-right:1px solid rgba(255,184,0,.45);
  border-bottom:1px solid rgba(255,184,0,.45);
  transform:rotate(45deg);
}

.chat-bee__bubble-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px 6px;
  border-bottom:1px solid rgba(255,184,0,.18);
}
.chat-bee__bubble-title{
  font-family:var(--mono, ui-monospace, monospace);
  font-size:10px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:#FFB800;
  font-weight:700;
}
.chat-bee__close{
  background:transparent;
  border:none;
  color:#F2E9D8;
  font-size:18px;
  line-height:1;
  cursor:pointer;
  padding:2px 6px;
  border-radius:6px;
  opacity:.7;
  transition:opacity .15s, background .15s;
}
.chat-bee__close:hover{
  opacity:1;
  background:rgba(255,184,0,.12);
}

.chat-bee__bubble-body{
  padding:12px 14px 14px;
}
.chat-bee__h{
  margin:0 0 6px;
  font-size:14.5px;
  line-height:1.3;
  font-weight:700;
  color:#F2E9D8;
  letter-spacing:-.005em;
}
.chat-bee__p{
  margin:0;
  font-size:13px;
  line-height:1.48;
  color:rgba(242,233,216,.85);
}
.chat-bee__where{
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid rgba(255,184,0,.14);
  font-family:var(--mono, ui-monospace, monospace);
  font-size:9.5px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:rgba(255,184,0,.6);
  font-weight:600;
}

/* Mobile: anchor bubble to bottom-center, full-width */
@media(max-width:540px){
  .chat-bee{
    right:16px;
    bottom:16px;
    width:56px;
    height:56px;
  }
  .chat-bee__bubble{
    width:min(320px, calc(100vw - 32px));
    right:0;
  }
}

/* Reduced motion */
@media(prefers-reduced-motion:reduce){
  .chat-bee__img,
  .chat-bee__pulse,
  .chat-bee--ping .chat-bee__img{
    animation:none;
  }
  .chat-bee__bubble{
    transition:opacity .2s, visibility .2s;
    transform:none;
  }
  .chat-bee.is-open .chat-bee__bubble{
    transform:none;
  }
}
