:root {
  --bg: #f7f9fc;
  --surface: rgba(255, 255, 255, 0.84);
  --text: #0f172a;
  --muted: #475569;
  --line: rgba(15, 23, 42, 0.1);
  --primary: #4f46e5;
  --primary-2: #7c3aed;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(51, 65, 85, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, #dbeafe 0%, var(--bg) 45%) no-repeat;
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}

.container { width: min(1120px, 92%); margin: 0 auto; }

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(60px);
  z-index: -1;
  opacity: .45;
}
.orb-1 { width: 280px; height: 280px; background: #a5b4fc; top: 10%; left: -80px; }
.orb-2 { width: 360px; height: 360px; background: #c4b5fd; bottom: -120px; right: -100px; }

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}
.brand { font-weight: 800; letter-spacing: -0.02em; }
.nav-cta { color: var(--primary); text-decoration: none; font-weight: 600; }

.hero { text-align: center; padding: 56px 0 36px; }
.eyebrow {
  display: inline-block;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 999px;
}
h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  margin: 16px auto 14px;
  max-width: 850px;
  letter-spacing: -0.03em;
}
.subheadline {
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  max-width: 720px;
  margin: 0 auto;
}
.hero-actions {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 24px rgba(79, 70, 229, .25);
}
.btn-ghost {
  color: var(--text);
  background: rgba(255,255,255,0.75);
  border-color: var(--line);
}

.offer, .section, .final-cta {
  margin-top: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.offer, .section { padding: clamp(20px, 3vw, 34px); }

.offer-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #7c2d12;
  background: #ffedd5;
  padding: 6px 10px;
  border-radius: 999px;
}
.offer h2 { margin: 12px 0 8px; font-size: clamp(1.35rem, 3vw, 1.9rem); }
.offer p { color: var(--muted); margin: 0 0 18px; }

.capture {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.capture input {
  flex: 1 1 260px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
}
.form-note { display: block; margin-top: 10px; color: #64748b; }

h3 {
  margin: 0 0 16px;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  letter-spacing: -0.02em;
}
.grid {
  display: grid;
  gap: 14px;
}
.steps { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps article,
.tech article {
  background: rgba(255,255,255,0.75);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.steps span {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #4338ca;
  background: #eef2ff;
  border-radius: 999px;
  padding: 5px 8px;
}
.steps h4, .tech h4 { margin: 10px 0 6px; }
.steps p, .tech p { color: var(--muted); margin: 0; }

.tech { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.vision p { margin: 0; color: var(--muted); max-width: 800px; }

.final-cta {
  padding: clamp(24px, 4vw, 42px);
  text-align: center;
}
.final-cta h3 { margin-bottom: 14px; }

.demo-head p { color: var(--muted); margin: 10px 0 0; }
.demo-layout {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 14px;
}
.chat-panel, .tree-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.72);
  min-height: 420px;
}
.chat-panel { display: flex; flex-direction: column; }
.chat-messages {
  flex: 1;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 360px;
}
.bubble {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  animation: pop .22s ease;
}
.bubble.user {
  align-self: flex-end;
  background: #4f46e5;
  color: #fff;
}
.bubble.ai {
  align-self: flex-start;
  background: #eef2ff;
  color: #1f2a44;
  border: 1px solid #dbe4ff;
}
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 14px 12px;
}
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
}
.chat-input {
  border-top: 1px solid var(--line);
  padding: 12px;
  display: flex;
  gap: 8px;
}
.chat-input input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}
.tree-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  font-size: 14px;
  color: #334155;
}
.tree-canvas {
  padding: 14px;
  overflow: auto;
}
.tree-empty { color: #64748b; margin: 0; }
.tree-canvas svg {
  display: block;
  min-width: 100%;
}
.edge {
  fill: none;
  stroke-linecap: round;
  opacity: .9;
  animation: fadeIn .35s ease;
}
.edge.parent { stroke: #94a3b8; stroke-width: 2; }
.edge.spouse { stroke: #7c3aed; stroke-width: 2.4; }
.node { cursor: pointer; }
.node rect {
  fill: #ffffff;
  stroke: rgba(15,23,42,.16);
  filter: drop-shadow(0 6px 14px rgba(51,65,85,.13));
}
.node.is-me rect {
  stroke: #4f46e5;
  stroke-width: 1.8;
  fill: #eef2ff;
}
.node .name {
  font-size: 13px;
  font-weight: 700;
  fill: #0f172a;
}
.node .years {
  font-size: 12px;
  fill: #64748b;
}
.node {
  opacity: 0;
  transform: translateY(6px);
  animation: nodeIn .28s ease forwards;
  animation-delay: var(--delay, 0ms);
}
.demo-note { margin: 14px 0 0; color: #64748b; }
.node-editor {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.82);
  padding: 12px;
}
.node-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.node-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.node-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #475569;
}
.node-form input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  color: #0f172a;
  background: #fff;
}
.node-form button {
  grid-column: 1 / -1;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: .9; }
}
@keyframes nodeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.footer {
  padding: 28px 0 36px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

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

@media (max-width: 900px) {
  .demo-layout { grid-template-columns: 1fr; }
  .chat-panel, .tree-panel { min-height: auto; }
}

@media (max-width: 680px) {
  .nav { padding-top: 14px; }
  .hero { padding-top: 34px; }
  .capture { flex-direction: column; }
  .capture button { width: 100%; }
  .chat-input { flex-direction: column; }
  .chat-input button { width: 100%; }
}
