/* ==========================================================================
   ASTRA × Grok Voice AI + 6-Language Unified Showcase Overlay Stylesheet
   Designed cleanly for / (Showcase Journey), /demo/ (Watch+iPhone), & /studio
   ========================================================================== */

:root {
  --gvw-glass: rgba(9, 15, 25, 0.84);
  --gvw-glass-deep: rgba(6, 11, 19, 0.94);
  --gvw-border: rgba(243, 245, 242, 0.14);
  --gvw-border-hi: rgba(56, 189, 248, 0.42);
  --gvw-text: #f3f5f2;
  --gvw-muted: rgba(243, 245, 242, 0.68);
  --gvw-amber: #ffb347;
  --gvw-cyan: #38bdf8;
  --gvw-mint: #5fd3a6;
  --gvw-violet: #a78bfa;
  --gvw-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --gvw-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

/* Unified Navigation & Language Cluster injected cleanly inside header.bar on / */
.astra-nav-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  margin-inline: 8px;
}

.astra-pill-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 99px;
  font: 600 0.81rem/1.2 var(--gvw-sans);
  color: var(--gvw-muted);
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.astra-pill-link:hover {
  color: var(--gvw-text);
  background: rgba(243, 245, 242, 0.08);
  border-color: rgba(243, 245, 242, 0.18);
}

.astra-pill-link.is-active {
  color: var(--gvw-text);
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.34);
}

.astra-pill-link.is-amber {
  color: #191003;
  background: var(--gvw-amber);
  border-color: var(--gvw-amber);
}

.astra-pill-link.is-amber:hover {
  background: #ffc368;
  border-color: #ffc368;
  color: #191003;
}

.astra-bar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Clean 6-Language Switcher */
.astra-lang-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--gvw-border);
  background: rgba(243, 245, 242, 0.07);
  color: var(--gvw-text);
  font: 600 0.78rem/1 var(--gvw-mono);
}

.astra-lang-select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding-right: 4px;
  outline: none;
}

.astra-lang-select option {
  background: #0b121e;
  color: #f3f5f2;
}

.astra-voice-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 99px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.24), rgba(167, 139, 250, 0.22));
  color: #f8fafc;
  font: 600 0.8rem/1.1 var(--gvw-sans);
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.astra-voice-nav-btn:hover {
  transform: translateY(-1px);
  border-color: var(--gvw-cyan);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.34);
}

.astra-orb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gvw-cyan);
  box-shadow: 0 0 8px var(--gvw-cyan), 0 0 16px rgba(167, 139, 250, 0.7);
  animation: astraPulseDot 2.1s ease-in-out infinite;
}

@keyframes astraPulseDot {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.32); opacity: 1; }
}

/* Top-Left Unified Dock on /demo/ so it sits cleanly opposite Restart / Close */
.astra-demo-dock {
  position: fixed;
  top: 10px;
  left: max(18px, 3vw);
  z-index: 65;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 99px;
  background: var(--gvw-glass);
  border: 1px solid var(--gvw-border);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  color: var(--gvw-text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

body.astra-demo-page .xp {
  padding-top: 62px;
}

.astra-narrate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.12);
  color: inherit;
  border-radius: 99px;
  padding: 9px 14px;
  font: 600 0.84rem/1 var(--gvw-sans);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.astra-narrate-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.28), rgba(167, 139, 250, 0.25));
  border-color: var(--gvw-cyan);
  color: #38bdf8;
}

/* Floating Grok Voice AI Launcher Pill + Expanded Copilot Drawer */
.astra-grok-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  border-radius: 99px;
  background: var(--gvw-glass-deep);
  border: 1px solid rgba(56, 189, 248, 0.42);
  backdrop-filter: blur(20px) saturate(165%);
  -webkit-backdrop-filter: blur(20px) saturate(165%);
  color: #f8fafc;
  font: 600 0.85rem/1.1 var(--gvw-sans);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.48), 0 0 28px rgba(56, 189, 248, 0.18);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.astra-grok-launcher:hover {
  transform: translateY(-2px);
  border-color: var(--gvw-cyan);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.56), 0 0 34px rgba(56, 189, 248, 0.32);
}

.astra-grok-launcher .astra-mini-bars {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
  height: 16px;
}

.astra-grok-launcher .astra-mini-bars i {
  display: block;
  width: 2.5px;
  height: 6px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gvw-cyan), var(--gvw-violet));
  animation: astraBarWave 1.3s ease-in-out infinite;
}

.astra-grok-launcher .astra-mini-bars i:nth-child(2) { animation-delay: 0.18s; height: 12px; }
.astra-grok-launcher .astra-mini-bars i:nth-child(3) { animation-delay: 0.36s; height: 9px; }
.astra-grok-launcher .astra-mini-bars i:nth-child(4) { animation-delay: 0.54s; height: 14px; }

