:root {
  --bg: #0a1220;
  --bg-soft: #121e31;
  --panel: rgba(10, 18, 32, 0.82);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #e8eefb;
  --muted: #9db0cb;
  --accent: #64e2b6;
  --accent-strong: #2dbf97;
  --assistant-bubble: rgba(255, 255, 255, 0.08);
  --user-bubble: linear-gradient(135deg, #64e2b6, #1991ff);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(45, 191, 151, 0.16), transparent 25%),
    radial-gradient(circle at bottom right, rgba(25, 145, 255, 0.22), transparent 30%),
    linear-gradient(160deg, #060b14 0%, #0a1220 45%, #101a2d 100%);
  color: var(--text);
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 32px;
}

.ambient {
  position: absolute;
  border-radius: 999px;
  filter: blur(22px);
  opacity: 0.55;
  pointer-events: none;
}

.ambient-one {
  top: 80px;
  left: -20px;
  width: 220px;
  height: 220px;
  background: rgba(100, 226, 182, 0.22);
}

.ambient-two {
  right: -30px;
  bottom: 100px;
  width: 260px;
  height: 260px;
  background: rgba(25, 145, 255, 0.18);
}

.app-card {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.75fr 1.45fr;
  gap: 24px;
}

.hero-panel,
.chat-panel {
  backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.profile-hero {
  margin-bottom: 28px;
}

.avatar-card {
  position: relative;
  width: min(100%, 340px);
  padding: 22px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(100, 226, 182, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.avatar-illustration {
  position: relative;
  height: 280px;
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.09), transparent 20%),
    linear-gradient(180deg, rgba(12, 23, 40, 0.45), rgba(8, 16, 28, 0.9));
}

.avatar-halo {
  position: absolute;
  top: 22px;
  left: 50%;
  width: 190px;
  height: 190px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(100, 226, 182, 0.22), rgba(25, 145, 255, 0.06) 65%, transparent 72%);
}

.avatar-photo {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 228px;
  max-width: 82%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  transform: translateX(-50%);
  z-index: 1;
  border-radius: 28px 28px 18px 18px;
  filter: grayscale(1) contrast(1.04) brightness(1.02);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.eyebrow,
.chat-label {
  margin: 0 0 12px;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-panel h1,
.chat-panel h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  line-height: 1;
}

.hero-panel h1 {
  max-width: 12ch;
  font-size: clamp(3rem, 6vw, 5.6rem);
}

.hero-copy {
  max-width: 36rem;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.feature-pills span {
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.95rem;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

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

.chat-header h2 {
  font-size: 1.6rem;
}

.ghost-button,
#sendBtn {
  border: 0;
  border-radius: 16px;
  font: inherit;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

.ghost-button {
  padding: 12px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.icon-button {
  min-width: 72px;
  font-size: 1.25rem;
  line-height: 1;
}

.icon-button i {
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1;
}

.ghost-button:hover,
#sendBtn:hover {
  transform: translateY(-1px);
}

.chat-messages {
  flex: 1;
  min-height: 520px;
  max-height: 65vh;
  overflow-y: auto;
  padding: 8px 4px 8px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.message.user {
  flex-direction: row-reverse;
}

.avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #04111d;
  background: linear-gradient(135deg, #c7fff0, #64e2b6);
}

.message.user .avatar {
  color: #eef5ff;
  background: linear-gradient(135deg, #1991ff, #63b6ff);
}

.bubble {
  max-width: min(82%, 720px);
  padding: 16px 18px;
  border-radius: 22px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.message.assistant .bubble {
  background: var(--assistant-bubble);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.message.user .bubble {
  color: #03111f;
  background: var(--user-bubble);
}

.bubble p {
  margin: 0;
}

.composer {
  margin-top: 16px;
  padding: 16px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#userInput {
  width: 100%;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.6;
  min-height: 44px;
  max-height: 180px;
}

#userInput::placeholder {
  color: #8092ad;
}

.composer-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.composer-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.helper-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.voice-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#sendBtn {
  padding: 12px 20px;
  font-weight: 700;
  color: #03111f;
  background: linear-gradient(135deg, #64e2b6, #1991ff);
}

#sendBtn:disabled,
.ghost-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .page-shell {
    padding: 20px;
  }

  .app-card {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: 0;
    padding: 32px 24px;
  }

  .avatar-card {
    width: min(100%, 300px);
  }

  .hero-panel h1 {
    max-width: 100%;
    font-size: clamp(2.6rem, 12vw, 4rem);
  }

  .chat-messages {
    min-height: 420px;
    max-height: 55vh;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 14px;
  }

  .hero-panel,
  .chat-panel {
    border-radius: 22px;
  }

  .hero-panel {
    padding: 28px;
  }

  .profile-hero {
    margin-bottom: 22px;
  }

  .avatar-card {
    width: 100%;
  }

  .avatar-illustration {
    height: 240px;
  }

  .chat-panel {
    padding: 18px;
  }

  .composer-actions,
  .composer-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .voice-actions {
    justify-content: stretch;
  }

  .voice-actions .ghost-button,
  #sendBtn {
    width: 100%;
  }

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