/* Public front page (home.html). Same brand tokens as the app (src/index.css); dark is the default,
   :root[data-theme="light"] is set by /theme-init.js from the visitor's saved preference. */
@font-face {
  font-family: "Inter Variable";
  src: url("/brand/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/brand/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --canvas: #0b1119;
  --canvas-alt: #0e151f;
  --panel: #121b27;
  --line: #1e2a3a;
  --line-strong: #2a3a4e;
  --ink: #e9eef5;
  --muted: #9aaabe;
  --dim: #6b7c91;
  --accent: #4fa3e8;
  --accent-soft: rgba(43, 139, 220, 0.12);
  --brand: #1b74bb;
  --brand-hover: #2b8bdc;
  --ok: #3fbf87;
  --shadow-card: 0 18px 45px -22px rgba(0, 0, 0, 0.85);
  --shadow-brand: 0 10px 26px -12px rgba(27, 116, 187, 0.9);
  --mark: rgba(240, 113, 103, 0.18);
  --mark-ink: #f5a39b;
  --font-brand: "Avenir Next LT Pro", "Avenir Next", "Inter Variable", system-ui, -apple-system, sans-serif;
  --font-ui: "Inter Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --canvas: #f4f7fb;
  --canvas-alt: #eef3f9;
  --panel: #ffffff;
  --line: #dde4ed;
  --line-strong: #c5d0dd;
  --ink: #0b1119;
  --muted: #4f5d6e;
  --dim: #6b7c91;
  --accent: #145a93;
  --accent-soft: rgba(27, 116, 187, 0.1);
  --brand-hover: #145a93;
  --ok: #1f8a5b;
  --shadow-card: 0 18px 40px -26px rgba(16, 32, 56, 0.35);
  --shadow-brand: 0 10px 22px -14px rgba(27, 116, 187, 0.7);
  --mark: rgba(180, 35, 24, 0.1);
  --mark-ink: #b42318;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-brand);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-ui); margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: #1b74bb; color: #fff; }

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.eyebrow { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.mono { font-family: var(--font-mono); }
.dim { color: var(--dim); }
.center { text-align: center; }

/* buttons and links */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 20px; border-radius: 10px; border: 1px solid transparent;
  background: var(--brand); color: #fff; text-decoration: none;
  font-family: var(--font-ui); font-weight: 600; font-size: 0.95rem;
  box-shadow: var(--shadow-brand); transition: background 0.15s, transform 0.15s;
}
.btn:hover { background: var(--brand-hover); transform: translateY(-1px); }
.btn-sm { padding: 8px 14px; font-size: 0.875rem; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); box-shadow: none; }
.btn-ghost:hover { background: var(--accent-soft); }
.link { font-family: var(--font-ui); font-weight: 500; font-size: 0.9rem; color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; }
[hidden] { display: none !important; }

/* ---------- hero (always dark, like the sign-in screen) ---------- */
.hero {
  color: #e9eef5;
  background-color: #0b1119;
  background-image:
    radial-gradient(ellipse 70% 55% at 75% 30%, rgba(43, 139, 220, 0.22), transparent 70%),
    linear-gradient(rgba(79, 163, 232, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 163, 232, 0.07) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
  padding-bottom: 72px;
}
.hero .btn-ghost { color: #e9eef5; border-color: rgba(154, 170, 190, 0.35); }
.hero .btn-ghost:hover { background: rgba(79, 163, 232, 0.12); }
.hero .link { color: #9aaabe; }
.hero .link:hover { color: #fff; text-decoration: none; }
.nav { display: flex; align-items: center; gap: 24px; padding-block: 18px; }
.logo img { width: 120px; filter: drop-shadow(0 0 18px rgba(43, 139, 220, 0.35)); }
.nav-links { display: flex; gap: 22px; margin-left: 12px; }
.nav-links a { color: #9aaabe; text-decoration: none; font-family: var(--font-ui); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: #fff; }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.theme { background: none; border: 0; color: #9aaabe; padding: 6px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.theme:hover { color: #fff; background: rgba(79, 163, 232, 0.12); }

.hero-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 56px; align-items: center; padding-top: 56px; }
.hero .eyebrow { color: #4fa3e8; display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #3fbf87; box-shadow: 0 0 0 4px rgba(63, 191, 135, 0.16); }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; line-height: 1.06; letter-spacing: -0.035em; }
h1 span { color: #4fa3e8; }
.lede { margin-top: 20px; font-size: 1.125rem; color: #9aaabe; max-width: 58ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.fine { margin-top: 12px; font-size: 0.85rem; color: #6b7c91; }

.finding {
  margin: 0; background: rgba(18, 27, 39, 0.85); border: 1px solid #2a3a4e; border-radius: 14px;
  padding: 22px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(79, 163, 232, 0.08);
  backdrop-filter: blur(4px);
}
.finding-top { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; }
.finding .dim { color: #6b7c91; }
.sev { font-family: var(--font-mono); font-size: 0.75rem; color: #fff; padding: 2px 8px; border-radius: 4px; }
.sev-critical { background: #7b1fa2; }
.finding-title { font-family: var(--font-ui); font-weight: 700; font-size: 1.15rem; margin-top: 10px; }
.vector { font-size: 0.72rem; color: #4fa3e8; margin-top: 6px; word-break: break-all; }
.finding dl { margin: 16px 0 0; border-top: 1px dashed #2a3a4e; }
.finding dl div { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px dashed #1e2a3a; }
.finding dl div:last-child { border-bottom: 0; padding-bottom: 0; }
.finding dt { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: #6b7c91; padding-top: 3px; }
.finding dd { margin: 0; font-size: 0.88rem; color: #c9d4e2; }
.pill { font-family: var(--font-mono); font-size: 0.72rem; color: #e3a94a; background: rgba(227, 169, 74, 0.12); border-radius: 999px; padding: 2px 9px; }

/* ---------- sections ---------- */
.band { padding-block: 88px; border-top: 1px solid var(--line); }
.section-head { max-width: 760px; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 800; line-height: 1.15; margin-top: 10px; }
.section-head em { font-style: normal; color: var(--accent); }

/* time saved */
.stats { background: var(--canvas-alt); }
.stat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-card); }
.stat-num { font-family: var(--font-ui); font-weight: 800; font-size: 1.45rem; letter-spacing: -0.02em; white-space: nowrap; }
.stat-num span { color: var(--accent); font-weight: 600; }
.stat-label { font-size: 0.9rem; color: var(--muted); flex: 1; }
.bars { display: grid; gap: 5px; margin-top: 4px; }
.bars i { display: block; height: 6px; border-radius: 3px; }
.bars .hand, .key.hand { background: var(--line-strong); }
.bars .ai, .key.ai { background: var(--accent); }
.bars .hand { width: 100%; }
.bars .ai { width: max(var(--w), 6px); }
.legend { margin-top: 22px; display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); }
.key { display: inline-block; width: 18px; height: 6px; border-radius: 3px; }
.key.ai { margin-left: 14px; }
.footnote { margin-top: 10px; font-size: 0.82rem; color: var(--dim); }

/* features */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: var(--shadow-card); }
.card h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.94rem; }
.flow { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); counter-reset: step; }
.flow li { position: relative; counter-increment: step; padding-right: 12px; min-width: 0; }
.flow li::before {
  content: counter(step); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--accent); color: var(--accent); background: var(--canvas);
  font-family: var(--font-mono); font-size: 0.8rem; position: relative; z-index: 1; margin-bottom: 10px;
}
.flow li::after { content: ""; position: absolute; top: 15px; left: 30px; right: 0; height: 1.5px; background: var(--line-strong); }
.flow li:last-child::after { display: none; }
.flow b { display: block; font-family: var(--font-ui); font-size: 0.95rem; }
.flow span { display: block; font-size: 0.82rem; color: var(--muted); line-height: 1.4; }

/* privacy */
.privacy { background: var(--canvas-alt); }
.privacy-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.privacy .section-head { margin-bottom: 18px; }
.lede-dark { color: var(--muted); font-size: 1.02rem; }
.mask { margin-top: 26px; display: grid; gap: 10px; }
.mask > div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.mask-label { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; }
.mask code { font-family: var(--font-mono); font-size: 0.85rem; word-break: break-word; }
.mask mark { background: var(--mark); color: var(--mark-ink); border-radius: 3px; padding: 0 3px; }
.mask b { color: var(--accent); font-weight: 500; background: var(--accent-soft); border-radius: 3px; padding: 0 3px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.checks li { position: relative; padding-left: 32px; color: var(--muted); font-size: 0.95rem; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%233fbf87' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.checks strong { color: var(--ink); font-family: var(--font-ui); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips span { font-size: 0.78rem; border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 10px; background: var(--panel); color: var(--ink); white-space: nowrap; }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 760px; }
.plan { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-card); }
.plan-hi { border-color: var(--accent); box-shadow: var(--shadow-brand); }
.plan h3 { font-size: 1.15rem; }
.price { font-family: var(--font-ui); font-weight: 800; font-size: 2.1rem; letter-spacing: -0.03em; margin-top: 6px; }
.price span { font-size: 0.95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan ul { margin: 12px 0 18px; padding-left: 18px; color: var(--muted); font-size: 0.94rem; flex: 1; }
.plan li::marker { color: var(--accent); }
.plans + .center { margin-top: 26px; max-width: 760px; }
.footnote.center { max-width: 760px; }

/* final call to action */
.final { background: linear-gradient(180deg, var(--canvas), var(--canvas-alt)); }
.final-inner { text-align: center; }
.final h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 800; }
.final .cta-row { justify-content: center; }

.foot { border-top: 1px solid var(--line); padding-block: 22px; font-size: 0.85rem; color: var(--dim); }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; }
.foot .eyebrow { color: var(--dim); }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero-body { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 36px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .privacy-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 22px; }
  .flow li:nth-child(3)::after { display: none; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .band { padding-block: 60px; }
  .hero { padding-bottom: 52px; }
}
@media (max-width: 560px) {
  .wrap { padding-inline: 16px; }
  .nav { gap: 10px; }
  .nav-actions { gap: 8px; }
  .nav-signin { display: none; } /* "Sign in" stays in the hero */
  .logo img { width: 96px; }
  .stat-grid, .cards, .plans { grid-template-columns: minmax(0, 1fr); }
  .stat-num { font-size: 1.3rem; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow li:nth-child(3)::after { display: block; }
  .flow li:nth-child(2n)::after { display: none; }
  .finding dl div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .cta-row .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .btn:hover { transform: none; }
}

/* ---------- legal pages (terms.html, privacy.html, refunds.html) ---------- */
.hero.slim { padding-bottom: 36px; }
.legal-head { padding-top: 28px; max-width: 760px; }
.legal-head h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.legal-head p { color: #9aaabe; margin-top: 10px; }
.legal { padding-block: 48px 72px; }
.legal .wrap { max-width: 820px; }
.legal h2 { font-size: 1.25rem; font-weight: 700; margin: 36px 0 10px; }
.legal h2:first-child { margin-top: 0; }
.legal h3 { font-size: 1rem; font-weight: 700; margin: 20px 0 6px; }
.legal p, .legal li { color: var(--muted); font-size: 0.97rem; }
.legal p + p { margin-top: 10px; }
.legal ul, .legal ol { padding-left: 22px; margin: 8px 0 0; }
.legal li { margin: 4px 0; }
.legal strong { color: var(--ink); }
.legal a { color: var(--accent); }
.legal table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.92rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--muted); }
.legal th { color: var(--ink); font-family: var(--font-ui); font-weight: 600; background: var(--canvas-alt); }
.table-scroll { overflow-x: auto; }
.company { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-top: 12px; }
.company p { margin: 0; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.legal-nav a { color: var(--muted); text-decoration: none; }
.legal-nav a:hover { color: var(--accent); }
.legal-nav a[aria-current="page"] { color: var(--ink); }
