/* =============================================
   Bon's Portfolio Chatbot — chatbot.css
   Matches your existing portfolio design system
   + Interactive Cat Mascot System additions
   ============================================= */

#bon-chat-widget {
  position: fixed;
  bottom: 3.5rem;
  right: 1.5rem;
  z-index: 9999;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

/* ── Toggle bubble ── */
#bon-chat-toggle::before {
  content: "💬 Chat with me!";
  position: absolute;
  bottom: 68px;
  right: 0;
  background: #5eead4;
  color: #0d1117;
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
  white-space: nowrap;
  animation: hint-bounce 2s infinite ease-in-out;
  pointer-events: none;
}

#bon-chat-toggle::after {
  content: "";
  position: absolute;
  bottom: 60px;
  right: 18px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #5eead4;
  pointer-events: none;
}

@keyframes hint-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-4px); }
}

#bon-chat-widget.open #bon-chat-toggle::before,
#bon-chat-widget.open #bon-chat-toggle::after {
  display: none;
}

#bon-chat-toggle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid #5eead4;
  background: #131a22;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 4px 20px rgba(94, 234, 212, 0.25);
  transition: box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
  perspective: 600px;
  transform-style: preserve-3d;
  animation: bon-idle-float 4.5s ease-in-out infinite;
}

#bon-chat-toggle:hover,
#bon-chat-toggle.bon-hover {
  box-shadow: 0 6px 28px rgba(94, 234, 212, 0.4);
}

@keyframes bon-idle-float {
  0%, 100% { transform: translateY(0) rotateX(0deg) rotateY(0deg); }
  50%       { transform: translateY(-5px) rotateX(4deg) rotateY(-4deg); }
}

#bon-chat-widget.open #bon-chat-toggle {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  #bon-chat-toggle { animation: none; }
}

#bon-chat-toggle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

#bon-notif-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #5eead4;
  border: 2px solid #0d1117;
  animation: notif-pulse 2.4s infinite;
  display: block;
}

@keyframes notif-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(94, 234, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0); }
}

/* ── Chat window ── */
#bon-chat-window {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 360px;
  max-height: 520px;
  background: #131a22;
  border: 1px solid #26313c;
  border-radius: 8px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

#bon-chat-widget.open #bon-chat-window {
  display: flex;
}

/* ── Header ── */
#bon-chat-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #26313c;
  background: #0d1117;
  flex-shrink: 0;
}

#bon-chat-header .avatar-wrap {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #5eead4;
  overflow: hidden;
  flex-shrink: 0;
}

#bon-chat-header .avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#bon-chat-header .info {
  flex: 1;
  min-width: 0;
}

#bon-chat-header .info strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #dde3ea;
  line-height: 1.2;
}

#bon-chat-header .info span {
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: #5eead4;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5eead4;
  flex-shrink: 0;
}

#bon-chat-close {
  background: transparent;
  border: 1px solid #26313c;
  color: #7d8b99;
  width: 28px;
  height: 28px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}

#bon-chat-close:hover {
  border-color: #5eead4;
  color: #5eead4;
}

/* ── Messages ── */
#bon-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  scrollbar-width: thin;
  scrollbar-color: #26313c transparent;
}

#bon-chat-messages::-webkit-scrollbar {
  width: 4px;
}

#bon-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

#bon-chat-messages::-webkit-scrollbar-thumb {
  background: #26313c;
  border-radius: 2px;
}

.bc-msg {
  max-width: 85%;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  font-size: 0.875rem;
  line-height: 1.55;
  word-wrap: break-word;
}

.bc-msg.bot {
  background: #0d1117;
  border: 1px solid #26313c;
  color: #dde3ea;
  align-self: flex-start;
  border-radius: 2px 6px 6px 6px;
}

.bc-msg.user {
  background: #2b5c54;
  border: 1px solid #5eead4;
  color: #dde3ea;
  align-self: flex-end;
  border-radius: 6px 2px 6px 6px;
}

/* ── Typing indicator ── */
.bc-typing {
  align-self: flex-start;
  background: #0d1117;
  border: 1px solid #26313c;
  border-radius: 2px 6px 6px 6px;
  padding: 0.65rem 0.9rem;
  display: flex;
  gap: 5px;
  align-items: center;
}

.bc-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5eead4;
  animation: bc-bounce 1.2s infinite ease-in-out;
}

