/* The contract documents under /legal. Contract typography on the site's paper: one measure,
   hanging section numbers, and nothing decorative between the reader and the clause.

   Kept apart from css/legal.css, which the privacy notice owns. The two share three class names
   (.legal-body, .legal-toc, .legal-aside) with genuinely different rules — a two-column TOC that
   scrolls away suits a notice you read once, and not a contract you cite by section — so one file
   would have had each page quietly restyling the other. */

.page-head--legal {
  padding-block: clamp(40px, 4.6vw, 74px) clamp(26px, 3vw, 44px);
  overflow: visible;
}
.page-head--legal h1 { max-width: 22ch; }

.legal-crumb { margin-bottom: 18px; font-size: var(--text-lg); }
.legal-crumb a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  padding-block: 4px 3px;
}
.legal-crumb a:hover { color: var(--emerald-deep); border-bottom-color: var(--emerald); }

.legal-stamp {
  margin-top: 20px;
  max-width: 56ch;
  color: var(--text-muted);
  font-size: var(--text-xl);
  line-height: var(--leading-body);
}

.legal-body { border-top: 1px solid var(--border); padding-block: clamp(38px, 4vw, 66px) clamp(64px, 8vw, 120px); }

.legal-grid {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: clamp(34px, 5vw, 96px);
  align-items: start;
}
.legal-narrow > * { max-width: 74ch; }

/* ------------------------------------------------------------------ contents */

.legal-toc h2 {
  font-size: var(--text-sm);
  font-weight: var(--weight-label);
  color: var(--text-label);
  margin-bottom: 16px;
}
.legal-toc-list { list-style: none; margin: 0; padding: 0; }
.legal-toc-list li + li { margin-top: 1px; }
.legal-toc-list a {
  display: grid;
  grid-template-columns: 3.4em minmax(0, 1fr);
  gap: 6px;
  /* 24px of hit area on a link this small has to be bought with padding: at
     15/1.35 the line box alone is 20px. */
  padding-block: 5px;
  font-size: var(--text-lg);
  line-height: 1.35;
  color: var(--text);
  text-decoration: none;
}
.legal-toc-list a:hover { color: var(--emerald-deep); }
.legal-toc-list .toc-num { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.legal-toc-foot {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: var(--text-lg);
}
.legal-toc-foot a { display: inline-block; padding-block: 4px; color: var(--emerald-deep); text-decoration-color: var(--emerald); text-underline-offset: 3px; }

/* ------------------------------------------------------------------ document */

.doc {
  --hang: 0px;
  max-width: 74ch;
  padding-left: var(--hang);
  color: var(--text);
  font-size: var(--text-xl);
  line-height: var(--leading-body);
}
 /* Inline padding grows the hit rect of a link set in running text without
   changing the line box, which is the only way a 16px link clears 24px. */
.doc a { color: var(--emerald-deep); text-decoration-color: var(--emerald); text-underline-offset: 3px; padding-block: 3px; }
.doc strong { color: var(--ink-soft); font-weight: 600; }
.doc p + p { margin-top: 1.05em; }

.doc h2, .doc h3, .doc .clause { position: relative; }

.doc h2 {
  margin-top: 2.6em;
  margin-bottom: .9em;
  padding-top: 1.1em;
  border-top: 1px solid var(--border);
  font-family: var(--font-sans);
  font-weight: var(--weight-heading);
  font-size: var(--text-2xl);
  line-height: var(--leading-heading);
  letter-spacing: -.012em;
  color: var(--ink);
}
.doc > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.doc h3 {
  margin-top: 2em;
  margin-bottom: .55em;
  font-family: var(--font-sans);
  font-weight: var(--weight-heading);
  font-size: var(--text-xl);
  line-height: 1.35;
  color: var(--ink);
}

.doc .clause { margin-top: 1.5em; }
.doc .clause-title { font-weight: 600; color: var(--ink-soft); }

.doc-num, .clause-num {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.clause-num { font-weight: 600; margin-right: .4em; }
.doc h2 .doc-num { margin-right: .45em; }

@media (min-width: 1180px) {
  .doc { --hang: 92px; }
  .doc-num, .clause-num {
    position: absolute;
    left: calc(-1 * var(--hang));
    width: calc(var(--hang) - 22px);
    margin-right: 0;
    text-align: right;
    font-weight: 400;
  }
  .doc h2 .doc-num { padding-top: .12em; }
}

.doc-alpha, .doc-list { margin: 1.15em 0 0; padding-left: 2.2em; }
.doc-alpha { list-style: none; counter-reset: alpha; }
.doc-alpha > li { counter-increment: alpha; position: relative; }
.doc-alpha > li::before {
  content: "(" counter(alpha, lower-alpha) ")";
  position: absolute;
  left: -2.2em;
  color: var(--text-muted);
}
.doc-list > li { list-style: none; position: relative; }
.doc-list > li::before {
  content: "";
  position: absolute;
  left: -1.35em;
  top: .72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sage);
}
.doc-alpha > li + li, .doc-list > li + li { margin-top: .7em; }

/* --------------------------------------------------------------------- table */

.doc-table-wrap { margin-top: 1.4em; overflow-x: auto; }
.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .94em;
  line-height: 1.5;
}
.doc-table th, .doc-table td {
  padding: 11px 18px 11px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.doc-table thead th {
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border-strong);
  font-weight: 600;
  color: var(--ink-soft);
}
.doc-table td:first-child { white-space: nowrap; padding-right: 30px; color: var(--ink-soft); }
.doc-table .hash code { font-size: .92em; word-break: break-all; white-space: normal; }

