/* Expense Hunt web — design system.
   Tokens mirror the app (src/utils/constants.ts): violet primary, teal/emerald/rose semantics.
   Light by default, dark via prefers-color-scheme. System font stack: no third-party requests. */

:root {
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --primary-50: #f5f3ff;
  --primary-100: #ede9fe;
  --primary-200: #ddd6fe;
  --primary-500: #8b5cf6;
  --primary-600: #7c3aed;
  --primary-700: #6d28d9;
  --primary-900: #2e1065;

  --bg: #f7f6f8;
  --surface: #ffffff;
  --surface-2: #f1f0f3;
  --border: #e5e7eb;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #64748b;
  --link: #6d28d9;
  --success: #047857;
  --success-bg: #ecfdf5;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --danger: #be123c;
  --danger-bg: #fff1f2;
  --focus: #7c3aed;

  --hero-1: #7c3aed;
  --hero-2: #4c1d95;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --shadow-1: 0 1px 2px rgb(15 23 42 / 6%), 0 1px 3px rgb(15 23 42 / 8%);
  --shadow-2: 0 10px 30px -10px rgb(76 29 149 / 30%);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px;
  --measure: 70ch;
  --wrap: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f1a;
    --surface: #1a1a2b;
    --surface-2: #232338;
    --border: #2d2d44;
    --text: #f8fafc;
    --text-2: #cbd5e1;
    --text-3: #94a3b8;
    --link: #c4b5fd;
    --success: #34d399;
    --success-bg: #06281f;
    --warn: #fbbf24;
    --warn-bg: #2a1d05;
    --danger: #fb7185;
    --danger-bg: #2d0f17;
    --focus: #c4b5fd;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow-2: 0 10px 30px -10px rgb(0 0 0 / 60%);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }
body { margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.65; color: var(--text); background: var(--bg); }
img, svg { max-width: 100%; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0; color: var(--text); }
p { margin: 0 0 var(--s4); }
ul, ol { margin: 0 0 var(--s4); padding-left: 1.25rem; }
li { margin-bottom: var(--s2); }
strong { font-weight: 650; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 6px; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--s5)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--primary-600); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.hide-sm { display: inline-flex; }

/* ── Buttons ───────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 48px; padding: 0 var(--s5); border-radius: var(--r-md); font-weight: 650; text-decoration: none; border: 1.5px solid transparent; cursor: pointer; transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease; font-size: 1rem; }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-sm { min-height: 40px; padding: 0 var(--s4); font-size: .9375rem; }
.btn-primary { background: var(--primary-600); color: #fff; box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--primary-700); }
.btn-light { background: #fff; color: var(--primary-700); }
.btn-light:hover { background: var(--primary-50); }
.btn-ghost { background: transparent; color: #fff; border-color: rgb(255 255 255 / 55%); }
.btn-ghost:hover { background: rgb(255 255 255 / 12%); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary-500); }

/* ── Header ────────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--border); }
.bar { display: flex; align-items: center; gap: var(--s5); min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.125rem; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.logo-mark { width: 32px; height: 32px; border-radius: 8px; }
.nav-inline { display: flex; gap: var(--s1); margin-left: auto; }
.nav-link { padding: 8px 14px; border-radius: 999px; color: var(--text-2); text-decoration: none; font-weight: 550; font-size: .9375rem; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link[aria-current="page"] { background: var(--primary-100); color: var(--primary-700); }
@media (prefers-color-scheme: dark) { .nav-link[aria-current="page"] { background: #2e2057; color: #ddd6fe; } }
.menu { display: none; margin-left: auto; position: relative; }
.menu summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.menu summary::-webkit-details-marker { display: none; }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; position: relative; content: ""; }
.menu-icon::before { position: absolute; top: -6px; }
.menu-icon::after { position: absolute; top: 6px; }
.menu-panel { position: absolute; right: 0; top: 52px; width: min(280px, 100vw - 32px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: var(--s2); display: grid; }
.menu-link { padding: 12px 14px; border-radius: var(--r-sm); color: var(--text); text-decoration: none; font-weight: 550; }
.menu-link:hover, .menu-link[aria-current="page"] { background: var(--surface-2); }
.menu-cta { background: var(--primary-600); color: #fff; text-align: center; margin-top: var(--s2); }
.menu-cta:hover { background: var(--primary-700); }
@media (max-width: 820px) { .nav-inline, .hide-sm { display: none; } .menu { display: block; } }

/* ── Hero ──────────────────────────────────────────────── */
.hero { background: radial-gradient(1200px 500px at 85% -10%, rgb(167 139 250 / 45%), transparent 60%), linear-gradient(160deg, var(--hero-1), var(--hero-2)); color: #fff; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--s7); align-items: center; padding: var(--s8) 0 var(--s7); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgb(255 255 255 / 14%); font-size: .875rem; font-weight: 600; margin-bottom: var(--s4); }
.hero h1 { color: #fff; font-size: clamp(2.25rem, 5vw, 3.75rem); letter-spacing: -0.03em; margin-bottom: var(--s4); }
.hero .lede { font-size: clamp(1.0625rem, 1.6vw, 1.25rem); color: rgb(255 255 255 / 88%); max-width: 52ch; margin-bottom: var(--s5); }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--s3); }
.hero-note { margin: var(--s4) 0 0; font-size: .875rem; color: rgb(255 255 255 / 75%); }
.hero-shot { justify-self: center; width: min(320px, 78%); filter: drop-shadow(0 30px 40px rgb(15 7 45 / 45%)); border-radius: 28px; }
.hero-shot img { border-radius: 28px; width: 100%; height: auto; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; padding: var(--s7) 0; } .hero-shot { width: min(260px, 70%); } }

