/* File: web/assets/legal.css — layout for the two long-form legal documents
 * (/terms and /privacy). Loaded AFTER /assets/style.css, which supplies the design
 * tokens, the nav, the buttons and the footer; nothing here redefines a token, so
 * both documents follow the site's light/dark theme with no extra work.
 *
 * These are pages a person has to actually read, so the layout optimises for that:
 * one measured prose column (~68ch), a sticky table of contents on desktop that
 * collapses above the text on mobile, and headings that carry their own anchor.
 * No build step, no JS — see the note in each page's <head>. */

.legal-hero { padding: 56px 0 28px; border-bottom: 1px solid var(--border); }
.legal-hero h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -.03em; margin: 12px 0 14px; }
.legal-hero .lede { color: var(--muted); font-size: 17px; margin: 0; max-width: 62ch; }
.legal-meta { margin: 18px 0 0; color: var(--faint); font-size: 13px; display: flex; gap: 18px; flex-wrap: wrap; }

.legal-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 52px; padding: 40px 0 20px; align-items: start; }
/* minmax(0, 1fr), not 1fr: a bare 1fr cannot shrink below its widest content, which pushed the
   contents box to 522px on a 390px phone (horizontal scroll, found 2026-09-30). */
@media (max-width: 880px) { .legal-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; } .legal-layout > * { min-width: 0; } }
/* Brand + theme toggle + Terms + Privacy + Sign up did not fit a phone's nav bar. */
@media (max-width: 480px) {
  .nav .wrap { gap: 8px; padding-left: 16px; padding-right: 16px; }
  .nav .links { gap: 0; }
  .nav .links a:not(.btn) { padding: 7px 6px; font-size: 13px; }
  .nav .links a.btn { padding: 8px 11px; font-size: 13px; }
  .nav .brand-logo { display: none; }
}

.legal-toc { position: sticky; top: 82px; font-size: 13.5px; }
@media (max-width: 880px) {
  .legal-toc { position: static; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; background: var(--panel); }
}
.legal-toc h2 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 0 0 12px; font-weight: 600; }
.legal-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.legal-toc li { counter-increment: toc; margin: 0 0 7px; }
.legal-toc a { color: var(--muted); display: block; padding: 3px 0; line-height: 1.45; }
.legal-toc a::before { content: counter(toc) ". "; color: var(--faint); }
.legal-toc a:hover { color: var(--accent); }

.legal-doc { max-width: 68ch; font-size: 16px; }
.legal-doc section { scroll-margin-top: 82px; padding-bottom: 8px; }
.legal-doc section + section { margin-top: 40px; padding-top: 34px; border-top: 1px solid var(--border-soft); }
.legal-doc h2 { font-size: 22px; letter-spacing: -.02em; margin: 0 0 14px; }
.legal-doc h3 { font-size: 16px; margin: 26px 0 8px; }
.legal-doc p { margin: 0 0 14px; color: var(--text); }
.legal-doc p.sub { color: var(--muted); }
.legal-doc ul, .legal-doc ol { margin: 0 0 16px; padding-left: 22px; color: var(--text); }
.legal-doc li { margin: 0 0 8px; }
.legal-doc a:not(.btn) { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.legal-doc a:not(.btn):hover { color: var(--accent-soft); }
.legal-doc strong { font-weight: 650; }
.legal-doc code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 5px; padding: 1px 5px; }

/* The one thing on these pages that must never be skim-read: a plain statement of
   something that works against the reader's assumptions. Deliberately loud. */
.legal-doc .callout {
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border-radius: var(--radius-sm); padding: 16px 18px; margin: 0 0 18px;
}
.legal-doc .callout p:last-child { margin-bottom: 0; }
.legal-doc .callout.warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); background: color-mix(in srgb, var(--warn) 7%, transparent); }

/* Data tables (what we collect / what deletion reaches). Scroll inside their own
   box so a narrow phone never scrolls the whole page sideways. */
.legal-table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); }
.legal-table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 14.5px; }
.legal-table th, .legal-table td { text-align: left; padding: 11px 14px; vertical-align: top; border-bottom: 1px solid var(--border-soft); }
.legal-table thead th { font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); font-weight: 600; background: var(--panel-2); }
.legal-table tbody tr:last-child td { border-bottom: 0; }
.legal-table td:first-child { font-weight: 600; white-space: nowrap; }

/* An unresolved owner decision. Loud on purpose: these documents must not go live
   with one still in them, and a quiet placeholder is one that ships. */
.todo {
  display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; font-weight: 600; line-height: 1.45;
  color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent);
  border: 1px dashed color-mix(in srgb, var(--warn) 55%, transparent);
  border-radius: 6px; padding: 2px 7px;
}

.legal-footnote { color: var(--faint); font-size: 13px; margin: 34px 0 0; padding-top: 20px; border-top: 1px solid var(--border); }
