/*
 * PlanSage marketing site — one stylesheet, no build step.
 *
 * Tokens come from the app's live src/index.css :root block (charcoal / blue
 * recolor). ONE accent (--accent, the app's blue); everything else is neutral.
 * Spacing is on an 8px grid (--s1 = 8px). One radius, one shadow.
 * Light only: `color-scheme: light`, so the page never half-flips.
 */
:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --soft: #F6F7F9;
  --ink: #1F2124;
  --muted: #5F626A;          /* app's #6B6E76 one step darker: AA on --soft too */
  --border: #E4E5E8;
  --accent: #1477C7;
  --accent-ink: #0F5E9E;     /* hover, and accent text on pale washes */
  --accent-wash: #EAF3FB;
  --dark: #2B2C2F;           /* the app's invariant nav band */
  --dark-2: #232427;
  --on-dark: #FFFFFF;
  --on-dark-muted: #C4C7CD;
  --on-dark-accent: #8CD4FF; /* the app's --ps-accent-soft; text-safe on --dark */
  --line-dark: rgba(255, 255, 255, .14);

  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 40px; --s6: 48px; --s8: 64px; --s10: 80px; --s12: 96px;
  --radius: 12px;
  --shadow: 0 12px 32px rgba(17, 19, 22, .10);
  --wrap: 1200px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Poppins", "Inter", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font);           /* 17px */
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
svg { display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0 0 var(--s2); letter-spacing: -0.015em; }
h1 { font-size: clamp(2.25rem, 1.5rem + 3vw, 3.5rem); font-weight: 700; }   /* 36px @375 -> 56px desktop */
h2 { font-size: clamp(1.75rem, 1.25rem + 2vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
p { margin: 0 0 var(--s2); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.on-dark :focus-visible, .nav :focus-visible { outline-color: var(--on-dark-accent); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s3); }
@media (min-width: 768px) { .wrap { padding: 0 var(--s4); } }

.skip { position: absolute; left: var(--s2); top: -64px; z-index: 60; background: var(--bg); color: var(--ink); padding: var(--s1) var(--s2); border-radius: 8px; font-weight: 600; }
.skip:focus { top: var(--s2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s1);
  min-height: 48px; padding: 0 var(--s3); border-radius: var(--radius);
  font: 600 1rem/1.2 var(--font); text-decoration: none; border: 2px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); color: #fff; }
.btn-secondary { background: var(--bg); color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--on-dark); border-color: rgba(255,255,255,.45); }
.btn-ghost:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.06); }
.btn-block { width: 100%; }

/* ---------- nav ---------- */
.nav { background: var(--dark); color: var(--on-dark); position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line-dark); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 72px; flex-wrap: wrap; padding-top: var(--s1); padding-bottom: var(--s1); }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img { height: 32px; width: auto; }
.nav-links { display: flex; align-items: center; gap: var(--s1); flex-wrap: wrap; }
.nav-links > a:not(.btn), .login > summary {
  color: var(--on-dark); text-decoration: none; font-weight: 500; font-size: .95rem;
  padding: var(--s1) 12px; border-radius: 8px; cursor: pointer;
}
.nav-links > a:not(.btn):hover, .login > summary:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav .btn { min-height: 40px; padding: 0 var(--s2); font-size: .95rem; }
.nav-short { display: inline; }
.nav-text { display: none; }
@media (min-width: 640px) { .nav-text { display: inline; } .nav-short { display: none; } }
@media (max-width: 639px) {
  .nav-links { width: 100%; justify-content: space-between; gap: 0; }
  .nav-links > a:not(.btn), .login > summary { padding: var(--s1); }
}

/* Log in: native <details> (works with keyboard and without JS);
   site.js only adds Escape-to-close and click-outside-to-close. */