/* ── Sections ──────────────────────────────────────────── */
.section { padding: var(--s8) 0; }
.section.alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-head { max-width: 60ch; margin-bottom: var(--s6); }
.section-head h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); margin-bottom: var(--s3); }
.section-head p { color: var(--text-2); font-size: 1.125rem; }
.kicker { color: var(--primary-600); font-weight: 700; font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: var(--s2); }
@media (prefers-color-scheme: dark) { .kicker { color: var(--primary-500); } }
.grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid.cols-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid.cols-3 { grid-template-columns: 1fr; } .section { padding: var(--s7) 0; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow-1); }
.section.alt .card { background: var(--bg); box-shadow: none; }
.card h3 { font-size: 1.125rem; margin-bottom: var(--s2); }
.card p { color: var(--text-2); margin: 0; font-size: .9875rem; }
.icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-100); color: var(--primary-700); margin-bottom: var(--s4); }
.icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-color-scheme: dark) { .icon { background: #2e2057; color: #ddd6fe; } }

/* Gallery */
.gallery { display: flex; gap: var(--s4); overflow-x: auto; padding: var(--s2) var(--s5) var(--s5); margin-inline: calc(-1 * var(--s5)); scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.gallery figure { margin: 0; flex: 0 0 min(270px, 72vw); scroll-snap-align: start; }
.gallery img { width: 100%; height: auto; border-radius: var(--r-xl); border: 1px solid var(--border); box-shadow: var(--shadow-2); }
.gallery figcaption { font-size: .875rem; color: var(--text-3); margin-top: var(--s2); }

/* Steps / privacy */
.privacy-split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6); align-items: start; }
@media (max-width: 860px) { .privacy-split { grid-template-columns: 1fr; } }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s3); }
.checklist li { display: grid; grid-template-columns: 24px 1fr; gap: var(--s3); margin: 0; align-items: start; }
.checklist li::before { content: ""; width: 24px; height: 24px; border-radius: 50%; background: var(--success-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center/14px no-repeat; margin-top: 2px; }
.flow { display: grid; gap: var(--s3); }
.flow-item { display: grid; grid-template-columns: auto 1fr; gap: var(--s4); padding: var(--s4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); align-items: center; }
.flow-item b { display: block; }
.flow-item span { color: var(--text-2); font-size: .9375rem; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--primary-100); color: var(--primary-700); white-space: nowrap; }
@media (prefers-color-scheme: dark) { .pill { background: #2e2057; color: #ddd6fe; } }
.pill.off { background: var(--surface-2); color: var(--text-3); }

/* Pricing */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }
.plan { border: 1px solid var(--border); border-radius: var(--r-xl); padding: var(--s6); background: var(--surface); }
.plan.premium { border: 2px solid var(--primary-600); box-shadow: var(--shadow-2); }
.plan h3 { font-size: 1.5rem; margin-bottom: var(--s2); }
.plan .sub { color: var(--text-2); margin-bottom: var(--s4); }
.tick-list { list-style: none; padding: 0; margin: 0; }
.tick-list li { padding-left: 28px; position: relative; margin-bottom: var(--s3); }
.tick-list li::before { content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--primary-600) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center/11px no-repeat; }
.fineprint { font-size: .875rem; color: var(--text-3); }

