/* css/mascot.css: the living mascot (js/mascot). Size the mount; the canvas fills it. */
/* sizing defaults sit in :where() (zero specificity) so any page rule that sizes or positions the mount wins */
:where(.orbio-mascot) {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 100%;
}
:where(.orbio-mascot--avatar) { width: 40px; height: 40px; flex: 0 0 auto; }
:where(.orbio-mascot--card) { max-width: 240px; margin-inline: auto; }
.orbio-mascot {
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.orbio-mascot__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  cursor: pointer;
  touch-action: manipulation;
  opacity: 1;
  transition: opacity 0.5s ease;
}
.orbio-mascot.is-loading .orbio-mascot__canvas { opacity: 0; }
.orbio-mascot__canvas:focus-visible { outline: 2px solid var(--ink, #141413); outline-offset: 2px; border-radius: 22px; }
.orbio-mascot--avatar .orbio-mascot__canvas { cursor: default; }

/* image fallback: no WebGL or reduced motion */
.orbio-mascot__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 18%;
  pointer-events: none;
}
.orbio-mascot--avatar .orbio-mascot__img { border-radius: 50%; object-fit: cover; }
.orbio-mascot--static { cursor: pointer; }
@media (prefers-reduced-motion: no-preference) {
  .orbio-mascot--static .orbio-mascot__img { animation: orbio-mascot-float 4.6s ease-in-out infinite; }
  .orbio-mascot--static.is-bounce .orbio-mascot__img { animation: orbio-mascot-bounce 0.6s ease-out; }
  .orbio-mascot--static.is-shake .orbio-mascot__img { animation: orbio-mascot-shake 0.6s ease-out; }
}
@keyframes orbio-mascot-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3%); } }
@keyframes orbio-mascot-bounce { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-9%) scale(1.02); } 70% { transform: translateY(0) scale(0.98, 1.02); } 100% { transform: none; } }
@keyframes orbio-mascot-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-4%); } 40% { transform: translateX(4%); } 60% { transform: translateX(-3%); } 80% { transform: translateX(2%); } }

/* speech bubble (say) */
.orbio-mascot__bubble {
  position: absolute;
  left: 50%;
  top: 2%;
  z-index: 2;
  max-width: min(260px, 86%);
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--white, #fffefd);
  color: var(--ink, #141413);
  border: 1px solid var(--line, rgba(20, 20, 19, 0.12));
  box-shadow: 0 1px 2px rgba(20, 20, 19, 0.06), 0 10px 28px -12px rgba(20, 20, 19, 0.28);
  font: 500 15px/1.35 'DM Sans', system-ui, sans-serif;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 6px) scale(0.96);
  transform-origin: 50% 100%;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
.orbio-mascot__bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: inherit;
  border-right: 1px solid var(--line, rgba(20, 20, 19, 0.12));
  border-bottom: 1px solid var(--line, rgba(20, 20, 19, 0.12));
  transform: translateX(-50%) rotate(45deg);
}
.orbio-mascot__bubble.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.orbio-mascot__bubble:empty { display: none; }
.orbio-mascot--avatar .orbio-mascot__bubble { display: none; }
@media (max-width: 480px) { .orbio-mascot__bubble { font-size: 14px; padding: 8px 12px; } }

/* sound toggle (mountSoundToggle) */
.orbio-sound-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(20, 20, 19, 0.12));
  background: var(--white, #fffefd);
  color: var(--ink, #141413);
  font: 500 13px/1 'DM Sans', system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.orbio-sound-toggle:hover { background: var(--surface-2, #f3efe7); }
.orbio-sound-toggle[data-sound='off'] { color: var(--ink-3, #77776f); }
.orbio-sound-toggle:focus-visible { outline: 2px solid var(--ink, #141413); outline-offset: 2px; }
.orbio-sound-toggle svg { flex: 0 0 auto; }