.login { position: relative; }
.login > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.login > summary::-webkit-details-marker { display: none; }
.login > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.login[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.login-menu { position: absolute; right: 0; top: calc(100% + var(--s1)); min-width: 216px; margin: 0; padding: var(--s1); list-style: none; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 50; }
.login-menu a { display: block; padding: 12px var(--s2); border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
.login-menu a:hover, .login-menu a:focus-visible { background: var(--accent-wash); color: var(--accent-ink); }
.nav .login-menu a:focus-visible { outline-color: var(--accent); }  /* white menu: the dark-band ring colour would be ~1.6:1 here */
.login-menu small { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; }

/* ---------- section scaffolding ---------- */
.section { padding: var(--s10) 0; }
@media (min-width: 768px) { .section { padding: var(--s12) 0; } }
.section-soft { background: var(--soft); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8125rem; font-weight: 600; color: var(--accent-ink); margin-bottom: var(--s2); }
.lede { font-size: 1.125rem; color: var(--muted); max-width: 40em; line-height: 1.6; }
.section-head { max-width: 48em; margin-bottom: var(--s6); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .lede { margin-left: auto; margin-right: auto; }

/* ---------- hero (dark) ---------- */
.hero { background: var(--dark); color: var(--on-dark); padding: var(--s8) 0 var(--s10); overflow: hidden; }
@media (min-width: 1024px) { .hero { padding: var(--s10) 0 var(--s12); } }
.hero-grid { display: grid; gap: var(--s6); align-items: center; }
@media (min-width: 1024px) { .hero-grid { grid-template-columns: 1fr 1.15fr; gap: var(--s8); } }
.hero .eyebrow { color: var(--on-dark-accent); }
.hero h1 { color: #fff; max-width: 13em; }
.hero .lede { color: var(--on-dark-muted); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: var(--s4) 0 var(--s2); }
.reassure { font-size: .9375rem; color: var(--muted); margin: 0; }
.hero .reassure { color: var(--on-dark-muted); }
.chip { display: inline-flex; align-items: center; gap: var(--s1); margin-top: var(--s2); padding: 6px 12px; border-radius: 999px; font-size: .875rem; font-weight: 600; }
.hero .chip { background: rgba(255,255,255,.08); border: 1px solid var(--line-dark); color: #fff; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--on-dark-accent); }

/* Browser-style frame around the hero screenshot slot (CSS only). */
.frame { border-radius: var(--radius); background: #1A1B1E; border: 1px solid var(--line-dark); box-shadow: 0 24px 64px rgba(0,0,0,.45); overflow: hidden; }
.frame-bar { display: flex; align-items: center; gap: var(--s1); height: 32px; padding: 0 12px; background: #202124; border-bottom: 1px solid var(--line-dark); }
.frame-bar span { width: 10px; height: 10px; border-radius: 50%; background: #4A4C51; }
.frame-bar i { margin-left: var(--s1); flex: 1; max-width: 240px; height: 16px; border-radius: 999px; background: #2E3034; }

/* ---------- screenshot slots ----------
   <figure class="shot"> holds an <img> pointing at a named file in
   assets/screens/. The figure is a finished branded panel; if the file is
   missing, the img's onerror removes it and the panel shows instead. */
.shot { position: relative; margin: 0; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(160deg, #FFFFFF, var(--soft)); }
.feature .shot { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.frame .shot { background: linear-gradient(160deg, #303135, #26272A); }
.shot-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: var(--s3); text-align: center; color: var(--muted); font-size: .9375rem; }
.frame .shot-fallback { color: var(--on-dark-muted); }
.shot-fallback img { width: 56px; height: 56px; border-radius: var(--radius); }
.shot > img.shot-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; background: #fff; }

/* ---------- trust strip ---------- */
.trust { background: var(--dark-2); color: var(--on-dark); border-top: 1px solid var(--line-dark); }
.trust ul { list-style: none; margin: 0; padding: var(--s3) 0; display: grid; gap: var(--s2) var(--s3); grid-template-columns: 1fr; }
@media (min-width: 640px) { .trust ul { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .trust ul { grid-template-columns: repeat(4, auto); justify-content: space-between; } }
.trust li { display: flex; align-items: center; gap: 12px; font-weight: 500; font-size: .9375rem; }
.trust svg { flex-shrink: 0; color: var(--on-dark-accent); }

/* ---------- how it works ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); counter-reset: step; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4); }
.step-icon { width: 48px; height: 48px; border-radius: var(--radius); background: var(--accent-wash); color: var(--accent-ink); display: grid; place-items: center; margin-bottom: var(--s3); }
.step-num { display: block; font-size: .8125rem; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: var(--s1); }
.step p { color: var(--muted); margin: 0; }
.builtby { margin-top: var(--s5); text-align: center; color: var(--muted); font-weight: 500; }

/* ---------- features ---------- */
.features { display: grid; gap: var(--s10); }
.feature { display: grid; gap: var(--s4); align-items: center; }
@media (min-width: 900px) {
  .feature { grid-template-columns: 1fr 1.15fr; gap: var(--s8); }
  .feature:nth-child(even) .feature-copy { order: 2; }
}
.feature-copy p { color: var(--muted); }
.feature-label { font-size: .875rem; font-weight: 600; color: var(--accent-ink); margin-bottom: var(--s1); }
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { position: relative; padding-left: 28px; margin: var(--s1) 0; }
.ticks li::before { content: ""; position: absolute; left: 4px; top: .6em; width: 10px; height: 6px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg); }

/* ---------- pricing ---------- */
.price-group + .price-group { margin-top: var(--s8); }
.price-group > h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-family: var(--font); font-weight: 600; margin-bottom: var(--s3); }
.price-grid { display: grid; gap: var(--s3); }
@media (min-width: 768px) { .price-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .price-grid.four { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4) var(--s3); display: flex; flex-direction: column; }
@media (min-width: 768px) { .card { padding: var(--s4); } }
.card h4 { font: 600 1.25rem/1.3 var(--display); margin: 0 0 var(--s1); }
.card .who { color: var(--muted); font-size: .9375rem; margin-bottom: var(--s2); }
.price { font: 700 2.5rem/1.1 var(--display); margin: 0 0 var(--s1); }
.price small { font: 500 1rem/1 var(--font); color: var(--muted); }
.card .ticks { margin: var(--s2) 0 var(--s3); flex: 1; font-size: 1rem; }
.card .reassure { margin-top: 12px; font-size: .875rem; }
.card-featured { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.badge { align-self: flex-start; background: var(--accent-wash); color: var(--accent-ink); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 12px; border-radius: 999px; margin-bottom: var(--s2); }
.slots { font-size: .9375rem; font-weight: 600; color: var(--accent-ink); background: var(--accent-wash); border-radius: 8px; padding: var(--s1) 12px; margin: var(--s1) 0 0; }
.soon { font-size: .75rem; font-weight: 600; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px var(--s1); margin-left: 4px; white-space: nowrap; }
.define { margin: var(--s3) 0 0; font-size: .9375rem; color: var(--muted); }

.addons { margin-top: var(--s6); display: grid; gap: var(--s3); }
@media (min-width: 900px) { .addons { grid-template-columns: 1.1fr 1fr; align-items: start; } }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
table { width: 100%; border-collapse: collapse; font-size: 1rem; }
caption { text-align: left; padding: var(--s2) var(--s3) 4px; font: 600 1.0625rem/1.4 var(--display); }
th, td { text-align: left; padding: 12px var(--s3); border-top: 1px solid var(--border); }
thead th { font-size: .8125rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; white-space: nowrap; }
.note { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3); font-size: 1rem; }
.note h4 { font: 600 1.0625rem/1.4 var(--display); margin: 0 0 var(--s1); }
.note p:last-child { margin-bottom: 0; }

/* ---------- FAQ ---------- */
.faq { max-width: 52em; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; padding: var(--s3) var(--s5) var(--s3) 0; position: relative; font-weight: 600; font-size: 1.0625rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: var(--s1); top: 18px; font-size: 1.5rem; font-weight: 400; color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq .answer { padding: 0 0 var(--s3); color: var(--muted); }
.faq .answer p:last-child { margin-bottom: 0; }

/* ---------- final CTA band ---------- */
.final { background: var(--dark); color: var(--on-dark); text-align: center; }
.final h2 { color: #fff; }
.final .lede { color: var(--on-dark-muted); margin-left: auto; margin-right: auto; }
.final .cta-row { justify-content: center; }
.final .reassure { color: var(--on-dark-muted); }

/* ---------- footer ---------- */
.footer { background: var(--dark-2); color: var(--on-dark-muted); padding: var(--s5) 0; font-size: .9375rem; border-top: 1px solid var(--line-dark); }
.footer-inner { display: flex; flex-direction: column; gap: var(--s2); }
@media (min-width: 768px) { .footer-inner { flex-direction: row; justify-content: space-between; align-items: center; } }
.footer nav { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); }
.footer a { color: var(--on-dark); text-decoration: none; }
.footer a:hover { text-decoration: underline; color: #fff; }
.footer p { margin: 0; }

/* ---------- mobile sticky CTA bar ----------
   Hidden by default; site.js shows it on <=768px only while the hero CTA is
   out of view. Without JS it never appears (the hero CTA is always there). */
.mobile-cta { display: none; }
@media (max-width: 768px) {
  html.js .mobile-cta {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    padding: 12px var(--s2) calc(12px + env(safe-area-inset-bottom));
    background: var(--dark); border-top: 1px solid var(--line-dark);
    transform: translateY(110%); transition: transform .2s ease;
  }
  html.js .mobile-cta.show { transform: none; }
  html.js body { padding-bottom: 80px; }
}

/* ---------- legal / 404 pages ----------
   The legal text is inserted verbatim from the supplied fragments; these
   rules only style its h2/h3/p/ul/a plus the two classes it carries. */
.legal { padding: var(--s8) 0 var(--s10); }
.legal .meta { color: var(--muted); }
.legal-body { max-width: 70ch; margin-top: var(--s3); font-size: 1.0625rem; line-height: 1.7; overflow-wrap: anywhere; }
.legal-body h2 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem); margin: var(--s6) 0 var(--s2); }
.legal-body h3 { font-size: 1.125rem; margin: var(--s4) 0 var(--s1); }
.legal-body p { margin: 0 0 var(--s2); }
.legal-body ul { margin: 0 0 var(--s2); padding-left: var(--s3); }
.legal-body li { margin: 0 0 var(--s1); padding-left: 4px; }
.legal-body li::marker { color: var(--muted); }
.legal-body a { color: var(--accent-ink); }
.legal-body .legal-effective { color: var(--muted); font-size: .9375rem; margin-bottom: var(--s4); }
/* The disclaimer and limitation paragraphs are supplied in capitals. No
   text-transform is applied either way: the text renders exactly as written,
   just a touch smaller with extra line-height so long capitals stay readable. */
.legal-body .legal-caps { font-size: .9375rem; line-height: 1.8; letter-spacing: .01em; }

/* ---------- scroll reveal ----------
   Only when JS is running AND the visitor hasn't asked for reduced motion.
   Without JS, or under reduced motion, everything is simply visible. */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
  html.js .reveal.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* ---------- the switch ----------
   site.js sets <html data-pricing="off"> before first paint when SHOW_PRICING
   is false. Every pricing element AND every link pointing at it carries
   [data-pricing], so nothing is left pointing at a hidden anchor. */
html[data-pricing="off"] [data-pricing] { display: none !important; }
