:root {
  --accent: #5c2d91;
  --accent-bright: #8b5cf6;
  --accent-soft: #ddd6fe;
  --background: #f5f0e8;
  --card: #ede7f6;
  --text: #2a1040;
  --muted: #6b4fa0;
  --success: #237a57;
  --danger: #a73333;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  background: radial-gradient(circle at top right, var(--accent-soft), transparent 38%), var(--background);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

main {
  min-height: 100vh;
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 32px 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.brand { color: var(--muted); letter-spacing: .18em; text-transform: uppercase; font-size: .78rem; }
h1 { font-family: Georgia, serif; color: var(--accent); font-size: clamp(2.8rem, 10vw, 5.2rem); margin: 12px 0 4px; font-weight: 500; }
.intro { color: var(--muted); font-size: clamp(1.1rem, 4vw, 1.35rem); line-height: 1.55; max-width: 540px; margin: 0 0 28px; }

.orb {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  margin: 8px 0 30px;
  background: radial-gradient(circle at 32% 28%, #fff, var(--accent-bright) 38%, var(--accent));
  box-shadow: 0 12px 55px color-mix(in srgb, var(--accent) 40%, transparent);
  transition: transform .25s ease, box-shadow .25s ease;
}
.orb.active { animation: breathe 2.4s ease-in-out infinite; }
.orb.listening { animation: breathe 1.2s ease-in-out infinite; box-shadow: 0 8px 65px color-mix(in srgb, var(--accent-bright) 65%, transparent); }
.orb.speaking { animation: speak 650ms ease-in-out infinite alternate; }

@keyframes breathe { 50% { transform: scale(1.07); } }
@keyframes speak { to { transform: scale(1.11); box-shadow: 0 8px 75px color-mix(in srgb, var(--accent-bright) 72%, transparent); } }

button, .choice {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-height: 64px;
  padding: 16px 30px;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
}

.primary { width: min(100%, 420px); color: white; background: linear-gradient(135deg, var(--accent), var(--accent-bright)); box-shadow: 0 8px 30px color-mix(in srgb, var(--accent) 32%, transparent); }
.secondary { color: var(--accent); background: var(--card); border: 2px solid color-mix(in srgb, var(--accent) 18%, transparent); }
button:disabled { opacity: .55; cursor: wait; }

.controls { display: flex; flex-wrap: wrap; gap: 12px; width: min(100%, 520px); justify-content: center; }
.status { min-height: 32px; margin: 20px 0 12px; color: var(--muted); font-size: 1.05rem; font-weight: 650; }
.status.error { color: var(--danger); }

.transcript {
  width: min(100%, 600px);
  max-height: 34vh;
  overflow: auto;
  background: color-mix(in srgb, var(--card) 86%, white);
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: 24px;
  padding: 18px 20px;
  margin: 10px 0 20px;
  text-align: left;
}
.transcript:empty { display: none; }
.turn { margin: 0 0 14px; line-height: 1.55; }
.turn:last-child { margin-bottom: 0; }
.speaker { color: var(--accent); font-weight: 800; }

.camera-panel { width: min(100%, 520px); margin-top: 18px; }
video { width: 100%; max-height: 42vh; object-fit: cover; border-radius: 22px; background: #21142d; margin-bottom: 12px; }
[hidden] { display: none !important; }

.privacy { color: var(--muted); font-size: .85rem; line-height: 1.45; margin-top: 26px; max-width: 520px; }

.chooser { gap: 18px; }
.choice { display: block; width: min(100%, 440px); text-decoration: none; color: white; background: linear-gradient(135deg, var(--accent), var(--accent-bright)); }
.choice small { display: block; font-weight: 500; opacity: .88; margin-top: 5px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
