:root{color-scheme:dark;--text:#edf0f7;--soft:#8e9aaf;--state:#8da9cd;--accent:#a8caff;--line:#ffffff1a}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{margin:0;height:100%;overflow:hidden;background:#05070b}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--text);-webkit-user-select:none;user-select:none}button{font:inherit;color:inherit;cursor:pointer;border:0;background:none;touch-action:manipulation}button:focus-visible{outline:2px solid var(--accent);outline-offset:5px}svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.symbols,.hidden{display:none!important}.screen{position:fixed;inset:0;height:100dvh;display:flex;flex-direction:column;align-items:center}#mobile{max-width:600px;margin:auto;background:#000;padding:calc(env(safe-area-inset-top) + 22px) 24px max(10px,env(safe-area-inset-bottom))}.top{width:100%;display:flex;align-items:center;justify-content:space-between;z-index:2}.brand{display:block;font-family:Georgia,serif;font-size:29px;letter-spacing:3px;font-weight:400}.brand-dot{color:var(--accent)}.eyebrow{display:block;font-size:9px;letter-spacing:2.2px;color:var(--soft);margin-top:7px}.chip{display:flex;align-items:center;gap:7px;border:1px solid var(--line);border-radius:7px;padding:10px 11px;font-size:11px;color:#c3cede;background:#11161d}.chip svg{width:17px;height:17px}.status{display:flex;gap:8px;align-items:center;align-self:flex-start;margin:20px 0 0;font-size:11px;letter-spacing:.4px;color:var(--state);z-index:2}.status .ico{width:5px;height:5px;flex-shrink:0;border-radius:50%;background:var(--state);box-shadow:0 0 10px var(--state)}.stage{position:relative;flex:1;min-height:100px;width:calc(100% + 48px);overflow:hidden;margin-top:12px}.face{position:absolute;width:100%;aspect-ratio:1;bottom:0;left:0;transform-origin:50% 80%}.face .img,.face .mouth{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}.face .img.b{display:none}.face .mouth{display:none;z-index:1;mask-image:radial-gradient(ellipse 6.2% 3.3% at 54% 37.7%,#000 55%,transparent 100%);-webkit-mask-image:radial-gradient(ellipse 6.2% 3.3% at 54% 37.7%,#000 55%,transparent 100%)}.face.breath{animation:breathe 5s ease-in-out infinite}@keyframes breathe{50%{transform:translateY(-2px) scale(1.005)}}.portrait-shade{position:absolute;inset:0;pointer-events:none;background:linear-gradient(0deg,#000 0%,transparent 26%,transparent 90%,#000 100%)}.portrait-label{position:absolute;bottom:10px;left:24px;right:24px;display:flex;justify-content:space-between;font-size:8px;letter-spacing:1.8px;color:#6b7890}.fx{display:none}.conversation{width:100%;z-index:2;padding-top:10px;background:#000}.voice-bars{height:16px;display:flex;align-items:center;justify-content:center;gap:4px}.voice-bars i{height:3px;width:2px;border-radius:4px;background:#a8caff88}.voice-bars i:nth-child(2),.voice-bars i:nth-child(4){height:7px}.voice-bars i:nth-child(3){height:13px}body[data-state=speaking] .voice-bars i{animation:wave .5s ease-in-out infinite alternate}body[data-state=speaking] .voice-bars i:nth-child(2n){animation-delay:-.3s}@keyframes wave{to{height:3px;opacity:.4}}.bubble{min-height:75px;max-height:120px;overflow:auto;display:grid;place-items:center;padding:12px 6px}.bubble p{font-family:Georgia,"Times New Roman",serif;font-size:21px;line-height:1.45;text-align:center;margin:0;font-weight:400}.buttons{display:flex;justify-content:center;gap:32px;margin-top:10px}.round{display:flex;flex-direction:column;align-items:center;gap:9px;min-width:64px;padding:0}.round span{position:relative;width:52px;height:52px;display:grid;place-items:center;border:1px solid #ffffff20;border-radius:50%;background:#13171e;color:#bdc6d5;transition:background .2s,transform .2s}.round.primary span{width:66px;height:66px;margin-top:-7px;background:#b3cdf2;color:#111823;border-color:#d9e5f8;box-shadow:0 0 28px #8eb9ff1c}.round.primary.connected span{background:#27374f;color:#d2e3ff;border-color:#7391ba}.round small{font-size:10px;letter-spacing:.3px;color:#9ba6b8}.round.primary small{color:#d6e3f6}.round:active span{transform:scale(.94)}.round.off span::after{content:"";position:absolute;width:30px;height:2px;background:#cc8c88;transform:rotate(-45deg)}.footer-note{text-align:center;font-size:8px;color:#536177;letter-spacing:2.5px;margin:23px 0 4px}.sheet{position:fixed;inset:0;z-index:10;background:#000b;backdrop-filter:blur(8px);display:grid;place-items:center;padding:24px}.card{width:100%;max-width:370px;border:1px solid #ffffff20;background:linear-gradient(140deg,#17202e,#090d14);padding:28px 24px;border-radius:16px;box-shadow:0 20px 70px #0008}.card h2{font-family:Georgia,serif;font-size:28px;line-height:1.25;font-weight:400;margin:17px 0 12px}.card p{font-size:13px;color:#a4afc0;line-height:1.7;margin:0 0 22px}.wide{display:flex;justify-content:space-between;width:100%;background:#bad0ef;color:#101925;border-radius:6px;padding:16px;font-size:13px;font-weight:600}.code{font-size:36px;letter-spacing:7px;margin-bottom:20px;color:#c8ddff}.welcome{place-items:end center;background:linear-gradient(0deg,#000e 15%,#0002 75%);backdrop-filter:none;padding-bottom:max(24px,env(safe-area-inset-bottom))}.welcome .card{max-width:430px}.text-button{display:block;margin:17px auto 0;color:#bdc9db;font-size:12px;padding:8px}.card .permission-note{font-size:10px;text-align:center;margin:12px 0 0;color:#64748a}#holo{background:#000;padding:0}.holo-stage{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;--holo-size:78vmin}.holo-stage.flip-y{transform:scaleY(-1)}.holo-stage.flip-x{transform:scaleX(-1)}.holo-stage.flip-y.flip-x{transform:scale(-1,-1)}.holo-face{position:relative;left:auto;bottom:auto;width:var(--holo-size);flex-shrink:0;filter:brightness(1.12)}.holo-caption{display:none}.holo-hint{position:absolute;bottom:0;left:0;right:0;padding:16px 12px max(16px,env(safe-area-inset-bottom));color:#9aa8bb;font-size:11px;text-align:center;transition:opacity .6s}.holo-hint p{margin:5px 0}.holo-hint.fade{opacity:0;pointer-events:none}.holo-tools{display:flex;gap:8px;justify-content:center;margin-top:12px}.holo-tools button{border:1px solid #ffffff30;border-radius:6px;padding:10px;font-size:11px;min-height:40px;color:#ccd9eb}@media(max-height:650px){#mobile{padding-top:calc(env(safe-area-inset-top) + 12px)}.status{margin-top:10px}.bubble{min-height:55px;max-height:78px}.bubble p{font-size:18px}.footer-note{margin-top:12px}.buttons{margin-top:5px}.stage{margin-top:5px}}@media(min-width:700px){#mobile{border-left:1px solid #ffffff10;border-right:1px solid #ffffff10}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
/* Fit the entire portrait inside the available stage, including short screens. */
.stage{container-type:size}.stage .face{width:min(100%,calc(100dvh - 390px));left:50%;translate:-50% 0}
@supports(width:100cqh){.stage .face{width:min(100cqw,100cqh)}}
/* Registered facial patches: body, hair and silhouette never change between expressions. */
.face .img.b,.face .mouth{display:none!important}
.avatar-patch{position:absolute;left:37.4396%;top:16.5056%;width:32.2061%;height:28.9855%;pointer-events:none;object-fit:fill}
.avatar-patch.expression{z-index:1;transition:opacity .48s ease-in-out}
.avatar-patch.mouth-patch{z-index:2;transition:opacity .085s linear}
.avatar-patch.blink-patch{z-index:3;transition:none}
.face.alive{animation:avatar-life 9.4s ease-in-out infinite;transform-origin:50% 88%;will-change:transform}
@keyframes avatar-life{0%,100%{transform:rotate(-.16deg) translateX(-.6px) scale(1)}35%{transform:rotate(.13deg) translateX(.7px) scale(1.0025)}70%{transform:rotate(.03deg) translateX(.2px) scale(1.001)}}
/* Captions scroll inside a fixed box instead of pushing the avatar up and down. */
#mobile{height:100svh}.bubble{height:104px;min-height:104px;max-height:104px;flex-shrink:0}
@media(max-height:650px){.bubble{height:78px;min-height:78px;max-height:78px}}
@media(prefers-reduced-motion:reduce){.face.alive{animation:none}.avatar-patch{transition:none}}
/* Emotion HUD follows the avatar in both mobile and reflected Hologram mode. */
.cyber-fx{display:block;position:absolute;inset:0;pointer-events:none;z-index:4;--neon:#60ecff;color:var(--neon);overflow:visible}
.cyber-glyph{position:absolute;left:73%;top:19%;width:15%;aspect-ratio:1;animation:cyber-hover 3.6s ease-in-out infinite;filter:drop-shadow(0 0 3px var(--neon))}
.cyber-glyph svg{width:100%;height:100%;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
.cyber-corner{position:absolute;right:-8%;bottom:0;width:25%;height:25%;border-right:1px solid currentColor;border-bottom:1px solid currentColor;opacity:.6}
.cyber-dot{position:absolute;border-radius:50%;background:currentColor;box-shadow:0 0 7px currentColor;animation:cyber-pulse 2.8s ease-in-out infinite}
.cyber-dot.d1{left:72%;top:38%;width:3px;height:3px}.cyber-dot.d2{left:33%;top:23%;width:2px;height:2px;animation-delay:-1.4s}
.cyber-orbit{position:absolute;left:27%;top:19%;width:9%;aspect-ratio:1;border:1px solid currentColor;border-bottom-color:transparent;border-right-color:transparent;border-radius:50%;opacity:.45;animation:cyber-orbit 7s linear infinite}
.cyber-fx.heart{--neon:#e49cff}.cyber-fx.alert,.cyber-fx.shield{--neon:#ffd18a}.cyber-fx.spark{--neon:#9cf6ee}.cyber-fx.focus{--neon:#a2bcff}
.cyber-fx.signal .cyber-glyph svg{animation:cyber-pulse 1.9s ease-in-out infinite}
.holo-face .cyber-fx{filter:brightness(1.2)}
@keyframes cyber-hover{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
@keyframes cyber-pulse{0%,100%{opacity:.5}50%{opacity:1}}
@keyframes cyber-orbit{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.cyber-fx *{animation:none!important}}
/* One call action on entry; three equally sized controls after relay readiness. */
.call-controls{position:relative;height:104px;flex-shrink:0;width:100%;margin:10px 0 max(18px,env(safe-area-inset-bottom))}
.call-controls .buttons{position:absolute;inset:0;align-items:flex-start;margin:0;gap:30px}
.call-controls .in-call{display:none}
body[data-call=ready] .call-start{display:none}
body[data-call=ready] .in-call{display:flex}
.call-button span{width:70px;height:70px;background:#3bce80;border-color:#61e49a;color:#042b15;box-shadow:0 0 28px #38ce8020}
.call-button svg{width:29px;height:29px;stroke-width:1.8}.call-button small{color:#a8cdb8}
body[data-call=connecting] .call-button span{animation:call-pulse 1.6s ease-in-out infinite}
body:not([data-call=ready]) .bubble,body:not([data-call=ready]) .voice-bars{visibility:hidden}
.call-button:disabled{cursor:wait;opacity:.8}
@keyframes call-pulse{50%{box-shadow:0 0 0 12px #3bce8010,0 0 34px #3bce8030}}
/* The entry view gives the call button its own space directly under the portrait. */
body:not([data-call=ready]) .bubble,body:not([data-call=ready]) .voice-bars{display:none}
#mobile{padding-bottom:max(24px,env(safe-area-inset-bottom))}
body:not([data-call=ready]) .stage{flex:1;max-height:calc(100svh - 235px)}
body:not([data-call=ready]) .conversation{padding-top:0}
body:not([data-call=ready]) .call-controls{margin-top:8px;margin-bottom:0;height:100px}
body:not([data-call=ready]) .stage .face{bottom:0}
.cyber-fx{transition:opacity .4s ease}
.face.alive.music-sway{animation:music-sway 4.8s ease-in-out infinite;transform-origin:50% 88%}
@keyframes music-sway{0%,100%{transform:rotate(-.8deg) translateX(-1px)}50%{transform:rotate(.8deg) translateX(1px)}}
body[data-music=true] .voice-bars{opacity:.4}
@media(prefers-reduced-motion:reduce){.face.alive.music-sway{animation:none}}
body:not([data-call=ready]) .stage{flex:0 1 auto;height:min(calc(100svh - 210px),100vw);margin-top:auto}
body:not([data-call=ready]) .conversation{margin-bottom:auto}
/* Voice-first captions: automatic reading, no scroll bar or swipe requirement. */
.bubble{overflow:hidden;scrollbar-width:none;overscroll-behavior:none;display:flex;flex-direction:column;justify-content:flex-start;align-items:center;scroll-behavior:auto}
.bubble::-webkit-scrollbar{display:none}.bubble p{flex-shrink:0;width:100%;margin-block:auto}
/* In-call layout uses the visible viewport and leaves safe headroom for swaying. */
body[data-call=ready] #mobile{height:100dvh;margin:0 auto;padding-bottom:max(12px,env(safe-area-inset-bottom))}
body[data-call=ready] .stage{margin-top:12px;min-height:120px}
body[data-call=ready] .stage .face{width:min(100%,calc(100dvh - 350px));bottom:8px}
@supports(width:100cqh){body[data-call=ready] .stage .face{width:min(100cqw,calc(100cqh - 28px))}}
/* Fade the lower torso only; the former upper fade darkened the crown of the hair. */
.portrait-shade{background:linear-gradient(0deg,#000 0%,transparent 26%)}
body[data-call=ready] .bubble{height:clamp(120px,18dvh,160px);min-height:clamp(120px,18dvh,160px);max-height:clamp(120px,18dvh,160px);padding:10px 4px}
body[data-call=ready] .bubble p{font-size:clamp(18px,5.2vw,21px);line-height:1.45}
body[data-call=ready] .call-controls{height:78px;margin:12px 0 0}
@media(max-height:650px){body[data-call=ready] .bubble{height:106px;min-height:106px;max-height:106px}}
/* Three restrained neon notes drift only while music is playing. */
.music-note{position:absolute;width:11%;aspect-ratio:1;color:#7defff;opacity:0;filter:drop-shadow(0 0 3px #56d6ff);animation:music-note-rise 4.8s ease-in-out infinite}
.music-note svg{width:100%;height:100%;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
.music-note.note-0{left:25%;top:40%}.music-note.note-1{left:75%;top:36%;animation-delay:-1.6s;color:#b3a6ff}.music-note.note-2{left:72%;top:53%;width:8%;animation-delay:-3.2s}
@keyframes music-note-rise{0%{opacity:0;transform:translateY(6px) rotate(-8deg)}20%{opacity:.8}75%{opacity:.65}100%{opacity:0;transform:translateY(-28px) translateX(5px) rotate(8deg)}}
@media(prefers-reduced-motion:reduce){.music-note{animation:none;opacity:.65}}
/* Cyberpunk control surfaces; static neon keeps attention on the character. */
.round{--control-neon:#7defff}
#btnStop{--control-neon:#d6adff}#btnHolo{--control-neon:#9cabff}.call-button{--control-neon:#79f7d6}
.round span,.call-button span{
  border-radius:12px 3px 12px 3px;
  border:1px solid color-mix(in srgb,var(--control-neon) 70%,transparent);
  background:linear-gradient(145deg,#17252c,#070d15 68%);
  color:var(--control-neon);
  box-shadow:inset 0 0 14px color-mix(in srgb,var(--control-neon) 8%,transparent),0 0 15px color-mix(in srgb,var(--control-neon) 13%,transparent);
  isolation:isolate;
}
.round span::before{
  content:"";position:absolute;inset:5px;border:1px solid color-mix(in srgb,var(--control-neon) 22%,transparent);
  border-radius:7px 1px 7px 1px;pointer-events:none;
  background:linear-gradient(90deg,transparent 46%,color-mix(in srgb,var(--control-neon) 40%,transparent) 46% 54%,transparent 54%) center bottom/100% 2px no-repeat;
}
.round svg{filter:drop-shadow(0 0 3px color-mix(in srgb,var(--control-neon) 40%,transparent));stroke-width:1.5}
.round small,.call-button small{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:10px;letter-spacing:.6px;color:var(--control-neon);opacity:.85}
.round:active span{background:#162b36;box-shadow:inset 0 0 16px #7defff20,0 0 20px #7defff28}
.round.off{--control-neon:#ff8d9f}.round.off span::after{background:#ff8d9f;box-shadow:0 0 6px #ff8d9f}
body[data-call=connecting] .call-button span{animation:cyber-call-connect 1.8s ease-in-out infinite}
@keyframes cyber-call-connect{50%{border-color:#e0fff6;box-shadow:inset 0 0 18px #79f7d61a,0 0 24px #79f7d630}}
.holo-tools button,.wide{border-radius:9px 2px 9px 2px;border:1px solid #7defff60;background:linear-gradient(145deg,#15242e,#080f18);color:#a6f3ff;box-shadow:inset 0 0 12px #7defff08}
.holo-tools button:active,.wide:active{background:#1b3440}
