:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #667085;
  --line: #e5e7eb;
  --primary: #635bff;
  --primary-dark: #4f46e5;
  --shadow: 0 24px 70px rgba(17, 24, 39, 0.10);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(99, 91, 255, 0.18), transparent 34rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 48%, #ffffff 100%);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid rgba(229, 231, 235, 0.75);
}

.nav, .section-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

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

.brand, .nav-links, .hero-actions, .chat-input-row { display: flex; align-items: center; }
.brand { gap: 10px; font-weight: 800; letter-spacing: -0.02em; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: white;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), #14b8a6);
  box-shadow: 0 10px 24px rgba(99, 91, 255, 0.28);
}
.nav-links { gap: 22px; color: var(--muted); font-size: 14px; }
.nav-links a:hover { color: var(--text); }

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 54px;
  align-items: center;
  padding: 86px 0 64px;
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
h1, h2 { margin: 0; letter-spacing: -0.055em; line-height: 1.02; }
h1 { font-size: clamp(44px, 7vw, 76px); max-width: 780px; }
h2 { font-size: clamp(32px, 4vw, 48px); }
.subheadline, .section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
  max-width: 680px;
}
.hero-actions { gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.button:hover { transform: translateY(-1px); }
.primary { color: white; background: var(--primary); box-shadow: 0 12px 28px rgba(99, 91, 255, 0.28); }
.primary:hover { background: var(--primary-dark); }
.ghost { background: white; border: 1px solid var(--line); color: var(--text); }

.hero-card, .panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-card { padding: 22px; transform: rotate(1.5deg); }
.mini-window { background: #0f172a; border-radius: 20px; padding: 18px; min-height: 330px; }
.mini-top { display: flex; gap: 7px; margin-bottom: 26px; }
.mini-top span { width: 10px; height: 10px; border-radius: 50%; background: #475569; }
.mini-message { padding: 13px 15px; border-radius: 16px; margin: 12px 0; max-width: 86%; line-height: 1.45; }
.mini-message.bot { color: #dbeafe; background: rgba(255, 255, 255, 0.09); }
.mini-message.user { margin-left: auto; color: white; background: var(--primary); }
.mini-message.accent { border: 1px solid rgba(20, 184, 166, 0.45); }

.builder, .embed { padding: 48px 0; }
.section-heading { margin-bottom: 24px; }
.builder-grid { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 24px; align-items: start; }
.panel { padding: 22px; }
.controls { display: grid; gap: 18px; }
label span { display: block; margin-bottom: 8px; font-weight: 800; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 13px 14px;
  color: var(--text);
  background: #fff;
  outline: none;
}
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99, 91, 255, 0.12); }
textarea { resize: vertical; line-height: 1.55; }
.color-row { display: grid; grid-template-columns: 1fr 84px; gap: 16px; align-items: end; }
.color-row input { height: 48px; padding: 5px; }

.preview { overflow: hidden; padding: 0; }
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  color: white;
  background: var(--primary);
}
.chat-header small { display: block; opacity: 0.82; margin-top: 2px; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.18); }
.chat-log { height: 430px; overflow: auto; padding: 20px; background: #f8fafc; }
.message { margin: 0 0 14px; display: flex; flex-direction: column; }
.bubble { max-width: 88%; padding: 12px 14px; border-radius: 16px; line-height: 1.5; white-space: pre-wrap; }
.message.assistant .bubble { background: white; border: 1px solid var(--line); }
.message.user { align-items: flex-end; }
.message.user .bubble { color: white; background: var(--primary); }
.sources { margin-top: 8px; max-width: 88%; color: var(--muted); font-size: 12px; line-height: 1.45; }
.sources ul { margin: 6px 0 0; padding-left: 18px; }
.chat-input-row { gap: 10px; padding: 14px; border-top: 1px solid var(--line); background: white; }
.chat-input-row input { flex: 1; }
.hint { margin: 0; padding: 0 18px 18px; color: var(--muted); font-size: 13px; }

.embed-panel { display: grid; gap: 16px; }
pre { margin: 0; overflow: auto; padding: 18px; border-radius: 16px; background: #0f172a; color: #dbeafe; }
.copy-status { min-height: 20px; margin: 0; color: var(--muted); }
.footer { padding: 34px 0 54px; color: var(--muted); }

@media (max-width: 860px) {
  .hero, .builder-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 58px; gap: 32px; }
  .nav-links { display: none; }
  .hero-card { transform: none; }
  .chat-log { height: 360px; }
}
