/* The legal pages: /terms and /privacy. Long-form text beside a contents
   list. The shell (nav, drawer, footer, tokens, faces) comes from
   oxagen.css; this file holds only what a long document needs. Gold stays
   off the page body: it is the mark's colour. A link here is rust words
   over a rust underline, as everywhere on the site. */

.legal-head {
  padding: calc(var(--nav-h) + var(--ox-space) * 14) 0 calc(var(--ox-space) * 9);
  border-bottom: 1px solid var(--line);
}
/* A legal page's title heads a long text, so it takes the h2 step. */
.legal-head h1 {
  margin-top: calc(var(--ox-space) * 4);
  font-size: var(--fs-h2);
}
.legal-head .lede {
  margin-top: calc(var(--ox-space) * 4);
  max-width: 64ch;
  color: var(--ink-2);
  font-size: clamp(var(--fs-small), 1.6vw, calc(var(--ox-m-body) * 12 / 11));
}
.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--ox-space) * 2) calc(var(--ox-space) * 7);
  margin-top: calc(var(--ox-space) * 5.5);
  font-size: var(--fs-micro);
  color: var(--ink-3);
}
.legal-meta b {
  color: var(--ink);
  font-weight: 560;
}
.legal-meta a {
  color: var(--link);
  text-decoration: underline 1px var(--rust);
  text-underline-offset: 0.22em;
}

/* ---- layout: contents on the left, the document on the right ---- */
.legal {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: calc(var(--ox-space) * 16);
  padding: calc(var(--ox-space) * 11) 0 calc(var(--ox-space) * 26);
}
@media (max-width: 960px) {
  .legal {
    grid-template-columns: minmax(0, 1fr);
    gap: calc(var(--ox-space) * 7);
    padding-top: calc(var(--ox-space) * 7);
  }
}

/* The contents list is a <details>, so a narrow screen can fold it away. On a
   wide screen it stays open and sticks beside the text. */
.toc {
  align-self: start;
  font-size: var(--fs-micro);
}
@media (min-width: 961px) {
  .toc {
    position: sticky;
    top: calc(var(--nav-h) + 24px);
    max-height: calc(100vh - var(--nav-h) - 48px);
    overflow: auto;
    padding-right: calc(var(--ox-space) * 2);
  }
  .toc > summary {
    pointer-events: none;
  }
  .toc > summary::after {
    display: none;
  }
}
.toc > summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: var(--ox-tracking-eyebrow);
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: calc(var(--ox-space) * 3);
}
.toc > summary::-webkit-details-marker {
  display: none;
}
.toc > summary::after {
  content: "+";
  font-size: var(--fs-ui);
  letter-spacing: 0;
}
.toc[open] > summary::after {
  content: "\2212";
}
@media (max-width: 960px) {
  .toc {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--panel);
    box-shadow: var(--lit);
    padding: calc(var(--ox-space) * 3.5) calc(var(--ox-space) * 4);
  }
  .toc > summary {
    margin-bottom: 0;
  }
  .toc[open] > summary {
    margin-bottom: calc(var(--ox-space) * 3);
  }
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: calc(var(--ox-space) * 0.5);
  counter-reset: toc;
}
.toc li {
  counter-increment: toc;
}
.toc a {
  display: grid;
  grid-template-columns: 2.2em minmax(0, 1fr);
  padding: calc(var(--ox-space) * 1.25) calc(var(--ox-space) * 2);
  margin-left: calc(var(--ox-space) * -2);
  border-radius: var(--r);
  color: var(--ink-3);
  line-height: 1.4;
  transition:
    color var(--motion-control),
    background-color var(--motion-control);
}
.toc a::before {
  content: counter(toc);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  padding-top: 1px;
}
.toc a:hover {
  color: var(--ink);
  background: var(--raised);
}

