/* Public landing page (/ and /fr), rendered by server/routes/site.js for
   signed-out visitors. Same tokens as web/src/habitude/tokens.css; follows
   the OS theme like the other account pages. */
:root {
  --ink: #101113;
  --ink-soft: #6B6B70;
  --ink-faint: #A3A2A0;
  --paper: #FAFAF9;
  --paper-raised: #FFFFFF;
  --paper-sunken: #F2F1EE;
  --line: #EBEAE6;
  --accent: #00B87C;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3F7EE;
  --brand-coral: #F96D56;
  --display: 'Space Grotesk', -apple-system, sans-serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-card: 18px;
  --radius-control: 12px;
  --shadow-card: 0 1px 2px rgba(16, 17, 19, 0.04);
  --shadow-float: 0 8px 20px rgba(0, 184, 124, 0.32);
  --width: 1080px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #F2F2F0;
    --ink-soft: #9C9CA1;
    --ink-faint: #67676D;
    --paper: #0E0F10;
    --paper-raised: #18191B;
    --paper-sunken: #202124;
    --line: #2A2B2E;
    --accent: #1FCB8E;
    --accent-ink: #06150F;
    --accent-soft: rgba(31, 203, 142, 0.14);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-float: 0 8px 22px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.02em; line-height: 1.12; }
a { color: inherit; }
.wrap { max-width: var(--width); margin: 0 auto; padding: 0 20px; }

/* ---- Header ---- */
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; }
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 1.2rem; }
.logo svg { display: block; height: 40px; width: auto; }
.head-links { display: flex; align-items: center; gap: 16px; font-size: 0.9rem; }
.head-links a { text-decoration: none; color: var(--ink-soft); }
.head-links a:hover { color: var(--ink); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  border-radius: var(--radius-control);
  font-weight: 600; font-size: 1rem; text-decoration: none;
  border: 1px solid var(--line); background: var(--paper-raised); color: var(--ink);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-float); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 0.88rem; box-shadow: none; }

/* ---- Hero ---- */
.hero { padding: 40px 0 72px; }
.eyebrow { display: inline-block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 5px 11px; border-radius: 20px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 600; }
.hero .lead { font-size: 1.15rem; color: var(--ink-soft); margin: 18px 0 28px; max-width: 34em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.fine { font-size: 0.86rem; color: var(--ink-soft); margin-top: 14px; }
.fine + .fine { margin-top: 6px; }
.fine a { color: var(--accent, inherit); font-weight: 600; }

.card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 18px; }

/* ---- Sections ---- */
section { padding: 64px 0; border-top: 1px solid var(--line); }
.section-head { max-width: 40em; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 600; }
.section-head p { color: var(--ink-soft); margin: 12px 0 0; font-size: 1.05rem; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature h3 { font-size: 1.1rem; font-weight: 600; margin: 10px 0 6px; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.feature .ico { font-size: 1.5rem; }
.part-label { font-family: var(--display); font-weight: 600; font-size: 0.95rem; color: var(--ink-soft); margin: 28px 0 12px; }
.part-label:first-of-type { margin-top: 0; }

/* ---- The hero and "See it in action" share one phone (/site/tour.js plays
   the app's screens in it). On a computer it sits in the right column, stays
   in view while scrolling (sticky), and settles beside the list of screens,
   where the column ends. On a phone: one column, the phone in the section. */
.showcase {
  /* The phone fits the window's height: screen 390x844, 10px bezel, controls below. */
  --phone-w: clamp(230px, calc((100vh - 140px) / 2.36), 300px);
  --stage-h: calc((var(--phone-w) - 20px) * 2.164 + 20px + 56px);
  display: grid; grid-template-columns: minmax(0, 1fr) var(--phone-w); column-gap: 64px;
}
.showcase-side { padding: 40px 0 64px; }
.tour-stage { position: sticky; top: max(16px, calc(50vh - var(--stage-h) / 2)); z-index: 2; }
/* The section's top line runs under the phone column too. */
.showcase .tour { margin-right: calc(-1 * (var(--phone-w) + 64px)); padding-right: calc(var(--phone-w) + 64px); }
/* As tall as the phone, so the list sits beside it where it settles. */
.tour-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: var(--stage-h); }
.tour-step {
  position: relative; overflow: hidden; display: grid; gap: 3px; width: 100%; text-align: left;
  padding: 14px 18px; border-radius: var(--radius-card); border: 1px solid transparent; background: none;
  font: inherit; color: var(--ink-soft); cursor: pointer;
}
.tour-step strong { font-family: var(--display); font-size: 1.08rem; font-weight: 600; color: var(--ink-faint); }
.tour-step span { display: none; font-size: 0.95rem; }
.tour-step:hover strong { color: var(--ink); }
.tour-step.on { background: var(--paper-raised); border-color: var(--line); box-shadow: var(--shadow-card); }
.tour-step.on strong { color: var(--ink); }
.tour-step.on span { display: block; }
.tour-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--accent); }
.tour-step.on .tour-bar { animation: tour-fill var(--tour-ms, 5000ms) linear forwards; }
.tour-body.paused .tour-step.on .tour-bar { animation-play-state: paused; }
@keyframes tour-fill { to { width: 100%; } }