.bc-typing span:nth-child(2) { animation-delay: 0.2s; }
.bc-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bc-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* ── Quick replies ── */
#bon-quick-replies {
  padding: 0 0.8rem 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex-shrink: 0;
}

.bc-quick {
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  background: transparent;
  border: 1px solid #26313c;
  color: #7d8b99;
  padding: 0.3rem 0.65rem;
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.bc-quick:hover {
  border-color: #5eead4;
  color: #5eead4;
}

/* ── Input row ── */
#bon-chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid #26313c;
  background: #0d1117;
  flex-shrink: 0;
}

/* ── FIX: textarea instead of input for wrapping text ── */
#bon-chat-input {
  flex: 1;
  background: #131a22;
  border: 1px solid #26313c;
  border-radius: 4px;
  color: #dde3ea;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; /* 16px prevents iOS auto-zoom */
  padding: 0.55rem 0.8rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 0;
  resize: none;          /* no manual resize handle */
  overflow-y: auto;
  min-height: 38px;
  max-height: 100px;     /* grows up to ~4 lines then scrolls */
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

#bon-chat-input::placeholder {
  color: #7d8b99;
}

#bon-chat-input:focus {
  border-color: #5eead4;
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.12);
}

#bon-chat-send {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: #5eead4;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, transform 0.15s;
  align-self: flex-end; /* stays at bottom when input grows */
}

#bon-chat-send:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

#bon-chat-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

#bon-chat-send svg {
  width: 16px;
  height: 16px;
  fill: #0d1117;
}

/* ═══════════════════════════════════════════
   CAT MASCOT SYSTEM — NEW STYLES
   ═══════════════════════════════════════════ */

/* ── Idle bob/breathing loop ── */
@keyframes bon-bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-3px); }
}

#bon-chat-toggle.bon-idle {
  animation: bon-bob 3.2s ease-in-out infinite;
}

/* pause idle bob while hovered/open so it doesn't fight the hover lift */
#bon-chat-toggle.bon-idle:hover,
#bon-chat-widget.open #bon-chat-toggle.bon-idle {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  #bon-chat-toggle.bon-idle { animation: none; }
}

/* ── Hover perk-up (tilt) ── */
#bon-chat-toggle.bon-hover {
  transform: translateY(-3px) rotate(-4deg);
}

/* ── Tap reaction (paw taps the avatar) ── */
@keyframes bon-tap-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.6); }
  100% { box-shadow: 0 0 0 14px rgba(94, 234, 212, 0); }
}

#bon-chat-toggle.bon-tapped {
  animation: bon-tap-pulse 0.5s ease-out;
}

/* ── Reaction bounce ("oh, my turn!") ── */
@keyframes bon-bounce-react {
  0%   { transform: scale(1) translateY(0); }
  30%  { transform: scale(1.12) translateY(-10px); }
  55%  { transform: scale(0.96) translateY(2px); }
  75%  { transform: scale(1.04) translateY(-3px); }
  100% { transform: scale(1) translateY(0); }
}

#bon-chat-toggle.bon-bounce {
  animation: bon-bounce-react 0.6s ease-out;
}

/* ── Settle-in (end of homepage intro, Salt takes position) ── */
@keyframes bon-settle {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

#bon-chat-toggle.bon-settle-in {
  animation: bon-settle 0.6s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  #bon-chat-toggle.bon-tapped,
  #bon-chat-toggle.bon-bounce,
  #bon-chat-toggle.bon-settle-in {
    animation: none;
  }
}

/* ── Light-switch gag: cat sprints to #theme-toggle and flips it ── */
#bon-light-runner {
  position: fixed;
  z-index: 10001;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid #5eead4;
  background: #131a22;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 4px 20px rgba(94, 234, 212, 0.35);
}

#bon-light-runner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#bon-light-runner.running {
  opacity: 1;
  transition: left 0.58s cubic-bezier(.4,0,.2,1), top 0.58s cubic-bezier(.4,0,.2,1);
}

#bon-light-runner.run-anim {
  animation: bon-run-bob 0.22s ease-in-out infinite, bon-run-squash 0.22s ease-in-out infinite;
}

@keyframes bon-run-bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%       { transform: translateY(-6px) rotate(4deg); }
}

