/* ============================================================
   NOBL — LEGAL / DOCUMENT PAGES
   /privacy and /terms share one pattern: a numbered document
   beside a sticky contents rail.

   Two deliberate departures from the marketing pages:

   · NOTHING REVEALS ON SCROLL. A legal page is read, not toured.
     Every word is on screen at rest, which also means a crawler,
     a print stylesheet and a reader with JS off all get the whole
     document. No [data-reveal] anywhere in these pages.
   · THE MEASURE IS NARROWER AND THE TYPE IS LARGER (16px, not the
     15px body step) because these are the longest stretches of
     continuous prose on the site. 600px at 16px is ~75 characters.
   ============================================================ */

:root {
  --legal-measure: 600px;   /* the prose column's cap */
  --legal-rail:    210px;   /* the contents rail      */
}

/* Following a contents link should read as travel through one
   document, not a cut. Scoped to these pages so the rest of the
   site keeps its instant jumps; the reduced-motion block in
   base.css already forces this back to auto. */
html:has(.legal) { scroll-behavior: smooth; }

/* A narrower container than .container's 1180px — the page is a
   document, not a layout. */
.legal__wrap {
  max-width: calc(940px + var(--page-pad) * 2);
  margin-inline: auto;
  padding-inline: var(--page-pad);
}


/* ============================================================
   1. DOCUMENT HEADER
   ============================================================ */

.legal-hero {
  background: var(--bg-deep);
  border-bottom: 1px solid var(--stroke);
  padding-block: clamp(52px, 6vw, 88px) clamp(40px, 4.4vw, 60px);
}

/* The one heading on these pages in the body face — same reason
   every page H1 is: SA Triumph has no lowercase. Smaller than the
   marketing H1 step; a document title is not a hero. */
.legal-hero__h1 {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(34px, 3.6vw, 48px);
  line-height: 1.06;
  letter-spacing: var(--tr-h1);
  color: var(--text);
}

.legal-hero__lede {
  margin: 20px 0 0;
  max-width: var(--legal-measure);
  font-size: var(--t-intro);
  line-height: var(--lh-intro);
  color: var(--body);
  text-wrap: pretty;
}

/* Effective date / entity / jurisdiction, as one boxed strip of
   cells rather than a run-on meta line. */
.legal-hero__meta {
  display: flex;
  flex-wrap: wrap;
  margin: 32px 0 0;
  background: var(--bg);
  border: 1px solid var(--stroke);
  border-radius: var(--r-card);
  overflow: hidden;
}
.legal-hero__meta > div {
  flex: 1 1 180px;
  min-width: 0;
  padding: 15px 20px 17px;
  border-left: 1px solid var(--stroke);
}
.legal-hero__meta > div:first-child { border-left: 0; }
.legal-hero__meta dt {
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  letter-spacing: var(--tr-meta);
  color: var(--body);        /* 5.8:1 — see the rail note below */
  text-transform: uppercase;
}
.legal-hero__meta dd {
  margin: 7px 0 0;
  font-size: var(--t-card);
  font-weight: 600;
  color: var(--text);
}


/* ------------------------------------------------------------
   SOLO — short documents, no contents rail

   /accessibility is six sections and /support is two. A sticky
   index beside a two-screen page is furniture, not navigation, so
   those pages set .legal-solo on <body> and the document narrows
   to its own measure and centres. Same move the <=1000px collapse
   makes, for the same reason: when the rail goes, the container
   has to come in with it or the text sits pinned to one edge of a
   width it no longer fills.

   On <body> rather than on .legal so the document header band
   narrows with the document below it.
   ------------------------------------------------------------ */
body.legal-solo { --legal-measure: 100%; }
body.legal-solo .legal__wrap { max-width: calc(600px + var(--page-pad) * 2); }
body.legal-solo .legal__grid { grid-template-columns: minmax(0, 1fr); }


/* ============================================================
   2. SHELL
   ============================================================ */

