*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0f13;
  --bg2: #16161d;
  --bg3: #1e1e28;
  --border: #2a2a38;
  --accent: #7c6ef5;
  --accent2: #9d91f7;
  --text: #e8e8f0;
  --text2: #9090a8;
  --user-bubble: #7c6ef5;
  --ai-bubble: #1e1e28;
  --radius: 16px;
  --font: 'Inter', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container { max-width: 900px; margin: 0 auto; padding: 0 24px; }
.accent { color: var(--accent2); }

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(124,110,245,.25) 0%, transparent 70%),
    var(--bg);
}

.hero__inner { max-width: 680px; }

.badge {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 28px;
  background: var(--bg2);
}

.hero h1 {
  font-size: clamp(36px, 6vw, 60px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero__sub {
  font-size: 17px;
  color: var(--text2);
  max-width: 560px;
  margin: 0 auto 32px;
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 40px;
}

.hero__chips span {
  padding: 8px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 14px;
  color: var(--text2);
}

.btn-primary {
  display: inline-block;
  padding: 16px 40px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.btn-primary:hover { background: var(--accent2); transform: translateY(-2px); }

/* ── HOW ── */
.how {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

.how h2 {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 56px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.step {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
}

.step__num {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(124,110,245,.2);
  color: var(--accent2);
  font-weight: 700;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}

.step h3 { font-size: 18px; margin-bottom: 8px; }
.step p  { font-size: 14px; color: var(--text2); }

/* ── CHAT SECTION ── */
.chat-section {
  padding: 80px 0 120px;
  border-top: 1px solid var(--border);
}

.chat-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  height: 680px;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}

.chat-header__info { display: flex; align-items: center; gap: 14px; }

.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.chat-header__name { font-weight: 600; font-size: 15px; }
.chat-header__status { font-size: 12px; color: var(--text2); }
.chat-header__status.thinking { color: var(--accent2); }

.btn-reset {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  font-family: var(--font);
  font-size: 13px;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.btn-reset:hover { border-color: var(--accent); color: var(--accent2); }

/* ── MESSAGES ── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.msg { display: flex; gap: 12px; max-width: 85%; }
.msg--user { align-self: flex-end; flex-direction: row-reverse; }
.msg--ai   { align-self: flex-start; }

.msg__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
  align-self: flex-end;
}
.msg--ai   .msg__avatar { background: linear-gradient(135deg, var(--accent), #a78bfa); color: #fff; }
.msg--user .msg__avatar { background: var(--bg3); color: var(--text2); border: 1px solid var(--border); }

.msg__bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg--ai   .msg__bubble { background: var(--ai-bubble); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg--user .msg__bubble { background: var(--user-bubble); color: #fff; border-bottom-right-radius: 4px; }

/* Typing dots */
.typing-dots span {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text2);
  animation: blink 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100% { opacity:.2; } 40% { opacity:1; } }

/* CTA block after handoff */
.cta-block {
  margin-top: 12px;
  padding: 16px 20px;
  background: rgba(124,110,245,.12);
  border: 1px solid rgba(124,110,245,.35);
  border-radius: 12px;
  font-size: 14px;
}
.cta-block p { margin-bottom: 12px; color: var(--text2); }
.btn-cta {
  display: inline-block;
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  border-radius: 100px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: background .2s;
}
.btn-cta:hover { background: var(--accent2); }
.cta-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-cta--max { background: #0077ff; }
.btn-cta--max:hover { background: #0066dd; }

/* ── INPUT ── */
.chat-input-wrap {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: var(--bg3);
}

.chat-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  padding: 11px 16px;
  resize: none;
  max-height: 150px;
  overflow-y: auto;
  transition: border-color .2s;
}
.chat-input:focus { outline: none; border-color: var(--accent); }
.chat-input::placeholder { color: var(--text2); }
.chat-input:disabled { opacity: .5; cursor: not-allowed; }

.btn-send {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .2s, transform .15s;
}
.btn-send:hover:not(:disabled) { background: var(--accent2); transform: scale(1.05); }
.btn-send:disabled { opacity: .4; cursor: not-allowed; }

/* ── FOOTER ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}
.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer p   { color: var(--text2); font-size: 14px; }
.footer__links { display: flex; gap: 16px; align-items: center; }
.footer__link {
  color: var(--accent2);
  font-size: 14px;
  text-decoration: none;
  font-weight: 500;
}
.footer__link:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .chat-wrap { height: calc(100vh - 140px); }
  .msg { max-width: 95%; }
}
