:root {
  --bg: #faf6f0;
  --surface: #ffffff;
  --ink: #1d1a16;
  --muted: #6b6259;
  --line: #e8dfd3;
  --accent: #d9481c;
  --accent-soft: #fbe6dc;
  color-scheme: light;
}
/* Dark: follows the OS unless the visitor picked a theme with the toggle (theme.js) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15120f;
    --surface: #1e1a16;
    --ink: #f3ede5;
    --muted: #a89d90;
    --line: #2f2923;
    --accent: #ff7a4d;
    --accent-soft: #3a2218;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15120f;
  --surface: #1e1a16;
  --ink: #f3ede5;
  --muted: #a89d90;
  --line: #2f2923;
  --accent: #ff7a4d;
  --accent-soft: #3a2218;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.7 "Plus Jakarta Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}
/* main grows so the footer sits at the bottom even on short pages */
main { flex: 1; width: 100%; }

.theme-toggle {
  width: 36px; height: 36px; padding: 0; flex-shrink: 0;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; line-height: 1.15; letter-spacing: -0.01em; }

/* Header */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-family: "Fraunces", serif; font-size: 20px;
}
.nav-links { display: flex; align-items: center; gap: 20px; font-size: 14px; font-weight: 600; }
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--ink); }

/* Landing */
.hero { max-width: 1080px; margin: 0 auto; padding: 88px 20px 64px; }
.eyebrow {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 700;
}
.hero h1 { font-size: clamp(40px, 7vw, 76px); margin: 20px 0 16px; max-width: 14ch; }
.hero h1 em { color: var(--accent); font-style: italic; }
.hero p { font-size: 19px; color: var(--muted); max-width: 56ch; margin: 0 0 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 12px;
  background: var(--ink); color: var(--bg);
  font-weight: 700; text-decoration: none;
  transition: transform .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-note { display: block; margin-top: 12px; font-size: 13px; color: var(--muted); }

.features {
  max-width: 1080px; margin: 0 auto; padding: 0 20px 96px;
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px;
}
.card .icon { font-size: 26px; }
.card h3 { font-size: 21px; margin: 12px 0 6px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

/* Legal pages */
.legal {
  max-width: 1080px; margin: 0 auto; padding: 56px 20px 96px;
  display: grid; gap: 48px; grid-template-columns: 220px minmax(0, 1fr);
}
.toc { position: sticky; top: 96px; align-self: start; font-size: 14px; }
.toc strong { display: block; margin-bottom: 10px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); border-left-color: var(--accent); }

.doc h1 { font-size: clamp(36px, 5vw, 52px); margin: 0 0 8px; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 32px; }
.summary {
  background: var(--accent-soft); border-radius: 16px; padding: 20px 24px; margin-bottom: 40px;
}
.summary p { margin: 0; }
.doc section { padding-top: 8px; margin-bottom: 36px; }
.doc h2 { font-size: 26px; margin: 0 0 12px; }
.doc p, .doc li { color: color-mix(in srgb, var(--ink) 88%, var(--muted)); }
.doc ul { padding-left: 20px; }
.doc li { margin-bottom: 6px; }

footer {
  border-top: 1px solid var(--line);
  padding: 28px 20px; text-align: center; font-size: 14px; color: var(--muted);
}
footer a { color: var(--muted); margin: 0 8px; }

@media (max-width: 760px) {
  .legal { grid-template-columns: 1fr; gap: 24px; padding-top: 32px; }
  .toc { position: static; }
  .nav-links { gap: 14px; }
  .hero { padding-top: 56px; }
}