.legal {
  padding-block: clamp(52px, 5.5vw, 80px) clamp(72px, 8vw, 112px);
}
.legal__grid {
  display: grid;
  grid-template-columns: var(--legal-rail) minmax(0, 1fr);
  gap: var(--gap-col-lg);
  align-items: start;   /* NOT stretch — the rail sticks, so it
                           must not be stretched to document height */
}


/* ============================================================
   3. CONTENTS RAIL
   ============================================================ */

.legal__index {
  position: sticky;
  top: calc(var(--header-h) + 26px);
  max-height: calc(100vh - var(--header-h) - 60px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.legal__index-h {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  font-weight: 400;
  letter-spacing: var(--tr-meta);
  color: var(--muted);
  text-transform: uppercase;
}
.legal__index ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--stroke);
}
.legal__index a {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 0 7px 14px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  font-size: 13px;
  line-height: 1.35;
  color: var(--body);
  transition: color var(--d-fast), border-color var(--d-fast);
}
/* --body, not the --muted the rest of the site gives mono
   captions, and definitely not --faint. These numbers are
   referenced by the text itself ("the periods in section 09"),
   so someone scanning the rail for a number has to be able to
   read it. --faint is 2.5:1 and --muted is 4.2:1; at 9.5px
   neither is good enough to carry information. */
.legal__index a > span {
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  letter-spacing: 0.04em;
  color: var(--body);
  padding-top: 2px;
  transition: color var(--d-fast);
}
.legal__index a:hover { color: var(--text); }
.legal__index a:hover > span { color: var(--text); }

/* Scroll-spy state, set by legalIndex() in main.js. Marks the
   edge as well as the text, so the rail reads as a position
   indicator and not just a hover colour.

   DELIBERATELY NOT font-weight. A title like "Apps from the Apple
   App Store and Google Play" rewraps at 600 in a 13px column, so a
   weight change makes the rail twitch line-by-line as you scroll.
   Colour and the edge carry the state at zero layout cost. */
.legal__index a[aria-current="true"] {
  color: var(--text);
  border-left-color: var(--accent);
}
.legal__index a[aria-current="true"] > span { color: var(--accent); }


/* ============================================================
   4. THE DOCUMENT
   ============================================================ */

.legal__body { min-width: 0; }

.legal__sec {
  padding-top: 30px;
  margin-top: 30px;
  border-top: 1px solid var(--stroke);
  /* clears the sticky header when an anchor is followed */
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.legal__sec:first-child { padding-top: 0; margin-top: 0; border-top: 0; }

.legal__num {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: var(--tr-label);
  color: var(--accent);
  text-transform: uppercase;
}

/* .legal__num is absent on /support — a help page is not a legal
   instrument and numbering it dresses a contact page as a
   contract. The heading carries the top margin in that case. */
.legal__sec > .legal__h2:first-child { margin-top: 2px; }

.legal__h2 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--t-h2-minor);
  line-height: var(--lh-display);
  letter-spacing: var(--tr-display);
  text-transform: uppercase;
  color: var(--text);
  text-wrap: balance;
}

/* The one step between the display H2 and body copy. Body face,
   semibold — a second display size would compete with the H2. */
.legal__h3 {
  margin: 30px 0 12px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16.5px;
  line-height: 1.35;
  letter-spacing: 0;
  color: var(--text);
}

.legal__body p,
.legal__body li {
  font-size: 16px;
  line-height: 1.72;
  color: var(--body);
  text-wrap: pretty;
}
.legal__body p { margin: 0 0 16px; max-width: var(--legal-measure); }
.legal__body p:last-child { margin-bottom: 0; }

.legal__body strong { color: var(--text); font-weight: 600; }
.legal__body a { text-decoration: underline; text-underline-offset: 2px; }

/* Lists: a 3px square marker on the first line's cap height.
   --r-icon, not a circle — the system has no round bullets. */
.legal__body ul {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  max-width: var(--legal-measure);
  display: grid;
  gap: 11px;
}
.legal__body ul li {
  position: relative;
  padding-left: 18px;
}
.legal__body ul li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 11px;
  width: 4px;
  height: 4px;
  border-radius: var(--r-icon);
  background: var(--rule);
}
.legal__body ul:last-child { margin-bottom: 0; }