/* CTA band */
.band { background: linear-gradient(160deg, var(--hero-1), var(--hero-2)); color: #fff; border-radius: var(--r-xl); padding: var(--s7) var(--s6); text-align: center; }
.band h2 { color: #fff; font-size: clamp(1.75rem, 3.4vw, 2.5rem); margin-bottom: var(--s3); }
.band p { color: rgb(255 255 255 / 88%); max-width: 52ch; margin-inline: auto; }
.band .cta-row { justify-content: center; margin-top: var(--s5); }

/* ── Document pages ────────────────────────────────────── */
.page-head { background: var(--surface); border-bottom: 1px solid var(--border); padding: var(--s7) 0 var(--s6); }
.page-head h1 { font-size: clamp(2rem, 4.4vw, 3rem); margin-bottom: var(--s3); letter-spacing: -0.025em; }
.page-head .lede { color: var(--text-2); font-size: 1.1875rem; max-width: 62ch; margin: 0; }
.meta-row { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: var(--s4); color: var(--text-3); font-size: .875rem; }
.doc-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: var(--s7); padding: var(--s7) 0 var(--s8); align-items: start; }
.toc { position: sticky; top: 92px; font-size: .9375rem; max-height: calc(100vh - 110px); overflow: auto; }
.toc h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: var(--s3); }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.toc li { margin: 0; }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--text); border-left-color: var(--primary-500); }
@media (max-width: 960px) { .doc-layout { grid-template-columns: 1fr; gap: var(--s5); } .toc { position: static; max-height: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s4); } }
.prose { max-width: var(--measure); }
.prose section { margin-bottom: var(--s7); }
.prose h2 { font-size: 1.5rem; margin-bottom: var(--s4); padding-top: var(--s2); }
.prose h3 { font-size: 1.125rem; margin: var(--s5) 0 var(--s2); }
.prose li { color: var(--text-2); }
.prose p { color: var(--text-2); }
.prose strong { color: var(--text); }
.callout { border-radius: var(--r-md); padding: var(--s4) var(--s5); border: 1px solid; margin: 0 0 var(--s5); }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout.info { background: var(--primary-50); border-color: var(--primary-200); }
.callout.info p, .callout.info li { color: var(--primary-900); }
.callout.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.callout.warn p, .callout.warn li { color: var(--text); }
.callout.good { background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.callout.good p, .callout.good li { color: var(--text); }
@media (prefers-color-scheme: dark) { .callout.info { background: #1f1740; border-color: #3b2a78; } .callout.info p, .callout.info li { color: #ddd6fe; } }
.callout .t { font-weight: 700; color: var(--text); margin-bottom: var(--s2); display: block; }

.table-wrap { overflow-x: auto; margin: 0 0 var(--s5); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; min-width: 560px; }
th, td { text-align: left; padding: 12px 14px; vertical-align: top; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); font-size: .8125rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
tr:last-child td { border-bottom: 0; }
td { color: var(--text-2); }
td:first-child { color: var(--text); font-weight: 600; }

/* Steps */
.steps { list-style: none; counter-reset: step; padding: 0; display: grid; gap: var(--s3); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 36px 1fr; gap: var(--s4); margin: 0; padding: var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.steps li::before { content: counter(step); width: 36px; height: 36px; border-radius: 50%; background: var(--primary-600); color: #fff; display: grid; place-items: center; font-weight: 700; }

/* FAQ */
.faq details { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); margin-bottom: var(--s3); }
.faq summary { cursor: pointer; font-weight: 650; padding: var(--s4) var(--s5); list-style: none; display: flex; justify-content: space-between; gap: var(--s4); align-items: center; color: var(--text); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; line-height: 1; color: var(--primary-600); transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 var(--s5) var(--s4); color: var(--text-2); margin: 0; }
.faq h3 { margin: var(--s6) 0 var(--s3); font-size: 1.125rem; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: var(--s7) 0 var(--s6); margin-top: var(--s6); }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--s6); }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }
.foot-brand p { color: var(--text-2); max-width: 36ch; margin-top: var(--s3); font-size: .9375rem; }
.foot-h { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: var(--s3); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: var(--s2); }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--link); text-decoration: underline; }
.foot-legal { border-top: 1px solid var(--border); margin-top: var(--s6); padding-top: var(--s5); color: var(--text-3); font-size: .875rem; }
.foot-legal p { margin-bottom: var(--s2); }
.fine { font-size: .8125rem; max-width: 80ch; }

/* Deep-link & 404 pages */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: var(--s5); background: linear-gradient(160deg, var(--primary-50), var(--bg)); }
@media (prefers-color-scheme: dark) { .center-page { background: linear-gradient(160deg, #1b1236, var(--bg)); } }
.center-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: var(--s7) var(--s6); text-align: center; box-shadow: var(--shadow-2); }
.center-card .logo-mark { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto var(--s4); }
.center-card h1 { font-size: 1.5rem; margin-bottom: var(--s3); }
.center-card p { color: var(--text-2); }
.center-card .btn { width: 100%; margin-top: var(--s3); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary-600); animation: spin .8s linear infinite; margin: var(--s4) auto 0; }
@keyframes spin { to { transform: rotate(360deg); } }
[hidden] { display: none !important; }

@media print {
  .site-header, .site-footer, .toc, .skip { display: none; }
  body { background: #fff; color: #000; }
  .doc-layout { display: block; padding: 0; }
  a { color: #000; }
}

/* Small helpers */
.flow-title { font-size: 1.125rem; margin-bottom: var(--s4); }
.faq-wrap { max-width: 820px; padding-bottom: var(--s8); }
.faq-title { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: var(--s4); }
.center-page main { width: min(440px, 100%); }
