/* ─────────────────────────────────────────────────────────────
   Shared styles for the document pages (privacy, terms, help).
   The landing page stays self-contained; these three are prose,
   so they share one stylesheet rather than repeating 800 lines.
   Tokens mirror index.html exactly.
   ───────────────────────────────────────────────────────────── */

:root {
  --ground:      #06090f;
  --ground-alt:  #080d16;
  --panel:       #0d1421;
  --panel-2:     #121b2b;
  --line:        #1c2739;
  --line-strong: #2a3850;

  --text:        #eaf0f8;
  --text-2:      #9aabc2;
  --text-3:      #7a8ca4;

  --accent:      #2f7bf6;
  --accent-hi:   #5b9cff;
  --accent-dim:  #1a4fa8;
  --accent-btn:  #2568dd;
  --accent-btn-hi: #1d5bc9;
  --accent-wash: rgb(47 123 246 / 12%);

  --ready:       #35d39a;
  --attention:   #f0a63c;
  --stop:        #f2705f;

  --display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --body:    "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --r-sm: 8px;
  --r-md: 12px;
  --r-pill: 999px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0313rem;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--accent-hi); text-underline-offset: 3px; }
a:hover { color: var(--text); }

:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent-btn); color: #fff; padding: .75rem 1.1rem;
  border-radius: 0 0 var(--r-sm) 0; font-weight: 600; text-decoration: none;
}
.skip:focus { left: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.shell { width: min(1240px, 100% - (var(--gutter) * 2)); margin-inline: auto; }

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgb(6 9 15 / 85%);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header__in { display: flex; align-items: center; gap: 1.25rem; padding-block: .95rem; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; margin-right: auto; color: var(--text); }
.brand:hover { color: var(--text); }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__name { font-family: var(--display); font-weight: 800; font-size: 1.0625rem; letter-spacing: -0.01em; line-height: 1.1; }
.brand__sub {
  display: block; font-family: var(--mono); font-size: .625rem; font-weight: 400;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-top: 2px;
}
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--body); font-size: .9375rem; font-weight: 600;
  padding: .7rem 1.1rem; border-radius: var(--r-sm);
  border: 1px solid transparent; text-decoration: none; cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn--primary { background: var(--accent-btn); color: #fff; }
.btn--primary:hover { background: var(--accent-btn-hi); color: #fff; }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--text-3); background: rgb(255 255 255 / 3%); color: var(--text); }
@media (max-width: 560px) { .btn--hide-sm { display: none; } }

/* ── Document ─────────────────────────────────────────────── */
.doc { padding-block: clamp(2.75rem, 6vw, 4.5rem) clamp(3.5rem, 7vw, 5.5rem); }
.doc__grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 15rem;
  gap: clamp(2rem, 5vw, 4rem); align-items: start;
}
@media (max-width: 940px) { .doc__grid { grid-template-columns: 1fr; } }

.doc__head { margin-bottom: 2.5rem; }
.eyebrow {
  font-family: var(--mono); font-size: .6875rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent-hi);
  margin: 0 0 1rem;
}
.doc h1 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.1rem, 4.6vw, 3rem); letter-spacing: -0.04em;
  line-height: 1.05; margin: 0 0 1rem; text-wrap: balance;
}
.doc__meta {
  font-family: var(--mono); font-size: .75rem; color: var(--text-3);
  display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin: 0;
}
.doc__lede { color: var(--text-2); margin: 1.25rem 0 0; max-width: 62ch; }

.prose { max-width: 68ch; }
.prose h2 {
  font-family: var(--display); font-weight: 700;
  font-size: 1.375rem; letter-spacing: -0.022em; line-height: 1.2;
  margin: 3rem 0 .9rem; padding-top: 1.75rem; border-top: 1px solid var(--line);
  scroll-margin-top: 5.5rem;
}
.prose h2:first-of-type { margin-top: 2rem; }
.prose h2 .num {
  font-family: var(--mono); font-size: .75rem; font-weight: 500;
  color: var(--accent-hi); display: block; margin-bottom: .45rem; letter-spacing: .1em;
}
.prose h3 {
  font-family: var(--display); font-weight: 700; font-size: 1.0313rem;
  letter-spacing: -0.012em; margin: 1.9rem 0 .55rem;
}
.prose p { margin: 0 0 1.05rem; color: var(--text-2); }
.prose p strong, .prose li strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 1.15rem; padding-left: 1.15rem; color: var(--text-2); }
.prose li { margin-bottom: .5rem; }
.prose li::marker { color: var(--text-3); }
.prose code {
  font-family: var(--mono); font-size: .875em;
  background: var(--panel-2); border: 1px solid var(--line);
  padding: .08rem .35rem; border-radius: 4px; color: var(--text);
}
.prose a { color: var(--accent-hi); }

.callout {
  background: var(--panel); border: 1px solid var(--line);
  border-left: 2px solid var(--accent); border-radius: var(--r-md);
  padding: 1.1rem 1.25rem; margin: 1.5rem 0;
}
.callout--warn { border-left-color: var(--attention); }
.callout p { margin: 0; font-size: .9375rem; }
.callout p + p { margin-top: .7rem; }
.callout__k {
  font-family: var(--mono); font-size: .625rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--attention); margin: 0 0 .5rem;
}
.callout:not(.callout--warn) .callout__k { color: var(--accent-hi); }

/* Tables scroll inside their own container, never the page */
.table-wrap { overflow-x: auto; margin: 1.35rem 0; border: 1px solid var(--line); border-radius: var(--r-md); }
table { border-collapse: collapse; width: 100%; min-width: 33rem; font-size: .9063rem; }
th, td { text-align: left; padding: .75rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-family: var(--mono); font-size: .6875rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-3); font-weight: 500;
  background: var(--panel-2);
}
td { color: var(--text-2); }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

/* ── Table of contents ────────────────────────────────────── */
.toc { position: sticky; top: 5.5rem; }
@media (max-width: 940px) {
  .toc { position: static; border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.15rem; }
}
.toc__k {
  font-family: var(--mono); font-size: .625rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--text-3); margin: 0 0 .85rem;
}
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; counter-reset: toc; }
.toc a {
  display: grid; grid-template-columns: 1.6rem 1fr; gap: .3rem;
  font-size: .8438rem; color: var(--text-3); text-decoration: none; line-height: 1.4;
}
.toc a::before {
  counter-increment: toc; content: counter(toc, decimal-leading-zero);
  font-family: var(--mono); font-size: .6875rem; color: var(--line-strong);
}
.toc a:hover { color: var(--text); }
.toc a:hover::before { color: var(--accent-hi); }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); padding-block: 2.75rem 2.5rem; }
.foot__row {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem;
  align-items: center; padding-bottom: 1.75rem;
}
.foot__nav { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; margin-left: auto; }
.foot__nav a { font-size: .9063rem; color: var(--text-2); text-decoration: none; }
.foot__nav a:hover { color: var(--text); text-decoration: underline; }
.foot__base {
  border-top: 1px solid var(--line); padding-top: 1.75rem;
  display: grid; gap: .9rem; font-size: .8125rem; color: var(--text-3); line-height: 1.6;
}
.foot__base p { margin: 0; max-width: 62rem; }

@media print {
  :root { --ground:#fff; --panel:#fff; --panel-2:#fff; --text:#111; --text-2:#333; --text-3:#555; --line:#ccc; }
  body { background:#fff; color:#111; }
  .site-header, .toc, .skip { display: none !important; }
  .doc__grid { grid-template-columns: 1fr; }
  .prose { max-width: none; }
  .prose h2, .callout, tr { break-inside: avoid; }
}
