/* 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, and a link here is ink with an
   underline. */

.legal-head {
  padding: calc(var(--nav-h) + 56px) 0 36px;
  border-bottom: 1px solid var(--line);
}
.legal-head h1 {
  margin-top: 16px;
  font-size: clamp(34px, 4.6vw, 52px);
}
.legal-head .lede {
  margin-top: 16px;
  max-width: 64ch;
  color: var(--ink-2);
  font-size: clamp(16px, 1.6vw, 17.5px);
}
.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: 22px;
  font-size: 13.5px;
  color: var(--ink-3);
}
.legal-meta b {
  color: var(--ink);
  font-weight: 560;
}
.legal-meta a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}

/* ---- layout: contents on the left, the document on the right ---- */
.legal {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 64px;
  padding: 44px 0 104px;
}
@media (max-width: 960px) {
  .legal {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding-top: 28px;
  }
}

/* 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: 13.5px;
}
@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: 8px;
  }
  .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: 10.5px;
  font-weight: 520;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.toc > summary::-webkit-details-marker {
  display: none;
}
.toc > summary::after {
  content: "+";
  font-size: 15px;
  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);
    padding: 14px 16px;
  }
  .toc > summary {
    margin-bottom: 0;
  }
  .toc[open] > summary {
    margin-bottom: 12px;
  }
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  counter-reset: toc;
}
.toc li {
  counter-increment: toc;
}
.toc a {
  display: grid;
  grid-template-columns: 2.2em minmax(0, 1fr);
  padding: 5px 8px;
  margin-left: -8px;
  border-radius: var(--r);
  color: var(--ink-3);
  line-height: 1.4;
}
.toc a::before {
  content: counter(toc);
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding-top: 1px;
}
.toc a:hover {
  color: var(--ink);
  background: var(--raised);
}

/* ---- the document ---- */
.doc {
  max-width: 74ch;
  color: var(--st-text);
  font-size: 16px;
  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: 52px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.doc h2 {
  display: grid;
  grid-template-columns: 2.4em minmax(0, 1fr);
  align-items: baseline;
  margin: 0 0 16px;
  font-size: clamp(21px, 2.2vw, 24px);
  color: var(--ink);
}
.doc h2::before {
  content: counter(sec);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
}
.doc h3 {
  margin: 28px 0 10px;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.doc p,
.doc ul,
.doc ol,
.doc dl {
  margin: 0 0 14px;
}
.doc ul,
.doc ol {
  padding-left: 1.25em;
}
.doc li {
  margin: 6px 0;
  padding-left: 2px;
}
.doc li::marker {
  color: var(--ink-3);
}
.doc a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.doc a:hover {
  text-decoration-color: var(--ink);
}
.doc strong {
  color: var(--ink);
  font-weight: 600;
}
.doc code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  overflow-wrap: anywhere;
}

/* Defined terms: the word, then what it means. */
.doc .defs {
  display: grid;
  gap: 12px;
}
.doc .defs div {
  display: grid;
  grid-template-columns: minmax(0, 11em) minmax(0, 1fr);
  gap: 16px;
}
@media (max-width: 620px) {
  .doc .defs div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}
.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: 52px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
}
.summary h2 {
  display: block;
  font-size: 18px;
  margin-bottom: 6px;
}
.summary h2::before {
  content: none;
}
.summary > p {
  color: var(--ink-3);
  font-size: 14.5px;
}
.summary ul {
  margin: 14px 0 0;
}
.note {
  margin: 18px 0;
  padding: 14px 18px;
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--panel);
}
.note p:last-child {
  margin-bottom: 0;
}

/* Tables scroll inside their own frame, so the page never scrolls sideways. */
.tbl {
  margin: 8px 0 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.tbl table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.55;
}
.tbl th,
.tbl td {
  padding: 11px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.tbl th {
  color: var(--ink);
  font-weight: 600;
  background: var(--panel);
  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: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-3);
}

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