/* ============================================================ *
 * qk-legal.css — shared styles for /legal/* pages
 * ------------------------------------------------------------
 * Extracted from design-imports/legal-template.html. Uses the
 * site-wide token palette from stake.css (--s-bg, --s-green,
 * --s-muted, --s-line, etc.) — no :root redefinition here.
 * The shell (/js/shell.js) injects sidebar + topbar + footer
 * around these pages; this file only covers the body content.
 * ============================================================ */

html { scroll-behavior: smooth; }

/* ============================================================ *
 * Hero strip — page title + last-updated meta
 * ============================================================ */
.legal-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--s-bg-2), var(--s-bg));
  border: 1px solid var(--s-line);
  border-radius: 14px;
  padding: 36px 32px 40px;
  margin: 0 0 24px;
}
.legal-hero::before {
  content: ""; position: absolute;
  left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(127,248,0,.55) 30%,
    var(--s-green) 50%,
    rgba(127,248,0,.55) 70%,
    transparent 100%);
  box-shadow: 0 0 14px rgba(127,248,0,.35);
}
.legal-hero::after {
  content: ""; position: absolute;
  right: -120px; top: -120px;
  width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, rgba(127,248,0,.08), transparent 70%);
  pointer-events: none;
}
.legal-hero-inner { position: relative; }

.legal-crumb {
  display: flex; align-items: center; gap: 8px;
  font-family: ui-monospace, monospace;
  font-size: 12px; color: var(--s-muted-2);
  letter-spacing: .04em; margin-bottom: 18px;
}
.legal-crumb a {
  color: var(--s-muted); text-decoration: none;
}
.legal-crumb a:hover { color: var(--s-text); }
.legal-crumb .sep { color: var(--s-line); }
.legal-crumb .here { color: var(--s-text); font-weight: 700; }

.legal-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px;
  background: rgba(127,248,0,.1);
  border: 1px solid rgba(127,248,0,.3);
  border-radius: 999px;
  font-family: ui-monospace, monospace;
  font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--s-green); font-weight: 900;
  margin-bottom: 14px;
}
.legal-kicker::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--s-green);
  box-shadow: 0 0 5px var(--s-green);
}

.legal-title {
  margin: 0 0 8px;
  font-size: 44px; font-weight: 900;
  letter-spacing: -.025em; line-height: 1.05;
  color: var(--s-text);
}
.legal-title .dot { color: var(--s-green); }

.legal-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 14px;
  font-family: ui-monospace, monospace;
  font-size: 12px; color: var(--s-muted);
  letter-spacing: .04em;
}
.legal-meta .item {
  display: inline-flex; align-items: center; gap: 6px;
}
.legal-meta .item b { color: var(--s-text); font-weight: 800; }
.legal-meta .sep { color: var(--s-line); }
.legal-meta .green-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--s-green);
  box-shadow: 0 0 6px var(--s-green);
  display: inline-block;
}

/* ============================================================ *
 * Two-column body: sticky TOC + content
 * ============================================================ */
.legal-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: flex-start;
}
@media (max-width: 960px) {
  .legal-body {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .legal-toc {
    position: relative !important;
    top: auto !important;
  }
}

/* ============================================================ *
 * Sticky TOC
 * ============================================================ */
.legal-toc {
  position: sticky; top: 80px;
  align-self: flex-start;
  background: var(--s-bg-2);
  border: 1px solid var(--s-line);
  border-radius: 12px;
  padding: 16px 12px;
}
.legal-toc h4 {
  margin: 0 0 10px; padding: 0 8px;
  font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--s-muted-2); font-weight: 900;
}
.legal-toc ol {
  list-style: none; padding: 0; margin: 0;
  counter-reset: tocnum;
  display: flex; flex-direction: column; gap: 1px;
}
.legal-toc li { counter-increment: tocnum; }
.legal-toc a {
  position: relative;
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px 8px 12px;
  border-radius: 6px;
  color: var(--s-muted);
  text-decoration: none;
  font-size: 12.5px; font-weight: 700;
  line-height: 1.4;
  transition: color .12s, background .12s;
}
.legal-toc a::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 2px; border-radius: 2px;
  background: transparent;
  transition: background .12s, box-shadow .12s;
}
.legal-toc a::after {
  content: counter(tocnum, decimal-leading-zero);
  font-family: ui-monospace, monospace;
  font-size: 10px; color: var(--s-muted-2); font-weight: 700;
  margin-right: 4px; flex: 0 0 auto;
  order: -1;
  padding-top: 1px;
}
.legal-toc a:hover {
  color: var(--s-text);
  background: var(--s-bg-3);
}
.legal-toc a.is-active {
  color: var(--s-text);
  background: rgba(127,248,0,.06);
}
.legal-toc a.is-active::before {
  background: var(--s-green);
  box-shadow: 0 0 6px rgba(127,248,0,.5);
}
.legal-toc a.is-active::after {
  color: var(--s-green);
  font-weight: 900;
}

/* ============================================================ *
 * Content column
 * ============================================================ */
.legal-content {
  min-width: 0;
  max-width: 820px;
}
.legal-content > section {
  scroll-margin-top: 80px;
  padding-top: 8px;
  margin-bottom: 40px;
}
.legal-content > section:last-child { margin-bottom: 24px; }

