/**
 * Otomat-style local companion (SVG + CSS, no CDN).
 */

.aim-logo.aim-logo--mascot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  min-width: 0;
  font-size: inherit;
}

/* Thinking blob above sidebar / brand logo (same as analyze loader) */
.aim-think-char {
  display: inline-flex;
  line-height: 0;
  filter: drop-shadow(0 6px 14px rgba(15, 23, 42, 0.12));
  animation: aimThinkBob 2.6s ease-in-out infinite;
}
.aim-think-char-svg {
  display: block;
  width: 72px;
  height: 64px;
  overflow: visible;
}
.aim-logo.aim-logo--mascot .aim-think-char-svg {
  width: 64px;
  height: 56px;
}
.aim-think-face {
  transform-box: fill-box;
  transform-origin: center;
}
.aim-think-char-eye {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.08s linear;
  will-change: transform;
}
.aim-think-dot {
  opacity: 0.2;
  animation: aimThinkDotBlink 1.2s ease-in-out infinite;
}
.aim-think-dot--1 { animation-delay: 0s; }
.aim-think-dot--2 { animation-delay: 0.2s; }
.aim-think-dot--3 { animation-delay: 0.4s; }
@keyframes aimThinkDotBlink {
  0%, 100% { opacity: 0.15; }
  40%, 60% { opacity: 1; }
}
@keyframes aimThinkBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
html[data-aim-theme="dark"] .aim-think-char {
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
}
@media (prefers-reduced-motion: reduce) {
  .aim-think-char,
  .aim-think-dot {
    animation: none !important;
  }
  .aim-think-dot { opacity: 1; }
}

/* Text wordmark — must beat .aim-logo { font-size: 18px } */
.aim-logo.aim-logo--mascot .aim-brand-name {
  display: block !important;
  font-size: 34px !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em;
  line-height: 1.1;
  color: #1A1D21;
  text-transform: lowercase;
}

/* Uploaded logo image — must beat .aim-logo img { width/height: 28px } */
.aim-logo.aim-logo--mascot img.aim-brand-logo-img,
.aim-logo.aim-logo--mascot img.aim-brand-logo-img--wordmark,
.aim-logo.aim-logo--mascot .aim-brand-logo-svg {
  width: auto !important;
  height: 48px !important;
  max-width: 200px !important;
  object-fit: contain !important;
  border-radius: 0 !important;
}
.aim-logo.aim-logo--mascot img.aim-brand-logo--light {
  display: block !important;
}
/* Light mode: never show white/dark logo (specificity must beat img.aim-brand-logo-img) */
.aim-logo.aim-logo--mascot img.aim-brand-logo--dark {
  display: none !important;
}
html[data-aim-theme="dark"] .aim-logo.aim-logo--mascot img.aim-brand-logo--light {
  display: none !important;
}
html[data-aim-theme="dark"] .aim-logo.aim-logo--mascot img.aim-brand-logo--dark {
  display: block !important;
}

html[data-aim-theme="dark"] .aim-logo.aim-logo--mascot .aim-brand-name {
  color: #E2E8F0;
}

.aim-mascot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 48px;
  flex-shrink: 0;
  line-height: 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  filter: drop-shadow(0 0 2px rgba(56, 189, 248, 0.22));
}

.aim-mascot-svg {
  display: block;
  width: 64px;
  height: 48px;
  overflow: visible;
}

.aim-mascot-stage {
  transform-origin: 36px 42px;
  animation: aim-mascot-float 4.2s ease-in-out infinite;
}

.aim-mascot-body {
  transform-origin: 36px 40px;
  animation: aim-mascot-breathe 3.2s ease-in-out infinite;
}

.aim-mascot-antenna {
  transform-origin: 36px 14px;
  transform-box: fill-box;
  animation: aim-mascot-antenna 2.6s ease-in-out infinite;
}

.aim-mascot-antenna-tip {
  transform-origin: center;
  transform-box: fill-box;
  animation: aim-mascot-tip-pulse 2.6s ease-in-out infinite;
}

