/* ===== Blue ghost (top bar) + rocket to the moon, phone shell ===== */
body.ps #ps-ghost-top{display:inline-grid!important;place-items:center;background:transparent!important;border-color:transparent!important;color:#00e5ff;animation:cv-ghost-drift 3.4s ease-in-out infinite}
body.ps #ps-ghost-top svg{width:22px;height:22px;animation:none;filter:drop-shadow(0 0 6px rgba(0,229,255,.85))}
body.ps #ps-ghost-top:hover svg{filter:drop-shadow(0 0 11px rgba(0,229,255,1))}
body.ps #ps-ghost-top.is-needs svg{animation:ps-flash 1.1s ease-in-out infinite;filter:drop-shadow(0 0 10px #5cc8ff)}
body.ps.daniel-on-moon #ps-ghost-top{animation:none}
body.ps.ps-wide #ps-ghost-top svg{width:19px;height:19px}
@keyframes cv-ghost-drift{0%,100%{translate:-3px 0}50%{translate:3px 0}}
/* moon sits under the top bar so it never hides a button */
body.ps.ps-wide #anyki-svg-moon{top:118px!important;right:26px!important;width:40px!important;height:40px!important}
body.ps:not(.ps-wide) #anyki-svg-moon{top:70px!important}
/* the phone shell pins Daniel's left edge; let the moon flight win while he is up there */
body.ps #anyki-clean-center-daniel-wrap.is-on-moon,body.ps.ps-wide #anyki-clean-center-daniel-wrap.is-on-moon{left:var(--moon-left,calc(100% - 40px))!important;top:var(--moon-top,20px)!important}

/* rocket flight in the phone shell: land his feet on the moon (the old arc parked him above the screen) */
body.ps #anyki-clean-center-daniel-wrap.is-on-moon{animation:cv-rocket-arc 1.1s cubic-bezier(.22,1,.36,1) both!important;transform:translate(-50%,-63%) scale(.26) rotate(-12deg)!important}
@keyframes cv-rocket-arc{0%{transform:translate(-50%,-50%) scale(1) rotate(0)}35%{transform:translate(-50%,-110%) scale(.7) rotate(-30deg)}100%{transform:translate(-50%,-63%) scale(.26) rotate(-12deg)}}

/* ===== Live speaking characters ===== */
body.cv-talking #anyki-daniel-live-bubble,body.cv-talking .ps-pablo-say{visibility:hidden}
.cv-turn{animation:cv-turn .9s cubic-bezier(.3,.7,.3,1)}
#ps-pablocard.cv-turn{animation:cv-sway .9s ease-in-out}
@keyframes cv-turn{0%{rotate:y 0deg}50%{rotate:y 180deg}100%{rotate:y 360deg}}
@keyframes cv-sway{0%,100%{rotate:y 0deg}30%{rotate:y -16deg}70%{rotate:y 12deg}}
.cv-speaking{scale:calc(1 + var(--cv-amp,0) * .06);transition:scale .06s linear}
#anyki-single-clean-daniel.cv-speaking{filter:drop-shadow(0 0 calc(6px + var(--cv-amp,0) * 18px) rgba(125,233,223,.9))!important}
.ps-pablo-face.cv-speaking,#cv-stal.cv-speaking img,#ps-daniel.cv-speaking{box-shadow:0 0 0 calc(var(--cv-amp,0) * 5px) rgba(188,156,247,.55),0 0 calc(8px + var(--cv-amp,0) * 22px) rgba(125,233,223,.8)}
#ps-pablocard.cv-speaking img{box-shadow:0 18px 50px #000a,0 0 calc(10px + var(--cv-amp,0) * 30px) rgba(241,217,154,.7)}
/* the "mouth": a soft glow under the muzzle that opens with the voice */
.ps-pablo-face{position:relative}
.ps-pablo-face.cv-speaking::after{content:"";position:absolute;left:44%;top:58%;width:22%;height:calc(4% + var(--cv-amp,0) * 10%);border-radius:50%;background:rgba(20,8,4,.55);filter:blur(1px)}

