/* The selected Max portrait, with whole-sprite reactions and accessible motion settings. */
.mascot {
  --mascot-width: 240px;
  position: relative;
  display: inline-block;
  flex: none;
  width: var(--mascot-width);
  max-width: 100%;
  aspect-ratio: 2 / 3;
  vertical-align: bottom;
  isolation: isolate;
}
.mascot-sprite {
  position: absolute;
  inset: 0;
  display: block;
}
.mascot-figure {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 93%;
}
.mascot[data-pose='wave'] .mascot-figure { animation: mascot-greet 4s ease-in-out infinite; }
.mascot[data-pose='think'] .mascot-figure { animation: mascot-think 3.8s ease-in-out infinite; }
.mascot[data-pose='cheer'] .mascot-figure { animation: mascot-cheer 1.6s ease-in-out infinite; }
.mascot[data-pose='celebrate'] .mascot-figure { animation: mascot-celebrate 1.5s ease-in-out infinite; }
.mascot-thoughts, .mascot-sparkles { pointer-events: none; display: none; position: absolute; inset: 0; }
.mascot[data-pose='think'] .mascot-thoughts { display: block; }
.mascot-thoughts i { position: absolute; right: 13%; top: 18%; width: 3.5%; aspect-ratio: 1; border-radius: 50%; background: #b76a2e; animation: mascot-thought-dot 1.8s ease-in-out infinite; }
.mascot-thoughts i:nth-child(2) { right: 7%; top: 13%; width: 4.5%; animation-delay: .2s; }
.mascot-thoughts i:nth-child(3) { right: 0%; top: 6%; width: 6%; animation-delay: .4s; }
.mascot[data-pose='celebrate'] .mascot-sparkles { display: block; }
.mascot-sparkles i { position: absolute; font-style: normal; line-height: 1; color: #e99139; font-size: clamp(13px, 2vw, 30px); animation: mascot-sparkle 1.5s ease-in-out infinite; }
.mascot-sparkles i:nth-child(1) { left: 1%; top: 27%; }
.mascot-sparkles i:nth-child(2) { right: 1%; top: 4%; animation-delay: .35s; }
.mascot-sparkles i:nth-child(3) { right: 5%; bottom: 30%; animation-delay: .7s; }
.mascot-sparkles i:nth-child(4) { left: 8%; bottom: 19%; animation-delay: 1.05s; }

/* Floating tips use the same character as the larger campus mentor. */
.max .max-portrait { width: 104px; height: auto; border: 0; background: transparent; padding: 0; cursor: pointer; }
.max .max-portrait .mascot { display: block; width: 104px; }
.max .max-portrait:focus-visible { outline: 3px solid var(--accent-deep); outline-offset: 3px; border-radius: 20px; }
.max .max-bubble { border-color: #82502c; background: #fff5df; margin-bottom: 28px; }
.max .max-bubble::after { background: #fff5df; border-color: #82502c; }
.max .max-bubble b { text-transform: none; letter-spacing: 0; font-size: 17px; }
.max .max-bubble .max-dismiss { float: right; margin-left: 8px; font-size: 11px; color: #946744; }

@keyframes mascot-greet { 0%, 55%, 100% { transform: rotate(0); } 15%, 35% { transform: rotate(-2deg); } 25%, 45% { transform: rotate(2deg); } }
@keyframes mascot-think { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(2deg) translateY(-1px); } }
@keyframes mascot-cheer { 0%, 65%, 100% { transform: translateY(0); } 25% { transform: translateY(-5px) rotate(-2deg); } 45% { transform: translateY(-2px) rotate(2deg); } }
@keyframes mascot-celebrate { 0%, 100% { transform: translateY(0) rotate(0); } 35% { transform: translateY(-8px) rotate(-3deg); } 70% { transform: translateY(-3px) rotate(3deg); } }
@keyframes mascot-thought-dot { 0%, 100% { opacity: .3; transform: translateY(0) scale(.85); } 45% { opacity: .9; transform: translateY(-3px) scale(1); } }
@keyframes mascot-sparkle { 0%, 100% { opacity: .2; transform: scale(.65) rotate(-12deg); } 50% { opacity: 1; transform: scale(1.1) rotate(12deg); } }

@media (max-width: 600px) {
  .max .max-portrait, .max .max-portrait .mascot { width: 66px; }
  .max .max-bubble { font-size: 12px; padding: 10px 12px; margin-bottom: 8px; }
  .max .max-bubble b { font-size: 15px; }
  .max .max-dismiss { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mascot *, .mascot::before, .mascot::after { animation: none !important; transition: none !important; }
}
body.reduced-motion .mascot *, body.reduced-motion .mascot::before, body.reduced-motion .mascot::after { animation: none !important; transition: none !important; }