.aim-mascot-shine {
  transform-origin: 28px 17px;
  animation: aim-mascot-shine 5s ease-in-out infinite;
}

.aim-mascot-cheek {
  animation: aim-mascot-cheek 4.5s ease-in-out infinite;
}

.aim-mascot-pupil {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.08s linear;
  will-change: transform;
}

.aim-mascot-lid {
  transform-box: fill-box;
  transform-origin: center top;
  transform: scaleY(0);
  /* No looping blink — occasional soft blink via JS class */
  transition: transform 0.09s ease-in;
}

.aim-mascot.is-blink .aim-mascot-lid {
  transform: scaleY(1);
  transition: transform 0.07s ease-out;
}

.aim-mascot.is-poke .aim-mascot-stage {
  animation: aim-mascot-wobble 0.55s ease;
}

.aim-mascot.is-poke .aim-mascot-antenna {
  animation: aim-mascot-antenna-spin 0.55s ease;
}

/* Click laugh — ^ ^ closed eyes (like Coucou / reference) */
.aim-mascot-laugh-eye,
.aim-mascot-smile {
  opacity: 0;
  pointer-events: none;
}
.aim-mascot.is-laugh .aim-mascot-pupil {
  opacity: 0;
}
.aim-mascot.is-laugh .aim-mascot-laugh-eye {
  opacity: 1;
}
/* Match reference: eyes only, no mouth smile */
.aim-mascot.is-laugh .aim-mascot-smile {
  opacity: 0 !important;
}
.aim-mascot.is-laugh .aim-mascot-lid {
  transform: scaleY(0) !important;
}
.aim-mascot.is-laugh .aim-mascot-cheek {
  animation: none;
  opacity: 0.55;
}
.aim-mascot.is-laugh .aim-mascot-stage {
  animation: aim-mascot-laugh 0.95s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.aim-mascot.is-laugh .aim-mascot-antenna {
  animation: aim-mascot-antenna-spin 0.95s ease;
}
.aim-mascot.is-laugh .aim-mascot-antenna-tip {
  animation: aim-mascot-tip-pulse 0.45s ease-in-out infinite;
}

@keyframes aim-mascot-laugh {
  0% { transform: translateY(0) scale(1, 1) rotate(0deg); }
  18% { transform: translateY(-6px) scale(1.04, 0.96) rotate(-3deg); }
  36% { transform: translateY(0) scale(0.98, 1.04) rotate(2deg); }
  52% { transform: translateY(-4px) scale(1.03, 0.97) rotate(-2deg); }
  70% { transform: translateY(0) scale(0.99, 1.02) rotate(1deg); }
  100% { transform: translateY(0) scale(1, 1) rotate(0deg); }
}

/* Idle: curious tip to one side */
.aim-mascot.is-tip .aim-mascot-stage {
  animation: aim-mascot-tip 1.1s ease;
}

/* Idle: soft happy bounce */
.aim-mascot.is-bounce .aim-mascot-stage {
  animation: aim-mascot-bounce 0.7s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.aim-mascot.is-bounce .aim-mascot-cheek {
  animation: none;
  opacity: 0.55;
}

@keyframes aim-mascot-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  35% { transform: translateY(-2.2px) rotate(-1.2deg); }
  70% { transform: translateY(-0.8px) rotate(1deg); }
}

@keyframes aim-mascot-breathe {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.035, 0.97); }
}

@keyframes aim-mascot-antenna {
  0%, 100% { transform: rotate(0deg); }
  40% { transform: rotate(-12deg); }
  70% { transform: rotate(10deg); }
}

@keyframes aim-mascot-tip-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.18); opacity: 0.85; }
}

@keyframes aim-mascot-shine {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.04); }
}

@keyframes aim-mascot-cheek {
  0%, 100% { opacity: 0.28; }
  50% { opacity: 0.42; }
}

