/* ==========================================================================
   legal.css — the three legal pages only:
     /terms/           legalPage.mjs
     /privacy/         legalPage.mjs
     /delete-account/  deleteAccountPage.mjs

   Loaded AFTER tokens.css and seo-hub.css (which supplies the breadcrumb). It
   extends, never redefines: every selector is namespaced `legal-`, and every
   value is a token, so the dark theme comes for free.

   What this sheet is for: a long document is the one thing on this site that
   gets read top to bottom, slowly, sometimes by someone who is angry. So the
   measure is capped near 70 characters, the headings are far smaller than the
   marketing display sizes (tokens.css sets h2 at up to 56px, which would turn a
   forty-clause document into a poster), and the contents list sits beside the
   text where it can be reached from any point.
   ========================================================================== */

/* --------------------------------------------------------------------------
   The navy header band (2026-11 redesign). .band-night + .on-night from
   tokens.css §13: navy in both themes, and the ink tokens re-pointed so the
   crumbs, kicker and meta read on it without per-element colours.
   -------------------------------------------------------------------------- */

.legal-head {
  padding-block: clamp(12px, 2vw, 28px) clamp(48px, 6vw, 88px);
  overflow: clip;
}
/* The crumb separator is --text-faint in seo-hub.css, which .on-night does not
   re-point; on navy it would be dark ink. Decorative, so a quiet light step. */
.legal-head .hub-crumbs li + li::before { color: rgba(242, 242, 243, .45); }

.legal-head .kicker-lg { margin-top: clamp(8px, 1.4vw, 18px); }
/* --fs-section, not --fs-hero: "Terms of Service" is a title, not a poster. */
.legal-title {
  margin-top: 20px;
  max-width: 16ch;
  font-size: var(--fs-section);
  line-height: .98;
  letter-spacing: -.025em;
}
.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: .1em;
  color: var(--text-copy);
  text-transform: uppercase;
}
/* Each date a quiet pill on the band. */
.legal-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--divider);
  border-radius: var(--r-pill);
}
.legal-meta time { color: var(--text); }
.legal-lede {
  max-width: 56ch;
  margin-top: 22px;
  font-size: clamp(18px, 1.55vw, 21px);
  line-height: 1.55;
  color: var(--text-copy);
}

.legal-main { padding-block: clamp(48px, 6vw, 88px) clamp(64px, 8vw, 112px); }

/* --------------------------------------------------------------------------
   Layout: contents on the left at desktop, above the text below 980px.
   -------------------------------------------------------------------------- */

.legal-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

/* Sticky under the site header (74px) with a little air. A panel, so the
   list reads as navigation and not as part of the text. */
.legal-toc {
  position: sticky;
  top: 98px;
  max-height: calc(100vh - 122px);
  overflow-y: auto;
  padding: 22px 22px 16px;
  border-radius: var(--r-surface);
  background: var(--accent-soft);
}
.legal-toc h2 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  letter-spacing: .16em;
  color: var(--accent-strong);
  margin-bottom: 10px;
}
.legal-toc ol { counter-reset: toc; }
.legal-toc li { counter-increment: toc; }
.legal-toc a {
  display: flex;
  gap: 10px;
  padding-block: 7px;
  font-size: var(--fs-small);
  line-height: 1.35;
  color: var(--text-copy);
  text-decoration: none;
}
.legal-toc a::before {
  content: counter(toc, decimal-leading-zero);
  flex: none;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.legal-toc a:hover { color: var(--accent-strong); }

@media (max-width: 980px) {
  .legal-layout { grid-template-columns: minmax(0, 1fr); }
  .legal-toc { position: static; max-height: none; overflow: visible; }
  /* A forty-line list above the text is a wall; fold it into a card with two
     columns while there is room, one column when there is not. */
  .legal-toc ol { columns: 2; column-gap: 28px; }
  .legal-toc li { break-inside: avoid; }
}
@media (max-width: 560px) {
  .legal-toc { padding: 18px 18px 12px; }
  .legal-toc ol { columns: 1; }
}

/* --------------------------------------------------------------------------
   The document. A reading measure near 70 characters; headings far smaller
   than the marketing display sizes.
   -------------------------------------------------------------------------- */

.legal-doc { max-width: 68ch; min-width: 0; }
/* /delete-account/ has no contents list, so its text sits alone in the wrap. */
.legal-doc-solo { max-width: 72ch; }

.legal-doc h2 {
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.1;
  letter-spacing: -.015em;
  margin-top: clamp(40px, 4.8vw, 60px);
  padding-top: clamp(24px, 3vw, 32px);
  border-top: 1px solid var(--divider);
}
.legal-doc > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.legal-doc h3 {
  font-size: clamp(19px, 1.7vw, 22px);
  line-height: 1.2;
  letter-spacing: 0;
  margin-top: 30px;
}
.legal-doc p,
.legal-doc li {
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--text-copy);
  overflow-wrap: anywhere;
}
.legal-doc p { margin-top: 14px; }
.legal-doc h2 + p { margin-top: 16px; }
.legal-doc h3 + p { margin-top: 10px; }
.legal-doc strong { color: var(--text); font-weight: 600; }

/* Bullets belong to <ul> only. The numbered steps on /delete-account/ are an
   <ol class="legal-steps"> inside the same container and draw their own markers;
   a bare `.legal-doc li::before` here would paint a dot on top of each number. */
.legal-doc ul { margin-top: 12px; }
.legal-doc ul > li {
  position: relative;
  padding-left: 22px;
  margin-top: 8px;
}
.legal-doc ul > li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* --------------------------------------------------------------------------
   /delete-account/ — numbered steps as panels. tokens.css zeroes list styles,
   so the numbers are drawn here.
   -------------------------------------------------------------------------- */

.legal-steps { counter-reset: step; margin-top: 22px; display: grid; gap: 10px; }
.legal-steps li {
  counter-increment: step;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 20px;
  border-radius: var(--r-surface);
  background: var(--accent-soft);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text-copy);
}
.legal-steps li::before {
  content: counter(step);
  flex: none;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-strong);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  color: var(--on-accent);
  /* Centres the 30px disc on the first 25.6px line. */
  margin-top: -2px;
}
.legal-steps li > span { min-width: 0; }
.legal-steps strong { color: var(--text); font-weight: 600; }

/* "Before you delete": three things to know, each with an accent edge. */
.legal-doc .legal-notes { display: grid; gap: 10px; margin-top: 20px; }
.legal-doc .legal-notes > li {
  margin-top: 0;
  padding: 16px 20px 16px 22px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-control) var(--r-control) 0;
  background: var(--accent-soft);
}
.legal-doc .legal-notes > li::before { content: none; }

@media (max-width: 560px) {
  .legal-steps li { padding: 14px 16px; gap: 12px; }
  .legal-doc .legal-notes > li { padding: 14px 16px 14px 18px; }
}

/* --------------------------------------------------------------------------
   Print — a legal page is the page people actually print. On paper the navy
   ground is gone, so the band's light ink goes back to the page's dark ink.
   -------------------------------------------------------------------------- */

@media print {
  .legal-head {
    background: none;
    --text: #1D1F20;
    --text-copy: rgba(29, 31, 32, .72);
    --text-secondary: rgba(29, 31, 32, .65);
    --divider: rgba(29, 31, 32, .16);
    --accent-strong: #416180;
    color: var(--text);
  }
  .legal-toc { display: none; }
  .legal-layout { display: block; }
  .legal-doc { max-width: none; }
  .legal-doc a { color: inherit; }
}
