/* Ground Zero POV legal pages. Self-contained: no web fonts, no external requests, no inline
   styles, so the pages work under a strict CSP (default-src 'self'). Tokens mirror
   assets/css/tokens.css: black page, white text, muted #9ba0a6, one warm sand accent #c8a97e. */

:root {
  --black: #000000;
  --white: #ffffff;
  --neutral-200: #d6dadd;
  --neutral-300: #bababa;
  --neutral-400: #9ba0a6;
  --neutral-500: #747980;
  --neutral-850: #131416;
  --neutral-900: #0c0d0e;
  --ink: #0a0b09;
  --sand: #c8a97e;
  --sand-300: #d4b98f;
  --sand-100: #e8dcc8;

  --background: var(--black);
  --foreground: var(--white);
  --text: var(--neutral-200);
  --muted: var(--neutral-400);
  --dim: var(--neutral-500);
  --accent: var(--sand);
  --on-accent: var(--ink);
  --surface: var(--neutral-900);
  --surface-raised: var(--neutral-850);
  --hairline: rgba(255, 255, 255, 0.1);
  --hairline-strong: rgba(255, 255, 255, 0.18);
  --accent-wash: rgba(200, 169, 126, 0.08);
  --accent-line: rgba(200, 169, 126, 0.32);
  --danger: #ffb4a8;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Fragment Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 44rem;
  --gutter: 1rem;
  --radius: 0.875rem;
  --radius-pill: 999px;
  --duration-fast: 150ms;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
}

@media (min-width: 720px) {
  :root { --gutter: 2rem; }
}

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

html {
  background-color: var(--background);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--background);
  background-image: radial-gradient(56rem 26rem at 50% -8rem, rgba(200, 169, 126, 0.09), transparent 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: anywhere;
}

@media (min-width: 720px) {
  body { font-size: 1.0625rem; }
}

h1, h2, h3, p, ul, ol, blockquote, figure { margin: 0; }
[hidden] { display: none !important; }

::selection { background: rgba(200, 169, 126, 0.3); color: var(--white); }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--accent-line);
  transition: text-decoration-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
a:hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; }
a:active { color: var(--sand-100); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 0.25rem;
}
main:focus { outline: none; }

strong { color: var(--white); font-weight: 600; }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.1em 0.35em;
  border-radius: 0.3rem;
  background: var(--surface-raised);
  color: var(--white);
}

/* Build-time placeholders (tools/build.py replaces them and removes the highlight). */
.ph {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0 0.3em;
  border-radius: 0.25rem;
  border: 1px dashed var(--accent);
  background: rgba(200, 169, 126, 0.12);
  color: inherit;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

/* ---------- Top bar ---------- */
.topbar { border-bottom: 1px solid var(--hairline); }
.topbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0.875rem var(--gutter);
}
.back, .topbar__hub {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  font-size: 0.9375rem;
  line-height: 1.3;
  text-decoration: none;
}
.back {
  padding: 0 1.1rem 0 0.95rem;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-pill);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  color: var(--white);
  font-weight: 500;
  transition: border-color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
}
.back:hover { border-color: var(--accent-line); background-color: var(--accent-wash); }
.back:active { transform: translateY(1px); }
.back span { color: var(--accent); }
.topbar__hub { color: var(--muted); }
.topbar__hub:hover { color: var(--white); }

/* ---------- Document ---------- */
.doc {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(2rem, 1.2rem + 3vw, 4rem) var(--gutter) 4rem;
}

.doc__head { margin-bottom: 1.75rem; }
.doc__head > * + * { margin-top: 1rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem 0.3rem 0.7rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}
.eyebrow__dot { width: 0.375rem; height: 0.375rem; border-radius: 50%; background: var(--sand-300); box-shadow: 0 0 0 3px rgba(200, 168, 124, 0.15); }

