:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: rgba(20, 23, 31, 0.72);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f5f6f8;
  --muted: #9298a5;
  --accent: #72f3bd;
  --accent-2: #65a9ff;
  --danger: #ff7c82;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(44, 77, 104, 0.2), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
}

button, input { font: inherit; }

.glow {
  position: fixed;
  width: 30rem;
  height: 30rem;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .12;
  pointer-events: none;
}

.glow-one { top: 7rem; left: -18rem; background: var(--accent-2); }
.glow-two { right: -18rem; bottom: 4rem; background: var(--accent); }

.app-shell {
  position: relative;
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(114, 243, 189, .25);
  border-radius: 10px;
  background: rgba(114, 243, 189, .07);
}

.brand-mark i {
  display: block;
  width: 2px;
  border-radius: 3px;
  background: var(--accent);
}

.brand-mark i:nth-child(1) { height: 8px; }
.brand-mark i:nth-child(2) { height: 15px; }
.brand-mark i:nth-child(3) { height: 10px; }

.model-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #bdc1ca;
  background: rgba(255, 255, 255, .025);
  font-family: "Manrope", sans-serif;
  font-size: 12px;
}

.model-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 78px 20px 72px;
  text-align: center;
}

.eyebrow, .section-label {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
}

h1 {
  margin: 15px 0 12px;
  font-family: "Manrope", sans-serif;
  font-size: clamp(38px, 6vw, 66px);
  line-height: 1.08;
  letter-spacing: -.045em;
}

.hero > p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.voice-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 214px;
  height: 214px;
  margin: 38px 0 20px;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(114, 243, 189, .12);
  border-radius: 50%;
  transition: .4s ease;
}

.orbit-outer { inset: 0; }
.orbit-inner { inset: 25px; border-color: rgba(114, 243, 189, .2); }

.voice-button {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #07130e;
  background: linear-gradient(145deg, #8bffd0, #56dba5);
  box-shadow: 0 15px 55px rgba(74, 224, 164, .22), inset 0 1px rgba(255,255,255,.55);
  transition: transform .2s ease, box-shadow .3s ease;
}

.voice-button:hover { transform: scale(1.04); box-shadow: 0 18px 70px rgba(74, 224, 164, .32); }
.voice-button:active { transform: scale(.97); }
.voice-button:disabled { cursor: wait; opacity: .7; }

.mic-icon {
  width: 33px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.stop-icon {
  display: none;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: currentColor;
}

.voice-stage.connected .voice-button { color: #f5f6f8; background: linear-gradient(145deg, #313640, #22262e); }
.voice-stage.connected .mic-icon { display: none; }
.voice-stage.connected .stop-icon { display: block; }
.voice-stage.connected .orbit { animation: breathe 2s ease-in-out infinite; border-color: rgba(114, 243, 189, .35); }
.voice-stage.speaking .orbit-inner { animation-duration: .75s; }
.voice-stage.speaking .orbit-outer { animation-duration: 1.1s; }

@keyframes breathe {
  0%, 100% { transform: scale(.95); opacity: .45; }
  50% { transform: scale(1.06); opacity: 1; }
}

.status-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 24px;
  color: #c5c8cf;
  font-size: 14px;
}

.status-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #626874;
}

.status-indicator.active { background: var(--accent); box-shadow: 0 0 10px rgba(114,243,189,.75); }
.status-indicator.busy { background: #ffd078; box-shadow: 0 0 10px rgba(255,208,120,.6); }
.status-indicator.error { background: var(--danger); }

.error-message {
  min-height: 20px;
  margin-top: 8px !important;
  color: var(--danger) !important;
  font-size: 13px !important;
}

.conversation {
  min-height: 330px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255,255,255,.04), rgba(255,255,255,.018));
  box-shadow: 0 24px 80px rgba(0,0,0,.2);
  backdrop-filter: blur(12px);
}

.conversation-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

h2 { margin: 5px 0 0; font-family: "Manrope", sans-serif; font-size: 24px; }

.clear-button {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.clear-button:hover { color: var(--text); border-color: rgba(255,255,255,.18); }

.messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 420px;
  padding-top: 24px;
  overflow-y: auto;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 190px;
  color: #666d79;
}

.empty-state p { margin: -45px 0 0; }
.empty-icon { color: #515966; font-size: 25px; }

.message {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  max-width: 82%;
  animation: enter .25s ease-out;
}

.message.assistant { align-self: flex-start; }
.message.user { align-self: flex-end; grid-template-columns: 1fr 34px; }

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--accent);
  background: rgba(114,243,189,.06);
  font-size: 12px;
}

.user .avatar { grid-column: 2; color: #aad0ff; background: rgba(101,169,255,.08); }

.bubble {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 5px 14px 14px 14px;
  color: #d8dbe1;
  background: rgba(255,255,255,.035);
  font-size: 14px;
  line-height: 1.55;
}

.user .bubble {
  grid-column: 1;
  grid-row: 1;
  border-radius: 14px 5px 14px 14px;
  background: rgba(101,169,255,.075);
}

@keyframes enter { from { opacity: 0; transform: translateY(5px); } }

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 95px;
  color: #616875;
  font-size: 12px;
}

.footer-separator { width: 3px; height: 3px; border-radius: 50%; background: #444a54; }

@media (max-width: 640px) {
  .app-shell { width: min(100% - 24px, 1080px); }
  .hero { padding: 58px 8px 55px; }
  .model-pill { font-size: 10px; }
  .conversation { padding: 20px; }
  .message { max-width: 94%; }
  footer { flex-direction: column; gap: 5px; text-align: center; }
  .footer-separator { display: none; }
}
