/* ---------------------------------------------------------------------------
   Design tokens
   Light-first with a real dark mode -- people sign documents at night and a
   white flash is a bad first impression.
   --------------------------------------------------------------------------- */
:root {
  --bg: #fbfbfa;        --surface: #ffffff;   --surface-2: #f4f4f2;
  --border: #e3e2de;    --text: #1a1a18;      --muted: #6b6a65;
  --accent: #1f6f5c;    --accent-hover: #185344; --accent-soft: #e8f2ef;
  --danger: #a63232;    --warn: #8a5a12;      --warn-soft: #fdf4e3;

  /* One spacing scale. Every margin and gap comes from here, which is what
     makes edges line up across unrelated sections. */
  --sp-1: 4px;   --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 24px;  --sp-6: 32px;  --sp-7: 48px;  --sp-8: 64px;
  --section: clamp(56px, 9vw, 96px);   /* rhythm between major sections */
  --gutter: clamp(20px, 4vw, 32px);    /* page edge padding, fluid */
  --card-pad: clamp(20px, 2.5vw, 28px);

  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 10px 30px rgba(0,0,0,.05);
  --header-h: 60px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16171a;      --surface: #1e2024;   --surface-2: #26282d;
    --border: #33363c;  --text: #e8e8e6;      --muted: #9a9a96;
    --accent: #4bb094;  --accent-hover: #5cc4a7; --accent-soft: #1c2f2a;
    --danger: #e07070;  --warn: #d9a441;      --warn-soft: #2b2517;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --bg: #16171a;        --surface: #1e2024;   --surface-2: #26282d;
  --border: #33363c;    --text: #e8e8e6;      --muted: #9a9a96;
  --accent: #4bb094;    --accent-hover: #5cc4a7; --accent-soft: #1c2f2a;
  --danger: #e07070;    --warn: #d9a441;      --warn-soft: #2b2517;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
}

/* ---------------------------------------------------------------------------
   Base
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15.5px; line-height: 1.62;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

h1, h2, h3 {
  line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 var(--sp-3);
  /* Stops headings breaking into a one-word orphan line, which is most of what
     made the old layout look ragged. */
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.35rem + 2.6vw, 3rem); letter-spacing: -0.032em; }
h2 { font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.7rem); }
h3 { font-size: 1.06rem; letter-spacing: -0.015em; }
p  { margin: 0 0 var(--sp-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------------------
   Layout
   --------------------------------------------------------------------------- */
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 720px; }

/* Consistent vertical rhythm without per-section inline margins. */
main > section { padding-block: 0; }
main > section + section { margin-top: var(--section); }

/* Auto-fit grids: 1 -> 2 -> 3 columns as space allows, with no dead zone where
   three cards are crushed. Equal heights come free from grid stretch. */
.grid { display: grid; gap: var(--sp-5); align-items: stretch; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

/* ---------------------------------------------------------------------------
   Header
   --------------------------------------------------------------------------- */
header.site {
  border-bottom: 1px solid var(--border); background: var(--surface);
  position: sticky; top: 0; z-index: 50;
}
header.site .wrap {
  display: flex; align-items: center; gap: var(--sp-5);
  min-height: var(--header-h); flex-wrap: wrap; padding-block: var(--sp-2);
}
.brand { font-weight: 660; letter-spacing: -0.025em; color: var(--text); font-size: 1.06rem; }
.brand:hover { text-decoration: none; }
.brand span { color: var(--accent); }
nav.site {
  margin-left: auto; display: flex; gap: var(--sp-5); align-items: center;
  flex-wrap: wrap;
}
nav.site a { color: var(--muted); font-size: .9rem; white-space: nowrap; }
nav.site a:hover { color: var(--text); text-decoration: none; }
@media (max-width: 560px) {
  /* Let the nav take its own row rather than squeezing the brand. */
  header.site .wrap { gap: var(--sp-2); }
  nav.site { margin-left: 0; width: 100%; gap: var(--sp-4); justify-content: flex-start; }
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 10px 18px; min-height: 42px; border-radius: 9px; border: 1px solid transparent;
  background: var(--accent); color: #fff; font: inherit; font-weight: 560;
  cursor: pointer; text-align: center; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--surface-2); color: var(--text); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: .875rem; }
.btn-row { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
@media (max-width: 420px) { .btn-row .btn { flex: 1 1 100%; } }

/* ---------------------------------------------------------------------------
   Cards
   Flex column + auto-margin on the trailing action is what puts every card's
   button on the same line regardless of how long the copy above it runs.
   --------------------------------------------------------------------------- */
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--card-pad);
}
.card > .btn:last-child,
.card > .btn-row:last-child { margin-top: auto; align-self: flex-start; }
.card > h2, .card > h3 { margin-bottom: var(--sp-2); }
/* Only the element immediately before a pinned BUTTON needs extra clearance.
   Scoping this with :has() matters -- applied unconditionally it also hit the
   heading in two-child cards and opened a gap under every title. */
