/* ---------- Tokens ---------- */
:root {
  --bg: #faf9f6;
  --bg-alt: #f3f1ec;
  --surface: #ffffff;
  --ink: #16181d;
  --ink-2: #4a4f5a;
  --ink-3: #7a7f89;
  --line: #e5e2da;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-ink: #ffffff;
  --accent-soft: #ecebfd;
  --warm: #f59e0b;
  --ok: #15803d;
  --err: #c2410c;
  --shadow: 0 1px 2px rgba(22, 24, 29, .04), 0 8px 24px rgba(22, 24, 29, .06);
  --shadow-lg: 0 30px 60px -20px rgba(22, 24, 29, .28), 0 12px 24px -12px rgba(22, 24, 29, .18);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 14px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1114;
    --bg-alt: #14171b;
    --surface: #1a1d22;
    --ink: #eef0f3;
    --ink-2: #b3b8c2;
    --ink-3: #80868f;
    --line: #2a2e35;
    --accent: #8b85ff;
    --accent-hover: #a39eff;
    --accent-ink: #0f1114;
    --accent-soft: #24234a;
    --ok: #4ade80;
    --err: #fb923c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .7), 0 12px 24px -12px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; }
img, svg { display: block; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: 760px; }

.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;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  padding: 10px 14px; border-radius: 8px;
  background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 50px; padding: 0 22px;
  border: 0; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink);
  font: 600 16px/1 var(--sans); text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn--sm { height: 40px; padding: 0 16px; font-size: 15px; border-radius: 10px; }
.btn--lg { height: 56px; padding: 0 28px; font-size: 17px; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo__mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--ink); color: var(--bg);
}
.logo__mark svg { width: 20px; height: 20px; }
.logo__text { font: 600 19px/1 var(--serif); letter-spacing: -.01em; }
.logo--sm .logo__mark { width: 28px; height: 28px; border-radius: 8px; }
.logo--sm .logo__mark svg { width: 16px; height: 16px; }
.logo--sm .logo__text { font-size: 17px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.nav__links { display: flex; gap: 28px; margin-left: auto; }
.nav__links a {
  color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500;
  transition: color .15s ease;
}
.nav__links a:hover { color: var(--ink); }
.nav__toggle { display: none; }
.nav__menu { display: none; }

@media (max-width: 720px) {
  .nav__links, .nav__inner > .btn { display: none; }
  .nav__toggle {
    display: grid; place-content: center; gap: 6px;
    width: 44px; height: 44px; margin-left: auto;
    background: none; border: 0; cursor: pointer; color: var(--ink);
  }
  .nav__toggle span {
    display: block; width: 22px; height: 2px; border-radius: 2px; background: currentColor;
    transition: transform .2s ease;
  }
  .nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav__menu:not([hidden]) {
    display: grid; padding: 8px var(--gutter) 16px;
    border-bottom: 1px solid var(--line);
  }
  .nav__menu a {
    padding: 12px 0; text-decoration: none; font-weight: 500;
    border-top: 1px solid var(--line);
  }
  .nav__menu a:first-child { border-top: 0; }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(56px, 8vw, 104px); }
.hero__grid { display: grid; gap: 56px; align-items: center; }
@media (min-width: 920px) {
  .hero__grid { grid-template-columns: 1.1fr .9fr; gap: 48px; }
}

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 14px; font-weight: 600;
}
.badge__dot {
  width: 8px; height: 8px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); }
  70%, 100% { box-shadow: 0 0 0 8px transparent; }
}

.hero__title {
  margin-top: 22px;
  font: 600 clamp(44px, 7.2vw, 76px)/1.02 var(--serif);
  letter-spacing: -.025em;
}
.hero__title em {
  font-style: italic; font-weight: 500;
  color: var(--accent);
}
.hero__sub {
  margin-top: 22px; max-width: 34ch;
  font-size: clamp(18px, 2vw, 20px); color: var(--ink-2);
}

