/* Shared styles for every page except /plan (which keeps its own inline copy).
   Tokens, fonts and buttons match /plan exactly. */
[hidden] { display: none !important; }

:root {
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --fg: #0E1726;
  --muted: #5B6676;
  --line: #D6DCE4;
  --accent: #E0532A;
  --accent-ink: #FFFFFF;
  --k-low: #B7C0CC;
  --focus: #1F5FD1;
  --display: "Bricolage Grotesque", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --body: "Public Sans", "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B111C; --surface: #121A28; --fg: #F2F5F9; --muted: #B3BCC9; --line: #2C3950;
    --accent: #F2704B; --accent-ink: #0B111C; --k-low: #37435A; --focus: #7FA6F5; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B111C; --surface: #121A28; --fg: #F2F5F9; --muted: #B3BCC9; --line: #2C3950;
  --accent: #F2704B; --accent-ink: #0B111C; --k-low: #37435A; --focus: #7FA6F5; color-scheme: dark;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
main.wrap { padding-block: 40px 56px; display: grid; gap: 72px; }
@media (min-width: 700px) { main.wrap { padding-block: 64px 88px; gap: 96px; } }

/* Type */
h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.1rem, 6.4vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.022em;
  margin: 0;
  text-wrap: balance;
  max-width: 14ch;
}
h1 em, h2 em { font-style: normal; color: var(--accent); }
h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.45rem, 3.6vw, 1.9rem);
  line-height: 1.15;
  letter-spacing: -0.012em;
  margin: 0 0 14px;
  text-wrap: balance;
}
h3 { font-family: var(--display); font-weight: 700; font-size: 1.08rem; margin: 0 0 2px; }
p { margin: 0; }
.lede { font-size: 1.15rem; max-width: 40ch; line-height: 1.5; }
.fine { font-size: 0.96rem; color: var(--muted); }
.eyebrow {
  font-family: var(--display); font-weight: 700; font-size: 0.8rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.lines { display: grid; gap: 6px; max-width: 46ch; }
a { color: inherit; }

/* Buttons: same as /plan */
.btn {
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  padding: 17px 24px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
.btn:hover { filter: brightness(0.95); }
.btn:disabled { opacity: 0.7; cursor: default; }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.text-link { font-weight: 600; text-underline-offset: 3px; }
@media (min-width: 560px) { .cta-row .btn, .btn.wide { min-width: 280px; padding: 17px 28px; } }
@media (max-width: 559px) {
  .cta-row { flex-direction: column; align-items: stretch; gap: 14px; }
  .cta-row .btn, .btn.wide { width: 100%; padding-block: 19px; font-size: 1.25rem; }
  .cta-row .text-link { text-align: center; }
}

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; min-height: 64px; position: relative; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand svg { width: 20px; height: 30px; display: block; flex: none; }
.brand span { font-family: var(--display); font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; white-space: nowrap; }
.links { display: flex; gap: 22px; align-items: center; }
.links a { text-decoration: none; font-weight: 600; font-size: 0.98rem; color: var(--muted); }
.links a:hover, .links a[aria-current="page"] { color: var(--fg); }
.topbar .btn { font-size: 1rem; padding: 10px 16px; white-space: nowrap; }
.menu-btn {
  display: none; appearance: none; background: transparent; color: var(--fg);
  border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 600; font-size: 0.95rem;
  padding: 8px 12px; cursor: pointer;
}
@media (max-width: 719px) {
  .menu-btn { display: inline-block; }
  .links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 6px max(16px, env(safe-area-inset-left, 0px)) 12px;
  }
  .topbar.open .links { display: flex; }
  .links a { padding: 12px 0; font-size: 1.05rem; color: var(--fg); border-top: 1px solid var(--line); }
  .links a:first-child { border-top: 0; }
}
@media (max-width: 380px) { .brand span { display: none; } }

/* Boxed card (same as /plan .card) */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 20px 28px;
}
@media (min-width: 700px) { .card { padding: 36px 36px 40px; } }

/* Forms (same field styles as /plan) */
form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; min-width: 0; }
.row { display: grid; gap: 18px; }
@media (min-width: 560px) { .row.two { grid-template-columns: 1fr 1fr; } }
label { font-weight: 600; font-size: 0.98rem; }
.opt { font-weight: 400; color: var(--muted); }
input, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 12px 13px; min-width: 0;
}
textarea { min-height: 120px; resize: vertical; }
.error { color: var(--accent); font-weight: 600; font-size: 0.95rem; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { padding-block: 28px 40px; display: grid; gap: 10px; color: var(--muted); font-size: 0.92rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer nav a { color: var(--fg); text-decoration: none; font-weight: 600; }
.site-footer nav a:hover { text-decoration: underline; }

/* Plain text pages (terms, privacy, 404) */
.doc { display: grid; gap: 28px; max-width: 62ch; }
.doc section { display: grid; gap: 6px; }
.doc h2 { font-size: 1.25rem; margin: 0; }
.doc ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
