/* Legal pages — Terms, Privacy.
 *
 * Its own stylesheet rather than more of styles.css, because these pages are
 * nothing like the rest of the site: no scroll choreography, no glass, no
 * frames. One column of text somebody has to be able to read, and quote a
 * clause number from, and find a definition in six months later.
 *
 * Built on the same tokens as everywhere else, so it is recognisably the same
 * studio — and deliberately quieter, because a legal page that performs is a
 * legal page nobody trusts.
 */

.legal {
  padding: 120px 0 140px;
}

.legal-wrap {
  width: 100%;
  /* Narrower than the site's --maxw. Long-form text wants a measure of
     roughly 70 characters; the site's 1180px grid would run clauses the
     width of a laptop and make them unreadable. */
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── The title block ─────────────────────────────────────────────────────── */

.legal-eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 18px;
}

.legal h1 {
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--fg-3);
}

/* The one paragraph somebody reads if they read nothing else. */
.legal-lede {
  margin-top: 32px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 16px;
  color: var(--fg-2);
}
.legal-lede strong { color: var(--fg); font-weight: 500; }
.legal-lede p + p { margin-top: 12px; }

/* ── Contents ────────────────────────────────────────────────────────────── */

.legal-toc {
  margin-top: 44px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.legal-toc h2 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 16px;
}
.legal-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  /* Two columns where there is room: a nineteen-item list in one column is a
     screen of scrolling before the document starts. */
  columns: 2;
  column-gap: 32px;
  font-size: 15px;
}
.legal-toc li { margin-bottom: 9px; break-inside: avoid; }
.legal-toc a { color: var(--fg-2); transition: color 0.15s var(--ease); }
.legal-toc a:hover { color: var(--fg); }
.legal-toc .n { color: var(--fg-3); margin-right: 8px; }

@media (max-width: 620px) {
  .legal-toc ol { columns: 1; }
}

/* ── The document ────────────────────────────────────────────────────────── */

.legal-doc { margin-top: 56px; }

.legal-doc section {
  padding-top: 44px;
  margin-top: 44px;
  border-top: 1px solid var(--line);
  /* The sticky header must not cover a heading somebody just jumped to. */
  scroll-margin-top: 100px;
}
.legal-doc section:first-child { padding-top: 0; margin-top: 0; border-top: 0; }

.legal-doc h2 {
  font-size: 24px;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.legal-doc h2 .n {
  color: var(--fg-3);
  margin-right: 12px;
}

.legal-doc h3 {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 32px 0 12px;
}

.legal-doc p,
.legal-doc li {
  color: var(--fg-2);
  font-size: 16px;
  line-height: 1.68;
}
.legal-doc p + p { margin-top: 14px; }
.legal-doc strong { color: var(--fg); font-weight: 500; }

.legal-doc ul,
.legal-doc ol {
  margin: 14px 0 0;
  padding-left: 22px;
}
.legal-doc li { margin-bottom: 9px; }
.legal-doc li::marker { color: var(--fg-3); }

.legal-doc a:not(.btn) {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(51, 149, 255, 0.4);
  transition: text-decoration-color 0.15s var(--ease);
}
.legal-doc a:not(.btn):hover { text-decoration-color: var(--accent-2); }

/* A definition list, for the definitions section. */
.legal-defs { margin: 18px 0 0; }
.legal-defs dt {
  color: var(--fg);
  font-weight: 500;
  font-size: 16px;
  margin-top: 18px;
}
.legal-defs dd {
  margin: 5px 0 0;
  color: var(--fg-2);
  font-size: 16px;
  line-height: 1.68;
}

/* A plain table — the subprocessor list, the retention schedule. Legal text
   is full of "who / what / how long", and three columns say that in a
   quarter of the words a paragraph needs. */
.legal-table {
  width: 100%;
  margin-top: 20px;
  border-collapse: collapse;
  font-size: 15px;
}
.legal-table th,
.legal-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--line);
}
.legal-table th {
  color: var(--fg);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom-color: var(--line-strong);
}
.legal-table td { color: var(--fg-2); line-height: 1.55; }
.legal-table td:first-child { color: var(--fg); }

/* Tables do not reflow. Below the measure, let this one scroll on its own
   rather than forcing the whole page sideways. */
.legal-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.legal-scroll .legal-table { min-width: 480px; }

/* A clause that carries a liability exclusion or a disclaimer. Set apart
   because a reader is entitled to find the parts that limit their rights
   without reading every word — not shouted in capitals, which is a habit
   from paper contracts and is measurably harder to read. */
.legal-callout {
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--raised);
}
.legal-callout p { color: var(--fg-2); }
.legal-callout p:first-child { margin-top: 0; }

/* The contact block that closes both documents. */
.legal-contact {
  margin-top: 20px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg-2);
}
.legal-contact strong { display: block; color: var(--fg); font-weight: 500; }

.legal-foot {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--fg-3);
}
.legal-foot p + p { margin-top: 10px; }

/* Back to the top of a long document. */
.legal-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  font-size: 14px;
  color: var(--fg-3);
  transition: color 0.15s var(--ease);
}
.legal-top:hover { color: var(--fg); }

@media (max-width: 620px) {
  .legal { padding: 96px 0 100px; }
  .legal-doc section { padding-top: 36px; margin-top: 36px; }
  .legal-doc h2 { font-size: 21px; }
  .legal-doc h2 .n { display: block; margin: 0 0 4px; font-size: 13px; }
}

/* The header and footer on these pages are the site's own, markup and all —
   see terms.html. The one thing they need from here is clearance: the sticky
   header must not land on top of a clause somebody has just jumped to, which
   is handled by scroll-margin-top on each section above. */
