/* Apricot Sage palette, matching the TabSplit app (src/theme/colors.ts) */
/* light-dark(light, dark) follows color-scheme: the system by default, or the saved choice from theme.js */
:root {
  color-scheme: light dark;
  --bg: light-dark(#FAF6EE, #141A14);
  --surface: light-dark(#FFFFFF, #1C241C);
  --surface-alt: light-dark(#F3EDE1, #242E24);
  --primary: light-dark(#5E7A57, #A9C4A0);
  --primary-dark: light-dark(#465D41, #C2D6BA);
  --apricot: light-dark(#F7DDC4, #3A2E22);
  --text: light-dark(#2E2A22, #EEF3EA);
  --text-2: light-dark(#6B6455, #A5B3A2);
  --border: light-dark(#E4DCCB, #2E3A2D);
  --on-primary: light-dark(#FFFFFF, #141A14);
  --ink: light-dark(#2E2A22, #EEF3EA);
  --on-ink: light-dark(#FAF6EE, #141A14);
  --pos: light-dark(#3F6B3A, #A9C4A0);
  --neg: light-dark(#9A4A2E, #EBA98B);
  /* Index-tab and avatar tints: pastel in both themes, always with dark text */
  --tab-1: #E2BE9C;
  --tab-2: #B9CDB0;
  --tab-3: #D9A585;
  --tab-4: #F2B880;
  --on-tab: #1F2A1E;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif;
  line-height: 1.55;
}
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
img, svg { max-width: 100%; }
[id] { scroll-margin-top: 84px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 24px; }
.display { font-weight: 800; font-stretch: 75%; line-height: 1; letter-spacing: -0.02em; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; gap: 12px 28px; min-height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-stretch: 75%; font-size: 1.55rem; text-decoration: none; color: var(--text); letter-spacing: -0.02em; }
.logo-word span { color: var(--primary); }
.logo-mark { width: 36px; height: 36px; }
/* Show the mark that matches the active theme: saved choice first, else the system */
.logo-mark-dark, :root[data-theme="dark"] .logo-mark:not(.logo-mark-dark) { display: none; }
:root[data-theme="dark"] .logo-mark-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-mark:not(.logo-mark-dark) { display: none; }
  :root:not([data-theme="light"]) .logo-mark-dark { display: block; }
}
.site-header nav { display: flex; gap: 24px; flex: 1 1 auto; font-weight: 500; }
.site-header nav a { color: var(--text-2); text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.theme-toggle { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center; padding: 0; }
.theme-toggle:hover { background: var(--surface-alt); }
.btn-ink { display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border-radius: 22px; background: var(--ink); color: var(--on-ink); font-weight: 700; text-decoration: none; white-space: nowrap; }
.btn-ink:hover { color: var(--on-ink); opacity: 0.9; }
@media (max-width: 640px) {
  .site-header nav { display: none; }
}

/* Shared buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 22px; border-radius: 14px; font-weight: 700; text-decoration: none; }
.btn-outline { border: 1.5px solid var(--border); background: var(--surface); color: var(--text); }
.btn-outline:hover { background: var(--surface-alt); color: var(--text); }
.chip-soon { display: inline-flex; align-items: center; gap: 8px; min-height: 56px; padding: 0 20px; border-radius: 14px; background: var(--apricot); color: var(--text); font-weight: 700; }

/* Sections */
section { padding-block: 72px; }
/* Two plain sections in a row share one gap instead of stacking both paddings */
section.wrap + section.wrap { padding-top: 0; }
.section-title { font-size: clamp(2.1rem, 5vw, 3.25rem); margin: 0 0 28px; }
.lead { font-size: 1.1rem; color: var(--text-2); max-width: 44ch; margin: 0; }

/* Hero */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; padding-top: 64px; }
.hero-copy { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.hero h1 { font-size: clamp(2.75rem, 7vw, 5.25rem); line-height: 0.95; letter-spacing: -0.025em; margin: 0; max-width: 11ch; }
.hero-copy > p { font-size: 1.2rem; color: var(--text-2); max-width: 46ch; margin: 0; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; }
.ticks { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--text-2); font-size: 0.95rem; }
.ticks li { display: flex; align-items: center; gap: 6px; }
.ticks svg { color: var(--primary); flex: none; }

/* App preview */
.preview { flex: 0 1 340px; min-width: 0; margin: 0 auto; }
.device { border-radius: 40px; background: var(--ink); padding: 10px; }
.screen { border-radius: 32px; background: light-dark(#FAF6EE, #141A14); padding: 22px 18px 24px; display: flex; flex-direction: column; gap: 14px; }
.screen-top { display: flex; align-items: center; justify-content: space-between; font-size: 0.8rem; color: var(--text-2); }
.screen-title { font-size: 1.9rem; }
.owed { border-radius: 18px; background: var(--primary); color: var(--on-primary); padding: 16px; font-size: 0.8rem; }
.owed strong { display: block; font-size: 2rem; font-weight: 800; font-stretch: 75%; line-height: 1.1; }
.tab { position: relative; padding-top: 20px; margin-top: -6px; color: var(--on-tab); }
.tab-label { position: absolute; top: 0; height: 24px; padding: 0 12px; border-radius: 10px 10px 0 0; background: var(--tint); font-size: 0.7rem; font-weight: 700; line-height: 24px; }
.tab-body { display: flex; justify-content: space-between; gap: 8px; padding: 13px 14px; background: var(--tint); border-radius: 14px; font-size: 0.875rem; line-height: 1.35; }
.tab-body small { font-size: 0.75rem; }
.screen-btn { display: flex; align-items: center; justify-content: center; height: 46px; border-radius: 14px; background: var(--ink); color: var(--on-ink); font-weight: 700; }

.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--tint); color: var(--on-tab); font-size: 0.85rem; font-weight: 700; }
.t1 { --tint: var(--tab-1); }
.t2 { --tint: var(--tab-2); }
.t3 { --tint: var(--tab-3); }
.t4 { --tint: var(--tab-4); }

/* Settle-up example */
.band { background: var(--surface-alt); }
.settle { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 40px 56px; }
.settle-copy { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.settle-copy .section-title { margin: 0; }
.balances-title { margin: 10px 0 0; font-size: 0.9rem; }
.balances { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.balances li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--surface); }
.balances li > span:nth-child(2) { flex: 1; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.settle-card { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; padding: 24px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); }
.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-alt); }
.segmented button { min-height: 44px; border: 0; border-radius: 11px; background: transparent; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
.count { display: flex; align-items: baseline; gap: 10px; margin: 0; color: var(--text-2); font-size: 1.05rem; }
.count strong { font-size: 4rem; line-height: 1; font-weight: 800; font-stretch: 75%; color: var(--text); }
.plan-smart .count strong { color: var(--pos); }
.payments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.payments li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.payments li > span:nth-child(4) { flex: 1; }
.payments .arrow { color: var(--text-2); flex: none; }
.caption { margin: 0; color: var(--text-2); font-size: 0.9rem; }
.plan[hidden] { display: none; }
.plan { display: flex; flex-direction: column; gap: 16px; }

/* Features */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px; }
.card svg { color: var(--primary); }
.card h3 { margin: 12px 0 6px; font-size: 1.25rem; }
.card p { margin: 0; color: var(--text-2); }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; counter-reset: step; }
.steps li { counter-increment: step; display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 20px; background: var(--surface-alt); color: var(--text-2); }
.steps li::before { content: counter(step); width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-weight: 800; display: grid; place-items: center; }
.steps strong { color: var(--text); font-size: 1.15rem; }

/* Privacy callout + FAQ */
.faq-row { display: flex; flex-wrap: wrap; gap: 32px 48px; align-items: flex-start; }
.callout { flex: 1 1 320px; min-width: 0; padding: 28px; border-radius: 24px; background: var(--apricot); display: flex; flex-direction: column; gap: 10px; }
.callout h2 { margin: 0; font-size: 1.75rem; }
.callout p { margin: 0; }
.callout a { font-weight: 700; color: var(--text); }
.faq { flex: 2 1 460px; min-width: 0; }
.faq h2 { margin: 0 0 12px; font-size: clamp(1.9rem, 4vw, 2.5rem); }
.faq details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { cursor: pointer; font-size: 1.125rem; font-weight: 700; min-height: 32px; }
.faq details p { margin: 8px 0 0; color: var(--text-2); }

/* Legal pages */
.legal { padding: 56px 24px 88px; display: flex; flex-direction: column; gap: 40px; }
.legal-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.legal-head h1 { font-size: clamp(2.75rem, 6vw, 4.5rem); line-height: 0.95; margin: 0; }
.legal-head p { margin: 10px 0 0; color: var(--text-2); }
.legal-head a { font-weight: 700; }
.short { padding: 28px; border-radius: 24px; background: var(--surface-alt); }
.short h2 { margin: 0 0 18px; font-size: 1.65rem; }
.short ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.short li { padding: 18px; border-radius: 16px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.short li svg { color: var(--primary); }
.short li span { color: var(--text-2); font-size: 0.95rem; }
.legal-body { display: flex; flex-wrap: wrap; gap: 32px 56px; align-items: flex-start; }
.toc { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 0.95rem; position: sticky; top: 92px; }
.toc > span { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.03em; color: var(--text-2); margin-bottom: 6px; }
.toc a { padding: 6px 12px; border-radius: 10px; color: var(--text-2); text-decoration: none; }
.toc a:hover { background: var(--surface); color: var(--text); }
.legal-text { flex: 999 1 560px; min-width: 0; max-width: 720px; font-size: 1.06rem; line-height: 1.6; }
.legal-text > p:first-child { margin-top: 0; }
.legal-text h2 { font-size: 1.375rem; margin: 36px 0 8px; }
.legal-text li { margin-bottom: 6px; }
/* On narrow screens the contents list sits above the text, so it must not stick */
@media (max-width: 860px) { .toc { position: static; } }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--text-2); font-size: 0.95rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--text-2); }
.site-footer a[aria-current="page"] { color: var(--text); font-weight: 700; }
