/* Voice chat — own page, Gemini-style premium intro */
:root {
  --voice-bg: #f6f6f4;
  --voice-panel: #ffffff;
  --voice-line: #e2e2dc;
  --voice-text: #20242a;
  --voice-muted: #6b7280;
  --voice-accent: #1e6b52;
  --voice-accent-dim: #e2efe8;
}

body.voice {
  background: var(--voice-bg);
  color: var(--voice-text);
  overflow: hidden;
}

.voice-app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.voice-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--voice-line);
  background: rgba(246,246,244,0.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 2;
}
.voice-head .back {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--voice-line);
  background: var(--voice-panel);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--voice-text);
}
.voice-head .back:hover { border-color: var(--voice-accent); color: var(--voice-accent); }
.voice-head .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.voice-head .brand .nx-logo { width: 26px; height: 26px; }
.voice-head .spacer { flex: 1; }
.voice-head .pill {
  font-size: 12px; color: var(--voice-muted);
  background: var(--voice-panel); border: 1px solid var(--voice-line);
  border-radius: 999px; padding: 6px 12px;
}

/* Intro — premium feel */
.voice-intro {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 32px;
  text-align: center;
  overflow-y: auto;
}
.voice-intro[hidden] { display: none !important; }

.orb-hero {
  width: 132px; height: 132px;
  border-radius: 50%;
  background: radial-gradient(120% 120% at 30% 30%, #e2efe8 0%, #ffffff 35%, #d6e8de 60%, #1e6b52 100%);
  box-shadow: 0 20px 60px rgba(30,107,82,0.25), inset 0 1px 0 rgba(255,255,255,0.9);
  position: relative;
  margin: 0 auto 28px;
  animation: heroFloat 4s ease-in-out infinite;
}
.orb-hero::before {
  content: '';
  position: absolute; inset: -12px;
  border-radius: 50%;
  background: radial-gradient(60% 60% at 50% 50%, rgba(30,107,82,0.15), transparent 70%);
  animation: heroPulse 2.8s ease-in-out infinite;
}
.orb-hero::after {
  content: '';
  position: absolute; inset: 22px;
  border-radius: 50%;
  background: radial-gradient(100% 100% at 30% 30%, rgba(255,255,255,0.9), rgba(255,255,255,0.2));
  filter: blur(0.5px);
}
@keyframes heroFloat { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-8px) scale(1.03); } }
@keyframes heroPulse { 0%,100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.12); opacity: 1; } }

.voice-title {
  font-family: var(--serif, Georgia, serif);
  font-size: clamp(28px, 6vw, 40px);
  line-height: 1.1;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.voice-title b { font-weight: 700; color: var(--voice-accent); }
.voice-sub {
  font-size: clamp(15px, 3.5vw, 18px);
  line-height: 1.5;
  color: var(--voice-muted);
  max-width: 520px;
  margin: 0 auto 24px;
}
.voice-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto 28px;
  text-align: left;
}
.vf {
  background: var(--voice-panel);
  border: 1px solid var(--voice-line);
  border-radius: 14px;
  padding: 12px 12px;
}
.vf-ic {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--voice-accent-dim); color: var(--voice-accent);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
}
.vf-ic svg { width: 16px; height: 16px; }
.vf-t { font-weight: 600; font-size: 13px; margin: 0 0 4px; }
.vf-d { font-size: 12px; color: var(--voice-muted); line-height: 1.4; }

