:root {
  color-scheme: dark;
  --bg: #080b10;
  --panel: rgba(18, 22, 30, .84);
  --panel-2: rgba(24, 29, 39, .88);
  --line: rgba(238, 217, 181, .16);
  --line-strong: rgba(238, 217, 181, .28);
  --ink: #f6ead7;
  --ink-soft: #d8cdbb;
  --muted: #8f98a9;
  --gold: #f0c879;
  --gold-2: #ffe5ac;
  --cyan: #70d7ee;
  --blue: #7893ff;
  --danger: #ff6b7e;
  --success: #5bd6a0;
  --shadow: 0 24px 80px rgba(0, 0, 0, .44);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 84% 4%, rgba(88, 170, 214, .16), transparent 34%),
    linear-gradient(180deg, #0a0d13 0%, #0d1118 48%, #080b10 100%);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(240, 200, 121, .36);
  outline-offset: 2px;
}

h1,
h2,
p {
  margin: 0;
  overflow-wrap: anywhere;
}

h1 {
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
}

h2 {
  font-size: 20px;
  line-height: 1.18;
}

.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;
}

.app {
  width: min(1180px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 32px;
}

.hero-shell,
.session-panel,
.side-panel > section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .018)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-shell {
  position: relative;
  overflow: hidden;
  min-height: 560px;
}

.hero-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 11, 16, .94) 0%, rgba(8, 11, 16, .70) 48%, rgba(8, 11, 16, .14) 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-shell > * {
  position: relative;
  z-index: 2;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(240, 200, 121, .36);
  background: #171b24;
  flex: 0 0 auto;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  display: block;
}

.brand-copy {
  min-width: 0;
}

.eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .06);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
}

.live-pill span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(91, 214, 160, .14);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 500px);
  gap: 10px;
  min-height: 500px;
}

.hero-copy {
  align-self: center;
  max-width: 640px;
  padding: 48px 0 42px 36px;
}

.hero-copy h2 {
  max-width: 610px;
  margin-bottom: 18px;
  font-size: clamp(42px, 5.2vw, 68px);
  line-height: 1.04;
  font-weight: 930;
  letter-spacing: 0;
  color: var(--ink);
}

.hero-copy h2::first-letter {
  color: var(--gold-2);
}

.hero-copy p {
  max-width: 520px;
  margin-bottom: 26px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.8;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px 82px;
  gap: 10px;
  max-width: 640px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius);
  background: rgba(5, 8, 13, .62);
}

textarea {
  width: 100%;
  min-height: 56px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius);
  padding: 12px 13px;
  background: rgba(255, 255, 255, .06);
  color: var(--ink);
  line-height: 1.45;
}

textarea::placeholder {
  color: rgba(216, 205, 187, .58);
}

.record-btn,
.send-btn,
.demo-btn,
.quick,
.mode-option {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  font-weight: 850;
}

.record-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: linear-gradient(180deg, #ffe2a8, #eebf6c);
  color: #17100a;
  box-shadow: 0 18px 38px rgba(240, 200, 121, .20);
}

.record-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: currentColor;
}

.record-btn.recording {
  background: linear-gradient(180deg, #ff9aa8, #ff637d);
  color: #fff9f6;
}

.record-btn.recording .record-dot {
  animation: pulse 1s infinite;
}

.send-btn {
  background: rgba(255, 255, 255, .10);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, .12);
}

.trust-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.trust-note span {
  color: var(--gold);
}

.hero-portrait {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  display: grid;
  place-items: end center;
}

.hero-portrait > img {
  position: absolute;
  inset: 18px 18px 128px;
  width: calc(100% - 36px);
  height: calc(100% - 146px);
  max-width: 440px;
  margin: 0 auto;
  object-fit: contain;
  object-position: center bottom;
  filter: saturate(.94) contrast(1.02);
}

.portrait-status {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 22px;
  width: auto;
  min-height: 82px;
  padding: 13px 15px;
  border: 1px solid rgba(240, 200, 121, .20);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(16, 20, 28, .92), rgba(8, 11, 16, .96));
  backdrop-filter: blur(16px);
}

.portrait-status span {
  display: inline-flex;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 850;
}

.portrait-status strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
}

.portrait-status p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.mode-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.mode-option {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .055);
  color: var(--ink-soft);
}

.mode-option.active {
  border-color: rgba(240, 200, 121, .46);
  background: rgba(240, 200, 121, .12);
  color: var(--gold-2);
  box-shadow: inset 0 -2px 0 var(--gold);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(330px, .92fr);
  gap: 14px;
}

.session-panel,
.side-panel > section {
  padding: 18px;
}

.side-panel {
  display: grid;
  gap: 14px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-head.compact {
  margin-bottom: 12px;
}

.play-state {
  min-width: 96px;
  text-align: right;
}

.play-state span,
.metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.play-state strong,
.metrics strong {
  color: var(--gold-2);
  font-size: 15px;
}

.voice-console {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .035);
}

.voice-orb {
  height: 96px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(112, 215, 238, .24);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(112, 215, 238, .13), rgba(240, 200, 121, .07)),
    rgba(8, 11, 16, .60);
}

.meter {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 46px;
}