.card:has(> .btn:last-child) > *:nth-last-child(2) { margin-bottom: var(--sp-5); }

/* ---------------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------------- */
.hero { padding-block: clamp(48px, 7vw, 84px) 0; }
.hero h1 { max-width: 20ch; }
.hero p.lede {
  font-size: clamp(1.02rem, .97rem + .35vw, 1.2rem); color: var(--muted);
  max-width: 54ch; margin-bottom: var(--sp-6);
}
.pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: .8rem;
  color: var(--accent); background: var(--accent-soft); border-radius: 999px;
  padding: 5px 13px; font-weight: 560; margin-bottom: var(--sp-4);
}

/* ---------------------------------------------------------------------------
   Pricing
   --------------------------------------------------------------------------- */
.pack { position: relative; }
.pack h3 { margin-bottom: var(--sp-1); }
.price {
  font-size: clamp(1.85rem, 1.6rem + 1vw, 2.15rem); font-weight: 660;
  letter-spacing: -0.035em; line-height: 1.1; margin-bottom: var(--sp-4);
  font-variant-numeric: tabular-nums;
}
.price small { font-size: .82rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.pack ul {
  list-style: none; padding: 0; margin: 0 0 var(--sp-5);
  color: var(--muted); font-size: .9rem;
}
.pack li { padding: 3px 0 3px 22px; position: relative; }
.pack li::before {
  content: "✓"; position: absolute; left: 0; top: 3px;
  color: var(--accent); font-size: .85em;
}
.pack.featured { border-color: var(--accent); box-shadow: var(--shadow); }
.grid-note { grid-column: 1 / -1; margin: 0; }

/* ---------------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------------- */
label { display: block; font-size: .875rem; font-weight: 560; margin-bottom: var(--sp-2); }
input[type=text], input[type=email], select {
  width: 100%; padding: 10px 12px; min-height: 42px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text); font: inherit;
}
input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent;
}
.check {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  margin-block: var(--sp-4); font-size: .9rem; color: var(--muted);
  line-height: 1.55; font-weight: 400; cursor: pointer;
}
.check input { margin-top: 4px; flex-shrink: 0; width: 16px; height: 16px; accent-color: var(--accent); }
.row { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------------------
   Notices
   --------------------------------------------------------------------------- */
.note {
  border-radius: 10px; padding: var(--sp-3) var(--sp-4);
  font-size: .9rem; margin-block: var(--sp-4);
}
.note.info { background: var(--accent-soft); color: var(--accent); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.err  { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.stack > * + * { margin-top: var(--sp-4); }

/* ---------------------------------------------------------------------------
   Tables -- scroll inside their own box so the page never scrolls sideways
   --------------------------------------------------------------------------- */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; min-width: 420px; }
th, td { text-align: left; padding: 10px var(--sp-4); border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
th {
  font-weight: 600; color: var(--muted); font-size: .78rem;
  text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
td { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */
footer.site {
  border-top: 1px solid var(--border); margin-top: var(--section);
  padding-block: var(--sp-6); color: var(--muted); font-size: .875rem;
}
footer.site .wrap { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center; }
footer.site nav { margin-left: auto; display: flex; gap: var(--sp-5); flex-wrap: wrap; }
@media (max-width: 480px) { footer.site nav { margin-left: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
