/* =========================================================
   ElevateNow — Animated Mascots
   ========================================================= */

.mascot {
  position: absolute;
  pointer-events: none; 
  z-index: 5;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mascot svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 20px 40px rgba(79,70,229,0.2));
  animation: mascotBob 4s ease-in-out infinite;
}
@keyframes mascotBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(-1.5deg); }
}

.mascot .eye, .mascot .pupil, .mascot .glint {
  transform-origin: center;
  transform-box: fill-box;
  animation: mascotBlink 5s infinite;
}
.mascot .pupil { animation: mascotBlinkPupil 5s infinite; }
@keyframes mascotBlink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.05); }
}
@keyframes mascotBlinkPupil {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.05); }
}
.mascot .pupil { transition: transform 0.15s ease-out; }

/* ===== HERO MASCOT: NOVA ===== */
.mascot-nova {
  width: 200px;
  bottom: -30px;
  left: -80px;
  pointer-events: auto;
  cursor: pointer;
}
.mascot-bubble {
  position: absolute;
  top: -20px;
  left: 100%;
  margin-left: 12px;
  padding: 12px 18px;
  background: #fff;
  border-radius: 16px 16px 16px 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 16px 40px rgba(15,14,42,0.15), 0 0 0 1px rgba(15,14,42,0.05);
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.4s, transform 0.4s;
  pointer-events: none;
}
.mascot-bubble span { color: var(--brand); font-weight: 800; }
.mascot-nova:hover .mascot-bubble,
.mascot-nova.bubble-show .mascot-bubble {
  opacity: 1;
  transform: translateX(0);
}
.mascot-bubble::before {
  content: '';
  position: absolute;
  bottom: 4px; left: -8px;
  width: 0; height: 0;
  border-style: solid;
  border-width: 8px 10px 8px 0;
  border-color: transparent #fff transparent transparent;
}

/* ===== AI SECTION MASCOT: PIXEL ===== */
.mascot-pixel {
  position: relative;
  top: auto; right: auto; bottom: auto; left: auto;
  flex-shrink: 0;
  width: 110px;
  margin-bottom: 12px;
  align-self: flex-end;
}
.mascot:hover .arm-right {
  animation: mascotWave 0.6s ease-in-out infinite;
  transform-origin: 145px 168px;
}
@keyframes mascotWave {
  0%, 100% { transform: rotate(-15deg); }
  50% { transform: rotate(35deg); }
}

/* ===== CLICK REACTION ===== */
.mascot.clicked svg {
  animation: mascotJump 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes mascotJump {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-25px) scale(1.08); }
  70% { transform: translateY(-8px) scale(1.02); }
}

/* =========================================================
   NOVA CHAT PANEL
   ========================================================= */

.nova-chat {
  position: absolute;
  bottom: 40px; left: 40px;
  width: 320px;
  max-width: calc(100vw - 40px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(15,14,42,0.18), 0 0 0 1px rgba(15,14,42,0.04);
  z-index: 20;
  overflow: hidden;
  transform-origin: bottom left;
  animation: novaChatOpen 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nova-chat[hidden] { display: none; }

@keyframes novaChatOpen {
  from { opacity: 0; transform: scale(0.85) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.nova-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(79,70,229,0.04), rgba(255,107,91,0.04));
}
.nova-chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--ink);
}
.nova-chat-title strong { font-weight: 800; letter-spacing: -0.01em; }
.nova-chat-sub { font-size: 0.75rem; color: var(--muted); font-weight: 500; }
.nova-chat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #28C840;
  box-shadow: 0 0 0 3px rgba(40,200,64,0.2);
  animation: pulse 2s infinite;
}
.nova-chat-close {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  display: grid; place-items: center;
  transition: all 0.2s;
}
.nova-chat-close:hover { background: var(--bg-alt); color: var(--ink); }

.nova-chat-body {
  max-height: 200px;
  overflow-y: auto;
  padding: 16px 18px;
}
.nova-chat-messages { display: flex; flex-direction: column; gap: 10px; }
.nova-msg {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.5;
  animation: novaMsgIn 0.3s ease-out;
}
@keyframes novaMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nova-msg-bot {
  background: var(--bg-alt);
  color: var(--ink);
  border-bottom-left-radius: 4px;
  max-width: 92%;
}
.nova-msg-user {
  background: var(--brand);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  max-width: 92%;
}

.nova-chat-questions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}
.nova-chat-questions button {
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: left;
  transition: all 0.2s;
  cursor: pointer;
  font-family: inherit;
}
.nova-chat-questions button:hover {
  background: var(--bg-alt);
  border-color: var(--brand);
  color: var(--brand);
  transform: translateX(4px);
}

.mascot-nova.chat-active svg {
  filter: drop-shadow(0 0 20px rgba(79,70,229,0.4)) drop-shadow(0 20px 40px rgba(79,70,229,0.2));
}

@media (max-width: 960px) {
  .mascot-nova { width: 150px; bottom: -20px; left: -40px; }
  .mascot-pixel { width: 90px; margin-bottom: 10px; }
  .mascot-bubble { font-size: 0.75rem; padding: 10px 14px; }
}
@media (max-width: 720px) {
  .mascot-nova { width: 120px; left: -20px; bottom: -10px; }
  .mascot-bubble { display: none; }
  .mascot-pixel { width: 70px; margin-bottom: 8px; }
  .nova-chat { left: 0; bottom: 20px; width: calc(100vw - 40px); }
  .nova-chat-body { max-height: 160px; }
  .nova-chat-questions button { font-size: 0.78rem; padding: 9px 12px; }
}
@media (max-width: 480px) { .mascot-pixel { display: none; } }