/* Vitaly: full-screen orb over the dimmed body, and the small launcher in the corner. */

.vitaly { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(3, 12, 14, .86); backdrop-filter: blur(3px); opacity: 0; transition: opacity .35s var(--ease); color: #d8f5f1; --v: 63, 214, 198; }
.vitaly.on { opacity: 1; }
.vitaly[data-level="warning"] { --v: 227, 155, 45; background: rgba(18, 12, 3, .86); }
.vitaly[data-level="emergency"] { --v: 224, 68, 46; background: rgba(20, 5, 3, .88); }
.v-orb { position: absolute; inset: 0; width: 100%; height: 100%; }

.v-text { position: absolute; left: 50%; top: 70%; transform: translateX(-50%); width: min(720px, calc(100vw - 32px)); text-align: center; }
.v-status { font: 600 13px var(--cond); letter-spacing: .3em; text-transform: uppercase; color: rgb(var(--v)); }
.v-say { margin-top: 12px; font: 400 22px/1.4 var(--sans); color: #fff; min-height: 1.4em; }
.v-heard { margin-top: 10px; font: 400 15px/1.4 var(--sans); color: rgba(255, 255, 255, .5); font-style: italic; min-height: 1.4em; }

/* Guide: the steps, with the current one lit */
.v-guide { position: absolute; right: 32px; top: 32px; bottom: 120px; width: 340px; overflow-y: auto; scrollbar-width: thin; font: 400 14px/1.45 var(--sans); color: rgba(255, 255, 255, .55); }
.v-guide:empty { display: none; }
.v-guide ol { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.v-guide li { counter-increment: step; position: relative; padding: 9px 10px 9px 38px; border-left: 2px solid rgba(255, 255, 255, .12); }
.v-guide li::before { content: counter(step); position: absolute; left: 12px; top: 9px; font: 600 14px var(--cond); color: rgba(255, 255, 255, .4); }
.v-guide li.done { color: rgba(255, 255, 255, .3); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .2); }
.v-guide li.now { color: #fff; border-left-color: rgb(var(--v)); background: rgba(var(--v), .12); }
.v-guide li.now::before { color: rgb(var(--v)); }
.v-bar { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); display: flex; gap: 10px; }
.v-bar button { font: 600 13px var(--cond); letter-spacing: .16em; text-transform: uppercase; padding: 9px 18px; border: 1px solid rgba(255, 255, 255, .3); color: #fff; background: transparent; cursor: pointer; }
.v-bar button.main { background: rgb(var(--v)); border-color: rgb(var(--v)); color: #071214; padding: 9px 34px; }

.v-confirm { position: absolute; left: 50%; top: calc(70% + 150px); transform: translateX(-50%); display: flex; gap: 12px; }
.v-confirm button { font: 600 14px var(--cond); letter-spacing: .16em; text-transform: uppercase; padding: 10px 26px; border: 1px solid rgb(var(--v)); color: #fff; background: transparent; cursor: pointer; }
.v-confirm button:first-child { background: rgb(var(--v)); color: #071214; }

.v-type { position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%); width: min(460px, calc(100vw - 32px)); }
.v-type input { width: 100%; padding: 12px 16px; font: 400 15px var(--sans); color: #fff; background: rgba(255, 255, 255, .06); border: 1px solid rgba(var(--v), .4); outline: none; }
.v-type input:focus { border-color: rgb(var(--v)); }
.v-type input::placeholder { color: rgba(255, 255, 255, .4); }
.v-close { position: absolute; left: 32px; top: 28px; font: 600 12px var(--cond); letter-spacing: .2em; color: rgba(255, 255, 255, .6); background: none; border: 1px solid rgba(255, 255, 255, .25); padding: 6px 12px; cursor: pointer; }

/* Launcher: bottom-left pill, glows when the wake word is listening. */
.v-launch { position: fixed; left: 24px; bottom: 18px; z-index: 25; display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 10px; font: 600 12px var(--cond); letter-spacing: .18em; text-transform: uppercase; color: #d8f5f1; background: #071214; border: 1px solid rgba(63, 214, 198, .5); cursor: pointer; }
.v-launch i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #3fd6c6; }
.v-launch.listening i { background: #3fd6c6; animation: v-breathe 2.4s ease-in-out infinite; }
.v-launch em { font-style: normal; font-weight: 500; color: rgba(255, 255, 255, .5); border: 1px solid rgba(255, 255, 255, .25); padding: 0 5px; }
@keyframes v-breathe { 50% { opacity: .35; transform: scale(.8); } }

@media (max-width: 900px) {
  .v-guide { left: 16px; right: 16px; top: 64px; bottom: auto; max-height: 30vh; width: auto; }
  .v-say { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .v-launch.listening i { animation: none; } }

/* `hidden` must win over the display rules above, or the closed overlay would still block clicks. */
.vitaly[hidden], .v-confirm[hidden], .v-bar[hidden] { display: none; }

/* Shown only when a line had to use Chrome's voice (Deepgram unreachable). */

/* Alert: questions to ask Vitaly, under the steps. */

/* Alert: the copy of the readings on its way to Earth, and the reply coming back. */
.v-earth { position: absolute; left: 32px; top: 96px; width: 300px; padding: 16px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(0, 0, 0, .28); font: 400 14px/1.45 var(--sans); color: rgba(255, 255, 255, .6); }
.v-earth[hidden] { display: none; }
.v-earth .v-h { font: 600 12px var(--cond); letter-spacing: .2em; text-transform: uppercase; color: rgb(var(--v)); margin: 0 0 12px; }
.v-track-ends { display: flex; justify-content: space-between; font: 600 11px var(--cond); letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .45); }
.v-track { height: 3px; margin: 6px 0 14px; background: rgba(255, 255, 255, .14); }
.v-track i { display: block; height: 100%; background: rgb(var(--v)); transition: width .5s linear; }
.v-earth-head { font: 600 22px/1.15 var(--cond); letter-spacing: .03em; color: #fff; }
.v-earth-sub { margin-top: 4px; color: rgba(255, 255, 255, .8); font-variant-numeric: tabular-nums; }
.v-earth-note { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .12); }
.v-earth-demo { margin-top: 8px; font: 500 11px var(--cond); letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .35); }
.v-earth[data-stage="replied"] .v-track i { width: 100% !important; opacity: .35; }
@media (max-width: 900px) { .v-earth { display: none; } }

/* Docked: Vitaly moves to a panel on the left so the body can zoom to what's wrong (vitaly-body.js).
   Same pieces as the full-screen view, stacked top to bottom: orb, what was said, steps, buttons. */
.vitaly.docked, .vitaly.docked[data-level] {
  inset: 88px auto 52px 24px; width: 380px; display: flex; flex-direction: column; place-items: initial;
  padding: 0 18px 16px; overflow: hidden; backdrop-filter: none;
  background: rgba(3, 12, 14, .94); border: 1px solid rgba(var(--v), .45);
}
.vitaly.docked .v-orb { position: relative; inset: auto; flex: none; height: 120px; }
.vitaly.docked .v-text { position: static; transform: none; width: auto; text-align: left; }
.vitaly.docked .v-say { margin-top: 8px; font-size: 17px; }
.vitaly.docked .v-heard { font-size: 14px; }
.vitaly.docked .v-guide { position: static; flex: 1; min-height: 0; width: auto; margin-top: 12px; }
.vitaly.docked .v-guide:empty { display: block; }
.vitaly.docked .v-earth { position: static; width: auto; margin-top: 12px; padding: 12px; }
.vitaly.docked .v-earth[hidden] { display: none; }
.vitaly.docked .v-earth-head { font-size: 17px; }
.vitaly.docked .v-bar, .vitaly.docked .v-confirm, .vitaly.docked .v-type { position: static; transform: none; margin-top: 12px; }
.vitaly.docked .v-bar[hidden], .vitaly.docked .v-confirm[hidden] { display: none; }
.vitaly.docked .v-bar button { padding: 8px 12px; letter-spacing: .1em; }
.vitaly.docked .v-bar button.main { padding: 8px 20px; }
.vitaly.docked .v-type { width: auto; }
.vitaly.docked .v-close { left: auto; right: 12px; top: 12px; }
@media (max-width: 900px) {
  .vitaly.docked, .vitaly.docked[data-level] { inset: auto 8px 8px 8px; width: auto; max-height: 52vh; }
  .vitaly.docked .v-orb { height: 70px; }
  .vitaly.docked .v-earth { display: none; }
}
/* The solar storm banner sits across the top: keep the docked panel below it. */
body:has(.storm-alert.in) .vitaly.docked { top: 276px; }
@media (max-width: 900px) { body:has(.storm-alert.in) .vitaly.docked { top: auto; } }
body:has(.storm-alert.in) .vitaly.docked .v-orb { display: none; }
.vitaly.docked .v-text { padding-top: 14px; }
.vitaly.docked .v-guide { min-height: 120px; }
.vitaly.docked .v-earth-note, .vitaly.docked .v-earth-demo { display: none; }
.vitaly.docked .v-status { padding-right: 64px; }

/* "Ask Vitaly" on the Body view (bottom left): the orb with its name. It reacts as the cursor comes near; click opens Vitaly. */
.vcall { display: flex; flex-direction: column; align-items: flex-start; margin: 0 0 0 -24px; padding: 0; background: none; border: 0; cursor: pointer; }
.vcall-label { font: 700 16px var(--cond); letter-spacing: .2em; text-transform: uppercase; color: #0a1f6b; white-space: nowrap; transition: color .3s; }
.vcall:hover .vcall-label, .vcall:focus-visible .vcall-label { color: #1846c4; }
.vcall-text { display: flex; flex-direction: column; gap: 6px; margin: -18px 0 0 24px; text-align: left; }   /* under the orb, lined up with the panel edge */
.vcall-hint { font: 400 14px var(--sans); font-style: normal; color: var(--soft); white-space: nowrap; }
.vcall-orb { width: 240px; height: 240px; display: block; margin-bottom: 0; }
.vcall:focus-visible { outline: 2px solid #1846c4; outline-offset: -12px; border-radius: 50%; }
/* The Body view has the orb, so the small launcher pill is only shown on the other screens. */
body:not(.injury-on):has(#view-body.on) .v-launch { display: none; }
