/* ─────────────────────────────────────────────────────────────────
   Tinker Citadel — shared styles for legal / policy pages.
   Mirrors the homepage: charcoal #17150f, cream ink, signal accent,
   Inter body + Bricolage Grotesque display. Nav + footer match
   index.html exactly.
   ───────────────────────────────────────────────────────────────── */

:root {
  --bg: #17150f;
  --ink: #f4f1ea;
  --ink-soft: #b8b2a6;
  --ink-mute: #8a857a;
  --line: rgba(255,255,255,0.12);
  --line-strong: rgba(255,255,255,0.24);
  --panel: #211e17;
  --panel-2: #1b1812;
  --accent: #ec4636;        /* signal accent — matches live homepage */
  --accent-2: #ff5e4f;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;

  --gutter: clamp(20px, 5vw, 40px);
}

/* ── Light theme ─────────────────────────────────────── */
html[data-theme="light"] {
  --bg: #ffffff;
  --ink: #1d1a13;
  --ink-soft: #565045;
  --ink-mute: #8a8474;
  --line: rgba(0,0,0,0.10);
  --line-strong: rgba(0,0,0,0.18);
  --panel: #f7f5f0;
  --panel-2: #fbfaf7;
}
html[data-theme="light"] footer.site .bottom { color: rgba(0,0,0,0.5); }
html[data-theme="light"] footer.site .bottom .legal a { color: rgba(0,0,0,0.7); }

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
a.txt { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a.txt:hover { color: var(--ink); }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--accent); color: #fff; }

.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ── Nav (identical to homepage) ───────────────────────── */
nav.top {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
nav.top .row {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 32px;
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px; letter-spacing: -0.01em;
}
.logo-mark { width: 26px; height: 26px; display: block; flex: none; }

/* ── Legal masthead ────────────────────────────────────── */
.legal-head {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 38px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 38px 100%,
    var(--panel-2);
  border-bottom: 1px solid var(--line);
  padding: clamp(56px, 9vw, 80px) 0 clamp(44px, 7vw, 60px);
}
.legal-head::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(90% 120% at 0% 0%, transparent 30%, color-mix(in srgb, var(--bg) 70%, transparent) 100%);
}
.legal-head > .container { position: relative; z-index: 2; }
.legal-head .kicker {
  font-size: 12px; font-weight: 700; color: var(--accent);
  letter-spacing: 0.16em; text-transform: uppercase;
  margin-bottom: 22px;
  display: inline-flex; align-items: center; gap: 10px;
}
.legal-head .kicker::before {
  content: ""; width: 18px; height: 2px; background: var(--accent);
}
.legal-head h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.0; letter-spacing: -0.035em;
  max-width: 18ch; text-wrap: balance;
}
.legal-head .updated {
  margin-top: 26px;
  font-size: 14px; color: var(--ink-soft); font-weight: 500;
}
.legal-head .updated strong { color: var(--ink); font-weight: 600; }
.legal-head .lead {
  margin-top: 22px;
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.5; color: var(--ink);
  max-width: 64ch; text-wrap: pretty;
}
.legal-head .lead strong { font-weight: 600; }

/* ── Layout: content + sticky TOC ──────────────────────── */
.legal-wrap {
  display: grid;
  grid-template-columns: 1fr 232px;
  gap: 72px;
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
  padding: clamp(48px, 7vw, 72px) var(--gutter) clamp(64px, 9vw, 96px);
  align-items: start;
}
@media (max-width: 940px) {
  .legal-wrap { grid-template-columns: 1fr; gap: 40px; }
}

/* TOC */
.toc {
  position: sticky; top: 32px;
  order: 2;
  font-size: 14px;
}
.toc .toc-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-mute);
  padding-bottom: 12px; margin-bottom: 8px;
  border-bottom: 2px solid var(--ink);
}
.toc ul { list-style: none; }
.toc li { border-bottom: 1px solid var(--line); }
.toc a {
  display: block; padding: 11px 0;
  color: var(--ink-soft); line-height: 1.3;
  transition: color .15s, padding-left .15s;
}
.toc a:hover { color: var(--accent); padding-left: 4px; }
@media (max-width: 940px) {
  .toc { position: static; order: 0; margin-bottom: 8px; }
  .toc ul { columns: 2; column-gap: 32px; }
  .toc li { break-inside: avoid; }
}
@media (max-width: 560px) { .toc ul { columns: 1; } }

/* ── Prose ─────────────────────────────────────────────── */
.prose { order: 1; max-width: 72ch; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(24px, 2.6vw, 32px);
  letter-spacing: -0.025em; line-height: 1.1;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--line-strong);
  margin-top: 2.4em; margin-bottom: 0.2em;
  scroll-margin-top: 32px;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-weight: 700; font-size: 18px;
  letter-spacing: -0.01em; line-height: 1.3;
  margin-top: 1.8em;
  color: var(--ink);
}
.prose p { color: var(--ink-soft); line-height: 1.62; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: var(--ink); }
.prose strong { font-weight: 600; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { line-height: 1.6; margin-top: 0.5em; color: var(--ink-soft); }
.prose li::marker { color: var(--accent); }
.prose ol li::marker { color: var(--ink-mute); font-weight: 600; }

/* Callout — used for the liability / emphasis blocks */
.prose .callout {
  background: var(--panel);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 22px 26px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink);
}

/* Tables (CCPA) */
.prose .table-scroll { overflow-x: auto; }
.prose table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  margin-top: 0.4em;
}
.prose thead th {
  background: var(--accent); color: #fff;
  text-align: left; font-weight: 600;
  padding: 12px 14px; vertical-align: top;
  border: 1px solid var(--accent);
}
.prose tbody td {
  padding: 12px 14px; vertical-align: top;
  border: 1px solid var(--line);
  line-height: 1.45; color: var(--ink-soft);
}
.prose tbody tr:nth-child(even) td { background: var(--panel); }
.prose tbody td:last-child { font-weight: 600; color: var(--ink); white-space: nowrap; }

/* Cross-links between policies */
.policy-nav {
  margin-top: 64px;
  border-top: 2px solid var(--line-strong);
  padding-top: 28px;
}
.policy-nav .pn-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-mute);
  margin-bottom: 18px;
}
.policy-nav .pn-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.policy-nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color .15s, transform .15s, background .15s;
}
.policy-nav a:hover { border-color: var(--accent); transform: translateY(-2px); }
.policy-nav a[aria-current="page"] {
  border-color: var(--line-strong); background: var(--panel);
}
.policy-nav a .pn-name { font-weight: 600; letter-spacing: -0.01em; }
.policy-nav a .pn-arrow { color: var(--accent); }
@media (max-width: 560px) { .policy-nav .pn-grid { grid-template-columns: 1fr; } }

/* ── Footer (identical to homepage) ────────────────────── */
footer.site {
  background: var(--panel); color: var(--ink);
  border-top: 1px solid var(--line);
  padding: 28px 0;
  margin-top: auto;
}
footer.site .bottom {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px 32px; flex-wrap: wrap;
  font-size: 13px; color: rgba(255,255,255,0.5);
}
footer.site .bottom .lg .red { color: var(--accent); font-weight: 700; }
footer.site .bottom .legal { list-style: none; display: flex; gap: 24px; flex-wrap: wrap; }
footer.site .bottom .legal a {
  font-size: 13px; color: rgba(255,255,255,0.78);
  transition: color .15s;
}
footer.site .bottom .legal a:hover { color: var(--accent); }
