/* =========================================================
   Long-form legal pages (privacy.html, terms.html)
   Layers over tokens.css + styles.css. Built for reading, not for selling.
   ========================================================= */

.page-legal ::selection { background: var(--lavender); color: var(--ink); }
.page-legal { accent-color: var(--blue); }

/* ---------- Header ---------- */
.legal-hero {
  padding: calc(var(--nav-h) + 3.5rem) 0 clamp(1.5rem, 3vw, 2.5rem);
  background:
    radial-gradient(60% 80% at 100% 0%, var(--lavender), transparent 70%),
    var(--mist);
}
.legal-hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  letter-spacing: -.025em;
}
.legal-hero__meta { margin-top: .9rem; font-size: var(--t-small); color: var(--ink-soft); }
.legal-hero__meta b { color: var(--ink); }

/* ---------- Body ---------- */
.legal { padding-block: clamp(2.5rem, 5vw, 4rem); }
.legal__body { max-width: 68ch; }           /* a comfortable measure for continuous prose */
.legal__body > * + * { margin-top: 1.05rem; }

.legal__body h2 {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  letter-spacing: -.02em;
  scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}
.legal__body h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.legal__body h3 { margin-top: 1.9rem; font-size: 1.08rem; }
.legal__body p, .legal__body li { color: var(--ink-soft); }
.legal__body strong, .legal__body b { color: var(--ink); font-weight: 800; }
.legal__body a { color: var(--blue-deep); text-decoration: underline; text-underline-offset: .18em; }

.legal__body ul { display: grid; gap: .6rem; padding-left: 0; list-style: none; }
.legal__body li { position: relative; padding-left: 1.4rem; }
.legal__body li::before {
  content: "";
  position: absolute; left: .25rem; top: .62em;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--purple);
}
.legal__body ul ul { margin-top: .6rem; }

/* ---------- Tables: the retention and lawful-basis grids ---------- */
.legal__table {
  margin-top: 1.3rem;
  overflow-x: auto;                          /* narrow screens scroll the table, not the page */
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.legal__table table { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
.legal__table th, .legal__table td {
  padding: .75rem .95rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.legal__table th { background: var(--mist); color: var(--ink); font-weight: 800; white-space: nowrap; }
.legal__table td { color: var(--ink-soft); }
.legal__table tr:last-child td { border-bottom: 0; }

/* ---------- Anything still to be filled in before publishing ---------- */
.legal__todo {
  /* inline, not inline-block: an inline-block leaves a visible gap before a following full stop */
  display: inline;
  padding: .1rem .35rem;
  border-radius: var(--r-sm);
  background: var(--butter);
  color: #6b4b00;
  font-size: .9em; font-weight: 800;
  white-space: nowrap;
}

/* ---------- Contents ---------- */
.legal__toc {
  margin: 0 0 clamp(2rem, 4vw, 3rem);
  padding: 1.2rem 1.4rem 1.4rem;
  border-radius: var(--r-lg);
  background: var(--mist);
  border: 1px solid var(--line);
}
.legal__toc h2 { margin: 0 0 .7rem; padding: 0; border: 0; font-size: 1rem; }
.legal__toc ol { display: grid; gap: .3rem; margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.legal__toc li { counter-increment: toc; }
.legal__toc li::before { content: counter(toc) "."; margin-right: .45rem; color: var(--ink-mute); font-weight: 700; }
.legal__toc a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: var(--t-small); }
.legal__toc a:hover { color: var(--blue-deep); text-decoration: underline; }

@media (min-width: 961px) {
  .legal__toc {
    position: sticky; top: calc(var(--nav-h) + 1.5rem);
    margin: 0;
  }
  .legal__grid {
    display: grid;
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-legal .reveal { opacity: 1; transform: none; }
}
