:root {
  --bg: #faf9fc;
  --ink: #1f1147;
  --muted: #7c7594;
  --purple: #7c3aed;
  --purple-deep: #5b21b6;
  --purple-soft: #ede9fe;
  --line: #e8e3f7;
  --card: #f4f1fb;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 80% 0%, rgba(109, 93, 252, 0.10), transparent 42%),
    #fff;
}

body.home-page {
  overflow-x: hidden;
  min-height: 100dvh;
}

body.home-page .app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.home-page .top-bar {
  flex-shrink: 0;
}

body.home-page .home {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 18px calc(14px + var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Landing stack: headline → avatar → props → CTAs ── */
.hero-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(10px, 2vh, 16px);
  flex: 0 0 auto;
  min-height: 0;
}

body.home-page h1 {
  font-size: clamp(1.45rem, 6vw, 2rem);
  text-align: center;
  margin: 0;
  flex-shrink: 0;
  line-height: 1.28;
  padding: 0 6px;
  position: relative;
  z-index: 2;
}

/* Hero avatar — fixed footprint so headline never sits under the art */
.avatar-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 100%;
  margin: 0 auto;
  padding: 4px 0 8px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.home-avatar-img {
  display: block;
  width: min(72vw, 280px);
  height: auto;
  max-width: 280px;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 50%;
  margin: 0 auto;
}

.home-hero-brand {
  width: min(78vw, 300px);
  max-width: 300px;
  border-radius: 22%;
  box-shadow:
    0 16px 40px rgba(124, 58, 237, 0.22),
    0 4px 12px rgba(15, 23, 42, 0.08);
}

body.home-page .value-props,
body.home-page .cta-row--stack {
  flex-shrink: 0;
}

body.home-page .how-it-works {
  flex-shrink: 0;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + var(--safe-top)) 20px 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-mark img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
}

.brand-name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  text-transform: none;
}

.brand--text .brand-name {
  font-size: 1.05rem;
  font-weight: 800;
}

.menu-btn {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.menu-btn span,
.menu-btn span::before,
.menu-btn span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  position: relative;
}

.menu-btn span::before,
.menu-btn span::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-btn span::before { top: -6px; }
.menu-btn span::after { top: 6px; }

.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 430px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px calc(24px + var(--safe-bottom));
  gap: 16px;
}

.hero { text-align: center; }

h1 {
  font-size: clamp(1.75rem, 7vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-weight: 800;
  margin-bottom: 2px;
}

.highlight { color: #7c3aed; }

/* Value prop cards */
.value-props {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  width: 100%;
}

.value-props li {
  background: rgba(124, 58, 237, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
  text-align: left;
  line-height: 1.35;
}

/* Legacy trait pills (other pages) */
.trait-row {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 2px 0 0;
}

body.home-page .trait-row {
  flex-shrink: 0;
  margin: 0;
  gap: 6px;
}

.trait-row li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1.5px solid var(--purple);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
}

body.home-page .trait-row li {
  padding: 5px 10px;
  font-size: 0.7rem;
  gap: 5px;
}

.trait-row svg {
  width: 16px;
  height: 16px;
  color: var(--purple);
  flex-shrink: 0;
}

body.home-page .trait-row svg {
  width: 13px;
  height: 13px;
}

.cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 2px;
}

.cta-row--stack {
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 2px;
  width: 100%;
}

body.home-page .cta-row--stack {
  margin-top: 0;
}

/* How it works — always visible, compact */
.how-it-works {
  background: #f3f0ff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 14px 16px;
  margin-top: 0;
  margin-bottom: 0;
}

.how-it-works h2 {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 12px;
}

.how-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.how-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  min-width: 0;
}

.how-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.how-step-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

.how-step-desc {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.3;
}

.setup-section {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  padding: 20px 18px 16px;
  margin-top: 4px;
}

body.home-page .setup-section {
  flex-shrink: 0;
  padding: 10px 12px;
  border-radius: 14px;
  margin-top: 0;
}

.setup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.setup-section h2 {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0;
  color: var(--ink);
}

body.home-page .setup-section h2 {
  font-size: 0.78rem;
}

.setup-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

