/* Mascot stays inside the welcome card, clear of navigation and controls. */
.nexo-welcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 176px;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  padding: 8px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(110deg, #fff 30%, #eff8fc);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.nexo-welcome__copy { min-width: 0; }
.nexo-welcome .eyebrow { color: var(--brand); }
.nexo-welcome h2 {
  margin: 6px 0 8px;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.2;
  letter-spacing: -.03em;
}
.nexo-welcome p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}
.nexo-mascot {
  position: relative;
  width: 100%;
  max-width: 176px;
  aspect-ratio: 1;
  pointer-events: none;
}
.nexo-mascot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.nexo-mascot__image { position: relative; }
.nexo-mascot__arm {
  position: absolute;
  left: -23%;
  top: 0;
  transform-origin: 55.5% 53%;
}
.nexo-mascot.is-ready img {
  opacity: 1;
}
.nexo-mascot.is-ready .nexo-mascot__arm {
  animation: nexo-mascot-wave 4.8s ease-in-out infinite;
}
.nexo-mascot__eyelid {
  position: absolute;
  z-index: 3;
  clip-path: inset(0 0 100% 0);
  mask-image: radial-gradient(ellipse at center, #000 65%, transparent 72%);
}
.nexo-mascot__eyelid--left { left: 39.73%; top: 34.38%; width: 13.39%; height: 14.29%; }
.nexo-mascot__eyelid--right { left: 60.71%; top: 33.04%; width: 14.51%; height: 14.73%; }
.nexo-mascot.is-ready .nexo-mascot__eyelid { animation: nexo-mascot-blink 4.7s linear infinite; }
@keyframes nexo-mascot-blink {
  0%, 54%, 60%, 100% { clip-path: inset(0 0 100% 0); }
  56.1%, 57.1% { clip-path: inset(0); }
}
.nexo-mascot[data-mascot-state="processing"] { border-radius: 14px; overflow: hidden; }
.nexo-mascot[data-mascot-state="success"] { overflow: clip; }
.nexo-mascot[data-mascot-state="success"] .nexo-mascot__image {
  clip-path: polygon(0 6%,27% 6%,27% 0,50% 0,50% 6%,100% 6%,100% 100%,0 100%);
}
.nexo-mascot__pdf { position: absolute; left: 18%; top: 10%; transform-origin: 65% 65%; }
.nexo-mascot.is-ready .nexo-mascot__pdf { animation: nexo-mascot-deliver 2.2s ease-in-out; }
.nexo-mascot[data-mascot-state="success"] .nexo-mascot__eyelid--left { left: 42.5%; top: 30.5%; width: 16%; height: 17%; }
.nexo-mascot[data-mascot-state="success"] .nexo-mascot__eyelid--right { left: 66%; top: 27.8%; width: 15.5%; height: 17%; }
@keyframes nexo-mascot-deliver {
  0%,100% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-1px) scale(1.025); }
}
.nexo-mascot__search-pose, .nexo-mascot__error-pose {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 50% 92%;
}
.nexo-mascot.is-ready .nexo-mascot__search-pose { animation: nexo-mascot-search 2.8s ease-in-out infinite; }
.nexo-mascot__lens {
  position: absolute;
  left: 28.5%; top: 29%; width: 21.5%; height: 23%;
  border-radius: 50%;
  overflow: hidden;
}
.nexo-mascot__glint {
  position: absolute;
  top: -20%; left: 0; width: 50%; height: 140%;
  background: linear-gradient(100deg, transparent, rgb(255 255 255 / .38), transparent);
  opacity: 0;
  transform: translateX(-140%) rotate(-18deg);
}
.nexo-mascot.is-ready .nexo-mascot__glint { animation: nexo-mascot-glint 2.8s ease-in-out infinite; }
@keyframes nexo-mascot-search {
  0%,100% { transform: translateX(-1px) rotate(-.55deg); }
  50% { transform: translateX(1.5px) rotate(.55deg); }
}
@keyframes nexo-mascot-glint {
  0%,10% { opacity: 0; transform: translateX(-140%) rotate(-18deg); }
  24% { opacity: .75; }
  48%,100% { opacity: 0; transform: translateX(260%) rotate(-18deg); }
}
.nexo-mascot.is-ready .nexo-mascot__error-pose { animation: nexo-mascot-sad 2.6s ease-in-out; }
.nexo-mascot[data-mascot-state="error"] .nexo-mascot__eyelid--left { left: 34.4%; top: 32.4%; width: 12.6%; height: 12.3%; }
.nexo-mascot[data-mascot-state="error"] .nexo-mascot__eyelid--right { left: 54.8%; top: 30.1%; width: 11.3%; height: 11.8%; }
.nexo-mascot[data-mascot-state="error"] .nexo-mascot__eyelid { mask-image: radial-gradient(ellipse at center, #000 84%, transparent 99%); }
.nexo-mascot__alert-glow {
  position: absolute;
  left: 44%; top: 46%; width: 18%; height: 17%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgb(239 82 82 / .3), transparent 72%);
  opacity: 0;
}
.nexo-mascot.is-ready .nexo-mascot__alert-glow { animation: nexo-mascot-alert 2.6s ease-in-out; }
@keyframes nexo-mascot-sad {
  0%,100% { transform: translateY(0) rotate(0); }
  28%,55% { transform: translateY(2px) rotate(-.65deg); }
}
@keyframes nexo-mascot-alert {
  0%,100% { opacity: 0; }
  35% { opacity: .8; }
}
.order-result-layout { position: relative; }
.order-mascot-slot {
  position: absolute;
  z-index: 1;
  top: 18px;
  right: 12px;
  width: 124px;
  text-align: center;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.order-result-layout.has-mascot .order-outcome { padding-right: 154px; min-height: 200px; }
.order-mascot-slot .nexo-mascot { transition: opacity .35s var(--ease); }
.order-mascot-slot .nexo-mascot.is-incoming { position: absolute; top: 0; left: 0; opacity: 0; }
.order-mascot-slot .nexo-mascot.is-incoming.is-ready { opacity: 1; }
.order-mascot-slot .nexo-mascot.is-outgoing { opacity: 0; }
.order-mascot-slot.is-leaving { opacity: 0; transform: translateY(2px); }
@keyframes nexo-mascot-wave {
  0%, 8%, 58%, 100% { transform: rotate(0deg); }
  16%, 32%, 48% { transform: rotate(14deg); }
  24%, 40% { transform: rotate(-9deg); }
}
@media (max-width: 599px) {
  .nexo-welcome {
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 6px;
    padding: 16px 10px 16px 16px;
    margin-bottom: 14px;
  }
  .nexo-welcome .eyebrow { font-size: .65rem; }
  .nexo-welcome h2 { font-size: 1.08rem; margin: 5px 0 7px; }
  .nexo-welcome p { font-size: .78rem; line-height: 1.5; }
  .order-mascot-slot { width: 80px; right: 8px; }
  .order-result-layout.has-mascot .order-outcome { padding-right: 98px; }
}
@media (prefers-reduced-motion: reduce) {
  .nexo-mascot img, .order-mascot-slot, .order-mascot-slot .nexo-mascot { transition: none; }
  .nexo-mascot.is-ready :is(.nexo-mascot__arm,.nexo-mascot__eyelid,.nexo-mascot__pdf,.nexo-mascot__search-pose,.nexo-mascot__glint,.nexo-mascot__error-pose,.nexo-mascot__alert-glow) { animation: none; }
}

/* Real 3D overlays the original assets only after a successful first render. */
.nexo-mascot__3d { position:absolute; inset:0; display:block; width:100%; height:100%; opacity:1; pointer-events:none; }
.nexo-mascot.is-3d > :not(.nexo-mascot__3d) { visibility:hidden; }
.nexo-mascot.is-3d :not(canvas) { animation:none !important; }
.nexo-mascot[data-mascot-state].is-3d { overflow:clip; border-radius:0; }