@keyframes astraBarWave {
  0%, 100% { transform: scaleY(0.55); opacity: 0.72; }
  50% { transform: scaleY(1.15); opacity: 1; }
}

.astra-grok-drawer {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9650;
  width: min(410px, calc(100vw - 24px));
  max-height: min(650px, calc(100dvh - 88px));
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: var(--gvw-glass-deep);
  border: 1px solid rgba(243, 245, 242, 0.16);
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.65), 0 0 42px rgba(56, 189, 248, 0.14);
  backdrop-filter: blur(24px) saturate(165%);
  -webkit-backdrop-filter: blur(24px) saturate(165%);
  color: var(--gvw-text);
  font-family: var(--gvw-sans);
  overflow: hidden;
  animation: astraDrawerIn 0.24s cubic-bezier(0.2, 0.75, 0.2, 1);
}

.astra-grok-drawer[hidden],
.astra-grok-launcher[hidden] {
  display: none !important;
}

@keyframes astraDrawerIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.astra-gd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(243, 245, 242, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.astra-gd-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.astra-gd-title strong {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.astra-gd-badge {
  font: 600 0.65rem/1 var(--gvw-mono);
  padding: 3px 7px;
  border-radius: 99px;
  background: rgba(95, 211, 166, 0.15);
  color: var(--gvw-mint);
  border: 1px solid rgba(95, 211, 166, 0.35);
  text-transform: uppercase;
}

.astra-gd-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.astra-gd-iconbtn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 99px;
  border: 1px solid rgba(243, 245, 242, 0.14);
  background: rgba(243, 245, 242, 0.06);
  color: var(--gvw-text);
  font-size: 0.86rem;
  cursor: pointer;
}

.astra-gd-iconbtn:hover {
  background: rgba(243, 245, 242, 0.14);
}

/* Persona + Language Row */
.astra-gd-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(243, 245, 242, 0.08);
  background: rgba(7, 13, 20, 0.45);
}

.astra-gd-select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(243, 245, 242, 0.14);
  background: rgba(243, 245, 242, 0.06);
  color: var(--gvw-text);
  padding: 5px 9px;
  font: 500 0.76rem/1.3 var(--gvw-sans);
  outline: none;
  cursor: pointer;
}

.astra-gd-select option {
  background: #0b121e;
  color: #f3f5f2;
}

/* Microphone / speaker pickers and hands-free toggle */
.astra-gd-io {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 6px;
  padding: 7px 14px;
  border-bottom: 1px solid rgba(243, 245, 242, 0.08);
  background: rgba(7, 13, 20, 0.45);
}

.astra-io-field {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--gvw-muted);
}

.astra-io-field svg {
  flex: none;
}

.astra-io-field .astra-gd-select {
  min-width: 0;
  padding: 4px 7px;
  font-size: 0.72rem;
  text-overflow: ellipsis;
}

.astra-gd-select:disabled {
  opacity: 0.7;
  cursor: default;
}

.astra-gd-select:focus-visible,
.astra-hf-btn:focus-visible,
.astra-mic-btn:focus-visible {
  outline: 2px solid var(--gvw-cyan);
  outline-offset: 2px;
}

.astra-hf-btn {
  border-radius: 10px;
  border: 1px solid rgba(243, 245, 242, 0.2);
  background: rgba(243, 245, 242, 0.06);
  color: var(--gvw-text);
  padding: 4px 9px;
  font: 600 0.72rem/1.3 var(--gvw-sans);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.astra-hf-btn[aria-pressed="true"] {
  background: rgba(95, 211, 166, 0.18);
  border-color: var(--gvw-mint);
  color: var(--gvw-mint);
}

/* 60-FPS Plasma Orb Visualizer */
.astra-orb-stage {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(243, 245, 242, 0.08);
  background: radial-gradient(circle at 20% 50%, rgba(56, 189, 248, 0.13), transparent 62%);
}

#astraVoiceCanvas {
  width: 82px;
  height: 82px;
  flex: none;
  display: block;
}

.astra-orb-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.astra-orb-state {
  font: 600 0.7rem/1.2 var(--gvw-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gvw-cyan);
}

.astra-orb-caption {
  font-size: 0.8rem;
  line-height: 1.38;
  color: var(--gvw-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 1-Tap Judge Prompts */
.astra-gd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(243, 245, 242, 0.08);
}

.astra-chip-btn {
  border: 1px solid rgba(243, 245, 242, 0.16);
  background: rgba(243, 245, 242, 0.05);
  color: #e2e8f0;
  border-radius: 99px;
  padding: 5px 10px;
  font: 500 0.74rem/1.25 var(--gvw-sans);
  cursor: pointer;
  text-align: left;
  transition: background-color 0.16s, border-color 0.16s;
}

.astra-chip-btn:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.45);
  color: #fff;
}