/* Don Pablo on phone: portrait with his CODE plate (was a round crop of the poker table) */
body.ps.ps-squad .ps-pablo-face{width:150px;height:174px;border-radius:16px;border:2px solid #f1d99a;background:#120d0a url('/assets/don-pablo-bg.jpg?v=3') no-repeat;background-size:205px auto;background-position:-51px -139px;pointer-events:auto;cursor:pointer}
body.ps.ps-squad .ps-pablo{top:90px;gap:8px}
/* desktop card: the CODE-plate art, and taps reach it */
body.ps.ps-wide.coding-chats.ps-welcome #ps-pablocard{aspect-ratio:768/1376;pointer-events:auto;cursor:pointer}
#ps-pablocard .cv-loop{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:18px;opacity:0;transition:opacity .25s}
body.cv-talking #ps-pablocard .cv-loop{opacity:1}

/* Stal Capony: small portrait beside Daniel in Code */
#cv-stal{position:fixed;z-index:650;display:flex;flex-direction:column;align-items:center;gap:2px;padding:0;border:0;background:none;cursor:pointer;color:#f1d99a;font:600 10.5px/1 system-ui,sans-serif}
#cv-stal[hidden]{display:none}
#cv-stal img{width:48px;height:48px;border-radius:50%;border:2px solid #f1d99a;box-shadow:0 4px 14px #000a;display:block}
body.ps.ps-wide #cv-stal img{width:54px;height:54px}

/* Comic pop-up bubble: tail at the mouth, beside the face, never over it */
#cv-bubble{position:fixed;z-index:900;display:none;box-sizing:border-box;padding:7px 11px 8px;border-radius:16px;background:#fffef6;color:#141414;border:2.5px solid #141414;box-shadow:3px 3px 0 #141414;font:600 13px/1.32 "Comic Sans MS","Chalkboard SE","Comic Neue",system-ui,sans-serif;pointer-events:none;transform-origin:var(--tail-x,20px) 100%}
#cv-bubble.is-on{display:block;animation:cv-pop .22s cubic-bezier(.2,1.6,.4,1)}
#cv-bubble b{display:block;font:800 10.5px/1.1 system-ui,sans-serif;letter-spacing:.06em;text-transform:uppercase;margin-bottom:2px;color:#6b3fd4}
#cv-bubble.cv-pablo b{color:#a8461a}
#cv-bubble.cv-stal b{color:#8a6a10}
#cv-bubble::before,#cv-bubble::after{content:"";position:absolute;width:0;height:0}
/* tail: side=right -> points left to the mouth; left -> points right; below/over -> points up */
#cv-bubble[data-side=right]::before{left:-15px;top:calc(var(--tail-y,40px) - 9px);border:9px solid transparent;border-right:15px solid #141414;border-left:0}
#cv-bubble[data-side=right]::after{left:-10px;top:calc(var(--tail-y,40px) - 6px);border:6px solid transparent;border-right:11px solid #fffef6;border-left:0}
#cv-bubble[data-side=left]::before{right:-15px;top:calc(var(--tail-y,40px) - 9px);border:9px solid transparent;border-left:15px solid #141414;border-right:0}
#cv-bubble[data-side=left]::after{right:-10px;top:calc(var(--tail-y,40px) - 6px);border:6px solid transparent;border-left:11px solid #fffef6;border-right:0}
#cv-bubble[data-side=below]::before,#cv-bubble[data-side=over]::before{top:-15px;left:calc(var(--tail-x,20px) - 9px);border:9px solid transparent;border-bottom:15px solid #141414;border-top:0}
#cv-bubble[data-side=below]::after,#cv-bubble[data-side=over]::after{top:-10px;left:calc(var(--tail-x,20px) - 6px);border:6px solid transparent;border-bottom:11px solid #fffef6;border-top:0}
@keyframes cv-pop{0%{scale:.6;opacity:0}100%{scale:1;opacity:1}}
@media (max-width:800px){#cv-bubble{font-size:12.5px;padding:6px 10px 7px}}
@media (prefers-reduced-motion:reduce){.cv-turn,#ps-pablocard.cv-turn,body.ps #ps-ghost-top{animation:none}}
body.ps #anyki-clean-center-daniel-wrap.is-on-moon #anyki-daniel-live-bubble{display:none!important}

/* 3 Nov: Don Pablo is the sharp full-body cutout (assets/don-pablo-cutout.png, transparent) standing on the dark stage
   like Mecha Dan: no card, border, courtyard, loop video or bokeh behind him. */
body.ps.ps-squad .ps-pablo-face{width:190px;height:322px;overflow:visible;border:0;border-radius:0;box-shadow:none;background:transparent url('/assets/don-pablo-cutout.png?v=1') center bottom/contain no-repeat;filter:drop-shadow(0 0 18px rgba(125,233,223,.18))}
body.ps.ps-squad .ps-pablo{top:104px;gap:4px}
body.ps.ps-squad .ps-pablo-face.cv-speaking{box-shadow:none;filter:drop-shadow(0 0 calc(10px + var(--cv-amp,0) * 18px) rgba(125,233,223,.55))}
body.ps.ps-squad .ps-pablo-face.cv-speaking::after{display:none}
body.ps.ps-squad .ps-pablo-loop,body.ps.ps-squad .ps-pablo-sprite,#ps-pablocard .cv-loop{display:none!important}
body.ps.ps-wide.coding-chats.ps-welcome #ps-pablocard{aspect-ratio:649/1100;overflow:visible;border-radius:0;box-shadow:none;background:transparent}
#ps-pablocard img{object-fit:contain;object-position:50% 100%;transform:none;border-radius:0;box-shadow:none!important;background:transparent;filter:drop-shadow(0 0 22px rgba(125,233,223,.16))}
#ps-pablocard.cv-speaking img{filter:drop-shadow(0 0 calc(12px + var(--cv-amp,0) * 22px) rgba(125,233,223,.5))}
/* 3 Nov: Don Pablo stands in Medellín: night balcony over the valley (assets/medellin-bg.png), darkened at the top and bottom for text. */
body.ps.ps-squad,body.ps.escodebars-squad.coding-chats,body.ps.ps-wide.coding-chats.ps-welcome{background:linear-gradient(180deg,rgba(5,7,13,.55) 0,rgba(5,7,13,0) 22%,rgba(5,7,13,0) 70%,rgba(5,7,13,.7) 100%),#05070d url('/assets/medellin-bg.png?v=1') center 62%/cover no-repeat fixed!important}
/* 3 Nov: speech bubbles always draw above every character (Stal's badge is 650, Pablo 700) and tails can point up or down. */
#cv-bubble{z-index:2400!important}
#cv-bubble[data-side=above]::before{bottom:-15px;left:calc(var(--tail-x,20px) - 9px);border:9px solid transparent;border-top:15px solid #141414;border-bottom:0}
#cv-bubble[data-side=above]::after{bottom:-10px;left:calc(var(--tail-x,20px) - 6px);border:6px solid transparent;border-top:11px solid #fffef6;border-bottom:0}
#anyki-daniel-live-bubble{position:relative;z-index:3}
body.ps.ps-wide.coding-chats.ps-welcome #ps-pablocard{top:100px!important;height:calc(100vh - 100px - var(--ps-comp-h, 64px) - 60px)!important}

/* 3 Nov: Codex's loop is the Code stage (assets/don-pablo-loop.mp4, Pablo smoking on the Medellín balcony). */
.cv-stage-loop{display:none}
body.ps.cv-stage-video:not(.ps-wide) .cv-stage-loop{display:block;position:fixed;inset:0;width:100vw;height:100dvh;object-fit:cover;object-position:34% 50%;z-index:-1;pointer-events:none;background:#05070d}
body.ps.cv-stage-video:not(.ps-wide){background:#05070d!important}
body.ps.cv-stage-video:not(.ps-wide) .ps-pablo-face{background:none!important;filter:none!important;height:360px}
body.ps.cv-stage-video.ps-wide #ps-pablocard{aspect-ratio:16/9!important;height:auto!important;width:min(880px,calc(100vw - var(--ps-dockw, 288px) - 80px))!important;top:96px!important;overflow:hidden!important;border-radius:22px!important;box-shadow:0 24px 70px #000c,0 0 0 1px rgba(125,233,223,.18)!important}
body.ps.cv-stage-video.ps-wide #ps-pablocard .cv-stage-loop{display:block;position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
body.ps.cv-stage-video.ps-wide #ps-pablocard img{display:none}
body.ps.cv-stage-video.ps-wide.coding-chats.ps-welcome{background:radial-gradient(ellipse at 60% 35%,#1a1410 0,#07080d 65%,#05070d 100%) fixed!important}
/* 3 Nov: brighter loop, and with the keyboard up the stage follows the visible area and shows Pablo's face */
body.ps.cv-stage-video .cv-stage-loop{filter:brightness(1.45) contrast(1.06) saturate(1.12)}
body.ps.cv-stage-video:not(.ps-wide) .cv-stage-loop{top:var(--cv-vvtop,0px)!important;bottom:auto!important;height:var(--cv-vvh,100dvh)!important}
body.ps.cv-stage-video.cv-kb:not(.ps-wide) .cv-stage-loop{transform-origin:52% 20%;transform:translateY(48px) scale(1.9)}
body.ps.cv-stage-video.cv-kb:not(.ps-wide) .ps-pablo-name,body.ps.cv-stage-video.cv-kb:not(.ps-wide) .ps-pablo-say{display:none!important}
