/* Shared by privacy-policy.html and terms-of-service.html.
   Fleuret palette (mirrors index.html and the app): deep green ground, warm cream
   text, sage for quiet accents, orchid for interactive. Brass is "earned" in the
   app and deliberately absent here. Headings use Gilda Display (the app's face);
   body is Inter for long-form legibility, as most legal centres do. */

:root {
  --bg:        #0d1a0f;
  --bg-raised: #122215;
  --rule:      #22352a;
  --rule-soft: #1a2b1e;
  --text:      #d4cfc8;
  --heading:   #ede8df;
  --muted:     #8fa892;
  --sage:      #7a9e7e;
  --link:      #b69ad6;
  --link-hover:#d4c1ea;
  --orchid:    #8f6fb3;
  --serif: 'Gilda Display', Georgia, 'Times New Roman', serif;
  --sans:  Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: underline; text-decoration-color: rgba(182,154,214,.35); text-underline-offset: 3px; overflow-wrap: anywhere; }
a:hover { color: var(--link-hover); text-decoration-color: currentColor; }
a:focus-visible { outline: 2px solid var(--orchid); outline-offset: 2px; border-radius: 2px; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(13,26,15,.92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 24px; height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.wordmark { font-family: var(--serif); font-size: 24px; color: var(--heading); text-decoration: none; letter-spacing: .01em; }
.wordmark:hover { color: var(--heading); }
.doc-tabs { display: flex; gap: 4px; }
.doc-tabs a {
  font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none;
  padding: 7px 12px; border-radius: 999px; white-space: nowrap;
}
.doc-tabs a:hover { color: var(--heading); background: var(--rule-soft); }
.doc-tabs a[aria-current="page"] { color: var(--heading); background: var(--rule); }

/* ── Title block ─────────────────────────────────────────────────────────── */
.hero { border-bottom: 1px solid var(--rule); background: linear-gradient(180deg, var(--bg-raised), var(--bg)); }
.hero-inner { max-width: 1120px; margin: 0 auto; padding: 56px 24px 40px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--sage); margin-bottom: 10px; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: 48px; line-height: 1.1; color: var(--heading); }
.meta { margin-top: 14px; font-size: 14px; color: var(--muted); }

/* ── Layout: contents rail + document ───────────────────────────────────── */
.layout {
  max-width: 1120px; margin: 0 auto; padding: 40px 24px 80px;
  display: grid; grid-template-columns: 240px minmax(0, 720px); gap: 64px;
}
.toc { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 110px); overflow-y: auto; }
.toc summary {
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--sage); cursor: pointer; list-style: none; margin-bottom: 12px;
}
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; border-left: 1px solid var(--rule); }
.toc li a {
  display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 1px solid transparent;
  font-size: 14px; line-height: 1.45; color: var(--muted); text-decoration: none;
}
.toc li a:hover { color: var(--heading); border-left-color: var(--orchid); }

/* ── Document typography ────────────────────────────────────────────────── */
.doc > p:first-child { font-size: 17px; }
.doc h2 {
  font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.25; color: var(--heading);
  margin: 56px 0 16px; padding-top: 32px; border-top: 1px solid var(--rule);
}
.doc h2:first-of-type { margin-top: 40px; }
.doc h3 { font-family: var(--sans); font-size: 17px; font-weight: 600; color: var(--heading); margin: 32px 0 10px; }
.doc p, .doc ul, .doc ol, .doc address, .doc table { margin-bottom: 16px; }
.doc strong { color: var(--heading); font-weight: 600; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin-bottom: 8px; padding-left: 4px; }
.doc li::marker { color: var(--sage); }
.doc ol[type="a"] { list-style-type: lower-alpha; }

.doc address {
  font-style: normal; padding: 16px 20px; line-height: 1.6;
  background: var(--bg-raised); border: 1px solid var(--rule); border-radius: 10px;
}
/* The all-caps arbitration notice: presented as a notice, not shouted body text. */
.doc .caps {
  font-size: 14px; font-weight: 600; letter-spacing: .01em; line-height: 1.6; color: var(--heading);
  padding: 16px 20px; background: var(--bg-raised); border: 1px solid var(--rule);
  border-left: 3px solid var(--orchid); border-radius: 6px;
}

/* ── Tables ─────────────────────────────────────────────────────────────── */
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.55; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--rule); }
.doc th { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--sage); border-bottom-color: var(--rule); }
.doc td:first-child { color: var(--heading); font-weight: 500; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--rule); }
.footer-inner {
  max-width: 1120px; margin: 0 auto; padding: 28px 24px 40px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  font-size: 14px; color: var(--muted);
}
.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--heading); }

/* ── Narrower screens ───────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; max-width: 768px; padding-top: 24px; }
  .toc { position: static; max-height: none; overflow: visible; }
  .toc details { background: var(--bg-raised); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 18px; }
  .toc summary { margin-bottom: 0; display: flex; justify-content: space-between; align-items: center; }
  .toc summary::after { content: '+'; font-size: 18px; font-weight: 400; color: var(--muted); }
  .toc details[open] summary::after { content: '–'; }
  .toc details[open] summary { margin-bottom: 10px; }
  .toc { margin-bottom: 28px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .topbar-inner { padding: 0 16px; height: 56px; }
  .wordmark { font-size: 21px; }
  .doc-tabs a { padding: 6px 9px; font-size: 13px; }
  .hero-inner { padding: 36px 16px 28px; }
  .hero h1 { font-size: 36px; }
  .layout { padding: 20px 16px 56px; }
  .doc h2 { font-size: 24px; margin-top: 44px; padding-top: 28px; }
  .footer-inner { padding: 24px 16px 32px; flex-direction: column; }
  /* Tables stack into cards rather than squeezing columns. */
  .doc table, .doc thead, .doc tbody, .doc tr, .doc th, .doc td { display: block; }
  .doc thead { display: none; }
  .doc tr { border-bottom: 1px solid var(--rule); padding: 12px 0; }
  .doc td { border: 0; padding: 2px 0; }
  .doc td:first-child { font-weight: 600; margin-bottom: 2px; }
  .doc table.collect td:nth-child(3)::before { content: "Source: "; color: var(--sage); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
