/* Vox, the website guide */
.vox { position: fixed; right: 20px; bottom: 20px; z-index: 80; font-family: var(--body); }
.to-top { bottom: 104px !important; }

/* The character button */
.vox-bot { position: relative; width: 78px; height: 78px; padding: 0; border: 0; background: none; cursor: pointer; display: block; transform: translateY(140%) scale(.6); opacity: 0; transition: transform .7s cubic-bezier(.3, 1.6, .5, 1), opacity .4s; }
.vox-bot.arrive { transform: none; opacity: 1; }
.vox-bot svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 10px 18px rgba(11, 10, 46, .35)); }
.vox-bot:focus-visible { outline: 3px solid var(--sky); outline-offset: 4px; border-radius: 50%; }
.vox-bot .vx-body { transform-origin: 60px 100px; animation: voxBob 3.2s ease-in-out infinite; }
.vox-bot .vx-shadow { transform-origin: 60px 114px; animation: voxShadow 3.2s ease-in-out infinite; }
@keyframes voxBob { 50% { transform: translateY(-5px); } }
@keyframes voxShadow { 50% { transform: scaleX(.8); opacity: .15; } }
.vox-badge { position: absolute; top: 4px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: #F43F5E; color: #fff; font: 700 .72rem/20px var(--body); text-align: center; box-shadow: 0 0 0 3px #fff; animation: voxPing 1.8s ease-out infinite; }
@keyframes voxPing { 0% { box-shadow: 0 0 0 3px #fff, 0 0 0 3px rgba(244, 63, 94, .5); } 100% { box-shadow: 0 0 0 3px #fff, 0 0 0 14px rgba(244, 63, 94, 0); } }

/* Antenna wiggle, always a little alive */
.vx-antenna { transform-origin: 60px 24px; animation: voxAntenna 4s ease-in-out infinite; }
@keyframes voxAntenna { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-12deg); } 86% { transform: rotate(10deg); } 93% { transform: rotate(-4deg); } }

/* Eyes: follow the cursor, blink, and switch shape by mood */
.vx-eyes { transform: translate(var(--ex, 0), var(--ey, 0)); transition: transform .12s ease-out; }
.vx-eyes > g { display: none; }
svg[data-mood="idle"] .e-open, svg[data-mood="think"] .e-open, svg[data-mood="surprised"] .e-open { display: inline; }
svg[data-mood="happy"] .e-happy { display: inline; }
svg[data-mood="love"] .e-heart { display: inline; }
svg[data-mood="sleep"] .e-sleep { display: inline; }
svg[data-mood="wink"] .e-wink { display: inline; }
.e-open { transform-origin: 60px 55px; transition: transform .12s; }
svg.blink .e-open { transform: scaleY(.08); }
svg[data-mood="think"] .vx-eyes { transform: translate(4px, -3px); }
svg[data-mood="surprised"] .e-open { transform: scale(1.25); }
.e-heart path { transform-box: fill-box; transform-origin: center; animation: voxHeart .6s ease-in-out infinite alternate; }
@keyframes voxHeart { to { transform: scale(1.25); } }
.vx-cheeks { opacity: 0; transition: opacity .3s; }
svg[data-mood="happy"] .vx-cheeks, svg[data-mood="love"] .vx-cheeks, svg[data-mood="wink"] .vx-cheeks { opacity: 1; }
.vx-mouth { transition: d .25s; }
.vx-zzz, .vx-dots { opacity: 0; }
svg[data-mood="sleep"] .vx-zzz { opacity: 1; animation: voxZ 2.4s ease-in-out infinite; }
svg[data-mood="think"] .vx-dots { opacity: 1; }
svg[data-mood="think"] .vx-dots circle { animation: voxDot 1.2s infinite; }
svg[data-mood="think"] .vx-dots circle:nth-child(2) { animation-delay: .2s; }
svg[data-mood="think"] .vx-dots circle:nth-child(3) { animation-delay: .4s; }
@keyframes voxZ { 50% { transform: translate(4px, -6px); opacity: .5; } }
@keyframes voxDot { 50% { opacity: .2; } }
svg[data-mood="sleep"] .vx-body { animation-duration: 5s; }

/* Arm, hidden until it waves */
.vx-arm { transform-origin: 100px 82px; transform: rotate(70deg) scale(.6); opacity: 0; transition: opacity .2s, transform .3s; }

/* Moves */
.mv-wave .vx-arm { opacity: 1; animation: voxWave .4s ease-in-out 4 alternate; }
@keyframes voxWave { from { transform: rotate(-15deg); } to { transform: rotate(25deg); } }
.mv-bounce svg { animation: voxBounce .55s cubic-bezier(.3, .6, .4, 1) 2; }
@keyframes voxBounce { 30% { transform: translateY(-22px) scaleY(1.05); } 60% { transform: translateY(0) scaleY(.88) scaleX(1.08); } 80% { transform: translateY(-6px); } }
.mv-spin svg { animation: voxSpin 1s cubic-bezier(.5, -.3, .4, 1.3); }
@keyframes voxSpin { to { transform: rotate(360deg); } }
.mv-wiggle svg { animation: voxWiggle .6s ease-in-out 2; }
@keyframes voxWiggle { 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
.mv-jump svg { animation: voxJump 1s cubic-bezier(.3, .6, .4, 1); }
@keyframes voxJump { 40% { transform: translateY(-40px) rotate(-8deg); } 55% { transform: translateY(-44px) rotate(8deg); } 100% { transform: none; } }
.mv-dance svg { animation: voxDance 2.4s ease-in-out; }
.mv-dance .vx-arm { opacity: 1; animation: voxWave .3s ease-in-out 8 alternate; }
@keyframes voxDance { 10% { transform: translateX(-10px) rotate(-12deg); } 20% { transform: translateX(10px) rotate(12deg); } 30% { transform: translateY(-18px); } 40% { transform: translateX(-10px) rotate(-12deg); } 50% { transform: translateX(10px) rotate(12deg); } 62% { transform: translateY(-26px) rotate(360deg); } 80% { transform: scale(1.1); } }
.calm .mv-spin svg, .calm .mv-jump svg, .calm .mv-dance svg { animation-name: voxWiggle; animation-duration: .9s; }

/* Greeting bubble */
.vox-bubble { position: absolute; right: 70px; bottom: 62px; width: max-content; max-width: 250px; padding: 12px 34px 12px 14px; background: #fff; color: var(--ink); border-radius: 16px 16px 4px 16px; box-shadow: 0 16px 40px -12px rgba(11, 10, 46, .35); border: 1px solid var(--line); font-size: .95rem; line-height: 1.45; cursor: pointer; opacity: 0; transform: translateY(10px) scale(.95); transform-origin: bottom right; pointer-events: none; transition: opacity .3s, transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.vox-bubble.show { opacity: 1; transform: none; pointer-events: auto; }
.vox-bubble-x { position: absolute; top: 4px; right: 6px; border: 0; background: none; font-size: 1.1rem; color: var(--slate); cursor: pointer; padding: 2px 6px; }
.vox.open .vox-bubble { display: none; }

/* Chat panel */
.vox-panel { position: absolute; right: 0; bottom: 92px; width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 140px)); display: flex; flex-direction: column; background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 30px 70px -20px rgba(11, 10, 46, .45); border: 1px solid var(--line); transform-origin: bottom right; animation: voxOpen .35s cubic-bezier(.3, 1.3, .5, 1); }
.vox-panel[hidden] { display: none; }
@keyframes voxOpen { from { opacity: 0; transform: translateY(16px) scale(.92); } }
.vox-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--night); color: #fff; position: relative; overflow: hidden; }
.vox-head::after { content: ''; position: absolute; inset: auto -40px -60px auto; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(45, 212, 191, .35), transparent 70%); }
.vox-mini { width: 44px; height: 44px; flex: none; }
.vox-mini svg { width: 100%; height: 100%; overflow: visible; }
.vox-mini .vx-shadow { display: none; }
.vox-head b { display: block; font: 700 1.05rem var(--display); letter-spacing: -.01em; }
.vox-head span { font-size: .82rem; color: var(--on-night); display: inline-flex; align-items: center; gap: 6px; }
.vox-head span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #34D399; }
.vox-close { margin-left: auto; position: relative; z-index: 1; border: 0; background: rgba(255, 255, 255, .1); color: #fff; width: 32px; height: 32px; border-radius: 50%; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.vox-close:hover { background: rgba(255, 255, 255, .2); }
.vox-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--mist); }
.vox-msg { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: .95rem; line-height: 1.5; animation: voxMsg .3s ease both; overflow-wrap: anywhere; }
.vox-msg.bot { align-self: flex-start; background: #fff; color: var(--text); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.vox-msg.me { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.vox-msg a { color: var(--blue); font-weight: 600; }
@keyframes voxMsg { from { opacity: 0; transform: translateY(6px); } }
.vox-msg.typing { display: inline-flex; gap: 4px; padding: 14px; }
.vox-msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--slate); animation: voxDot 1s infinite; }
.vox-msg.typing i:nth-child(2) { animation-delay: .15s; }
.vox-msg.typing i:nth-child(3) { animation-delay: .3s; }
.vox-chips { display: flex; gap: 6px; padding: 10px 12px 2px; overflow-x: auto; background: #fff; scrollbar-width: none; }
.vox-chips:empty { display: none; }
.vox-chips button { flex: none; border: 1px solid var(--line); background: #fff; color: var(--navy); font: 600 .84rem var(--body); padding: 7px 11px; border-radius: 999px; cursor: pointer; transition: border-color .15s, background .15s; }
.vox-chips button:hover { border-color: var(--teal); background: #F0FDFA; }
.vox-form { display: flex; gap: 8px; padding: 10px 12px; background: #fff; }
.vox-form input { flex: 1; min-width: 0; font: inherit; font-size: .95rem; border: 1.5px solid var(--line); border-radius: 999px; padding: .6rem .95rem; }
.vox-form input:focus { outline: 0; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(14, 165, 233, .15); }
.vox-form button { width: 42px; height: 42px; flex: none; border: 0; border-radius: 50%; background: var(--teal); color: var(--ink); font-size: 1rem; cursor: pointer; }
.vox-form button:hover { background: #5EEAD4; }
.vox-foot { margin: 0; padding: 0 14px 10px; background: #fff; font-size: .74rem; color: #8A91A8; }
.vox-foot a { color: inherit; }

@media (max-width: 560px) {
  .vox { right: 12px; bottom: 12px; }
  .vox-bot { width: 64px; height: 64px; }
  .vox-panel { position: fixed; right: 8px; left: 8px; bottom: 86px; width: auto; height: min(70vh, 560px); }
  .vox-bubble { right: 58px; bottom: 52px; max-width: 210px; }
  .to-top { bottom: 90px !important; right: 14px; }
}
