/* The stage: what the visitor sees after pressing Talk or Make a song.
   Uses the landing page's tokens (--bg, --text, --muted, --orange, --pink, --line, --font, --ease). */

#stage { position: fixed; inset: 0; z-index: 20; background: #000; overflow: hidden;
         opacity: 0; transition: opacity .7s var(--ease); }
#stage.on { opacity: 1; }
#stage[hidden] { display: none; }

/* a 16:9 frame that always covers the window; everything inside is placed in fractions of it */
.frame { position: absolute; left: 50%; top: 50%; width: max(100vw, 177.78vh); aspect-ratio: 16 / 9;
         transform: translate(-50%, -50%); overflow: hidden; }
.frame video.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
                  opacity: 0; transition: opacity .9s var(--ease); }
.frame video.bg.on { opacity: 1; }
#st-mascot { position: absolute; left: 50%; aspect-ratio: 640 / 952; transform: translateX(-50%);
             transition: height .9s var(--ease), bottom .9s var(--ease), filter .9s var(--ease); }
#st-band { position: absolute; left: 0; bottom: 0; width: 100%; }

/* the stage's two side screens */
.screen { position: absolute; top: 16.4%; height: 27.2%; width: 20.6%; padding: 1.1% 1.3%;
          display: flex; flex-direction: column; justify-content: center; gap: .5em;
          color: #fff; text-align: center; font-size: clamp(11px, 1.15vw, 22px); line-height: 1.25;
          opacity: 0; transition: opacity .6s var(--ease); pointer-events: none; overflow: hidden; isolation: isolate; }
