/* WittyStar Witty Engine v1.0 — additive, safe styles */
.witty-engine-ready .witty-character {
  will-change: transform, filter;
}

.witty-companion[data-state='listening'] .witty-character {
  animation: wittyListening 2.7s ease-in-out infinite;
  box-shadow: 0 22px 65px rgba(0,0,0,.48), 0 0 42px rgba(0,217,255,.26);
}

.witty-companion[data-state='listening'] .witty-status-dot {
  background: var(--cyan);
  box-shadow: 0 0 16px rgba(0,217,255,.78);
}

.witty-companion[data-state='proud'] .witty-character {
  animation: wittyProud 1.25s cubic-bezier(.2,.8,.2,1) both;
  box-shadow: 0 22px 65px rgba(0,0,0,.48), 0 0 52px rgba(255,209,102,.38);
}

.witty-companion[data-state='proud'] .witty-status-dot {
  background: var(--gold);
  box-shadow: 0 0 18px rgba(255,209,102,.9);
}

.witty-companion[data-state='sleeping'] .witty-character {
  animation: wittySleepBreath 4.8s ease-in-out infinite;
  filter: saturate(.58) brightness(.72);
  box-shadow: 0 18px 48px rgba(0,0,0,.48), 0 0 22px rgba(0,217,255,.09);
}

.witty-companion[data-state='sleeping'] .witty-character img {
  transform: scale(1.045) translateY(3px);
}

.witty-companion[data-state='sleeping'] .witty-status-dot {
  background: #6b7f91;
  box-shadow: none;
  animation: wittySleepDot 2.4s ease-in-out infinite;
}

.witty-companion[data-state='sleeping'] .witty-sparkles {
  opacity: .35;
}

.witty-companion[data-state='sleeping'] .witty-sparkles span:nth-child(1)::after {
  content: 'Z';
  position: absolute;
  left: 18px;
  top: -14px;
  color: rgba(255,255,255,.8);
  font-weight: 900;
  animation: wittyZzz 2.6s ease-in-out infinite;
}

@keyframes wittyListening {
  0%,100% { transform: translateY(0) rotate(0deg) scale(1); }
  50% { transform: translateY(-3px) rotate(-1.3deg) scale(1.015); }
}