/* ---- the document ---- */
.doc {
  max-width: 74ch;
  color: var(--body);
  font-size: var(--fs-small);
  line-height: 1.72;
  counter-reset: sec;
}
.doc > section {
  counter-increment: sec;
  scroll-margin-top: calc(var(--nav-h) + 20px);
}
.doc > section + section {
  margin-top: calc(var(--ox-space) * 13);
  padding-top: calc(var(--ox-space) * 10);
  border-top: 1px solid var(--line);
}
.doc h2 {
  display: grid;
  grid-template-columns: 2.4em minmax(0, 1fr);
  align-items: baseline;
  margin: 0 0 calc(var(--ox-space) * 4);
  font-size: var(--ox-m-h3);
  color: var(--ink);
}
.doc h2::before {
  content: counter(sec);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  color: var(--ink-3);
}
.doc h3 {
  margin: calc(var(--ox-space) * 7) 0 calc(var(--ox-space) * 2.5);
  font-size: var(--fs-card);
  color: var(--ink);
}
.doc p,
.doc ul,
.doc ol,
.doc dl {
  margin: 0 0 calc(var(--ox-space) * 3.5);
}
.doc ul,
.doc ol {
  padding-left: 1.25em;
}
.doc li {
  margin: calc(var(--ox-space) * 1.5) 0;
  padding-left: calc(var(--ox-space) * 0.5);
}
.doc li::marker {
  color: var(--ink-3);
}
.doc a {
  color: var(--link);
  text-decoration: underline 1px var(--rust);
  text-underline-offset: 0.22em;
  overflow-wrap: anywhere;
  transition: text-decoration-color var(--motion-control);
}
.doc a:hover {
  text-decoration-color: var(--link);
}
.doc strong {
  color: var(--ink);
  font-weight: 600;
}
.doc code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 1px calc(var(--ox-space) * 1.5);
  border-radius: var(--ox-radius-sm);
  background: var(--raised);
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* Defined terms: the word, then what it means. */
.doc .defs {
  display: grid;
  gap: calc(var(--ox-space) * 3);
}
.doc .defs div {
  display: grid;
  grid-template-columns: minmax(0, 11em) minmax(0, 1fr);
  gap: calc(var(--ox-space) * 4);
}
@media (max-width: 620px) {
  .doc .defs div {
    grid-template-columns: minmax(0, 1fr);
    gap: calc(var(--ox-space) * 0.5);
  }
}
.doc .defs dt {
  color: var(--ink);
  font-weight: 600;
}
.doc .defs dd {
  margin: 0;
}

/* The plain-language summary at the top, and the notes inside the text that
   a reader must not miss. State is not carried here, so neither uses gold. */
.summary {
  margin-bottom: calc(var(--ox-space) * 13);
  padding: calc(var(--ox-space) * 6) calc(var(--ox-space) * 6.5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow:
    var(--lit),
    var(--panel-shadow);
}
.summary h2 {
  display: block;
  font-size: var(--fs-card);
  margin-bottom: calc(var(--ox-space) * 1.5);
}
.summary h2::before {
  content: none;
}
.summary > p {
  color: var(--ink-3);
  font-size: var(--fs-ui);
}
.summary ul {
  margin: calc(var(--ox-space) * 3.5) 0 0;
}
.note {
  margin: calc(var(--ox-space) * 4.5) 0;
  padding: calc(var(--ox-space) * 3.5) calc(var(--ox-space) * 4.5);
  border: 1px solid var(--line);
  border-left: 3px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--lit);
}
.note p:last-child {
  margin-bottom: 0;
}

/* Tables scroll inside their own frame, so the page never scrolls sideways. */
.tbl {
  margin: calc(var(--ox-space) * 2) 0 calc(var(--ox-space) * 5);
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--lit);
}
.tbl table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: var(--fs-micro);
  line-height: 1.55;
}
.tbl th,
.tbl td {
  padding: calc(var(--ox-space) * 2.75) calc(var(--ox-space) * 3.5);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.tbl th {
  color: var(--ink);
  font-weight: 600;
  background: var(--raised);
  white-space: nowrap;
}
.tbl tr:last-child td {
  border-bottom: 0;
}
.tbl td:first-child {
  color: var(--ink);
  font-weight: 500;
}

.doc-end {
  margin-top: calc(var(--ox-space) * 14);
  padding-top: calc(var(--ox-space) * 6);
  border-top: 1px solid var(--line);
  font-size: var(--fs-micro);
  color: var(--ink-3);
}

@media print {
  .nav,
  .drawer,
  .skip,
  footer,
  .toc {
    display: none !important;
  }
  .legal-head {
    padding-top: 0;
  }
  .legal {
    display: block;
    padding: calc(var(--ox-space) * 6) 0 0;
  }
  .doc,
  .summary,
  .note,
  .tbl th {
    color: #000;
    background: none;
  }
  .doc > section + section {
    break-inside: auto;
  }
}
