:root {
  --bg: #000000;
  --bg-elevated: #090909;
  --panel: rgba(255, 255, 255, 0.055);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --muted: #a6a6a6;
  --ghost: rgba(255, 255, 255, 0.62);
  --line: rgba(0, 153, 255, 0.18);
  --line-strong: rgba(0, 153, 255, 0.38);
  --accent: #0099ff;
  --accent-soft: rgba(0, 153, 255, 0.14);
  --shadow: 0 18px 70px rgba(0, 0, 0, 0.48);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --container: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(0, 153, 255, 0.16), transparent 26%),
    radial-gradient(circle at 100% 12%, rgba(0, 153, 255, 0.08), transparent 24%),
    var(--bg);
  color: var(--text);
  font-family: "Instrument Sans", "PingFang SC", "Noto Sans SC", sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04), transparent 18%),
    radial-gradient(circle at center, transparent 50%, rgba(0, 0, 0, 0.35));
}

.page-noise,
.page-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.page-noise {
  opacity: 0.08;
  mix-blend-mode: screen;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.8) 0.8px, transparent 0);
  background-size: 18px 18px;
}

.page-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 90px 90px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 85%);
  opacity: 0.15;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
textarea {
  font: inherit;
}

.topbar,
.hero,
.chat-zone,
.footer {
  width: min(calc(100% - 32px), var(--container));
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(20px);
  box-shadow:
    0 0 0 1px rgba(0, 153, 255, 0.08),
    0 12px 40px rgba(0, 0, 0, 0.36);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  inline-size: 42px;
  block-size: 42px;
  border-radius: 14px;
  font-family: "Archivo", sans-serif;
  font-size: 1.2rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
  box-shadow: 0 0 0 1px var(--line);
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 0.96rem;
  font-weight: 600;
}

.brand-copy small,
.topnav a,
.ghost-pill,
.composer-hint,
.rule-list,
.stat-card small,
.panel-kicker,
.eyebrow,
.chat-kicker,
.footer small {
  color: var(--muted);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topnav a {
  font-size: 0.95rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 24px;
  padding-block: 84px 48px;
  align-items: end;
}

.eyebrow,
.panel-kicker,
.chat-kicker {
  margin: 0 0 18px;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero h1,
.chat-head h2 {
  font-family: "Archivo", sans-serif;
  margin: 0;
  letter-spacing: -0.13em;
  line-height: 0.9;
}

.hero h1 {
  font-size: clamp(3.8rem, 8vw, 7rem);
  max-width: 8ch;
}

.hero h1 span {
  display: block;
  color: #dff2ff;
  text-shadow: 0 0 30px rgba(0, 153, 255, 0.14);
}

.hero-text {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--ghost);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-pills,
.signal-strip,
.chat-head-actions,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-pills {
  margin-top: 24px;
}

.hero-pills span,
.signal-strip span,
.status-pill,
.prompt-chip,
.ghost-pill,
.solid-pill {
  border-radius: var(--radius-pill);
}

.hero-pills span,
.signal-strip span,
.status-pill {
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.86rem;
}

.hero-actions {
  margin-top: 26px;
}

.hero-panel,
.sidebar-card,
.chat-shell {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 32%),
    var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 1px var(--line),
    var(--shadow);
}

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

.hero-panel {
  padding: 22px;
}

.hero-panel::after,
.chat-shell::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.hero-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.status-pill {
  color: #dff2ff;
  box-shadow: 0 0 0 1px rgba(0, 153, 255, 0.14);
}

.status-pill[data-state="online"] {
  background: rgba(0, 153, 255, 0.14);
  color: #eef9ff;
}

.status-pill[data-state="loading"] {
  background: rgba(255, 255, 255, 0.08);
}

.status-pill[data-state="offline"] {
  background: rgba(255, 87, 87, 0.12);
  color: #ffdede;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.stat-card {
  padding: 18px 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-card small {
  display: block;
  margin-bottom: 8px;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  line-height: 1.35;
  font-size: 1rem;
  word-break: break-word;
}

.signal-strip {
  margin-top: 18px;
}

.solid-pill,
.ghost-pill,
.prompt-chip {
  border: 0;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.solid-pill {
  padding: 12px 18px;
  background: #ffffff;
  color: #000000;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.ghost-pill {
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ghost-pill.small {
  padding: 9px 14px;
  font-size: 0.88rem;
}

.solid-pill:hover,
.ghost-pill:hover,
.prompt-chip:hover {
  transform: translateY(-1px);
}

.chat-zone {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  padding-bottom: 70px;
}

.chat-sidebar {
  display: grid;
  gap: 16px;
  align-content: start;
}

.sidebar-card {
  border-radius: 20px;
  padding: 18px;
}

.sidebar-title {
  margin: 0 0 14px;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f4f8fb;
}

.prompt-bank {
  display: grid;
  gap: 10px;
}

.prompt-chip {
  padding: 14px 16px;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  color: #f7fbff;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.rule-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  line-height: 1.6;
}

.chat-shell {
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr) auto;
  min-height: 780px;
  overflow: hidden;
}

.chat-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-head h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.message-list {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 20px 22px;
  overflow: auto;
}

.message {
  display: grid;
  gap: 10px;
  max-width: min(820px, 100%);
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(0, 153, 255, 0.06);
}

.message[data-role="assistant"] {
  background: rgba(255, 255, 255, 0.04);
}

.message[data-role="user"] {
  justify-self: end;
  background: rgba(0, 153, 255, 0.12);
  border-color: rgba(0, 153, 255, 0.22);
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.message-role {
  display: inline-grid;
  place-items: center;
  inline-size: 28px;
  block-size: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-family: "Azeret Mono", monospace;
  color: #eef8ff;
}

.message-body {
  color: #f4f7fb;
  line-height: 1.75;
  font-size: 0.98rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.message[data-role="typing"] .message-body {
  color: var(--ghost);
}

.composer {
  display: grid;
  gap: 14px;
  padding: 18px 22px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.02));
}

.composer textarea {
  width: 100%;
  min-height: 68px;
  max-height: 220px;
  resize: none;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
  line-height: 1.65;
  box-shadow: 0 0 0 1px rgba(0, 153, 255, 0.04);
}

.composer textarea:focus {
  border-color: var(--line-strong);
  box-shadow:
    0 0 0 1px rgba(0, 153, 255, 0.2),
    0 0 0 8px rgba(0, 153, 255, 0.08);
}

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

.composer-hint {
  margin: 0;
  font-size: 0.86rem;
}

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

.footer p {
  margin: 0;
  font-size: 0.95rem;
}

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

@media (max-width: 1080px) {
  .hero,
  .chat-zone {
    grid-template-columns: 1fr;
  }

  .chat-shell {
    min-height: 720px;
  }
}

@media (max-width: 780px) {
  .topbar {
    border-radius: 22px;
    padding: 14px;
  }

  .topnav {
    display: none;
  }

  .hero {
    padding-top: 56px;
  }

  .hero h1 {
    font-size: clamp(3rem, 16vw, 4.6rem);
  }

  .hero-panel,
  .chat-shell,
  .sidebar-card {
    border-radius: 20px;
  }

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

  .chat-head,
  .composer-bar,
  .footer {
    display: grid;
  }

  .footer {
    padding-bottom: 28px;
  }
}