@keyframes wittyProud {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-12px) scale(1.07) rotate(-2deg); }
  68% { transform: translateY(-3px) scale(1.02) rotate(1deg); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes wittySleepBreath {
  0%,100% { transform: translateY(3px) scale(.985) rotate(-1deg); }
  50% { transform: translateY(0) scale(1.005) rotate(1deg); }
}

@keyframes wittySleepDot {
  0%,100% { opacity: .35; transform: scale(.82); }
  50% { opacity: .75; transform: scale(1); }
}

@keyframes wittyZzz {
  0% { opacity: 0; transform: translate(0,8px) scale(.7); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translate(14px,-22px) scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .witty-companion[data-state='listening'] .witty-character,
  .witty-companion[data-state='proud'] .witty-character,
  .witty-companion[data-state='sleeping'] .witty-character,
  .witty-companion[data-state='sleeping'] .witty-status-dot {
    animation: none !important;
  }
}

/* WittyStar Living Host v1.1 */
.witty-companion-compat {
  display: none !important;
}

.hero-primary-action {
  margin-bottom: 1.2rem;
}

.witty-host-panel {
  isolation: isolate;
  min-height: 100%;
  background:
    radial-gradient(circle at 50% 22%, rgba(0, 217, 255, .15), transparent 34%),
    radial-gradient(circle at 50% 55%, rgba(0, 255, 194, .10), transparent 42%),
    rgba(0, 0, 0, .34);
}

.witty-host-stage {
  min-height: 320px !important;
  display: grid;
  place-items: center;
  overflow: visible !important;
}

.witty-host-stage img {
  width: min(330px, 88%) !important;
  max-height: 320px;
  object-fit: contain;
  object-position: center;
  transform-origin: 50% 88%;
  animation: wittyLivingIdle 4.8s ease-in-out infinite;
  will-change: transform, filter;
}

.witty-host-panel[data-state="listening"] .witty-host-stage img {
  animation: wittyHostListening 2.9s ease-in-out infinite;
  filter: brightness(1.04) saturate(1.08) drop-shadow(0 24px 34px rgba(0,0,0,.44));
}

.witty-host-panel[data-state="thinking"] .witty-host-stage img {
  animation: wittyHostThinking .82s ease-in-out infinite alternate !important;
}

.witty-host-panel[data-state="celebrate"] .witty-host-stage img,
.witty-host-panel[data-state="proud"] .witty-host-stage img {
  animation: wittyHostCelebrate 1.05s cubic-bezier(.22,.9,.25,1.15) both !important;
}

.witty-host-panel[data-state="gentle"] .witty-host-stage img,
.witty-host-panel[data-state="breathe"] .witty-host-stage img {
  animation: wittyHostGentle 5.2s ease-in-out infinite !important;
}

.witty-host-panel[data-state="sleeping"] .witty-host-stage img {
  animation: wittyHostSleep 5.4s ease-in-out infinite !important;
  filter: saturate(.65) brightness(.78) drop-shadow(0 18px 28px rgba(0,0,0,.42));
}

.witty-host-panel[data-state="celebrate"] .witty-host-sparkles,
.witty-host-panel[data-state="proud"] .witty-host-sparkles {
  transform: scale(1.14);
  opacity: 1;
}

.witty-host-copy {
  max-width: 540px;
  margin: 0 auto;
}

#wittyHostMessage {
  min-height: 2.65em;
}

.witty-micro-blink {
  animation: wittyMicroBlink .17s ease-in-out 1 !important;
}

.final-smile-section {
  padding-top: 2.5rem;
  padding-bottom: 4.5rem;
}

@keyframes wittyLivingIdle {
  0%, 100% { transform: translateY(0) scale(1) rotate(-.4deg); }
  50% { transform: translateY(-8px) scale(1.012) rotate(.5deg); }
}

@keyframes wittyHostListening {
  0%, 100% { transform: translateY(0) rotate(0) scale(1); }
  50% { transform: translateY(-5px) rotate(-1deg) scale(1.018); }
}

@keyframes wittyHostThinking {
  from { transform: translateY(0) rotate(-1.6deg) scale(.995); }
  to { transform: translateY(-7px) rotate(1.6deg) scale(1.025); }
}

@keyframes wittyHostCelebrate {
  0% { transform: translateY(0) scale(1) rotate(0); }
  35% { transform: translateY(-24px) scale(1.09) rotate(-4deg); }
  68% { transform: translateY(-4px) scale(.99) rotate(3deg); }
  100% { transform: translateY(0) scale(1) rotate(0); }
}

@keyframes wittyHostGentle {
  0%,100% { transform: translateY(2px) scale(.995); }
  50% { transform: translateY(-3px) scale(1.006); }
}

@keyframes wittyHostSleep {
  0%,100% { transform: translateY(5px) scale(.985) rotate(-.6deg); }
  50% { transform: translateY(1px) scale(1.002) rotate(.5deg); }
}

@keyframes wittyMicroBlink {
  0%,100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(2px) scaleY(.965); filter: brightness(.9); }
}

@media (max-width: 900px) {
  .witty-host-stage { min-height: 270px !important; }
  .witty-host-stage img { width: min(290px, 78%) !important; max-height: 280px; }
}

@media (max-width: 620px) {
  .witty-host-stage { min-height: 230px !important; }
  .witty-host-stage img { width: min(240px, 76%) !important; max-height: 230px; }
}

@media (prefers-reduced-motion: reduce) {
  .witty-host-stage img,
  .witty-micro-blink {
    animation: none !important;
  }
}

