@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;600;700&family=Space+Grotesk:wght@400;600;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #0b0b0d;
  --surface: rgba(20, 20, 24, 0.88);
  --surface-strong: rgba(32, 32, 36, 0.95);
  --ink: #f7f5f2;
  --muted: #a09c96;
  --accent: #9ae87c;
  --accent-2: #64d2ff;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Sora", "Space Grotesk", sans-serif;
  background: radial-gradient(circle at top, #202022 0%, #101012 45%, #0b0b0d 100%);
  color: var(--ink);
}


.shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 12px;
  color: var(--accent-2);
  margin: 0 0 10px;
}

h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(28px, 3.2vw, 46px);
  margin: 0;
  line-height: 1.1;
}

.status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px 18px;
  min-width: 250px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  margin-bottom: 12px;
}

.status-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d64040;
  box-shadow: 0 0 0 6px rgba(214, 64, 64, 0.2);
}

.dot.small {
  width: 8px;
  height: 8px;
  box-shadow: 0 0 0 4px rgba(214, 64, 64, 0.2);
}

.dot.connected {
  background: #2fa46a;
  box-shadow: 0 0 0 6px rgba(47, 164, 106, 0.2);
}

button {
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

button.primary {
  background: linear-gradient(135deg, #9ae87c, #59d8ff);
  color: #0b0b0d;
  box-shadow: 0 14px 30px rgba(58, 199, 162, 0.3);
}

button.primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}

button.ghost:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.status-actions {
  display: flex;
  gap: 10px;
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 0.6fr) minmax(0, 1fr);
  gap: 28px;
}

.profile-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-card {
  background: var(--surface-strong);
  border-radius: 24px;
  border: 1px solid var(--border);
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.profile-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(100, 210, 255, 0.2), transparent 60%);
  pointer-events: none;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.badge {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-2);
}

.menu-dot {
  color: var(--muted);
  font-size: 18px;
}

.avatar-frame {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #0b0b0d;
  aspect-ratio: 3 / 4;
}


.listen-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: rgba(5, 5, 8, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.avatar-frame.listening .listen-overlay {
  opacity: 1;
}

#video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.avatar-frame.live #video {
  opacity: 1;
}

.profile-copy {
  margin-top: 16px;
}

.profile-title {
  color: var(--muted);
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.profile-copy h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 36px;
  margin: 6px 0 12px;
}

.profile-desc {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}

.quick-tips {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--border);
}

.quick-tips h3 {
  margin: 0 0 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.quick-tips ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.chat-panel {
  background: var(--surface);
  border-radius: 26px;
  border: 1px solid var(--border);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 600px;
}

.listen-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(154, 232, 124, 0.22), rgba(100, 210, 255, 0.22));
  border: 1px solid rgba(154, 232, 124, 0.45);
  color: #e9ffe1;
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.listen-bar.active {
  opacity: 1;
  transform: translateY(0);
}

.listen-icon {
  font-size: 14px;
}

.listen-wave {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.2));
  background-size: 200% 100%;
  animation: wave 1.2s ease-in-out infinite;
}

@keyframes wave {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.chat-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  margin: 0 0 4px;
}

.chat-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.chat-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.chat-feed {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bubble {
  padding: 14px 16px;
  border-radius: 18px;
  max-width: 80%;
  backdrop-filter: blur(8px);
}

.bubble.tutor {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
  align-self: flex-start;
}

.bubble.user {
  background: rgba(154, 232, 124, 0.2);
  border: 1px solid rgba(154, 232, 124, 0.35);
  color: #dff9d5;
  align-self: flex-end;
}

.bubble-label {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.question-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.question-form label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent-2);
}

textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  font-size: 14px;
  resize: vertical;
  font-family: inherit;
  background: rgba(10, 10, 12, 0.8);
  color: var(--ink);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.action-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.busy {
  font-size: 12px;
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.mic-status {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 1024px) {
  .stage {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
  }

  .status-actions {
    flex-direction: column;
  }

  .bubble {
    max-width: 100%;
  }
}