.tour-stage { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.tour-stage .tour-phone { flex: none; }
.tour-phone {
  width: var(--phone-w); padding: 10px; border-radius: 46px; background: #111214;
  box-shadow: 0 30px 60px -24px rgba(16, 17, 19, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.tour-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  aspect-ratio: 390 / 844; border-radius: 37px; background: #FAFAF9; outline-offset: 4px;
}
.tour-track::-webkit-scrollbar { display: none; }
.tour-slide { flex: 0 0 100%; margin: 0; scroll-snap-align: center; scroll-snap-stop: always; }
.tour-slide img { display: block; width: 100%; height: auto; }
.tour-caption { display: none; text-align: center; max-width: 26em; min-height: 4.8em; }
.tour-caption strong { display: block; font-family: var(--display); font-size: 1.15rem; font-weight: 600; }
.tour-caption span { color: var(--ink-soft); font-size: 0.95rem; }
.tour-controls { display: flex; align-items: center; gap: 10px; }
.tour-arrow, .tour-toggle {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper-raised);
  color: var(--ink); font: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.tour-toggle::before { content: "❚❚"; font-size: 0.7rem; letter-spacing: -1px; }
.tour-toggle[aria-pressed="true"]::before { content: "▶"; font-size: 0.8rem; }
.tour-dots { display: flex; gap: 6px; padding: 0 4px; }
.tour-dots i { width: 7px; height: 7px; border-radius: 4px; background: var(--ink-faint); opacity: 0.45; transition: width 0.3s, background 0.3s; }
.tour-dots i.on { width: 20px; background: var(--accent); opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .tour-step.on .tour-bar { animation: none; }
  .tour-dots i { transition: none; }
}

/* ---- Pricing ---- */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; }
.plan.best { border: 2px solid var(--accent); }
.plan .badge { position: absolute; top: -12px; left: 18px; background: var(--accent); color: var(--accent-ink); font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.plan h3 { font-size: 1.15rem; font-weight: 600; }
.plan .what { color: var(--ink-soft); font-size: 0.9rem; margin: 6px 0 16px; flex: 1; }
.price { font-family: var(--display); font-size: 2rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.price small { font-family: var(--sans); font-size: 0.9rem; font-weight: 500; color: var(--ink-soft); }
.yearly { font-size: 0.86rem; color: var(--ink-soft); margin: 4px 0 16px; }
.trial-note { margin-top: 20px; font-size: 0.92rem; color: var(--ink-soft); }

/* ---- FAQ ---- */
.faq { max-width: 46em; }
.faq details { border-top: 1px solid var(--line); padding: 16px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--ink-faint); font-weight: 500; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 10px 0 0; color: var(--ink-soft); }

/* ---- Final call ---- */
.final { text-align: center; }
.final h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 600; margin-bottom: 20px; }

/* ---- Footer ---- */
.site-foot { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 0.85rem; color: var(--ink-soft); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; }
.foot-links a { color: var(--ink-soft); }

@media (max-width: 820px) {
  .hero { padding: 20px 0 48px; }
  .grid, .plans { grid-template-columns: minmax(0, 1fr); }
  .plans { gap: 24px; }
  section { padding: 48px 0; }
  .head-links .hide-sm { display: none; }
  .showcase { --phone-w: min(76vw, 290px); grid-template-columns: minmax(0, 1fr); }
  .showcase .tour { margin-right: 0; padding-right: 0; padding-bottom: 20px; }
  .showcase-side { padding: 0 0 48px; display: flex; justify-content: center; }
  .tour-stage { position: static; }
  .tour-steps { display: none; }
  .tour-caption { display: block; }
}
