/* Closeout — legal pages (terms.html, privacy.html).
   Additive layer loaded after css/app.css; uses the site tokens so dark theme follows [data-theme]. */

/* Hero: same night band as the marketing pages, static headline (no kinetic word-set) */
.legal-hero { padding-bottom: 1rem; }
.legal-hero h1 {
  margin: 0.9rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-variation-settings: "opsz" 96, "wdth" 100, "wght" 800;
  color: var(--night-ink);
  max-width: 18ch;
}
.legal-hero .legal-meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--night-muted);
}

/* Prose */
.legal-section { padding-top: 1.5rem; }
.legal-prose {
  max-width: 72ch;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink);
}
.legal-prose h2 {
  margin: 2.4rem 0 0.75rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border);
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.15;
  font-variation-settings: "opsz" 32;
  color: var(--heading);
}
.legal-prose hr + h2 { margin-top: 0; padding-top: 0; border-top: 0; }
.legal-prose h3 {
  margin: 1.6rem 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--heading);
}
.legal-prose p { margin: 0 0 1rem; }
.legal-prose ul,
.legal-prose ol { margin: 0 0 1.1rem; padding-left: 1.6rem; }
.legal-prose li { margin: 0.4rem 0; }
.legal-prose li::marker { color: var(--accent-text); font-weight: 600; }
.legal-prose hr { border: 0; border-top: 1px solid var(--border-strong); margin: 2rem 0; }
.legal-prose a { text-decoration: underline; overflow-wrap: anywhere; }
.legal-prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05em 0.35em;
}
.legal-prose .legal-scope {
  padding: 1rem 1.2rem;
  background: var(--brand-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 0.97rem;
}
.legal-prose .legal-colophon { color: var(--muted); font-size: 0.9rem; }

/* Tables scroll sideways on narrow screens instead of breaking the layout */
.legal-table-wrap {
  overflow-x: auto;
  margin: 0.75rem 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}
.legal-prose table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.94rem;
  background: var(--surface);
}
.legal-prose th,
.legal-prose td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.legal-prose th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--surface-2);
  font-weight: 600;
}
.legal-prose tr:last-child td { border-bottom: 0; }
.legal-prose td:first-child { font-weight: 700; white-space: nowrap; }

/* Terms <-> Privacy switch under the article */
.legal-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.5rem;
  margin: 2.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.94rem;
}
.legal-switch a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 0.5rem;
  margin-left: -0.5rem;
  margin-right: 0.5rem;
  text-decoration: none;
}
.legal-switch a:hover { text-decoration: underline; }
.legal-switch a[aria-current="page"] { color: var(--ink); text-decoration: underline; }