.screen.left { left: 16.2%; } .screen.right { left: 63.4%; }
.screen.on { opacity: 1; }
.screen::before { content: ""; position: absolute; inset: 0; background: rgba(10, 8, 12, .62); z-index: -1; }
.screen .k { font-size: .72em; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--orange); }
.screen .big { font-size: 1.5em; font-weight: 800; letter-spacing: -.02em; line-height: 1.08; }
.screen .sub { opacity: .8; }
.screen .lines { display: flex; flex-direction: column; gap: .18em; font-size: .86em; font-weight: 600; }
.screen .lines span { opacity: 0; transform: translateY(.4em); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.screen .lines span.in { opacity: .92; transform: none; }
.kara { font-size: 1.45em; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.kara.next { font-size: 1em; font-weight: 600; opacity: .55; }
.kara span { color: rgba(255, 255, 255, .45); transition: color .12s linear; }
.kara span.on { color: #fff; }

/* heads-up display */
.hud-top { position: absolute; inset: 0 0 auto 0; z-index: 3; display: flex; align-items: center; gap: 10px;
           padding: clamp(18px, 3vh, 30px) var(--pad);
           background: linear-gradient(to bottom, rgba(0, 0, 0, .55), transparent); }
.hud-top .logo { height: clamp(22px, 3vh, 28px); margin-right: auto; }
.chip { font: inherit; font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer;
        padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line); background: rgba(22, 20, 18, .55);
        backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
        transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease); }
.chip:hover { border-color: rgba(243, 237, 228, .4); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #161412; }
.chip.end:hover { background: #d8452f; border-color: #d8452f; color: #fff; }
.chip[hidden] { display: none; }

.hud-bottom { position: absolute; inset: auto 0 0 0; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 14px;
              padding: 6vh var(--pad) clamp(18px, 3.2vh, 32px);
              background: linear-gradient(to top, rgba(0, 0, 0, .72), rgba(0, 0, 0, .35) 60%, transparent); }
.caption { min-height: 2.7em; max-width: min(880px, 90vw); text-align: center;
           font-size: clamp(17px, 2.5vh, 24px); font-weight: 600; line-height: 1.35; letter-spacing: -.01em;
           text-shadow: 0 2px 14px rgba(0, 0, 0, .7); transition: opacity .3s var(--ease); }
.caption.you { color: rgba(243, 237, 228, .72); font-weight: 500; }
.caption.lyric { font-size: clamp(22px, 3.6vh, 36px); font-weight: 800; letter-spacing: -.02em; }
.caption.lyric span { color: rgba(255, 255, 255, .45); transition: color .12s linear; }
.caption.lyric span.on { color: #fff; }
.song-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: min(980px, 94vw); }
.song-form[hidden] { display: none; }
.song-form .lead { font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 4px; }
.song-form input { font: inherit; font-size: 14.5px; font-weight: 500; color: var(--text); width: 190px; padding: 11px 16px; border-radius: 999px;
                   border: 1px solid var(--line); background: rgba(22, 20, 18, .7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
                   transition: border-color .2s var(--ease), background .2s var(--ease); }
.song-form input#st-f-occasion { width: 240px; }
.song-form input#st-f-vibe { width: 150px; }
.song-form input::placeholder { color: rgba(243, 237, 228, .45); }
.song-form input:focus { outline: none; border-color: var(--pink); background: rgba(22, 20, 18, .88); }
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }

.pill { display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 12px; border-radius: 999px;
        font-size: 13.5px; font-weight: 600; background: rgba(22, 20, 18, .6); border: 1px solid var(--line);
        backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); min-width: 138px; }
.pill i { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); transition: background .25s var(--ease), box-shadow .25s var(--ease); }
.pill[data-state="listening"] i { background: #5ad17a; box-shadow: 0 0 0 0 rgba(90, 209, 122, .6); animation: pulse 1.6s ease-out infinite; }
.pill[data-state="thinking"] i { background: var(--orange); animation: blinkdot .7s ease-in-out infinite alternate; }
.pill[data-state="speaking"] i { background: var(--orange); box-shadow: 0 0 12px var(--orange); }
.pill[data-state="singing"] i { background: var(--pink); box-shadow: 0 0 12px var(--pink); }
.pill[data-state="muted"] i { background: #d8452f; }
@keyframes pulse { to { box-shadow: 0 0 0 9px rgba(90, 209, 122, 0); } }
@keyframes blinkdot { to { opacity: .35; } }

.btn { font: inherit; font-size: 14.5px; font-weight: 700; color: var(--text); cursor: pointer;
       padding: 11px 20px; border-radius: 999px; border: 1px solid var(--line); background: rgba(22, 20, 18, .6);
       backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
       transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease); }
.btn:hover { transform: translateY(-1px); border-color: rgba(243, 237, 228, .4); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #1a0e06; }
.btn.primary:hover { background: #ff7a35; border-color: #ff7a35; }
.btn.song { background: var(--pink); border-color: var(--pink); color: #24070f; }
.btn[aria-pressed="true"] { background: #d8452f; border-color: #d8452f; color: #fff; }
.btn[hidden] { display: none; }
.btn:focus-visible, .chip:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

/* waking up / ended */
.st-overlay { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; text-align: center; padding: 24px;
              background: rgba(8, 7, 6, .8); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
              opacity: 0; pointer-events: none; transition: opacity .5s var(--ease); }
.st-overlay.on { opacity: 1; pointer-events: auto; }
.st-overlay.soft { background: none; backdrop-filter: none; -webkit-backdrop-filter: none; z-index: 2; place-items: end center; padding-bottom: 19vh; pointer-events: none; }
.st-overlay.soft .wake { padding: 10px 18px; border-radius: 999px; background: rgba(22, 20, 18, .7); border: 1px solid var(--line); }
.st-overlay h2 { margin: 0 0 10px; font-size: clamp(24px, 4vh, 40px); font-weight: 800; letter-spacing: -.03em; }
.st-overlay p { margin: 0 0 22px; color: var(--muted); font-size: clamp(14px, 2vh, 17px); max-width: 460px; }
.st-overlay .wake { font-size: clamp(15px, 2.1vh, 18px); font-weight: 600; }
.dots::after { content: ""; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

@media (max-width: 640px) {
  .hud-top { gap: 6px; }
  .chip { padding: 8px 11px; font-size: 12.5px; }
  .screen { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  #stage, .frame video.bg, #st-mascot { transition: none; }
}
