:root {
  --bg: #faf6ee;
  --bg-grad-1: #fbf6ec;
  --bg-grad-2: #f4e9d2;
  --bg-grad-3: #f8efe0;
  --surface: #ffffff;
  --pill: #f0e6d0;
  --pill-text: #6b5836;
  --ink: #1a1530;
  --ink-soft: #5a5470;
  --ink-faint: #908aa0;
  --border: rgba(26, 21, 48, 0.08);
  --border-strong: rgba(26, 21, 48, 0.16);
  --gold: #c9a86a;
  --gold-soft: #d9bc83;
  --gold-deep: #8e6d3a;
  --shadow-sm: 0 2px 8px rgba(26, 21, 48, 0.04);
  --shadow-md: 0 8px 32px rgba(26, 21, 48, 0.06);
  --shadow-lg: 0 16px 48px rgba(26, 21, 48, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, var(--bg-grad-2) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 25%, var(--bg-grad-3) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-grad-1) 0%, var(--bg) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* === Top nav === */
.topbar {
  position: sticky;
  top: 16px;
  z-index: 50;
  padding: 0 24px;
  margin-top: 16px;
}
.nav-island {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 12px 10px 22px;
  display: flex;
  align-items: center;
  gap: 32px;
  box-shadow: var(--shadow-sm);
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: white;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.brand-name { font-weight: 700; font-size: 16px; color: var(--ink); letter-spacing: -0.01em; }
.nav-links {
  display: flex;
  gap: 28px;
  flex: 1;
  justify-content: center;
}
.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--gold-deep); }

/* === Pills === */
.pill {
  display: inline-block;
  background: var(--pill);
  color: var(--pill-text);
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.01em;
}
.pill-card {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
}

/* === Buttons === */
.cta-dark {
  background: var(--ink);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease;
}
.cta-dark:hover { transform: translateY(-1px); background: #2a2348; }
.cta-dark:active { transform: translateY(0); }
.cta-dark:disabled { opacity: 0.6; cursor: progress; }
.cta-small { padding: 9px 18px; font-size: 14px; }

.cta-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border-strong);
  padding: 13px 26px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background 0.15s, border-color 0.15s;
}
.cta-ghost:hover { background: rgba(26, 21, 48, 0.04); border-color: var(--ink); }

/* === Hero === */
.hero {
  text-align: center;
  padding: 80px 0 56px;
}
.hero .pill { margin-bottom: 22px; }
.hero h1 {
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 24px;
  color: var(--ink);
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--gold-deep) 0%, var(--gold) 50%, var(--gold-soft) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.lead {
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 auto 36px;
}
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.hint {
  margin-top: 18px;
  font-size: 13px;
  color: var(--ink-faint);
}

/* === Showcase === */
.showcase {
  display: flex;
  justify-content: center;
  margin-bottom: 80px;
}
.showcase-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 520px;
}
.avatar-stage {
  position: relative;
  aspect-ratio: 4 / 5;
  background: linear-gradient(180deg, #f8efe0 0%, #e8d5b0 100%);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
#avatar-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  background: #000;
}
#avatar-video.active { display: block; }
.avatar-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
#avatar-video.active ~ .avatar-fallback { display: none; }
.avatar-portrait {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f5e8c8 0%, var(--gold) 60%, var(--gold-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(184, 151, 92, 0.35);
}
.avatar-letter {
  color: white;
  font-size: 80px;
  font-weight: 600;
  font-family: "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.04em;
}
.status-pill {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(26, 21, 48, 0.7);
  backdrop-filter: blur(10px);
  color: white;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.status-pill.error { background: rgba(220, 60, 60, 0.85); }
.showcase-meta {
  padding: 18px 6px 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.showcase-meta h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}
.showcase-meta p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

/* === Transcript === */
.transcript-section {
  max-width: 720px;
  margin: 0 auto 80px;
}
.section-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--ink);
}
.transcript-pane {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px 20px;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
}
#transcript-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 88%;
}
.bubble.user { background: var(--ink); color: white; align-self: flex-end; }
.bubble.assistant { background: var(--pill); color: var(--ink); align-self: flex-start; }

/* === Section heads === */
.section-head {
  text-align: center;
  margin-bottom: 48px;
}
.section-head .pill { margin-bottom: 16px; }
.section-head h2 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
  line-height: 1.15;
}

/* === How it works === */
.how { padding: 56px 0 64px; }
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
}
.step-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-deep);
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}
.step h3 {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--ink);
}
.step p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* === Use cases === */
.cases { padding: 56px 0 64px; }
.cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.case-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.case-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.case-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}
.case-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* === Book === */
.book { padding: 56px 0 64px; }
.book-card {
  background: linear-gradient(135deg, var(--ink) 0%, #2d2557 100%);
  color: white;
  border-radius: 28px;
  padding: 56px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  box-shadow: var(--shadow-lg);
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
.book-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 100% 0%, rgba(201, 168, 106, 0.18) 0%, transparent 60%);
  pointer-events: none;
}
.book-card > * { position: relative; z-index: 1; }
.book-card .pill {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  margin-bottom: 14px;
}
.book-card h2 {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  margin: 0 0 12px;
  color: white;
  letter-spacing: -0.01em;
}
.book-card .lead {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}
.book-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.book-card .cta-ghost {
  border-color: rgba(255, 255, 255, 0.25);
  color: white;
}
.book-card .cta-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.5);
}
.book-card .cta-dark {
  background: var(--gold);
  color: var(--ink);
}
.book-card .cta-dark:hover {
  background: var(--gold-soft);
}

/* === Footer === */
footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  margin-top: 40px;
}
.footer-row {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-faint);
  gap: 16px;
}
.footer-row .legal { text-align: right; max-width: 540px; }

/* === Responsive === */
@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-island { padding-right: 8px; }
  .steps, .cases-grid { grid-template-columns: 1fr; }
  .book-card { flex-direction: column; align-items: flex-start; padding: 40px 28px; }
  .book-cta { width: 100%; }
  .hero { padding: 60px 0 40px; }
  .footer-row { flex-direction: column; align-items: flex-start; }
  .footer-row .legal { text-align: left; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 12px; top: 12px; }
  main { padding: 0 16px 60px; }
  .pill-card { top: 12px; right: 12px; }
}