/* ============================================================
   5. NOTE PANEL
   A paragraph the document itself emphasises — "we do not sell
   personal information", "these Terms do not create any right to
   compensation". Boxed, so a reader skimming cannot miss it.
   No accent bar: the box is the emphasis.
   ============================================================ */

.legal__note {
  max-width: var(--legal-measure);
  margin: 0 0 16px;
  padding: 18px 20px;
  background: var(--s2);
  border: 1px solid var(--stroke);
  border-radius: var(--r-card);
}
.legal__note p {
  margin: 0 0 10px;
  color: var(--text);
}
.legal__note p:last-child { margin-bottom: 0; }
.legal__note strong { font-weight: 600; }


/* ============================================================
   6. CONTACT BLOCK + CROSS-LINK
   ============================================================ */

.legal__addr {
  max-width: var(--legal-measure);
  margin: 0;
  padding: 22px 24px;
  background: var(--s2);
  border: 1px solid var(--stroke);
  border-radius: var(--r-card);
  font-style: normal;
  font-size: 16px;
  line-height: 1.7;
  color: var(--body);
}
.legal__addr b {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  color: var(--text);
}
.legal__addr a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.legal__also {
  max-width: var(--legal-measure);
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--stroke);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  align-items: baseline;
}
.legal__also span {
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  letter-spacing: var(--tr-meta);
  color: var(--muted);
  text-transform: uppercase;
}
.legal__also a { font-size: var(--t-card); font-weight: 600; }


/* ============================================================
   7. NARROW
   Below 1000px the rail stops being a rail: at that width it
   would take a third of the screen to hold 20 links. It becomes
   a plain contents list above the document, two columns wide so
   it does not push the first section a screen and a half down.
   ============================================================ */

@media (max-width: 1000px) {
  /* The measure stops being a cap inside a wide column and becomes
     the column. Capping 600px of prose inside a 940px container
     once the rail is gone leaves 340px of dead space down the
     right — the document has to narrow with it, not sit pinned to
     one edge of a container it no longer fills. */
  :root { --legal-measure: 100%; }
  .legal__wrap { max-width: calc(600px + var(--page-pad) * 2); }

  .legal__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
  }
  .legal__index {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 22px 24px 24px;
    background: var(--s2);
    border: 1px solid var(--stroke);
    border-radius: var(--r-card);
  }
  .legal__index ol {
    border-left: 0;
    columns: 2;
    column-gap: 32px;
  }
  .legal__index a {
    padding-left: 0;
    margin-left: 0;
    border-left: 0;
    break-inside: avoid;
  }
  /* The rail's position indicator is meaningless once the list no
     longer tracks the document beside it. */
  .legal__index a[aria-current="true"] {
    color: var(--body);
    border-left-color: transparent;
  }
  .legal__index a[aria-current="true"] > span { color: var(--body); }
}

@media (max-width: 620px) {
  /* One column of 20 items is a screen and a half before the
     document starts, so the rows tighten. Not hidden: on a phone
     the contents list is how someone finds the one section they
     came for — account deletion, what we collect — without
     thumbing through the whole policy. */
  .legal__index ol { columns: 1; }
  .legal__index a { padding-block: 5px; font-size: 13px; }
  .legal-hero__meta > div {
    flex-basis: 100%;
    border-left: 0;
    border-top: 1px solid var(--stroke);
  }
  .legal-hero__meta > div:first-child { border-top: 0; }
  .legal__body p,
  .legal__body li { font-size: 15.5px; }
}


/* ============================================================
   8. PRINT
   Someone will print a privacy policy or hand it to counsel.
   Drop the chrome, keep the document.
   ============================================================ */

@media print {
  .site-header, .site-footer, .legal__index, .skip-link, .legal__also { display: none; }
  .legal-hero { background: none; padding-block: 0 24px; }
  .legal__grid { display: block; }
  .legal__body p, .legal__body li { font-size: 11pt; line-height: 1.5; color: #000; }
  .legal__sec { break-inside: avoid-page; }
  .legal__note, .legal__addr { background: none; }
}