.meter span {
  width: 5px;
  height: 18px;
  border-radius: 999px;
  background: var(--gold);
  opacity: .55;
}

.voice-console.listening .meter span {
  animation: meter 900ms ease-in-out infinite;
}

.voice-console.listening .meter span:nth-child(2) {
  animation-delay: 80ms;
}

.voice-console.listening .meter span:nth-child(3) {
  animation-delay: 160ms;
}

.voice-console.listening .meter span:nth-child(4) {
  animation-delay: 240ms;
}

.voice-console.listening .meter span:nth-child(5) {
  animation-delay: 320ms;
}

.transcript-card {
  min-width: 0;
}

.transcript-card p {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.chat {
  display: grid;
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.msg {
  max-width: 82%;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .055);
}

.msg.user {
  justify-self: end;
  background: rgba(93, 121, 180, .18);
  border-color: rgba(120, 147, 255, .22);
}

.msg.assistant {
  justify-self: start;
}

.bubble-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.msg p {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.66;
}

.msg-actions {
  margin-top: 10px;
}

.listen-btn {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(240, 200, 121, .28);
  border-radius: var(--radius);
  background: rgba(240, 200, 121, .10);
  color: var(--gold-2);
  font-size: 13px;
  font-weight: 800;
}

.status-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.state-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(91, 214, 160, .12);
  flex: 0 0 auto;
}

.state-dot.busy {
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(240, 200, 121, .12);
}

.state-dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(255, 107, 126, .12);
}

.status-card strong {
  display: block;
  margin-bottom: 4px;
}

.status-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.knowledge-map {
  display: grid;
  gap: 9px;
}

.signal-cell,
.pipeline-item {
  display: grid;
  grid-template-columns: 42px minmax(4.5em, max-content) minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-height: 62px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .035);
}

.signal-cell > span,
.pipeline-item > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(240, 200, 121, .24);
  border-radius: var(--radius);
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.signal-cell strong,
.pipeline-item strong {
  display: block;
  margin-bottom: 0;
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
}

.signal-cell p,
.pipeline-item p {
  grid-column: 3;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: normal;
  word-break: keep-all;
}

.signal-cell.active,
.pipeline-item.active {
  border-color: rgba(112, 215, 238, .36);
  background: rgba(112, 215, 238, .08);
}

.signal-cell.done,
.pipeline-item.done {
  border-color: rgba(240, 200, 121, .32);
}

.demo-btn {
  width: 100%;
  margin-bottom: 10px;
  background: linear-gradient(180deg, #ffe2a8, #eebf6c);
  color: #17100a;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quick {
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .055);
  color: var(--ink-soft);
  font-size: 13px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metrics div {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .035);
}

button:hover {
  filter: brightness(1.05);
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(.4);
  opacity: .7;
}

@keyframes meter {
  0%,
  100% {
    height: 14px;
    opacity: .4;
  }
  50% {
    height: 42px;
    opacity: 1;
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(.92);
    opacity: .7;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

@media (max-width: 920px) {
  .app {
    width: auto;
    margin: 0 12px;
  }

  .hero-shell {
    min-height: auto;
  }

  .hero-shell::before {
    background:
      linear-gradient(180deg, rgba(8, 11, 16, .64) 0%, rgba(8, 11, 16, .94) 46%, rgba(8, 11, 16, .98) 100%);
  }

  .topbar {
    padding: 16px 16px 0;
  }

  .hero-grid,
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    order: 2;
    padding: 22px 16px 16px;
  }

  .hero-copy h2 {
    font-size: 38px;
  }

  .hero-portrait {
    position: relative;
    order: 1;
    height: 520px;
    min-height: 520px;
    z-index: 1;
  }

  .hero-portrait > img {
    inset: 18px 16px 116px;
    width: calc(100% - 32px);
    height: calc(100% - 134px);
    max-width: 360px;
  }

  .portrait-status {
    left: 16px;
    right: 16px;
    bottom: 14px;
    width: auto;
    min-height: 86px;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  .mode-bar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .app {
    margin: 0;
    padding: 0 0 14px;
  }

  .hero-shell,
  .session-panel,
  .side-panel > section {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .topbar {
    padding: 14px 14px 0;
  }

  .avatar {
    width: 42px;
    height: 42px;
  }

  h1 {
    font-size: 24px;
  }

  .hero-copy {
    padding-top: 18px;
  }

  .hero-copy h2 {
    font-size: 34px;
  }

  .hero-copy p {
    font-size: 15px;
  }

  .hero-portrait > img {
    inset: 16px 12px 122px;
    width: calc(100% - 24px);
    height: calc(100% - 138px);
    max-width: 330px;
  }

  .mode-bar,
  .workspace {
    margin-left: 0;
    margin-right: 0;
  }

  .mode-bar {
    padding: 0 12px;
  }

  .session-panel,
  .side-panel > section {
    padding: 15px 14px;
  }

  .voice-console {
    grid-template-columns: 1fr;
  }

  .voice-orb {
    height: 72px;
  }

  .msg {
    max-width: 92%;
  }

  .quick-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 340px) {
  .signal-cell,
  .pipeline-item {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
  }

  .signal-cell p,
  .pipeline-item p {
    grid-column: 2;
  }
}
