/* Selfscript marketing site — Lovable-inspired: warm cream canvas, ink CTAs,
   one blue-violet accent and a soft orange → pink → violet → blue glow.
   Tokens mirror lib/theme.ts in the app. */
:root {
  --bg: #fcfbf8; --bg-alt: #f7f4ed; --surface: #ffffff; --surface-alt: #f3f0e8;
  --text: #1c1c1c; --muted: #5c5b57; --subtle: #6e6c66;
  --border: #e7e3d9; --border-soft: #efece4;
  --accent: #4353ff; --ink: #1c1c1c; --on-ink: #fcfbf8;
  --g1: #ff8a4c; --g2: #ff5fb4; --g3: #a24dff; --g4: #4f6bff;
  --glow: .55; --shadow: 0 1px 2px rgba(28,28,28,.04), 0 8px 24px rgba(28,28,28,.06);
  --radius: 20px; --maxw: 1160px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #141413; --bg-alt: #1a1a19; --surface: #1e1e1d; --surface-alt: #272725;
  --text: #fafaf7; --muted: #b9b7b0; --subtle: #9a988f;
  --border: #2f2f2d; --border-soft: #262624;
  --accent: #8f9bff; --ink: #fafaf7; --on-ink: #141413;
  --glow: .32; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.6 "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--on-ink); padding: 8px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { left: 16px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s; }
.nav.scrolled { border-bottom-color: var(--border-soft); }
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 18px; letter-spacing: -.02em; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.nav-links { display: flex; gap: 22px; margin-left: 12px; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .sun { display: none; } :root[data-theme="dark"] .icon-btn .sun { display: block; } :root[data-theme="dark"] .icon-btn .moon { display: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: 12px; font-family: inherit; font-weight: 600; font-size: 15px; line-height: 1; text-decoration: none; cursor: pointer; border: 0;
  transition: transform .15s ease, opacity .15s, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-ink { background: var(--ink); color: var(--on-ink); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 4px 14px rgba(28,28,28,.18); }
.btn-ink:hover { opacity: .9; }
.btn-line { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }

/* Hero */
.hero { position: relative; padding: 72px 0 40px; isolation: isolate; }
.glow { position: absolute; inset: -10% 0 auto; height: 820px; z-index: -1; pointer-events: none; opacity: var(--glow);
  background:
    radial-gradient(38% 42% at 30% 38%, var(--g1), transparent 70%),
    radial-gradient(36% 40% at 52% 30%, var(--g2), transparent 70%),
    radial-gradient(40% 44% at 70% 46%, var(--g3), transparent 70%),
    radial-gradient(42% 46% at 58% 66%, var(--g4), transparent 70%);
  filter: blur(60px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--border); font-size: 13px; font-weight: 500; color: var(--muted); }
.pill b { background: var(--ink); color: var(--on-ink); border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
h1 { font-size: clamp(42px, 6.4vw, 76px); line-height: 1.02; letter-spacing: -.045em; font-weight: 600; margin: 20px 0 18px; }
.grad { background: linear-gradient(92deg, var(--g1), var(--g2) 35%, var(--g3) 70%, var(--g4)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); max-width: 560px; margin: 0 0 28px; }

/* Lovable-style prompt box = waitlist form */
.join { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 10px; box-shadow: var(--shadow); max-width: 540px; }
.join-row { display: flex; gap: 8px; }
.join input[type=email] { flex: 1; min-width: 0; height: 48px; border: 0; background: transparent; color: var(--text);
  font-family: inherit; font-size: 16px; padding: 0 12px; outline: none; }
.join input::placeholder { color: var(--subtle); }
.join .btn { height: 48px; border-radius: 14px; }
.join-meta { display: flex; align-items: center; gap: 6px; padding: 8px 6px 2px; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface-alt); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: inline-block; padding: 5px 10px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.join-note { font-size: 13px; color: var(--subtle); margin-left: auto; }
.hp { position: absolute; left: -5000px; }
.msg { min-height: 22px; font-size: 14px; margin: 10px 4px 0; }
.msg.ok { color: #1a7f55; } :root[data-theme="dark"] .msg.ok { color: #4cc38a; }
.msg.err { color: #c93545; } :root[data-theme="dark"] .msg.err { color: #f2707e; }
.trust { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 18px; font-size: 13px; color: var(--subtle); }
.trust span::before { content: "✓"; margin-right: 6px; color: var(--accent); font-weight: 700; }
.stores { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.store { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); text-decoration: none; font-size: 13px; line-height: 1.2; }
.store svg { width: 20px; height: 20px; }
.store small { display: block; color: var(--subtle); font-size: 11px; }

/* Phones */
.phones { position: relative; height: 640px; }
.phone { position: absolute; width: 290px; border-radius: 46px; padding: 10px; background: #0d0d0d; box-shadow: 0 30px 80px rgba(28,28,28,.25), 0 0 0 1px rgba(255,255,255,.06) inset; }
.phone img { border-radius: 36px; width: 100%; height: auto; aspect-ratio: 585/1266; background: var(--bg); }
.phone.front { right: 8%; top: 10px; z-index: 2; }
.phone.back { left: 2%; top: 70px; transform: rotate(-6deg); opacity: .96; }
.shot-dark { display: none; } :root[data-theme="dark"] .shot-dark { display: block; } :root[data-theme="dark"] .shot-light { display: none; }

/* Sections */
section { padding: 96px 0; }
.alt { background: var(--bg-alt); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
h2 { font-size: clamp(32px, 4.2vw, 50px); line-height: 1.06; letter-spacing: -.035em; font-weight: 600; margin: 0 0 16px; }
.sub { font-size: 18px; color: var(--muted); max-width: 640px; margin: 0; }
.head { margin-bottom: 48px; }
.center { text-align: center; } .center .sub { margin: 0 auto; }

.cards { display: grid; gap: 16px; }
.c3 { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.card h3 { font-size: 20px; letter-spacing: -.02em; font-weight: 600; margin: 14px 0 8px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.num { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 15px;
  background: linear-gradient(135deg, var(--g1), var(--g2) 40%, var(--g3) 75%, var(--g4)); }
.ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-alt); color: var(--text); }
.ico svg { width: 20px; height: 20px; }
.step-shot { margin-top: 20px; border-radius: 16px; border: 1px solid var(--border); overflow: hidden; aspect-ratio: 585/700; }
.step-shot img { width: 100%; height: auto; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-grid .wide { grid-column: span 2; display: grid; grid-template-columns: 1fr 200px; gap: 20px; align-items: end; overflow: hidden; position: relative; }
.wide .mini { border-radius: 22px 22px 0 0; border: 1px solid var(--border); border-bottom: 0; overflow: hidden; margin-bottom: -28px; height: 300px; align-self: end; }
.wide .mini img { width: 100%; height: auto; }
.tag { display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-alt); color: var(--muted); }

/* Challenge timeline */
.weeks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.week { position: relative; overflow: hidden; }
.week .bar { height: 4px; border-radius: 2px; margin-bottom: 18px; background: linear-gradient(90deg, var(--g1), var(--g2), var(--g3), var(--g4)); }
.week:nth-child(2) .bar { background: linear-gradient(90deg, var(--g2), var(--g3)); }
.week:nth-child(3) .bar { background: linear-gradient(90deg, var(--g3), var(--g4)); }
.week ul { margin: 14px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 15px; }
.week li { padding: 6px 0; border-top: 1px solid var(--border-soft); }

/* Science */
.cite { font-size: 13px; color: var(--subtle); margin-top: 14px !important; }
.stat { font-size: 44px; font-weight: 600; letter-spacing: -.04em; line-height: 1; }

/* Privacy band */
.privacy-band { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.checks svg { flex: none; width: 20px; height: 20px; color: var(--accent); margin-top: 2px; }

/* Pricing */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 880px; margin: 0 auto; }
.plan h3 { font-size: 22px; margin: 0; }
.plan .price { font-size: 15px; color: var(--muted); margin: 6px 0 18px; }
.plan ul { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; }
.plan li { display: flex; gap: 10px; font-size: 15px; }
.plan li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%;
  background: var(--surface-alt) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3 3 7-7' fill='none' stroke='%234353ff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.plan.pro { position: relative; border: 1px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, var(--g1), var(--g2), var(--g3), var(--g4)) border-box; }
.plan .badge { position: absolute; top: 20px; right: 20px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--ink); color: var(--on-ink); }
.fine { text-align: center; font-size: 13px; color: var(--subtle); margin-top: 18px; }

/* FAQ */
.faq { max-width: 800px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 0 20px; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 0; font-weight: 600; font-size: 17px; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; font-size: 22px; line-height: 1; color: var(--subtle); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 18px; color: var(--muted); }

/* Final CTA */
.cta { position: relative; overflow: hidden; isolation: isolate; border-radius: 32px; padding: 72px 32px; text-align: center; border: 1px solid var(--border); background: var(--surface); }
.cta .glow { inset: -40% -10% auto; height: 700px; }
.cta .join { margin: 28px auto 0; text-align: left; }

/* Footer */
footer { padding: 64px 0 40px; border-top: 1px solid var(--border-soft); margin-top: 96px; font-size: 14px; }
.foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot h4 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--subtle); font-weight: 600; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot a { text-decoration: none; color: var(--muted); } .foot a:hover { color: var(--text); }
.legal-line { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border-soft); color: var(--subtle); font-size: 13px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Prose (legal pages) */
.prose-wrap { position: relative; isolation: isolate; padding: 56px 0 0; }
.prose-wrap .glow { height: 420px; opacity: calc(var(--glow) * .55); }
.prose { max-width: 760px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 28px; padding: clamp(24px, 5vw, 56px); box-shadow: var(--shadow); }
.prose h1 { font-size: clamp(34px, 5vw, 48px); margin: 0 0 8px; }
.prose h2 { font-size: 22px; letter-spacing: -.02em; margin: 36px 0 10px; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--text); }
.prose a { color: var(--accent); }
.prose em { color: var(--subtle); font-style: normal; font-size: 14px; }
.prose ul { padding-left: 20px; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .reveal { opacity: 1; transform: none; transition: none; } }

/* Responsive */
@media (max-width: 960px) {
  .hero-grid, .privacy-band { grid-template-columns: 1fr; }
  .phones { height: 560px; max-width: 520px; margin: 0 auto; width: 100%; }
  .phone { width: 250px; }
  .c3, .weeks, .feature-grid { grid-template-columns: 1fr 1fr; }
  .feature-grid .wide { grid-column: span 2; }
  .nav-links { display: none; }
}
@media (max-width: 640px) {
  section { padding: 72px 0; }
  .hero { padding-top: 40px; }
  .c3, .weeks, .feature-grid, .plans, .foot { grid-template-columns: 1fr; }
  .feature-grid .wide { grid-column: auto; grid-template-columns: 1fr; }
  .wide .mini { display: none; }
  .phones { height: 470px; }
  .phone { width: 210px; border-radius: 38px; padding: 8px; }
  .phone img { border-radius: 30px; }
  .phone.front { right: 0; } .phone.back { left: 0; }
  .join-row { flex-direction: column; }
  .join .btn { width: 100%; }
  .join-note { margin-left: 0; width: 100%; padding: 4px 6px 0; }
  .nav .btn-sm { display: none; }
  .cta { padding: 56px 20px; border-radius: 24px; }
}