@keyframes bon-run-squash {
  0%, 100% { transform: scaleX(1) scaleY(1); }
  50%       { transform: scaleX(0.92) scaleY(1.08); }
}

#bon-chat-toggle.bon-hidden-runner {
  opacity: 0;
  pointer-events: none;
  transition: none;
}

#bon-switch-paw {
  position: fixed;
  z-index: 10002;
  font-size: 1.4rem;
  pointer-events: none;
  opacity: 0;
  transform-origin: top center;
}

#bon-switch-paw.flip {
  animation: bon-switch-flip 0.42s ease-out;
}

@keyframes bon-switch-flip {
  0%   { opacity: 0; transform: rotate(-40deg) translateY(-10px); }
  40%  { opacity: 1; transform: rotate(18deg) translateY(0); }
  70%  { transform: rotate(-8deg); }
  100% { opacity: 0; transform: rotate(0deg); }
}

@keyframes bon-light-flicker {
  0%   { opacity: 0; }
  10%  { opacity: 0.55; }
  20%  { opacity: 0; }
  32%  { opacity: 0.32; }
  45%  { opacity: 0; }
  100% { opacity: 0; }
}

body.bon-flicker::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10003;
  background: #000;
  pointer-events: none;
  opacity: 0;
  animation: bon-light-flicker 0.55s steps(1, end);
}

@media (prefers-reduced-motion: reduce) {
  #bon-light-runner,
  #bon-switch-paw {
    display: none !important;
  }
  body.bon-flicker::after {
    animation: none !important;
    display: none !important;
  }
}

/* ── "On duty: [Cat Name]" tag label ── */
#bon-cat-tag {
  position: absolute;
  bottom: 68px;
  right: 0;
  background: #131a22;
  border: 1px solid #5eead4;
  color: #5eead4;
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.65rem;
  border-radius: 14px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

#bon-cat-tag.show {
  opacity: 1;
  transform: translateY(0);
}

/* hide the tag once the "chat with me" hint bubble would show, and once chat is open */
#bon-chat-widget.open #bon-cat-tag {
  opacity: 0;
  pointer-events: none;
}

/* if the toggle's own ::before hint bubble is present, keep the tag from overlapping —
   nudge the tag up a bit higher so both can coexist briefly */
#bon-cat-tag.show ~ #bon-chat-toggle::before {
  bottom: 104px;
}

/* ── Achievement: paw-print progress badge ──
   Sits below the toggle. The widget's own `bottom` offset was
   increased to 3.5rem (mobile: 3rem) specifically so this badge has
   real clearance from the actual screen edge at these negative
   offsets, instead of clipping or overlapping the toggle. */
#bon-paw-progress {
  position: absolute;
  bottom: -34px; /* sits below the toggle; safe now that the widget itself has 3.5rem of clearance from the screen edge */
  right: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  background: #131a22;
  border: 1px solid #26313c;
  border-radius: 20px;
  padding: 0.28rem 0.6rem;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

#bon-paw-progress.show {
  opacity: 1;
  transform: translateY(0);
}

#bon-paw-progress.complete {
  border-color: #5eead4;
}

.bon-paw-dot {
  font-size: 0.95rem;
  filter: grayscale(1) opacity(0.3);
  transition: filter 0.3s ease, transform 0.3s ease;
  line-height: 1;
}

.bon-paw-dot.met {
  filter: grayscale(0) opacity(1) drop-shadow(0 0 3px rgba(94, 234, 212, 0.7));
  transform: scale(1.1);
}

.bon-paw-count {
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: #7d8b99;
}

#bon-paw-progress.complete .bon-paw-count {
  color: #5eead4;
}

#bon-chat-widget.open #bon-paw-progress {
  opacity: 0;
  pointer-events: none;
}

body.dark-mode #bon-paw-progress {
  background: #f5f2ea;
  border-color: #d6cfbf;
}
body.dark-mode #bon-paw-progress.complete { border-color: #0f8f7e; }
body.dark-mode .bon-paw-count { color: #6b7682; }
body.dark-mode #bon-paw-progress.complete .bon-paw-count { color: #0f8f7e; }
body.dark-mode .bon-paw-dot.met {
  filter: grayscale(0) opacity(1) drop-shadow(0 0 3px rgba(15, 143, 126, 0.7));
}

@media (max-width: 480px) {
  #bon-paw-progress {
    bottom: -28px;
    right: 0;
    padding: 0.22rem 0.5rem;
    gap: 4px;
  }
  .bon-paw-dot { font-size: 0.82rem; }
  .bon-paw-count { font-size: 0.62rem; }
}