/* Project Heartbeat v1.2 — Witty's arrival ritual and living presence */
.witty-host-panel {
  --witty-look-x: 0deg;
  --witty-look-y: 0deg;
}

.witty-host-stage {
  position: relative;
  cursor: default;
}

#wittyHostImage {
  cursor: pointer;
  transition: filter .28s ease, opacity .28s ease;
}

#wittyHostImage:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 7px;
  border-radius: 24px;
}

.witty-presence {
  display: block;
  min-height: 1.25rem;
  margin: .15rem auto .42rem;
  color: var(--gold);
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .9;
}

.witty-signature {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 13%;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff5b8;
  font-size: 2.1rem;
  text-shadow: 0 0 10px #fff, 0 0 24px var(--gold), 0 0 42px var(--mint);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px) scale(.35) rotate(-25deg);
}

.witty-host-panel.signature-active .witty-signature {
  animation: wittySignatureTwinkle .86s cubic-bezier(.2,.8,.2,1) both;
}

.witty-host-panel[data-state="notice"] .witty-host-stage img {
  animation: wittyNotice 1.05s cubic-bezier(.2,.82,.25,1) both !important;
}

.witty-host-panel[data-state="wave"] .witty-host-stage img {
  animation: wittyHostWave 1.05s cubic-bezier(.2,.82,.25,1) both !important;
}

.witty-host-panel[data-state="curious"] .witty-host-stage img {
  animation: wittyCurious 2.4s ease-in-out infinite !important;
}

.witty-host-panel.is-arriving .witty-host-copy,
.witty-host-panel.is-arriving .guest-result-text {
  animation: wittyCopyReveal .7s ease both;
}

.witty-host-panel.is-looking .witty-host-stage img {
  animation: none;
  transform: perspective(700px)
             rotateY(var(--witty-look-x))
             rotateX(var(--witty-look-y))
             translateY(-3px)
             scale(1.012);
}

@keyframes wittyNotice {
  0% { opacity: .15; transform: translateY(18px) scale(.92); filter: brightness(.65) saturate(.7); }
  58% { opacity: 1; transform: translateY(-7px) scale(1.025); filter: brightness(1.08) saturate(1.12); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: none; }
}

@keyframes wittyHostWave {
  0%,100% { transform: translateY(0) rotate(0) scale(1); }
  25% { transform: translateY(-10px) rotate(-3deg) scale(1.035); }
  52% { transform: translateY(-5px) rotate(3deg) scale(1.025); }
  76% { transform: translateY(-2px) rotate(-1.5deg) scale(1.012); }
}

@keyframes wittyCurious {
  0%,100% { transform: translateY(0) rotate(0) scale(1); }
  50% { transform: translateY(-4px) rotate(-2.2deg) scale(1.012); }
}

@keyframes wittySignatureTwinkle {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(.35) rotate(-25deg); }
  34% { opacity: 1; transform: translate(-50%, -5px) scale(1.28) rotate(8deg); }
  68% { opacity: 1; transform: translate(-50%, -12px) scale(.92) rotate(-5deg); }
  100% { opacity: 0; transform: translate(-50%, -28px) scale(.55) rotate(18deg); }
}

@keyframes wittyCopyReveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (hover: none), (pointer: coarse) {
  .witty-host-panel.is-looking .witty-host-stage img {
    transform: translateY(-3px) scale(1.012);
  }
}

@media (prefers-reduced-motion: reduce) {
  .witty-host-panel[data-state="notice"] .witty-host-stage img,
  .witty-host-panel[data-state="wave"] .witty-host-stage img,
  .witty-host-panel[data-state="curious"] .witty-host-stage img,
  .witty-host-panel.signature-active .witty-signature,
  .witty-host-panel.is-arriving .witty-host-copy,
  .witty-host-panel.is-arriving .guest-result-text {
    animation: none !important;
  }
  .witty-signature { display: none; }
}