/* Signup */
.signup { margin-top: 32px; max-width: 480px; }
.signup__row {
  display: flex; gap: 8px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.signup__row:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow), 0 0 0 4px var(--accent-soft);
}
.signup input {
  flex: 1; min-width: 0; height: 50px; padding: 0 12px;
  border: 0; background: transparent; color: var(--ink);
  font: 400 16px var(--sans);
}
.signup input::placeholder { color: var(--ink-3); }
.signup input:focus { outline: none; }
.signup.is-invalid .signup__row { border-color: var(--err); }
.signup__note { margin-top: 10px; font-size: 14px; color: var(--ink-3); }
.signup__msg { margin-top: 10px; font-size: 15px; font-weight: 500; min-height: 0; }
.signup__msg:empty { display: none; }
.signup__msg.is-error { color: var(--err); }
.signup__msg.is-ok { color: var(--ok); }
.signup.is-done .signup__row,
.signup.is-done .signup__note { display: none; }
.signup.is-done .signup__msg {
  margin-top: 0; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  color: var(--ink); box-shadow: var(--shadow);
}
.signup.is-done .signup__msg strong { color: var(--ok); }

@media (max-width: 480px) {
  .signup__row { flex-direction: column; padding: 6px; }
  .signup__row .btn { width: 100%; }
}

.hero__facts {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  margin: 28px 0 0; padding: 0; list-style: none;
  font-size: 14px; color: var(--ink-2);
}
.hero__facts li { display: inline-flex; align-items: center; gap: 8px; }
.hero__facts li::before {
  content: ""; width: 5px; height: 10px; margin: 0 3px 3px 2px;
  border: solid var(--accent); border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- Phone mockup ---------- */
.hero__art { position: relative; display: grid; place-items: center; }
.glow {
  position: absolute; inset: 8% 4%;
  background:
    radial-gradient(closest-side, color-mix(in srgb, var(--accent) 38%, transparent), transparent),
    radial-gradient(closest-side at 70% 80%, color-mix(in srgb, var(--warm) 30%, transparent), transparent);
  filter: blur(30px); opacity: .7;
}
.phone {
  position: relative;
  width: min(300px, 78vw); aspect-ratio: 9 / 19;
  padding: 10px; border-radius: 46px;
  background: #16181d;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, .06) inset;
  transform: rotate(-3deg);
}
.phone__notch {
  position: absolute; top: 20px; left: 50%; z-index: 2;
  width: 88px; height: 24px; border-radius: 20px; background: #16181d;
  transform: translateX(-50%);
}
.phone__screen {
  height: 100%; border-radius: 37px; overflow: hidden;
  background: var(--bg);
}
.app { display: flex; flex-direction: column; height: 100%; padding: 58px 18px 22px; }
.app__top { display: flex; justify-content: space-between; align-items: center; }
.app__date { font: 600 20px/1 var(--serif); }
.streak {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--warm) 16%, transparent);
  color: #b45309; font-size: 13px; font-weight: 600;
}
@media (prefers-color-scheme: dark) { .streak { color: var(--warm); } }
.streak__flame { font-size: 10px; color: var(--warm); }

.cards { display: grid; margin-top: 18px; }
.card {
  grid-area: 1 / 1;
  display: flex; flex-direction: column;
  padding: 20px 18px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px) scale(.98);
  transition: opacity .5s ease, transform .5s ease;
}
.card.is-active { opacity: 1; transform: none; }
.card__track {
  font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent);
}
.card__title { margin-top: 10px; font: 600 22px/1.15 var(--serif); letter-spacing: -.01em; }
.card__body { margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.card__foot { display: flex; gap: 6px; margin-top: auto; padding-top: 18px; }
.pill {
  padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
}
.pill--ghost { background: transparent; color: var(--ink-3); border: 1px solid var(--line); }

.week { margin-top: 18px; padding: 14px 14px 12px; border-radius: 16px; background: var(--bg-alt); }
.week__label { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.week__days {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  margin: 10px 0 0; padding: 0; list-style: none;
}
.week__days li {
  display: grid; place-items: center; aspect-ratio: 1;
  border-radius: 50%; font-size: 11px; font-weight: 600; color: var(--ink-3);
  border: 1.5px dashed var(--line);
}
.week__days li.is-done { background: var(--accent); border: 0; color: var(--accent-ink); }
.week__days li.is-today { border: 1.5px solid var(--accent); color: var(--accent); }

.app__bar { margin-top: auto; padding-top: 14px; }
.app__cta {
  display: grid; place-items: center; height: 46px; border-radius: 14px;
  background: var(--accent); color: var(--accent-ink); font-size: 15px; font-weight: 600;
}
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
.dots span {
  width: 6px; height: 6px; border-radius: 3px; background: var(--line);
  transition: width .3s ease, background-color .3s ease;
}
.dots span.is-active { width: 18px; background: var(--ink-3); }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section--alt { background: var(--bg-alt); }
.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent);
}
.h2 {
  margin-top: 12px; max-width: 18ch;
  font: 600 clamp(32px, 4.6vw, 48px)/1.08 var(--serif); letter-spacing: -.02em;
}