/* ── Lead-captured celebration (biggest moment on the site) ── */
#bon-lead-celebration {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#bon-lead-celebration.show {
  opacity: 1;
}

#bon-lead-celebration.fade-out {
  opacity: 0;
}

.bon-lead-card {
  background: #131a22;
  border: 1.5px solid #5eead4;
  border-radius: 12px;
  padding: 1.7rem 2.1rem;
  text-align: center;
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.55), 0 0 0 6px rgba(94, 234, 212, 0.08);
  transform: scale(0.82);
  transition: transform 0.55s cubic-bezier(.2,1.4,.4,1);
}

#bon-lead-celebration.show .bon-lead-card {
  transform: scale(1);
}

.bon-lead-paws {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
  letter-spacing: 0.18em;
}

.bon-lead-card strong {
  display: block;
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  font-size: 1.15rem;
  color: #5eead4;
  letter-spacing: 0.02em;
}

.bon-lead-card span {
  display: block;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.92rem;
  color: #dde3ea;
  margin-top: 0.35rem;
}

.bon-confetti-paw--lead {
  font-weight: bold;
}

body.dark-mode .bon-lead-card {
  background: #f5f2ea;
  border-color: #0f8f7e;
}
body.dark-mode .bon-lead-card strong { color: #0f8f7e; }
body.dark-mode .bon-lead-card span   { color: #1b232c; }

@media (prefers-reduced-motion: reduce) {
  #bon-lead-celebration,
  #bon-lead-celebration.show,
  .bon-lead-card {
    animation: none;
    transition: none;
  }
}

@media (max-width: 480px) {
  .bon-lead-card {
    padding: 1.3rem 1.5rem;
  }
  .bon-lead-card strong { font-size: 1rem; }
  .bon-lead-card span   { font-size: 0.8rem; }
}

/* ── Crew celebration overlay ── */
#bon-crew-celebration {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#bon-crew-celebration.show {
  opacity: 1;
}

#bon-crew-celebration.fade-out {
  opacity: 0;
}

.bon-crew-card {
  background: #131a22;
  border: 1px solid #5eead4;
  border-radius: 10px;
  padding: 1.4rem 1.8rem;
  text-align: center;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  transform: scale(0.85);
  transition: transform 0.5s ease;
}

#bon-crew-celebration.show .bon-crew-card {
  transform: scale(1);
}

.bon-crew-paws {
  font-size: 1.4rem;
  margin-bottom: 0.4rem;
  letter-spacing: 0.2em;
}

.bon-crew-card strong {
  display: block;
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  font-size: 1rem;
  color: #5eead4;
  letter-spacing: 0.03em;
}

.bon-crew-card span {
  display: block;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.85rem;
  color: #dde3ea;
  margin-top: 0.3rem;
}

/* confetti paws falling from the top */
.bon-confetti-paw {
  position: fixed;
  top: -40px;
  font-size: 1rem;
  color: #5eead4;
  animation: bon-confetti-fall 1.8s ease-in forwards;
  pointer-events: none;
}

@keyframes bon-confetti-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(340deg); opacity: 0; }
}

body.dark-mode .bon-crew-card {
  background: #f5f2ea;
  border-color: #0f8f7e;
}
body.dark-mode .bon-crew-card strong { color: #0f8f7e; }
body.dark-mode .bon-crew-card span   { color: #1b232c; }
body.dark-mode .bon-confetti-paw     { color: #0f8f7e; }

@media (prefers-reduced-motion: reduce) {
  #bon-crew-celebration,
  #bon-crew-celebration.show,
  .bon-crew-card,
  .bon-confetti-paw {
    animation: none;
    transition: none;
  }
  .bon-confetti-paw { display: none; }
}

/* ── Scroll reaction: one-time "peek & wave" ── */
@keyframes bon-peek-wave {
  0%   { transform: rotate(0deg) translateY(0); }
  20%  { transform: rotate(-10deg) translateY(-4px); }
  40%  { transform: rotate(8deg) translateY(-2px); }
  60%  { transform: rotate(-6deg) translateY(-3px); }
  80%  { transform: rotate(4deg) translateY(0); }
  100% { transform: rotate(0deg) translateY(0); }
}

#bon-chat-toggle.bon-peek-wave {
  animation: bon-peek-wave 0.9s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  #bon-chat-toggle.bon-peek-wave { animation: none; }
}

/* ── Paw-swipe handoff element ── */
#bon-paw-swipe {
  position: absolute;
  bottom: 14px;
  right: -80px;
  width: 46px;
  height: 46px;
  opacity: 0;
  pointer-events: none;
}

#bon-paw-swipe::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  border: 2px solid #5eead4;
  border-radius: 50% 50% 50% 4px;
  position: relative;
}

