/* legal.css
 *
 * The four legal pages (Privacy Policy, Terms of Service, Terms of Sale,
 * Processing Agreement) share one layout: a hero, a sticky index of the legal
 * pages and of the page's own sections, and the document.
 *
 * LIVE-ONLY. The designer's four pages each carried this as an inline <style>
 * block, copied between files and slightly different in each. They are merged
 * here once, with the hero rules defined once (the designs set them twice, the
 * second set overriding the first), the dark-theme rules left out (the public
 * site is light only), and two additions: the current page in the legal index
 * is marked with aria-current instead of a hard-coded .active (which showed it
 * highlighted beside the section in view), and the Contents label's gap is a
 * class instead of an inline style. The small mono labels use --ink-3, not the design's --ink-4: Lighthouse measured
 * 3.2:1 on --ink-4 against the page. Tokens only.
 */

/* ---- Hero ---- */
.doc-hero { padding: 56px 0 64px; border-bottom: 1px solid var(--rule-soft); }
.doc-hero-inner { max-width: 1200px; margin: 0 auto; padding: 0 48px; display: grid; gap: 26px; justify-items: start; }
.doc-h1 { margin: 0; font-family: var(--font-display); font-size: clamp(42px, 5vw, 76px); font-weight: 700; letter-spacing: -0.038em; line-height: .98; color: var(--ink); text-wrap: balance; max-width: 14ch; }
.doc-lede { margin: 0; font-size: 19px; line-height: 1.6; color: var(--ink-3); max-width: min(66%, 72ch); text-wrap: pretty; }
.doc-date { margin: 0; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); }

/* ---- Body layout ---- */
.doc-body { max-width: 1200px; margin: 0 auto; padding: 40px 48px 96px; display: grid; grid-template-columns: 220px 1fr; gap: 72px; align-items: start; }

/* ---- Index ---- */
.doc-toc { position: sticky; top: 120px; display: flex; flex-direction: column; gap: 4px; }
.doc-toc-label { font-family: var(--font-mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-3); margin-bottom: 10px; }
.doc-toc-contents { margin-top: 20px; }
.doc-toc-link { font-size: 13px; font-weight: 500; color: var(--ink-3); text-decoration: none; padding: 5px 0 5px 10px; border-left: 2px solid transparent; line-height: 1.4; display: block; transition: color .12s, border-color .12s; }
.doc-toc-link:hover { color: var(--ink); border-left-color: var(--rule); }
.doc-toc-link[aria-current="page"] { color: var(--ink); font-weight: 600; }
.doc-toc-link.active { color: var(--canary-deep); border-left-color: var(--canary-deep); font-weight: 600; }

/* ---- Document ---- */
.doc-content { min-width: 0; max-width: 72ch; }
.doc-section { margin-bottom: 40px; scroll-margin-top: 96px; }
.doc-section:last-child { margin-bottom: 0; }
.doc-section h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 14px; line-height: 1.2; }
.doc-section h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); margin: 28px 0 10px; }
.doc-section h3:first-of-type { margin-top: 0; }
.doc-section p { font-size: 14.5px; line-height: 1.75; color: var(--ink-2); margin: 0 0 16px; }
.doc-section p:last-child, .doc-section .doc-clause:last-child p { margin-bottom: 0; }
.doc-section ul { margin: 0 0 16px; padding: 0 0 0 20px; display: flex; flex-direction: column; gap: 8px; }
.doc-section li { font-size: 14.5px; line-height: 1.65; color: var(--ink-2); }
.doc-section strong { font-weight: 600; color: var(--ink); }

/* A numbered clause: the number beside the text. */
.doc-clause { display: grid; grid-template-columns: 34px 1fr; gap: 0 8px; margin-bottom: 16px; }
.doc-clause-num { font-weight: 600; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.doc-clause p { margin-bottom: 8px; }
.doc-clause ul { grid-column: 2; }

/* A defined term and what it means. */
.doc-term { display: grid; grid-template-columns: 1fr; gap: 2px; margin-bottom: 14px; }
.doc-term:last-child { margin-bottom: 0; }
.doc-term-label { font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.doc-term p { margin: 0; }

/* Company details. */
.doc-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0 0 16px; background: var(--bg-2); border: 1px solid var(--rule-soft); border-radius: 10px; padding: 18px 20px; }
.doc-dt { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); padding-top: 2px; }
.doc-dd { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; margin: 0; }

/* An important notice. */
.doc-callout { background: color-mix(in oklch, var(--canary) 8%, var(--bg)); border: 1px solid color-mix(in oklch, var(--canary) 24%, transparent); border-radius: 10px; padding: 16px 20px; margin: 20px 0; font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }
.doc-callout strong { color: var(--canary-deep); }

/* The sub-processor table of the Processing Agreement. */
.doc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); margin: 0 0 16px; }
.doc-table th { text-align: left; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); padding: 0 12px 8px 0; border-bottom: 1px solid var(--rule); }
.doc-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.doc-table td:first-child { font-weight: 600; color: var(--ink); }

/* ---- Narrow screens ---- */
@media (max-width: 900px) {
  .doc-body { grid-template-columns: 1fr; gap: 32px; padding: 40px 24px 80px; }
  .doc-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px 0; padding-bottom: 24px; border-bottom: 1px solid var(--rule-soft); }
  .doc-toc-label { width: 100%; }
  .doc-toc-contents { margin-top: 0; }
  .doc-toc-link { padding: 4px 12px 4px 10px; border-left: 0; border-bottom: 2px solid transparent; }
  .doc-toc-link.active { border-left: 0; border-bottom-color: var(--canary-deep); }
  .doc-hero { padding: 40px 0 48px; }
  .doc-hero-inner { padding: 0 24px; gap: 18px; }
  .doc-lede { font-size: 17px; max-width: none; }
}
@media (max-width: 640px) {
  .doc-table thead { display: none; }
  .doc-table, .doc-table tbody, .doc-table tr, .doc-table td { display: block; }
  .doc-table td { padding: 2px 0; border: 0; }
  .doc-table tr { padding: 10px 0; border-bottom: 1px solid var(--rule-soft); }
}
@media (max-width: 480px) {
  .doc-hero { padding: 32px 0 28px; }
  .doc-hero-inner { padding: 0 20px; }
  .doc-body { padding: 32px 20px 64px; }
}