/* Multi-turn Messages */
.astra-gd-messages {
  flex: 1 1 auto;
  min-height: 145px;
  max-height: 240px;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  scrollbar-width: thin;
}

.astra-msg {
  max-width: 90%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 0.83rem;
  line-height: 1.44;
  word-wrap: break-word;
}

.astra-msg-user {
  align-self: flex-end;
  background: rgba(56, 189, 248, 0.22);
  border: 1px solid rgba(56, 189, 248, 0.36);
  color: #f8fafc;
  border-bottom-right-radius: 4px;
}

.astra-msg-ai {
  align-self: flex-start;
  background: rgba(243, 245, 242, 0.07);
  border: 1px solid rgba(243, 245, 242, 0.12);
  color: #f1f5f9;
  border-bottom-left-radius: 4px;
}

.astra-msg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.astra-tag-pill {
  font: 600 0.64rem/1.2 var(--gvw-mono);
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 179, 71, 0.14);
  color: var(--gvw-amber);
  border: 1px solid rgba(255, 179, 71, 0.3);
}

.astra-tag-pill.is-cite {
  background: rgba(95, 211, 166, 0.12);
  color: var(--gvw-mint);
  border-color: rgba(95, 211, 166, 0.28);
}

/* Composer */
.astra-gd-form {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 12px;
  border-top: 1px solid rgba(243, 245, 242, 0.1);
  background: rgba(7, 13, 20, 0.72);
}

.astra-mic-btn {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 99px;
  border: 1px solid rgba(243, 245, 242, 0.2);
  background: rgba(243, 245, 242, 0.08);
  color: #f8fafc;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

/* The ring grows with the live input level, so the person can see the microphone hears them. */
.astra-mic-btn.is-listening {
  background: rgba(239, 68, 68, 0.28);
  border-color: #f87171;
  box-shadow: 0 0 0 calc(2px + var(--mic-level, 0) * 12px) rgba(248, 113, 113, 0.32), 0 0 18px rgba(239, 68, 68, 0.45);
  transition: box-shadow 0.06s linear;
}

.astra-gd-input {
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 99px;
  border: 1px solid rgba(243, 245, 242, 0.16);
  background: rgba(243, 245, 242, 0.06);
  color: #f8fafc;
  padding: 8px 13px;
  font: 500 0.82rem/1.3 var(--gvw-sans);
  outline: none;
}

.astra-gd-input:focus {
  border-color: var(--gvw-cyan);
}

.astra-send-btn {
  flex: none;
  border: 0;
  border-radius: 99px;
  padding: 8px 14px;
  background: var(--gvw-amber);
  color: #191003;
  font: 700 0.8rem/1.2 var(--gvw-sans);
  cursor: pointer;
}

.astra-send-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* Inline Film Dialog on /demo/ & /studio when triggered outside / */
dialog.astra-film-modal {
  padding: 0;
  border: 1px solid rgba(243, 245, 242, 0.18);
  border-radius: 20px;
  background: #070d14;
  color: #f3f5f2;
  width: min(880px, calc(100vw - 32px));
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8);
}

dialog.astra-film-modal::backdrop {
  background: rgba(3, 6, 12, 0.78);
  backdrop-filter: blur(8px);
}

dialog.astra-film-modal video {
  display: block;
  width: 100%;
  max-height: 75dvh;
  background: #000;
}

dialog.astra-film-modal .astra-film-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  font: 600 0.85rem/1.2 var(--gvw-sans);
}

/* Responsive adjustments */
@media (max-width: 1080px) {
  .astra-nav-pills .astra-hide-md {
    display: none;
  }
}

@media (max-width: 860px) {
  .astra-nav-pills {
    display: none;
  }
  .astra-demo-dock {
    display: none;
  }
  .astra-grok-launcher {
    right: 12px;
    bottom: 72px;
    padding: 8px 13px;
  }
  .astra-grok-drawer {
    right: 10px;
    bottom: 72px;
    width: calc(100vw - 20px);
    max-height: 72dvh;
  }
}

/* Inside the workstation header the language picker and Grok Voice button take the
   workstation's own tokens, so they stay readable in both the light and dark theme. */
.topbar .astra-lang-wrap {
  border-color: var(--border-control);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.topbar .astra-lang-select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.topbar .astra-lang-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.topbar .astra-voice-nav-btn {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text-primary);
  box-shadow: none;
}

.topbar .astra-voice-nav-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.topbar .astra-orb-dot {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}