/* simple paw shape using an outline circle + three small toe circles, in the site's teal outline style */
#bon-paw-swipe::after {
  content: "🐾";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.6rem;
  filter: drop-shadow(0 0 0 #5eead4);
  color: #5eead4;
}

#bon-paw-swipe.swipe-in {
  opacity: 1;
  animation: bon-paw-in 0.55s ease-out forwards;
}

#bon-paw-swipe.swipe-out {
  animation: bon-paw-out 0.35s ease-in forwards;
}

@keyframes bon-paw-in {
  0%   { right: -80px; opacity: 0; transform: rotate(-25deg); }
  100% { right: 4px;   opacity: 1; transform: rotate(0deg); }
}

@keyframes bon-paw-out {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.6); }
}

@media (prefers-reduced-motion: reduce) {
  #bon-paw-swipe.swipe-in,
  #bon-paw-swipe.swipe-out {
    animation: none;
    opacity: 0;
  }
}

/* ═══════════════════════════════════════════
   HOMEPAGE FIRST-VISIT INTRO OVERLAY
   ═══════════════════════════════════════════ */

#bon-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(13, 17, 23, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.2rem;
  flex-wrap: wrap;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#bon-intro-overlay.show {
  opacity: 1;
}

#bon-intro-overlay.fade-out {
  opacity: 0;
}

.bon-intro-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#bon-intro-overlay.show .bon-intro-cat {
  opacity: 1;
  transform: translateY(0);
}

.bon-intro-cat img {
  width: 130px;
  height: 130px;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
}

.bon-intro-caption {
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.bon-intro-cat.speaking .bon-intro-caption {
  opacity: 1;
  transform: translateY(0);
}

.bon-intro-cat.speaking img {
  animation: bon-intro-perk 0.5s ease-out;
}

@keyframes bon-intro-perk {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.1) translateY(-6px); }
  100% { transform: scale(1); }
}

.bon-intro-caption strong {
  display: block;
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  font-size: 0.95rem;
  color: #5eead4;
  letter-spacing: 0.05em;
}

.bon-intro-caption span {
  display: block;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.82rem;
  color: #dde3ea;
  margin-top: 0.2rem;
  max-width: 160px;
}

/* Ash, Pepper, Amber walk off in different directions */
.bon-intro-cat.walk-off {
  transition: opacity 0.8s ease, transform 0.8s ease;
  opacity: 0;
}

.bon-intro-cat[data-cat="ash"].walk-off    { transform: translate(-160px, 40px) scale(0.7); }
.bon-intro-cat[data-cat="pepper"].walk-off { transform: translate(0, 120px) scale(0.7); }
.bon-intro-cat[data-cat="amber"].walk-off  { transform: translate(160px, 40px) scale(0.7); }

/* Salt stays, then drifts toward the corner where the widget lives */
.bon-intro-cat[data-cat="salt"].stay {
  transition: opacity 0.9s ease, transform 0.9s ease;
  transform: translate(calc(50vw - 120px), calc(50vh - 80px)) scale(0.4);
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  #bon-intro-overlay,
  #bon-intro-overlay.show,
  #bon-intro-overlay.fade-out,
  .bon-intro-cat,
  .bon-intro-cat.speaking img,
  .bon-intro-cat.walk-off,
  .bon-intro-cat[data-cat="salt"].stay {
    transition: none;
    animation: none;
  }
}

@media (max-width: 700px) {
  #bon-intro-overlay {
    gap: 1.2rem;
  }
  .bon-intro-cat img {
    width: 92px;
    height: 92px;
  }
  .bon-intro-caption span {
    font-size: 0.74rem;
    max-width: 120px;
  }
}

/* ── Light mode overrides (matches your .dark-mode body class) ── */
body.dark-mode #bon-chat-toggle::before {
  background: #0f8f7e;
  color: #f5f2ea;
}

