2026-11-11 23:39:17 +00:00
# bubbles-toggle [ aria-pressed = "true" ] { background : var ( -- accent - soft ); color : var ( -- accent ); }
. bubbles { position : fixed ; inset : 0 ; z-index : 20 ; overflow : hidden ; pointer-events : none ; }
. bubbles [ hidden ] { display : none ; }
. speech-bubble { --scale : 1 ; --tail : 0 px ; position : absolute ; display : grid ; gap : 2 px ; width : max-content ; max-width : min ( 280 px , 72 vw ); padding : 8 px 13 px ; border : 2 px solid var ( -- text ); border-radius : 18 px ; background : var ( -- panel ); color : var ( -- text ); box-shadow : var ( -- shadow - lift ); font : 400 var ( -- fs - md ) / 1.35 "Comic Neue" , "Comic Sans MS" , cursive ; transform : translate ( -50 % , -100 % ) scale ( var ( -- scale )); transform-origin : 50 % 100 % ; transition : transform .3 s var ( -- ease ), opacity .4 s var ( -- ease ); }
. speech-bubble :: before , . speech-bubble :: after { content : "" ; position : absolute ; top : 100 % ; left : calc ( 50 % + var ( -- tail )); border-style : solid ; border-color : transparent ; }
. speech-bubble :: before { margin-left : -9 px ; border-width : 12 px 9 px 0 ; border-top-color : var ( -- text ); }
. speech-bubble :: after { margin-left : -6 px ; border-width : 8 px 6 px 0 ; border-top-color : var ( -- panel ); }
. speech-bubble . leaving { opacity : 0 ; }
2026-11-12 23:14:42 +00:00
. speech-bubble [ data-state = "speaking" ] : not ( . leaving ) { z-index : 1 ; }
2026-11-11 23:39:17 +00:00
. bubble-words { display : block ; max-height : calc ( 6 * 1.35 em ); overflow : hidden ; overflow-wrap : anywhere ; scroll-behavior : smooth ; }
. speech-bubble [ data-state = "waiting" ] . bubble-words { letter-spacing : .12 em ; }
. bubble-who { display : none ; color : var ( -- muted ); font : 650 var ( -- fs - xs ) / 1.2 var ( -- sans ); }
. bubble-bar { position : absolute ; right : 0 ; bottom : calc ( var ( -- sp -4 ) + env ( safe - area - inset - bottom , 0 px )); left : 0 ; display : flex ; flex-wrap : wrap-reverse ; justify-content : center ; align-items : flex-end ; gap : var ( -- sp -3 ) var ( -- sp -4 ); padding : 0 var ( -- sp -3 ); }
. bubble-bar . speech-bubble { position : relative ; transform : scale ( var ( -- scale )); }
. bubble-bar . speech-bubble :: before , . bubble-bar . speech-bubble :: after { display : none ; }
. bubble-bar . bubble-who { display : block ; }
@ media ( prefers-reduced-motion : reduce ) {
. speech-bubble { transition : opacity .4 s var ( -- ease ); }
. bubble-words { scroll-behavior : auto ; }
}