@keyframes aim-mascot-wobble {
  0% { transform: rotate(0deg) scale(1) translateY(0); }
  25% { transform: rotate(-8deg) scale(1.06) translateY(-1px); }
  50% { transform: rotate(6deg) scale(0.97) translateY(0); }
  75% { transform: rotate(-4deg) scale(1.03) translateY(-0.5px); }
  100% { transform: rotate(0deg) scale(1) translateY(0); }
}

@keyframes aim-mascot-antenna-spin {
  0% { transform: rotate(0deg); }
  40% { transform: rotate(-28deg); }
  70% { transform: rotate(22deg); }
  100% { transform: rotate(0deg); }
}

@keyframes aim-mascot-tip {
  0% { transform: rotate(0deg) translateY(0); }
  30% { transform: rotate(-9deg) translateY(-1.5px); }
  70% { transform: rotate(-7deg) translateY(-1px); }
  100% { transform: rotate(0deg) translateY(0); }
}

@keyframes aim-mascot-bounce {
  0% { transform: translateY(0) scale(1, 1); }
  35% { transform: translateY(-5px) scale(0.96, 1.06); }
  55% { transform: translateY(0) scale(1.04, 0.94); }
  75% { transform: translateY(-2px) scale(0.99, 1.02); }
  100% { transform: translateY(0) scale(1, 1); }
}

/* Auth login hero — larger companion above the form */
.aim-auth-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 4px 0 14px;
}
.aim-auth-hero .aim-mascot {
  width: 96px;
  height: 72px;
  filter: drop-shadow(0 4px 12px rgba(56, 189, 248, 0.28));
}
.aim-auth-hero .aim-mascot-svg {
  width: 96px;
  height: 72px;
}
.aim-auth-wordmark {
  margin-top: 2px;
}
.aim-auth-wordmark .aim-logo {
  margin: 0;
}

.aim-mascot.is-focus .aim-mascot-stage {
  animation: aim-mascot-tip 1.1s ease;
}
.aim-mascot.is-typing .aim-mascot-antenna {
  animation: aim-mascot-antenna 0.9s ease-in-out infinite;
}
.aim-mascot.is-typing .aim-mascot-cheek {
  opacity: 0.45;
}
.aim-mascot.is-happy .aim-mascot-cheek {
  animation: none;
  opacity: 0.65;
}
.aim-mascot.is-happy .aim-mascot-antenna-tip {
  animation: aim-mascot-tip-pulse 0.9s ease-in-out infinite;
}

/* Coucou-style detached limbs — appear when hovering site buttons (is-happy) */
.aim-mascot-limbs {
  pointer-events: none;
}
.aim-mascot-limb {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.22s ease, transform 0.34s cubic-bezier(0.34, 1.35, 0.64, 1);
}
.aim-mascot-limb--l {
  transform: translate(6px, 4px) scale(0.55);
}
.aim-mascot-limb--r {
  transform: translate(-8px, 10px) scale(0.55);
}
.aim-mascot.is-happy .aim-mascot-limb--l {
  opacity: 1;
  transform: translate(0, 0) scale(1);
  animation: aim-mascot-limb-bob 1.1s ease-in-out infinite;
}
.aim-mascot.is-happy .aim-mascot-limb--r {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}
.aim-mascot-limb-wave {
  transform-box: fill-box;
  transform-origin: center;
  transform: rotate(-38deg);
}
.aim-mascot.is-happy .aim-mascot-limb-wave {
  animation: aim-mascot-limb-wave 0.85s ease-in-out infinite;
}
.aim-mascot.is-shy .aim-mascot-limb {
  opacity: 0 !important;
  animation: none !important;
}

@keyframes aim-mascot-limb-bob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(0, -1.5px) scale(1.04); }
}

@keyframes aim-mascot-limb-wave {
  0%, 100% { transform: rotate(-38deg); }
  40% { transform: rotate(-16deg); }
  70% { transform: rotate(-50deg); }
}