.legal-content h2 {
  position: relative;
  margin: 0 0 14px;
  padding-bottom: 12px;
  font-size: 22px; font-weight: 900;
  letter-spacing: -.01em;
  color: var(--s-text);
  border-bottom: 1px solid var(--s-line);
  display: flex; align-items: baseline; gap: 14px;
}
.legal-content h2 .num {
  font-family: ui-monospace, monospace;
  font-size: 12px; color: var(--s-green); font-weight: 800;
  letter-spacing: .06em;
  flex: 0 0 auto;
}

.legal-content h3 {
  margin: 22px 0 8px;
  font-size: 14px; font-weight: 900;
  color: var(--s-text);
  letter-spacing: .04em; text-transform: uppercase;
}
.legal-content h3::before {
  content: ""; display: inline-block;
  width: 10px; height: 1px;
  background: var(--s-green);
  vertical-align: middle; margin-right: 10px;
  box-shadow: 0 0 4px var(--s-green);
}

.legal-content p,
.legal-content li {
  max-width: 720px;
  color: var(--s-muted);
  font-size: 14.5px; line-height: 1.65;
}
.legal-content p { margin: 0 0 12px; }
.legal-content p strong,
.legal-content li strong { color: var(--s-text); font-weight: 700; }
.legal-content a.inline-link {
  color: var(--s-green); text-decoration: none;
  border-bottom: 1px dashed rgba(127,248,0,.4);
}
.legal-content a.inline-link:hover { border-bottom-style: solid; }

.legal-content ul,
.legal-content ol {
  max-width: 720px;
  padding-left: 0; list-style: none;
  margin: 0 0 14px;
}
.legal-content ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 6px;
}
.legal-content ul li::before {
  content: ""; position: absolute; left: 4px; top: 11px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--s-green);
  box-shadow: 0 0 5px rgba(127,248,0,.5);
}
.legal-content ol { counter-reset: olist; }
.legal-content ol li {
  counter-increment: olist;
  position: relative;
  padding-left: 36px;
  margin-bottom: 6px;
}
.legal-content ol li::before {
  content: counter(olist, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  font-family: ui-monospace, monospace;
  font-size: 11px; font-weight: 800;
  color: var(--s-green);
  background: rgba(127,248,0,.08);
  border: 1px solid rgba(127,248,0,.25);
  border-radius: 4px;
  padding: 1px 6px;
  letter-spacing: .04em;
}

/* Note callout — inline "heads up" strip */
.legal-note {
  margin: 14px 0 18px;
  padding: 14px 16px;
  background: var(--s-bg-2);
  border: 1px solid var(--s-line);
  border-left: 3px solid var(--s-green);
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--s-muted);
  max-width: 720px;
}
.legal-note strong { color: var(--s-text); }

/* ============================================================ *
 * Bottom strip — cross-links to the other two legal pages + CTA
 * ============================================================ */
.legal-foot {
  margin-top: 28px;
  border: 1px solid var(--s-line);
  background: var(--s-bg-2);
  border-radius: 12px;
  padding: 28px 32px;
}
.legal-foot-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
@media (max-width: 720px) {
  .legal-foot-inner { grid-template-columns: 1fr; }
}
.legal-foot .reading { font-size: 13px; }
.legal-foot .reading .lbl {
  font-family: ui-monospace, monospace;
  font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--s-muted-2); font-weight: 800;
  display: block; margin-bottom: 6px;
}
.legal-foot .reading .here {
  color: var(--s-text); font-weight: 800;
}
.legal-foot .reading .here::before {
  content: ""; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  margin-right: 8px;
  background: var(--s-green);
  box-shadow: 0 0 6px var(--s-green);
  vertical-align: middle;
}
.legal-foot .reading .also {
  margin-top: 6px;
  color: var(--s-muted);
}
.legal-foot .reading .also a {
  color: var(--s-muted); text-decoration: none;
  border-bottom: 1px solid var(--s-line);
  margin: 0 4px;
  transition: color .15s, border-color .15s;
}
.legal-foot .reading .also a:hover {
  color: var(--s-green);
  border-color: var(--s-green);
}

.legal-foot .gp-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 20px;
  background: var(--s-green); color: #061108;
  border: 0; border-radius: 10px;
  font: inherit; font-weight: 900; font-size: 12px;
  letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  transition: transform .12s, box-shadow .15s;
  box-shadow: 0 8px 22px rgba(127,248,0,.22);
}
.legal-foot .gp-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 26px rgba(127,248,0,.45),
              0 8px 22px rgba(127,248,0,.35);
}
.legal-foot .gp-btn .arrow { font-size: 14px; }

/* Tiny meta strip below */
.legal-tiny {
  margin-top: 14px;
  padding: 10px 6px 0;
  font-family: ui-monospace, monospace;
  font-size: 11px; color: var(--s-muted-2);
  letter-spacing: .04em;
  display: flex; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--s-line);
  padding-top: 14px;
}

/* Phone tweaks */
@media (max-width: 640px) {
  .legal-hero { padding: 28px 20px 32px; }
  .legal-title { font-size: 34px; }
  .legal-foot { padding: 22px 20px; }
}