h1 {
  margin-top: 1.25rem;
  color: var(--white);
  font-size: clamp(2.125rem, 1.6rem + 2.4vw, 3.25rem);
  line-height: 1.08;
  font-weight: 650;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.doc__head > h1 { margin-top: 1.25rem; }

.updated {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.summary {
  position: relative;
  margin-top: 1.75rem;
  padding: 1.1rem 1.25rem 1.15rem 1.4rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(200, 169, 126, 0.09), rgba(200, 169, 126, 0.02) 60%), var(--surface);
  color: var(--white);
}
.summary::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 1rem;
  bottom: 1rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.summary strong { color: var(--accent); }

.doc__body > * + * { margin-top: 1rem; }
.doc__body > h2 {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
  color: var(--white);
  font-size: 1.375rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.doc__body > h2:first-child { margin-top: 0.5rem; }
.doc__body > h3 {
  margin-top: 2rem;
  color: var(--white);
  font-size: 1.0625rem;
  line-height: 1.4;
  font-weight: 600;
}
.doc__body > h2 + *, .doc__body > h3 + * { margin-top: 0.75rem; }

.doc ul, .doc ol { padding-left: 1.35rem; }
.doc li + li { margin-top: 0.5rem; }
.doc ul > li::marker { color: var(--accent); }
.doc ol > li::marker { color: var(--muted); font-family: var(--font-mono); font-size: 0.875em; }

blockquote {
  padding: 0.25rem 0 0.25rem 1.1rem;
  border-left: 2px solid var(--hairline-strong);
  color: var(--white);
}

/* ---------- Table of contents ---------- */
.toc {
  margin-bottom: 2.5rem;
  padding: 1rem 1.25rem 1.1rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface);
}
.toc__title {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}
.toc ol { list-style: none; margin-top: 0.5rem; padding: 0; }
.toc li + li { margin-top: 0.1rem; }
.toc a {
  display: block;
  padding: 0.3rem 0;
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.4;
  text-decoration: none;
}
.toc a:hover { color: var(--accent); }

@media (min-width: 1100px) {
  .doc--toc {
    grid-template-columns: 15rem minmax(0, var(--measure));
    column-gap: 4rem;
    justify-content: center;
    max-width: none;
  }
  .doc--toc .doc__head, .doc--toc .doc__body { grid-column: 2; }
  .doc--toc .doc__toc {
    grid-column: 1;
    grid-row: 1 / span 2;
    position: sticky;
    top: 1.5rem;
    align-self: start;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    margin: 0;
    padding: 0.25rem 0 0 1rem;
    border: 0;
    border-left: 1px solid var(--hairline);
    border-radius: 0;
    background: none;
  }
  .doc--toc .toc a { font-size: 0.875rem; color: var(--muted); }
  .doc--toc .toc a:hover { color: var(--white); }
}

/* ---------- Tables: scroll-free cards on phones, a real table from 720px ---------- */
.table-wrap { margin-top: 1.25rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.55; }
th {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: lowercase;
  vertical-align: bottom;
}
th, td { padding: 0.75rem 0.9rem 0.75rem 0; vertical-align: top; }
th:last-child, td:last-child { padding-right: 0; }
td { border-top: 1px solid var(--hairline); }

@media (max-width: 719.98px) {
  table, thead, tbody, tr, th, td { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  tr {
    padding: 0.9rem 1rem;
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    background: var(--surface);
  }
  tr + tr { margin-top: 0.75rem; }
  td { padding: 0; border: 0; }
  td + td { margin-top: 0.6rem; }
  td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: lowercase;
  }
}

/* ---------- Withdrawal form ---------- */
.wd { margin-top: 1.25rem; }
.wd__fallback {
  padding: 1rem 1.25rem;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
}
.wd__panel {
  padding: 1.25rem;
  border: 1px solid var(--hairline-strong);
  border-radius: calc(var(--radius) + 0.25rem);
  background: var(--surface);
}
@media (min-width: 720px) { .wd__panel { padding: 1.75rem; } }
.wd__panel > * + * { margin-top: 1rem; }
.wd__panel--done { border-color: var(--accent-line); }
.wd__panel:focus { outline: none; }
.wd__panel:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wd__step {
  color: var(--white);
  font-size: 1.0625rem;
  line-height: 1.4;
  font-weight: 600;
}

.field > * + * { margin-top: 0.35rem; }
.field label, .field__label-plain { display: block; color: var(--white); font-weight: 500; }
.field__label-plain { margin-top: 1.25rem; }
.field__optional { color: var(--muted); font-weight: 400; }
.field__hint { color: var(--muted); font-size: 0.875rem; line-height: 1.5; }
.field__error { color: var(--danger); font-size: 0.875rem; line-height: 1.5; }
.field__error::before { content: "! "; font-weight: 700; }

input[type="text"], input[type="email"], input[type="date"], textarea {
  display: block;
  width: 100%;
  min-height: 2.875rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 0.625rem;
  background: var(--black);
  color: var(--white);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color var(--duration-fast) var(--ease-out);
}
input:hover, textarea:hover { border-color: rgba(255, 255, 255, 0.32); }
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input[aria-invalid="true"] { border-color: var(--danger); }
textarea { font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.55; resize: vertical; }
::placeholder { color: var(--dim); }

.wd__error-summary {
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 180, 168, 0.45);
  border-radius: 0.625rem;
  color: var(--danger);
}
.wd__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.wd__panel > .wd__actions { margin-top: 1.5rem; }
.wd__note, .wd__status { color: var(--muted); font-size: 0.875rem; line-height: 1.5; }
.wd__status:empty { display: none; }

.statement {
  margin: 0;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--hairline-strong);
  border-radius: 0.625rem;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.875rem;
  padding: 0 1.4rem;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn:disabled { cursor: not-allowed; opacity: 0.5; }
.btn--primary { border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--sand-100); border-color: var(--sand-100); }
.btn--ghost { border: 1px solid var(--hairline-strong); background: transparent; color: var(--white); }
.btn--ghost:hover { border-color: var(--accent-line); background: var(--accent-wash); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--hairline); }
.site-footer__inner {
  display: grid;
  gap: 1.75rem;
  max-width: 68rem;
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 3rem;
}
.site-footer__title {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}
.site-footer__nav ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.15rem 1.5rem;
  margin-top: 0.75rem;
  padding: 0;
  list-style: none;
}
.site-footer__nav a {
  display: inline-block;
  padding: 0.4rem 0;
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.4;
  text-decoration: none;
}
.site-footer__nav a:hover { color: var(--accent); }
.site-footer__nav a[aria-current="page"] { color: var(--white); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.3em; }
.site-footer__brand { display: flex; align-items: center; gap: 0.6rem; }
.site-footer__brand img { display: block; }
.wordmark { color: var(--white); font-weight: 800; letter-spacing: -0.02em; font-size: 0.9375rem; }
.wordmark__pov { margin-left: 0.4em; color: var(--accent); font-family: var(--font-mono); font-size: 0.65em; font-weight: 700; letter-spacing: 0.14em; }
.site-footer__fine { max-width: 48rem; color: var(--dim); font-size: 0.8125rem; line-height: 1.6; }

/* ---------- Motion and print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

@media print {
  :root { --background: #fff; --text: #000; --muted: #333; --dim: #333; }
  body { background: #fff; color: #000; }
  .topbar, .skip-link, .toc, .site-footer__nav, .wd { display: none; }
  h1, h2, h3, strong, .summary, blockquote, .site-footer__fine { color: #000; }
  .summary { background: none; border-color: #999; }
  a { color: #000; }
}
