/*
 * Privacy policy and terms. Depends on base.css tokens.
 *
 * Legal text is only protective if it is read, so this is set like an article
 * rather than a contract: one column, generous line height, numbered headings
 * that can be cited, and no wall of block capitals.
 */

.legal {
  padding: calc(var(--nav-height) + 44px) 0 80px;
}

.legal__inner {
  max-width: 680px;
}

.legal__title {
  font-size: 34px;
  letter-spacing: -0.03em;
}

.legal__date {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 14px;
}

/* The version someone actually reads before scrolling past the rest. */
.legal__summary {
  margin-top: 26px;
  padding: 20px 22px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.legal__summary h2 {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.legal__summary ul {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  font-size: 15px;
  line-height: 1.6;
}

.legal__summary li {
  padding-left: 18px;
  position: relative;
}

.legal__summary li::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.legal__body {
  counter-reset: section;
  margin-top: 36px;
}

.legal__body section {
  margin-top: 34px;
}

.legal__body h2 {
  counter-increment: section;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.legal__body h2::before {
  content: counter(section) ". ";
  color: var(--text-muted);
  font-weight: 500;
}

.legal__body h3 {
  margin-top: 20px;
  font-size: 15px;
}

.legal__body p {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.legal__body strong {
  color: var(--text);
  font-weight: 600;
}

.legal__body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal__body ul {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.legal__body ul li {
  padding-left: 20px;
  position: relative;
}

.legal__body ul li::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-strong);
}

/* What is kept in the browser, named key by key. */
.legal__table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  font-size: 14.5px;
}

.legal__table th,
.legal__table td {
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.legal__table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal__table td:first-child {
  width: 40%;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}

.legal__table td:last-child {
  color: var(--text-secondary);
}

/* Warnings that carry real consequences get a colour, and only those. */
.legal__note {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
}

.legal__note p {
  margin-top: 0;
  color: var(--text);
  font-size: 15px;
}

.legal__note p + p {
  margin-top: 10px;
}

.legal__contact {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 15px;
  color: var(--text-secondary);
}

.legal__contact a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 720px) {
  .legal {
    padding: calc(var(--nav-height) + 28px) 0 56px;
  }

  .legal__title {
    font-size: 27px;
  }

  .legal__body h2 {
    font-size: 17.5px;
  }

  .legal__body p,
  .legal__body ul {
    font-size: 15.5px;
  }

  /* A two column table at 360px is unreadable; stack each key over its meaning. */
  .legal__table td,
  .legal__table th {
    display: block;
    padding-right: 0;
  }

  .legal__table th {
    display: none;
  }

  .legal__table td:first-child {
    width: auto;
    padding-bottom: 2px;
    border-bottom: 0;
    white-space: normal;
  }
}