.voice-start {
  border: 0; cursor: pointer;
  background: #17181a; color: #fff;
  border-radius: 999px;
  padding: 14px 26px;
  font: inherit; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.voice-start:hover { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(0,0,0,0.22); background: #000; }
.voice-start:active { transform: translateY(0); }
.voice-start .icon { width: 18px; height: 18px; }

.voice-note {
  margin-top: 18px;
  font-size: 11.5px; color: var(--voice-muted);
  max-width: 460px; line-height: 1.4;
}

/* Active voice UI */
.voice-active {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.voice-active[hidden] { display: none !important; }

.voice-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 20px;
  gap: 18px;
  min-height: 0;
}

.orb {
  width: min(62vw, 220px);
  height: min(62vw, 220px);
  border-radius: 50%;
  background: radial-gradient(120% 120% at 35% 30%, #ffffff 0%, #e8f1ec 30%, #cfe2d8 58%, #1e6b52 100%);
  box-shadow: 0 18px 50px rgba(30,107,82,0.22), inset 0 1px 0 rgba(255,255,255,0.9);
  position: relative;
  transition: transform .25s ease, box-shadow .25s ease;
}
.orb::before {
  content: ''; position: absolute; inset: -18px; border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(30,107,82,0.18), transparent 70%);
  opacity: 0; transition: opacity .3s;
}
.orb.listening { transform: scale(1.06); box-shadow: 0 22px 60px rgba(30,107,82,0.32), inset 0 1px 0 rgba(255,255,255,0.9); }
.orb.listening::before { opacity: 1; animation: orbListen 1.2s ease-in-out infinite; }
.orb.thinking { animation: orbThink 1.6s ease-in-out infinite; }
.orb.speaking { animation: orbSpeak 0.9s ease-in-out infinite; }

@keyframes orbListen { 0%,100% { transform: scale(1); opacity: 0.7; } 50% { transform: scale(1.14); opacity: 1; } }
@keyframes orbThink { 0%,100% { transform: scale(1) rotate(0deg); } 25% { transform: scale(1.04) rotate(1deg); } 75% { transform: scale(1.04) rotate(-1deg); } }
@keyframes orbSpeak { 0%,100% { transform: scale(1); } 30% { transform: scale(1.08); } 60% { transform: scale(0.98); } }

.orb-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border-radius: 50%;
  pointer-events: none;
}

.voice-status {
  font-size: 14px; color: var(--voice-muted);
  background: var(--voice-panel);
  border: 1px solid var(--voice-line);
  border-radius: 999px;
  padding: 7px 14px;
  min-height: 32px;
  display: inline-flex; align-items: center; gap: 8px;
  max-width: 90vw;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.voice-status b { color: var(--voice-text); font-weight: 600; }
.voice-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--voice-accent);
  box-shadow: 0 0 0 4px var(--voice-accent-dim);
  animation: dotPulse 1.4s ease-in-out infinite;
}
@keyframes dotPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.3); opacity: 0.8; } }

.voice-transcript {
  width: 100%;
  max-width: 720px;
  max-height: 34vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 4px;
  scrollbar-width: thin;
}
.vt {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px; line-height: 1.45;
  white-space: pre-wrap; word-break: break-word;
}
.vt.user { align-self: flex-end; background: #ebebe8; border-radius: 18px 18px 4px 18px; }
.vt.assistant { align-self: flex-start; background: var(--voice-panel); border: 1px solid var(--voice-line); border-radius: 18px 18px 18px 4px; }
.vt .vt-time { display: block; font-size: 11px; color: var(--voice-muted); margin-top: 6px; }

.voice-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 18px 22px;
  border-top: 1px solid var(--voice-line);
  background: rgba(246,246,244,0.9);
  backdrop-filter: blur(10px);
}

.vc-btn {
  border: 0; cursor: pointer;
  border-radius: 999px;
  font: inherit; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s, background .12s, border-color .12s;
}
.vc-btn:active { transform: scale(0.97); }

.vc-mic {
  width: 64px; height: 64px;
  background: #17181a; color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}
.vc-mic:hover { background: #000; transform: translateY(-1px); }
.vc-mic.rec { background: #c4453f; animation: recPulse 1.3s ease-in-out infinite; }
@keyframes recPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(196,69,63,0.4); } 50% { box-shadow: 0 0 0 12px rgba(196,69,63,0); } }

.vc-small {
  width: 44px; height: 44px;
  background: var(--voice-panel); color: var(--voice-text);
  border: 1px solid var(--voice-line);
}
.vc-small:hover { border-color: var(--voice-accent); color: var(--voice-accent); }

.vc-text {
  padding: 10px 18px;
  background: var(--voice-panel); color: var(--voice-text);
  border: 1px solid var(--voice-line);
  font-size: 13px;
}
.vc-text:hover { border-color: var(--voice-accent); }

@media (max-width: 560px) {
  .voice-features { grid-template-columns: 1fr; }
  .voice-stage { padding: 12px 14px; gap: 14px; }
  .voice-transcript { max-height: 40vh; }
}