/* ------------------------------------------------------- notices and metadata */

/* A framed region, so it takes the panel radius. */
.legal-notice {
  margin-bottom: 2.2em;
  padding: 16px 20px;
  border-radius: var(--radius-panel);
  border-left: 2px solid var(--emerald-edge);
  background: var(--tint-emerald);
  font-size: .95em;
}
.legal-fingerprint {
  margin-top: 3.4em;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--text-lg);
  line-height: 1.55;
}
.legal-fingerprint code { word-break: break-all; }

/* ------------------------------------------------------------ hub and archive */

.legal-entry { padding-block: clamp(24px, 2.4vw, 34px); border-top: 1px solid var(--border); }
.legal-entries > .legal-entry:first-child { border-top: 0; padding-top: 0; }
.legal-entry h3 { font-family: var(--font-sans); font-weight: var(--weight-heading); font-size: var(--text-2xl); line-height: var(--leading-heading); color: var(--ink); }
.legal-entry h3 a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--border-strong); }
.legal-entry h3 a:hover { color: var(--emerald-deep); border-bottom-color: var(--emerald); }
.legal-entry-meta { margin-top: 10px; color: var(--text-muted); font-size: var(--text-lg); }
.legal-entry p:last-child { margin-top: 12px; color: var(--text); max-width: 62ch; line-height: 1.6; }
.legal-older { margin-left: 6px; color: var(--emerald-deep); text-decoration-color: var(--emerald); text-underline-offset: 3px; }

.legal-aside {
  margin-top: clamp(40px, 4.4vw, 68px);
  padding-top: clamp(26px, 2.6vw, 38px);
  border-top: 1px solid var(--border);
  color: var(--text);
  line-height: 1.62;
}
.legal-aside--lead { margin-top: 0; padding-top: 0; border-top: 0; }
.legal-aside h2 { font-size: var(--text-sm); font-weight: var(--weight-label); color: var(--text-label); margin-bottom: 14px; }
.legal-aside p + p { margin-top: 1em; }
.legal-aside a { color: var(--emerald-deep); text-decoration-color: var(--emerald); text-underline-offset: 3px; }

.legal-archive-doc { margin-top: clamp(38px, 4vw, 58px); }
.legal-archive-doc h2 { font-family: var(--font-sans); font-weight: var(--weight-heading); font-size: var(--text-2xl); line-height: var(--leading-heading); color: var(--ink); }
.legal-archive-doc a { color: var(--emerald-deep); text-decoration-color: var(--emerald); text-underline-offset: 3px; }
.legal-current { margin-left: 8px; color: var(--text-muted); font-size: .9em; }

@media (max-width: 900px) {
  .legal-grid { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .legal-toc { padding-bottom: 26px; border-bottom: 1px solid var(--border); }
  .doc-table td:first-child { white-space: normal; }
}

/* ------------------------------------------------------------- version log */

.version-log { list-style: none; margin: 18px 0 0; padding: 0; }
.version-log > li { padding-block: 18px; border-top: 1px solid var(--border); }
.version-line { font-size: var(--text-xl); }
.version-line a { display: inline-block; padding-block: 3px; }
.version-dates, .version-hash { margin-top: 5px; color: var(--text-muted); font-size: var(--text-lg); line-height: 1.5; }
.version-hash code { word-break: break-all; }
.legal-toc-list .toc-sub a { padding-left: 3.4em; color: var(--text-muted); }
.legal-toc-list .toc-sub a:hover { color: var(--emerald-deep); }

@media (min-width: 1180px) {
  /* A worded label ("PART 1.", "EXHIBIT A.") will not fit the hanging gutter. */
  .doc h2 .doc-num--inline {
    position: static;
    width: auto;
    margin-right: .45em;
    text-align: left;
  }
}
