:root {
  color-scheme: dark;
  --bg: #080914;
  --surface: rgba(20, 21, 43, 0.82);
  --surface-strong: #17182e;
  --border: rgba(255, 255, 255, 0.12);
  --text: #f8f6ff;
  --muted: #b9b5cc;
  --accent: #c6a7ff;
  --accent-strong: #9c6cff;
  --pink: #f2a8cf;
  --success: #9ee8bf;
  --danger: #ffb0b0;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 18%, rgba(156, 108, 255, 0.2), transparent 28%),
    radial-gradient(circle at 82% 28%, rgba(242, 168, 207, 0.15), transparent 25%),
    linear-gradient(180deg, #080914 0%, #0d0e1d 60%, #080914 100%);
  color: var(--text);
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.6;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.85) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(198,167,255,.55) 0 1px, transparent 1.5px);
  background-size: 88px 88px, 137px 137px;
  background-position: 0 0, 33px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

.shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.narrow { width: min(560px, calc(100% - 32px)); }
.hidden { display: none !important; }
.full { width: 100%; }

.site-header {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 3;
}

.brand { font-weight: 800; letter-spacing: 0.24em; font-size: 0.95rem; }
.hero {
  min-height: 660px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 72px;
  align-items: center;
  padding: 56px 0 96px;
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 800;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 24px;
  font-size: clamp(2.7rem, 6vw, 5.8rem);
  line-height: 0.97;
  letter-spacing: -0.055em;
  max-width: 800px;
}
h2 { margin-bottom: 0; font-size: clamp(1.55rem, 3vw, 2.15rem); letter-spacing: -0.035em; }
h3 { margin-bottom: 8px; }
.hero-text { max-width: 650px; color: var(--muted); font-size: 1.16rem; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 32px 0 16px; }
.microcopy { color: var(--muted); font-size: 0.82rem; max-width: 580px; }

.button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, opacity .18s ease;
  font-weight: 750;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: 0.55; cursor: wait; transform: none; }
.button-primary { background: linear-gradient(135deg, var(--accent), var(--pink)); color: #171226; }
.button-secondary { background: rgba(255,255,255,.08); border-color: var(--border); color: var(--text); }
.button-ghost { background: transparent; border-color: var(--border); color: var(--muted); }

.preview-card, .panel {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}
.preview-card { border-radius: 34px; padding: 34px; transform: rotate(2deg); }
.orbit-mark {
  width: 62px;
  height: 62px;
  border: 1px solid rgba(198,167,255,.5);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 1.7rem;
  box-shadow: 0 0 36px rgba(156,108,255,.35);
  margin-bottom: 28px;
}
.orbit-mark.small { width: 44px; height: 44px; font-size: 1.1rem; margin: 0 auto 12px; }
.preview-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .13em; }
.preview-question { font-size: 1.35rem; line-height: 1.45; }
.preview-answer { display: grid; gap: 9px; margin: 28px 0; }
.preview-answer span { height: 9px; border-radius: 100px; background: rgba(255,255,255,.12); }
.preview-answer span:nth-child(2) { width: 83%; }
.preview-answer span:nth-child(3) { width: 61%; }
.counter-chip { display: inline-flex; background: rgba(198,167,255,.12); color: var(--accent); border-radius: 999px; padding: 9px 13px; font-size: .82rem; }

.panel { border-radius: 26px; padding: 28px; }
.panel-header { margin-bottom: 24px; }
.panel-header.compact { margin-bottom: 20px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: rgba(255,255,255,.05); padding: 5px; border-radius: 14px; margin-bottom: 20px; }
.tab { background: transparent; color: var(--muted); border: 0; padding: 11px; border-radius: 10px; cursor: pointer; }
.tab.active { background: rgba(255,255,255,.1); color: var(--text); }

.form-stack { display: grid; gap: 16px; }
label { display: grid; gap: 8px; color: var(--muted); font-size: .9rem; }
input, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(4,5,13,.58);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
input:focus, textarea:focus { border-color: rgba(198,167,255,.72); box-shadow: 0 0 0 4px rgba(156,108,255,.12); }
textarea { resize: vertical; min-height: 86px; line-height: 1.5; }
.status-message { min-height: 20px; margin: 14px 0 0; font-size: .88rem; color: var(--muted); }
.status-message.error { color: var(--danger); }
.status-message.success { color: var(--success); }

.app-shell { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; padding: 28px 0 72px; }
.profile-panel { position: sticky; top: 18px; }
.privacy-note { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 18px; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.chat-panel { min-height: 690px; display: flex; flex-direction: column; }
.chat-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.trial-counter { min-width: 116px; text-align: right; }
.trial-counter span { display: block; color: var(--accent); font-size: 2rem; font-weight: 850; line-height: 1; }
.trial-counter small { color: var(--muted); font-size: .72rem; }
.suggestions { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.suggestions button { border: 1px solid var(--border); background: rgba(255,255,255,.04); color: var(--muted); border-radius: 999px; padding: 9px 12px; cursor: pointer; font-size: .78rem; text-align: left; }
.suggestions button:hover { color: var(--text); border-color: rgba(198,167,255,.45); }
.messages { flex: 1; min-height: 310px; max-height: 480px; overflow-y: auto; padding: 6px 4px 18px; display: grid; align-content: start; gap: 14px; }
.empty-state { text-align: center; color: var(--muted); padding: 80px 20px; }
.message { max-width: 86%; border-radius: 18px; padding: 14px 16px; line-height: 1.58; white-space: pre-wrap; }
.message.user { justify-self: end; background: linear-gradient(135deg, rgba(156,108,255,.9), rgba(201,126,192,.9)); color: #fff; border-bottom-right-radius: 5px; }
.message.assistant { justify-self: start; background: rgba(255,255,255,.075); border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 5px; }
.message-meta { display: block; color: rgba(255,255,255,.55); font-size: .67rem; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .1em; }
.question-form { border-top: 1px solid var(--border); padding-top: 18px; }
.question-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 10px; color: var(--muted); font-size: .78rem; }
.trial-ended { margin-top: 18px; border: 1px solid rgba(198,167,255,.3); background: rgba(156,108,255,.09); border-radius: 18px; padding: 20px; }
.trial-ended p { color: var(--muted); line-height: 1.55; }

.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px 0 40px; border-top: 1px solid var(--border); color: var(--muted); font-size: .75rem; position: relative; z-index: 1; }
.site-footer p { margin: 0; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 36px; }
  .preview-card { max-width: 520px; transform: none; }
  .app-shell { grid-template-columns: 1fr; }
  .profile-panel { position: static; }
}

@media (max-width: 600px) {
  .shell, .site-header { width: min(100% - 20px, 1180px); }
  .site-header { min-height: 66px; }
  .hero { min-height: auto; padding-bottom: 60px; }
  h1 { font-size: 2.65rem; }
  .panel, .preview-card { border-radius: 21px; padding: 20px; }
  .chat-header { align-items: center; }
  .message { max-width: 94%; }
  .site-footer { flex-direction: column; }
}