/* OTP / password: cover eyes with hands */
.aim-mascot-hands {
  pointer-events: none;
}
.aim-mascot-hand {
  transform-box: fill-box;
  transform-origin: center bottom;
  opacity: 0;
  transform: translateY(14px) scale(0.72);
  transition: transform 0.32s cubic-bezier(0.34, 1.35, 0.64, 1), opacity 0.22s ease;
}
.aim-mascot-hand--l {
  transform-origin: 26px 34px;
}
.aim-mascot-hand--r {
  transform-origin: 46px 34px;
}
.aim-mascot.is-shy .aim-mascot-hand {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.aim-mascot.is-shy .aim-mascot-hand--l {
  transform: translateY(0) translateX(1px) rotate(-6deg) scale(1);
}
.aim-mascot.is-shy .aim-mascot-hand--r {
  transform: translateY(0) translateX(-1px) rotate(6deg) scale(1);
}
.aim-mascot.is-shy .aim-mascot-lid {
  transform: scaleY(1);
  transition: transform 0.18s ease-out;
}
.aim-mascot.is-shy .aim-mascot-pupil {
  opacity: 0;
}
.aim-mascot.is-shy .aim-mascot-cheek {
  animation: none;
  opacity: 0.55;
}
.aim-mascot.is-shy .aim-mascot-stage {
  animation: aim-mascot-shy-bob 2.4s ease-in-out infinite;
}
.aim-mascot.is-shy .aim-mascot-antenna {
  animation: aim-mascot-antenna 1.4s ease-in-out infinite;
}

@keyframes aim-mascot-shy-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-1.5px) rotate(-1deg); }
}

/* Thinking: looking up, chin hand, antenna buzzing */
.aim-mascot.is-thinking {
  cursor: default;
}
.aim-mascot.is-thinking .aim-mascot-stage {
  animation: aim-mascot-think-bob 2.4s ease-in-out infinite;
}
.aim-mascot.is-thinking .aim-mascot-pupil {
  transform: translate(1.2px, -2.4px);
  transition: none;
}
.aim-mascot.is-thinking .aim-mascot-smile {
  opacity: 1;
  stroke-width: 2;
  d: path("M30 35 Q36 38 42 35");
}
.aim-mascot.is-thinking .aim-mascot-antenna {
  animation: aim-mascot-antenna 1.1s ease-in-out infinite;
}
.aim-mascot.is-thinking .aim-mascot-antenna-tip {
  animation: aim-mascot-tip-pulse 0.7s ease-in-out infinite;
}
.aim-mascot.is-thinking .aim-mascot-hand--r {
  opacity: 1;
  transform: translate(-6px, 10px) rotate(-28deg) scale(0.92);
}
.aim-mascot.is-thinking .aim-mascot-hand--l {
  opacity: 0;
}
.aim-mascot.is-thinking .aim-mascot-cheek {
  opacity: 0.4;
  animation: none;
}

@keyframes aim-mascot-think-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-3px) rotate(2deg); }
}

@media (prefers-reduced-motion: reduce) {
  .aim-mascot-stage,
  .aim-mascot-body,
  .aim-mascot-antenna,
  .aim-mascot-antenna-tip,
  .aim-mascot-shine,
  .aim-mascot-cheek,
  .aim-mascot-lid,
  .aim-mascot-hand,
  .aim-mascot-limb,
  .aim-mascot-limb-wave {
    animation: none !important;
  }
  .aim-mascot-hand {
    transition: none !important;
  }
  .aim-mascot-pupil {
    transition: none !important;
  }
  .aim-mascot.is-shy .aim-mascot-hand {
    opacity: 1;
    transform: none;
  }
  .aim-mascot.is-thinking .aim-mascot-stage,
  .aim-mascot.is-thinking .aim-mascot-antenna,
  .aim-mascot.is-thinking .aim-mascot-antenna-tip {
    animation: none !important;
  }
  .aim-analyze-orbit--icons,
  .aim-orbit-item {
    animation: none !important;
  }
}
