/* ============================================================
   Mole mascot – "Крот-консультант"
   Lives above the FAQ-bot launcher button (fixed position).
   Appears on scroll, shows speech bubble after 5s.
   ============================================================ */

/* Stage sits inside .faq-bot, above the launcher */
.faq-bot .mole-stage {
  position: absolute;
  bottom: 100%;
  right: 18px;
  width: 100px;
  height: 60px;
  overflow: visible;
  pointer-events: none;
  z-index: 1;
  display: flex;
  justify-content: center;
  margin-bottom: -8px;
}

.mole-burrow {
  position: relative;
  width: 100px;
  height: 60px;
  overflow: hidden;
}

/* ---- mole body (hidden by default, slides up) ---- */
.mole-character {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 72px;
  height: 72px;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

.mole--visible .mole-character {
  transform: translateX(-50%) translateY(20%);
  animation: mole-sway 4s ease-in-out 0.8s infinite;
}

/* ---- dirt mound (always visible) ---- */
.mole-dirt {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  z-index: 3;
}

/* ---- speech bubble (inside mole-stage, above the mole) ---- */
.mole-bubble {
  position: absolute;
  bottom: 54px;
  left: 50%;
  transform: translateX(-50%) scale(0.7) translateY(8px);
  background: #fff;
  color: #333;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  padding: 7px 14px;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
}

.mole-bubble::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  margin-left: -6px;
  width: 10px;
  height: 10px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: 2px 2px 4px rgba(0,0,0,0.06);
}

.mole-bubble--show {
  opacity: 1;
  transform: translateX(-50%) scale(1) translateY(0);
}

/* ---- blink animation ---- */
@keyframes mole-blink {
  0%, 42%, 48%, 100% { transform: scaleY(1); }
  45%                 { transform: scaleY(0.08); }
}

.mole-eye-lid {
  transform-origin: center center;
}

.mole--visible .mole-eye-lid {
  animation: mole-blink 3.5s ease-in-out 0.7s infinite;
}

/* ---- body sway ---- */
@keyframes mole-sway {
  0%, 100% { transform: translateX(-50%) translateY(20%) rotate(0deg); }
  50%      { transform: translateX(-50%) translateY(20%) rotate(2.5deg); }
}

/* ---- paw wave ---- */
@keyframes mole-wave {
  0%, 70%, 100% { transform: rotate(0deg); }
  75%           { transform: rotate(-15deg); }
  80%           { transform: rotate(10deg); }
  85%           { transform: rotate(-10deg); }
  90%           { transform: rotate(0deg); }
}

.mole-paw-right {
  transform-origin: bottom center;
}

.mole--visible .mole-paw-right {
  animation: mole-wave 5s ease-in-out 1.2s infinite;
}

/* ---- nose wiggle ---- */
@keyframes mole-nose {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.12, 0.9); }
}

.mole-nose {
  transform-origin: center center;
}

.mole--visible .mole-nose {
  animation: mole-nose 2.5s ease-in-out 0.5s infinite;
}

/* ---- whiskers twitch ---- */
@keyframes mole-whiskers {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(2deg); }
  75%      { transform: rotate(-2deg); }
}

.mole-whiskers-left {
  transform-origin: right center;
}
.mole-whiskers-right {
  transform-origin: left center;
}

.mole--visible .mole-whiskers-left {
  animation: mole-whiskers 3s ease-in-out 0.6s infinite;
}
.mole--visible .mole-whiskers-right {
  animation: mole-whiskers 3s ease-in-out 0.6s infinite reverse;
}

/* ---- cheek glow pulse ---- */
@keyframes mole-cheek {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 0.8; }
}

.mole-cheek {
  animation: mole-cheek 3s ease-in-out infinite;
}

/* ---- hide when faq panel is open ---- */
.faq-bot[aria-expanded="true"] .mole-stage,
.faq-bot.is-open .mole-stage {
  display: none;
}

/* ---- mobile: hide ---- */
@media (max-width: 768px) {
  .faq-bot .mole-stage {
    display: none;
  }
}