body.dark-mode #bon-chat-toggle::after {
  border-top-color: #0f8f7e;
}

body.dark-mode #bon-chat-toggle {
  background: #ebe6da;
  border-color: #0f8f7e;
  box-shadow: 0 4px 20px rgba(15, 143, 126, 0.2);
}

body.dark-mode #bon-notif-dot {
  background: #0f8f7e;
  border-color: #f5f2ea;
}

body.dark-mode #bon-chat-window {
  background: #ebe6da;
  border-color: #d6cfbf;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
}

body.dark-mode #bon-chat-header {
  background: #f5f2ea;
  border-color: #d6cfbf;
}

body.dark-mode #bon-chat-header .info strong { color: #1b232c; }
body.dark-mode #bon-chat-header .info span   { color: #0f8f7e; }
body.dark-mode .status-dot                   { background: #0f8f7e; }

body.dark-mode #bon-chat-close {
  border-color: #d6cfbf;
  color: #6b7682;
}
body.dark-mode #bon-chat-close:hover {
  border-color: #0f8f7e;
  color: #0f8f7e;
}

body.dark-mode #bon-chat-messages { scrollbar-color: #d6cfbf transparent; }
body.dark-mode #bon-chat-messages::-webkit-scrollbar-thumb { background: #d6cfbf; }

body.dark-mode .bc-msg.bot {
  background: #f5f2ea;
  border-color: #d6cfbf;
  color: #1b232c;
}

body.dark-mode .bc-msg.user {
  background: #bfe6df;
  border-color: #0f8f7e;
  color: #1b232c;
}

body.dark-mode .bc-typing {
  background: #f5f2ea;
  border-color: #d6cfbf;
}
body.dark-mode .bc-typing span { background: #0f8f7e; }

body.dark-mode .bc-quick {
  border-color: #d6cfbf;
  color: #6b7682;
}
body.dark-mode .bc-quick:hover {
  border-color: #0f8f7e;
  color: #0f8f7e;
}

body.dark-mode #bon-chat-input-row {
  background: #f5f2ea;
  border-color: #d6cfbf;
}

body.dark-mode #bon-chat-input {
  background: #ebe6da;
  border-color: #d6cfbf;
  color: #1b232c;
}
body.dark-mode #bon-chat-input::placeholder { color: #6b7682; }
body.dark-mode #bon-chat-input:focus {
  border-color: #0f8f7e;
  box-shadow: 0 0 0 3px rgba(15, 143, 126, 0.12);
}

body.dark-mode #bon-chat-send {
  background: #0f8f7e;
}
body.dark-mode #bon-chat-send svg { fill: #f5f2ea; }

/* light-mode mascot overrides */
body.dark-mode #bon-cat-tag {
  background: #f5f2ea;
  border-color: #0f8f7e;
  color: #0f8f7e;
}

body.dark-mode #bon-paw-swipe::before {
  border-color: #0f8f7e;
}

body.dark-mode #bon-paw-swipe::after {
  color: #0f8f7e;
}

body.dark-mode #bon-intro-overlay {
  background: rgba(245, 242, 234, 0.92);
}

body.dark-mode .bon-intro-caption strong {
  color: #0f8f7e;
}

body.dark-mode .bon-intro-caption span {
  color: #1b232c;
}

/* ── Mobile ── */
@media (max-width: 480px) {
  #bon-chat-widget {
    bottom: 3rem;
    right: 1rem;
  }

  #bon-chat-window {
    width: calc(100vw - 2rem);
    right: 0;
    bottom: 66px;
    max-height: 75vh;
  }

  #bon-chat-messages {
    max-height: 50vh;
  }

  #bon-chat-input {
    font-size: 16px;
    min-height: 44px;
  }

  #bon-cat-tag {
    font-size: 0.6rem;
    padding: 0.25rem 0.55rem;
  }

  .bon-crew-card {
    padding: 1.1rem 1.3rem;
  }

  .bon-crew-card strong {
    font-size: 0.88rem;
  }

  .bon-crew-card span {
    font-size: 0.76rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #bon-notif-dot        { animation: none; }
  .bc-typing span       { animation: none; opacity: 1; }
  #bon-chat-toggle      { transition: none; }
  #bon-chat-send        { transition: none; }
}