body.home-page .setup-steps {
  flex-direction: row;
  gap: 6px;
}

.setup-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

body.home-page .setup-steps li {
  flex: 1;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  min-width: 0;
}

.step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  margin-top: 1px;
}

body.home-page .step-num {
  width: 20px;
  height: 20px;
  font-size: 0.65rem;
  margin-top: 0;
}

.step-body strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

body.home-page .step-body strong {
  font-size: 0.66rem;
  line-height: 1.25;
  margin-bottom: 1px;
}

.step-body p,
.step-body span {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

body.home-page .step-body span {
  display: block;
  font-size: 0.6rem;
  line-height: 1.3;
}

.setup-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--purple);
  text-decoration: none;
  white-space: nowrap;
}

body.home-page .setup-link {
  font-size: 0.68rem;
}

body.home-page .btn-primary,
body.home-page .btn-secondary {
  min-height: 48px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 14px;
}

body.home-page .btn-primary {
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.28);
}

body.home-page .btn-secondary {
  border-width: 2px;
}

body.home-page .top-bar {
  flex-shrink: 0;
  padding: calc(8px + var(--safe-top)) 18px 4px;
}

.btn-primary,
.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  border-radius: 16px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.98rem;
  text-decoration: none;
}

.btn-primary {
  background: #7c3aed;
  color: #fff;
}

.btn-primary svg,
.btn-secondary svg {
  width: 18px;
  height: 18px;
}

.btn-secondary {
  background: #fff;
  color: var(--purple);
  border: 1.5px solid var(--purple);
}

.page-body {
  padding: 8px 22px calc(28px + var(--safe-bottom));
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

.page-body h1 {
  margin-bottom: 12px;
}

.page-body h2 {
  font-size: 1rem;
  margin: 22px 0 8px;
}

.page-body p,
.page-body li {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.page-body p { margin-bottom: 14px; }

.page-body ul {
  padding-left: 18px;
  margin-bottom: 16px;
}

.page-body li { margin-bottom: 8px; }

.page-body .btn-ghost {
  background: #fff;
  color: var(--purple);
  border: 1.5px solid var(--purple);
  border-radius: 16px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  text-decoration: none;
}

.page-body .btn.btn-primary,
.page-body a.btn-primary {
  min-height: 48px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 22, 51, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(80vw, 300px);
  background: #fff;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 21;
  padding: calc(20px + var(--safe-top)) 22px 20px;
}

.drawer.is-open { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.drawer-close {
  border: none;
  background: none;
  font-size: 1.4rem;
  color: var(--ink);
  cursor: pointer;
}

.drawer nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 8px;
  border-radius: 12px;
}

.drawer nav a[aria-current="page"],
.drawer nav a:hover {
  background: var(--purple-soft);
  color: var(--purple-deep);
}

.page-body .cta-row {
  margin-top: 20px;
}

@media (max-width: 480px) {
  .page-body .cta-row {
    grid-template-columns: 1fr;
  }

  .trait-row li {
    font-size: 0.72rem;
    padding: 6px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .drawer, .drawer-backdrop { transition: none; }
}

@media (max-width: 480px) {
  body.home-page h1 {
    font-size: 1.4rem;
    line-height: 1.3;
  }

  body.home-page .home-avatar-img {
    width: min(62vw, 220px);
    max-width: 220px;
  }

  body.home-page .home-hero-brand {
    width: min(68vw, 260px);
    max-width: 260px;
  }

  body.home-page .how-it-works {
    margin-top: 4px;
  }
}

@media (max-height: 700px) {
  body.home-page h1 {
    font-size: 1.35rem;
  }

  body.home-page .value-props li {
    padding: 8px 12px;
    font-size: 13px;
  }

  body.home-page .home-avatar-img {
    width: min(58vw, 200px);
    max-width: 200px;
  }

  body.home-page .home-hero-brand {
    width: min(62vw, 220px);
    max-width: 220px;
  }

  body.home-page .btn-primary,
  body.home-page .btn-secondary {
    min-height: 44px;
    padding: 12px 14px;
    font-size: 15px;
  }

  body.home-page .how-it-works {
    padding: 12px;
  }
}
