/* oliviaai.com/live: one fixed stage sized only by the viewport; everything else overlays it. */

/* Shareable OliviaAI page: one fixed stage that never changes size. Everything that
   appears or disappears during a session is an overlay inside or above it. */
:root{color-scheme:light dark;--stage-ratio:4/3;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,Helvetica,Arial,sans-serif;--letterbox:linear-gradient(135deg,#2c2c2e,#1d1d1f)}
*{box-sizing:border-box}
html,body{width:100%;height:100%;margin:0;overflow:hidden;background:var(--letterbox);color:#fff}
body{display:grid;place-items:center;-webkit-text-size-adjust:100%}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
[hidden]{display:none!important}
.live{display:grid;place-items:center;width:100%;height:100%}
/* Size is decided once by the viewport, never by content: 4:3 on wide screens,
   3:4 on a phone held upright so Olivia fills the screen. */
.video-wrap{position:relative;overflow:hidden;aspect-ratio:var(--stage-ratio);
  width:min(100vw,736px,calc(100dvh * 4 / 3));border-radius:16px;background:#1d1d1f;
  box-shadow:0 20px 60px rgba(0,0,0,.45);isolation:isolate}
@media (max-aspect-ratio:4/5){:root{--stage-ratio:3/4}.video-wrap{width:min(100vw,calc(100dvh * 3 / 4));border-radius:0;box-shadow:none}}
@media (max-width:600px) and (min-aspect-ratio:4/5){.video-wrap{border-radius:0}}
.video-wrap>img,.video-wrap>video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center}
.video-wrap #avatar{opacity:0;transition:opacity 500ms ease}.video-wrap[data-live=true] #avatar{opacity:1}
.video-wrap[data-live=true]:not([data-film=true]) #waiting-video{opacity:0}
.video-wrap #working-poster,.video-wrap #working-video{pointer-events:none}
.video-wrap #working-video:not([data-motion-ready=true]){opacity:0}
.synced-avatar{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none}.video-wrap:not([data-live=true]) .synced-avatar{visibility:hidden}
@media(prefers-reduced-motion:reduce){#working-video{display:none}}

/* Curtain: closed with the OliviaAI logo before Start, peek while connecting,
   slides open once she is settled and talking. */
.video-wrap #curtain{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:2}
.curtain-panel{position:absolute;inset:0;overflow:hidden;opacity:1;transform:translate3d(0,0,0);will-change:transform;backface-visibility:hidden;transition:transform .8s cubic-bezier(.22,.7,.2,1),opacity .45s ease}
.curtain-cloth{position:absolute;inset:0;background:#303740 url("/assets/live/olivia-curtain-closed.jpg") no-repeat center/cover}
.video-wrap[data-curtain=done] #curtain{display:none}
.video-wrap[data-curtain=peek] .curtain-panel{opacity:0}
@keyframes curtain-rustle{0%,100%{transform:scaleX(1.01) skewX(0)}35%{transform:scaleX(1.02) skewX(.45deg)}65%{transform:scaleX(1.01) skewX(-.35deg)}}
.video-wrap[data-curtain=covered] .curtain-panel{transition:none;opacity:1;transform:translate3d(0,0,0)}
.video-wrap[data-curtain=open] .curtain-panel{transform:translate3d(102%,0,0)}
.curtain-logo{transition:opacity .4s ease;position:absolute;inset:0 0 18% 0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:#f2efe9;text-shadow:0 1px 2px rgba(0,0,0,.5)}
.curtain-logo img{width:clamp(52px,9vw,72px);height:auto;filter:drop-shadow(0 1px 2px rgba(0,0,0,.5))}
.curtain-logo span{font-size:clamp(28px,5vw,40px);font-weight:600;letter-spacing:-.02em}

/* Start: one obvious action on the closed curtain. */
.start-wrap{position:absolute;left:16px;right:16px;bottom:max(9%,28px);z-index:4;display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center}
.video-wrap:not([data-curtain=idle]) .start-wrap{display:none}
.start-button{min-height:56px;min-width:min(280px,100%);padding:14px 28px;border:0;border-radius:10px;font:inherit;font-size:1.125rem;font-weight:600;color:#fff;background:linear-gradient(135deg,#7c3aed 0%,#0071e3 100%);cursor:pointer;touch-action:manipulation;box-shadow:0 8px 24px rgba(0,113,227,.35);transition:transform .15s ease,box-shadow .15s ease}
.start-button:hover{box-shadow:0 10px 28px rgba(0,113,227,.45)}
.start-button:disabled{opacity:.6;cursor:default}
.start-button:active{transform:scale(.97)}
.start-button:focus-visible,.conversation-toolbar button:focus-visible,.live-brand:focus-visible{outline:3px solid #fff;outline-offset:3px}
.start-note{margin:0;font-size:.9375rem;line-height:1.4;color:#e6e3de;text-shadow:0 1px 2px rgba(0,0,0,.5)}

/* Status overlay never moves anything: it floats inside the stage. */
.video-wrap #placeholder{position:absolute;left:50%;bottom:max(9%,24px);transform:translateX(-50%);z-index:3;margin:0;max-width:calc(100% - 32px);width:max-content;
  padding:10px 16px;border-radius:12px;background:#1c1c1e;color:#fff;box-shadow:0 4px 16px rgba(0,0,0,.35);font-size:1rem;line-height:1.4;text-align:center}
.video-wrap[data-curtain=idle] #placeholder,.video-wrap[data-curtain=peek] #placeholder{opacity:0}
.video-wrap[data-curtain=idle] #placeholder{display:none}

/* Persistent brand inside the live scene (lower left); the curtain carries it before. */
.scene-branding{position:absolute;left:16px;bottom:12px;z-index:1;pointer-events:none;color:#fff;filter:drop-shadow(0 1px 2px #171717);opacity:0;transition:opacity .4s ease}
.video-wrap[data-curtain=done] .scene-branding{opacity:1}
.scene-branding span{font-size:clamp(16px,2.4vw,20px);font-weight:600;letter-spacing:-.02em}

/* Conversation controls: glass chrome, only during a session, fixed so they never resize the stage. */
.conversation-toolbar{position:fixed;left:50%;bottom:max(16px,env(safe-area-inset-bottom));transform:translateX(-50%);z-index:10;display:flex;align-items:center;gap:6px;padding:5px;border:1px solid rgba(255,255,255,.14);border-radius:14px;background:rgba(28,28,30,.72);color:#fff;box-shadow:0 8px 24px rgba(0,0,0,.35)}
@supports ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){.conversation-toolbar{-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}}
body[data-session=off] .conversation-toolbar{display:none}
.conversation-toolbar button{display:grid;place-items:center;min-width:44px;min-height:44px;border:0;border-radius:10px;padding:0 14px;background:transparent;color:inherit;font:inherit;font-size:.9375rem;font-weight:600;cursor:pointer;touch-action:manipulation}
.conversation-toolbar button:disabled{opacity:.5;cursor:default}
.conversation-toolbar button{transition:transform .12s ease,background-color .12s ease}.conversation-toolbar button:active:not(:disabled){transform:scale(.94);background:rgba(255,255,255,.12)}.live-brand{transition:opacity .12s ease}.live-brand:active{opacity:.7}
.conversation-toolbar #mic{width:44px;padding:0}
.conversation-toolbar svg{width:22px;height:22px}
#mic .mic-off{display:none}#mic[aria-pressed=true] .mic-on{display:none}#mic[aria-pressed=true] .mic-off{display:block;color:#ff6961}
.end-button{color:#ff6961!important}

/* Required brand presence, kept out of the stage's way. */
.live-top,.live-bottom{background:none!important;border:0!important;box-shadow:none!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;display:block;position:fixed;left:0;right:0;z-index:5;padding:10px max(16px,env(safe-area-inset-left));font-size:14px;color:rgba(255,255,255,.78);pointer-events:none}
.live-top{top:max(0px,env(safe-area-inset-top))}.live-bottom{bottom:max(0px,env(safe-area-inset-bottom));text-align:right}
.live-brand{display:inline-flex;align-items:center;gap:8px;min-height:44px;color:inherit;text-decoration:none;font-weight:600;letter-spacing:-.01em;pointer-events:auto}.live-brand img{width:22px;height:22px}
body[data-session=on] .live-bottom{display:none}


.live-challenge{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:30}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important}.start-button:active{transform:none}}
.video-wrap:not([data-curtain=idle]) .curtain-logo{opacity:0}
/* With the peek film, its held final frame IS the curtain: the film slides away at the reveal, so the
   curtain never changes pixels (no still-image swap, no blink). The cloth panel covers only the idle
   state and the reduced-motion path. */
.video-wrap[data-film=true] #waiting-video{z-index:1;will-change:transform;backface-visibility:hidden;transform:translate3d(0,0,0);transition:transform .8s cubic-bezier(.22,.7,.2,1)}
.video-wrap[data-film=true][data-curtain=open] #waiting-video{transform:translate3d(102%,0,0)}
.video-wrap[data-film=true][data-curtain=done] #waiting-video{visibility:hidden}
.video-wrap[data-film=true]:not([data-curtain=idle]) .curtain-panel{opacity:0}
.start-note[data-problem=true]{padding:10px 14px;border-radius:12px;background:#1c1c1e;color:#fff;font-weight:600;box-shadow:0 4px 16px rgba(0,0,0,.35);text-shadow:none}