/* Steps */
.steps {
  display: grid; gap: 20px; margin: 48px 0 0; padding: 0; list-style: none;
}
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 28px; } }
.step { padding-top: 22px; border-top: 1px solid var(--line); }
.step__num { font: 500 15px/1 var(--serif); color: var(--accent); }
.step h3 { margin-top: 14px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.step p { margin-top: 8px; color: var(--ink-2); }

/* Features */
.grid { display: grid; gap: 16px; margin-top: 48px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.feature {
  padding: 26px 24px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .2s ease, box-shadow .2s ease;
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.feature h3 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.feature h3::before {
  content: ""; display: block; width: 28px; height: 3px; margin-bottom: 16px;
  border-radius: 2px; background: var(--accent);
}
.feature p { margin-top: 8px; font-size: 16px; color: var(--ink-2); }

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  background: var(--surface);
}
@media (min-width: 820px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat {
  display: flex; flex-direction: column; gap: 6px;
  padding: clamp(22px, 3vw, 36px);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stat:nth-child(2n) { border-right: 0; }
.stat:nth-child(n+3) { border-bottom: 0; }
@media (min-width: 820px) {
  .stat { border-bottom: 0; border-right: 1px solid var(--line); }
  .stat:nth-child(2n) { border-right: 1px solid var(--line); }
  .stat:last-child { border-right: 0; }
}
.stat__num {
  font: 600 clamp(36px, 5vw, 52px)/1 var(--serif); letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat__label { font-size: 15px; color: var(--ink-2); }

/* FAQ */
.faq { margin-top: 40px; border-top: 1px solid var(--line); }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__q {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  width: 100%; padding: 22px 0;
  background: none; border: 0; color: var(--ink); text-align: left; cursor: pointer;
  font: 600 18px/1.35 var(--sans);
}
.faq__icon { position: relative; flex: none; width: 14px; height: 14px; }
.faq__icon::before, .faq__icon::after {
  content: ""; position: absolute; left: 0; top: 6px;
  width: 14px; height: 2px; border-radius: 2px; background: var(--ink-3);
  transition: transform .25s ease;
}
.faq__icon::after { transform: rotate(90deg); }
.faq__q[aria-expanded="true"] .faq__icon::after { transform: rotate(0deg); }
.faq__a {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .3s ease;
}
.faq__a > p { overflow: hidden; color: var(--ink-2); max-width: 62ch; }
.faq__q[aria-expanded="true"] + .faq__a { grid-template-rows: 1fr; }
.faq__q[aria-expanded="true"] + .faq__a > p { padding-bottom: 22px; }

/* Final CTA */
.cta { padding: clamp(72px, 10vw, 128px) 0; text-align: center; }
.cta__inner { display: flex; flex-direction: column; align-items: center; }
.cta .h2 { max-width: 16ch; margin-top: 0; }
.cta p { margin: 16px 0 32px; font-size: 18px; color: var(--ink-2); max-width: 40ch; }

/* Footer */
.footer { padding: 32px 0 40px; border-top: 1px solid var(--line); }
.footer__inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px;
}
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer__links a { color: var(--ink-2); text-decoration: none; font-size: 15px; }
.footer__links a:hover { color: var(--ink); }
.footer__legal { margin-left: auto; font-size: 14px; color: var(--ink-3); }
@media (max-width: 720px) {
  .footer__inner { flex-direction: column; align-items: flex-start; }
  .footer__legal { margin-left: 0; }
}

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
