/* Cortex companion: a small character pinned to the bottom of the screen. Transforms only. --x is its spot along the bottom,
   --dir which way it faces, --tilt the lean while the page scrolls, --lift keeps it above the privacy bar. */
.cxa{position:fixed;left:0;bottom:calc(env(safe-area-inset-bottom,0px) + 14px + var(--lift,0px));z-index:70;width:0;height:0;pointer-events:none;opacity:0;transition:opacity .6s,bottom .3s}
.cxa.on{opacity:1}
.cxa.on.offstage{opacity:0;pointer-events:none}.cxa.offstage .cxa-bot,.cxa.offstage .cxa-chat{pointer-events:none}
.cxa-bot{position:absolute;left:0;bottom:0;width:68px;height:68px;padding:0;border:0;background:none;cursor:pointer;pointer-events:auto;transform:translateX(var(--x,0px));transition:transform var(--walk,1.2s) cubic-bezier(.45,.05,.3,1);-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.cxa-bot:focus-visible{outline:2px solid #f1d889;outline-offset:4px;border-radius:50%}
.cxa-body{position:absolute;inset:0;transform:scaleX(var(--dir,1)) rotate(calc(var(--tilt,0deg) * var(--dir,1)));transform-origin:50% 60%;animation:cxaHover 3.2s ease-in-out infinite;will-change:transform;filter:drop-shadow(0 12px 14px rgba(0,0,0,.55)) drop-shadow(0 0 12px rgba(227,181,60,.25))}
@keyframes cxaHover{0%,100%{translate:0 0}50%{translate:0 -6px}}
.cxa.walking .cxa-body{animation:cxaWalk .42s ease-in-out infinite}
@keyframes cxaWalk{0%,100%{translate:0 0;rotate:0deg}25%{translate:0 -7px;rotate:-5deg}75%{translate:0 -7px;rotate:5deg}}
.cxa.jump .cxa-body{animation:cxaJump .9s cubic-bezier(.3,.9,.3,1) 1}
@keyframes cxaJump{0%{translate:0 0;scale:1 1}12%{scale:1.15 .82;translate:0 4px}40%{translate:0 -46px;scale:.94 1.1}60%{translate:0 -46px;rotate:12deg}85%{translate:0 2px;scale:1.1 .9;rotate:0deg}100%{translate:0 0;scale:1 1}}
.cxa.wave .cxa-body{animation:cxaWave 1.4s ease-in-out 1}
@keyframes cxaWave{0%,100%{rotate:0deg}20%{rotate:-10deg}40%{rotate:10deg}60%{rotate:-8deg}80%{rotate:6deg}}
.cxa.look .cxa-body{animation:cxaLook 1.8s ease-in-out 1}
@keyframes cxaLook{0%,100%{rotate:0deg;translate:0 0}30%{rotate:-14deg;translate:-4px -3px}70%{rotate:12deg;translate:4px -3px}}
.cxa.fly .cxa-body{animation:none;translate:0 -10px}
.cxa.think .cxa-body{animation:cxaThink 1.1s ease-in-out infinite}
@keyframes cxaThink{0%,100%{rotate:-4deg}50%{rotate:4deg}}
/* the sprite, when the PNGs exist */
.cxa-img{display:none;position:absolute;inset:-6px;width:calc(100% + 12px);height:calc(100% + 12px);object-fit:contain}
.cxa.has-img .cxa-img{display:block}.cxa.has-img .cxa-orb{display:none}
/* the CSS orb used until the sprite loads: black shell, gold circuit rim, two gold eyes, a C on the chest */
.cxa-orb{position:absolute;inset:4px;border-radius:50% 50% 46% 46%;background:radial-gradient(circle at 35% 28%,#3a3426 0,#111 38%,#060606 100%);border:1.5px solid rgba(241,216,137,.55);box-shadow:inset 0 -10px 18px rgba(0,0,0,.8),inset 0 2px 6px rgba(241,216,137,.25),0 0 0 3px rgba(227,181,60,.08)}
.cxa-orb::before{content:"";position:absolute;left:14%;right:14%;top:18%;height:34%;border-radius:50%/60%;background:linear-gradient(180deg,rgba(20,18,12,.95),rgba(8,8,8,.98));border:1px solid rgba(241,216,137,.25)}
.cxa-eye{position:absolute;top:30%;width:9px;height:11px;border-radius:50%;background:radial-gradient(circle at 40% 35%,#fff7d6 0,#f1d889 35%,#b8861a 100%);box-shadow:0 0 10px rgba(241,216,137,.9);animation:cxaBlink 4.6s infinite}
.cxa-eye.l{left:31%}.cxa-eye.r{right:31%;animation-delay:.08s}
@keyframes cxaBlink{0%,92%,100%{scale:1 1}95%{scale:1 .1}}
.cxa-c{position:absolute;left:50%;top:62%;translate:-50% 0;font:900 11px/1 Inter,system-ui,sans-serif;color:#f1d889;letter-spacing:0;text-shadow:0 0 8px rgba(241,216,137,.7)}
.cxa-jet{position:absolute;left:50%;bottom:-2px;translate:-50% 0;width:26px;height:12px;border-radius:50%;background:radial-gradient(ellipse at 50% 0,rgba(241,216,137,.85),rgba(227,181,60,.25) 55%,transparent 75%);filter:blur(1px);animation:cxaJet .5s ease-in-out infinite alternate}
@keyframes cxaJet{from{scale:1 .8;opacity:.75}to{scale:1.15 1.15;opacity:1}}
/* speech bubble */
.cxa-tip{position:absolute;left:0;bottom:84px;width:max-content;max-width:min(260px,70vw);transform:translateX(clamp(8px,calc(var(--x,0px) - 90px),calc(100vw - 100% - 8px)));background:#141310;color:#f7f4ed;border:1px solid rgba(241,216,137,.45);border-radius:14px;padding:10px 13px;font:14px/1.4 Inter,system-ui,sans-serif;box-shadow:0 18px 40px -16px rgba(0,0,0,.8);pointer-events:none;animation:cxaPop .35s cubic-bezier(.2,.9,.3,1.3)}
.cxa-tip::after{content:"";position:absolute;left:50%;bottom:-7px;width:12px;height:12px;background:#141310;border-right:1px solid rgba(241,216,137,.45);border-bottom:1px solid rgba(241,216,137,.45);transform:translateX(-50%) rotate(45deg)}
@keyframes cxaPop{from{opacity:0;translate:0 8px;scale:.9}to{opacity:1;translate:0 0;scale:1}}
html[dir=rtl] .cxa-tip{direction:rtl}
/* chat panel */
.cxa-chat{position:fixed;right:14px;bottom:calc(env(safe-area-inset-bottom,0px) + 96px + var(--lift,0px));width:min(360px,calc(100vw - 28px));max-height:min(520px,calc(100vh - 140px));display:flex;flex-direction:column;background:rgba(14,13,10,.96);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border:1px solid rgba(241,216,137,.4);border-radius:20px;box-shadow:0 30px 80px -20px rgba(0,0,0,.9),0 0 40px -18px rgba(227,181,60,.4);pointer-events:auto;font:15px/1.45 Inter,system-ui,sans-serif;color:#f7f4ed;animation:cxaPop .3s cubic-bezier(.2,.9,.3,1.2);overflow:hidden}
html[dir=rtl] .cxa-chat{right:auto;left:14px;direction:rtl}
.cxa-chat header{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid rgba(241,216,137,.18)}
.cxa-chat header b{font-size:13px;letter-spacing:.22em;text-transform:uppercase;color:#f1d889}
.cxa-x{border:0;background:none;color:#b6b0a4;font-size:22px;line-height:1;cursor:pointer;padding:2px 6px}
.cxa-log{flex:1;overflow:auto;padding:12px 14px;display:flex;flex-direction:column;gap:8px;min-height:120px}
.cxa-m{max-width:88%;padding:9px 12px;border-radius:14px;white-space:pre-wrap;word-break:break-word}
.cxa-m.a{align-self:flex-start;background:#1c1a14;border:1px solid rgba(241,216,137,.22);border-bottom-left-radius:4px}
.cxa-m.u{align-self:flex-end;background:linear-gradient(180deg,#f1d889,#d8b45a);color:#1a1405;border-bottom-right-radius:4px;font-weight:600}
html[dir=rtl] .cxa-m.a{align-self:flex-end;border-radius:14px;border-bottom-right-radius:4px}html[dir=rtl] .cxa-m.u{align-self:flex-start;border-radius:14px;border-bottom-left-radius:4px}
.cxa-m.wait{color:#b6b0a4;animation:cxaPulse 1s ease-in-out infinite}
@keyframes cxaPulse{50%{opacity:.5}}
.cxa-chips{display:flex;gap:6px;flex-wrap:wrap;padding:0 14px 10px}
.cxa-chips button{border:1px solid rgba(241,216,137,.35);background:none;color:#f1d889;border-radius:999px;padding:7px 11px;font:600 12px/1 Inter,system-ui,sans-serif;cursor:pointer}
.cxa-form{display:flex;gap:8px;padding:10px 12px 12px;border-top:1px solid rgba(241,216,137,.18)}
.cxa-in{flex:1;min-width:0;background:#0a0a08;border:1px solid rgba(241,216,137,.3);border-radius:12px;padding:11px 12px;color:#f7f4ed;font:16px/1.3 Inter,system-ui,sans-serif}
.cxa-in:focus{outline:none;border-color:#f1d889}
.cxa-send{border:0;border-radius:12px;padding:0 16px;background:linear-gradient(180deg,#f1d889,#d8b45a);color:#1a1405;font:800 13px/1 Inter,system-ui,sans-serif;cursor:pointer}
@media (max-width:760px){.cxa-chat{right:14px;left:14px;width:auto;bottom:calc(env(safe-area-inset-bottom,0px) + 92px + var(--lift,0px));max-height:min(460px,calc(100vh - 120px))}html[dir=rtl] .cxa-chat{left:14px}}
@media (prefers-reduced-motion:reduce){.cxa-body,.cxa-jet,.cxa-eye,.cxa-tip,.cxa-chat{animation:none!important}.cxa-bot{transition:none}}
