/* Privacy policy and terms of service.
   Long legal text read two ways: scanned for the one section someone needs,
   or read straight through. So a contents list that stays in view, numbered
   sections that are easy to land on, and a comfortable reading measure. */

/* --- Hero ---------------------------------------------------------------- */

.legal-hero__meta {
  font-size: 0.875rem;
  color: var(--on-dark-mute);
}
.legal-hero__meta a { color: var(--on-dark); text-underline-offset: 3px; }

.legal-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.legal-tabs a {
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--on-dark-mute);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.legal-tabs a:hover { color: var(--on-dark); }
.legal-tabs a[aria-current="page"] { background: var(--paper); color: var(--ink); }

/* --- Layout -------------------------------------------------------------- */

.legal-shelf { padding-top: clamp(40px, 5vw, 72px); }

.legal {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 88px);
  align-items: start;
}

.legal__aside {
  position: sticky;
  top: calc(var(--head) + 24px);
  max-height: calc(100vh - var(--head) - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* --- Contents ------------------------------------------------------------ */

.legal__toc summary {
  font-size: 0.688rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  list-style: none;
  cursor: default;
  padding-bottom: 14px;
}
.legal__toc summary::-webkit-details-marker { display: none; }

.legal__toc ol { border-left: 1px solid var(--paper-line); }
.legal__toc a {
  display: flex;
  gap: 10px;
  padding: 6px 0 6px 16px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--on-light-mute);
  text-decoration: none;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.legal__toc a span {
  flex: none;
  min-width: 1.6em;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.legal__toc a:hover { color: var(--ink); }
.legal__toc a[aria-current="true"] {
  color: var(--ink);
  font-weight: 600;
  border-left-color: var(--red);
}
.legal__toc a[aria-current="true"] span { color: var(--red); }

/* --- Body ---------------------------------------------------------------- */

.legal__body { max-width: 68ch; }

.legal__section {
  padding-block: 36px;
  border-top: 1px solid var(--paper-line);
  scroll-margin-top: calc(var(--head) + 16px);
}
.legal__section:first-child { border-top: 0; padding-top: 0; }

.legal__h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: clamp(1.3rem, 1.9vw, 1.6rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.legal__num {
  flex: none;
  font-size: 0.8em;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}

.legal__h3 {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.legal__subnum { color: var(--on-light-mute); font-variant-numeric: tabular-nums; }

.legal__section p,
.legal__list,
.legal__facts { margin-top: 14px; }
.legal__section p {
  color: #4a4440;
  line-height: 1.7;
  text-wrap: pretty;
}
.legal__h2 + p { margin-top: 18px; }

.legal__section a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--red); }
.legal__section a:hover { color: var(--red-deep); }

.legal__list li {
  position: relative;
  padding: 7px 0 7px 22px;
  line-height: 1.6;
  color: #4a4440;
}
.legal__list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.95em;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: var(--red);
}
.legal__list strong { color: var(--ink); font-weight: 700; }

.legal__facts {
  display: grid;
  gap: 0;
  padding: 8px 22px;
  border-radius: var(--radius-sm);
  background: var(--paper-warm);
}
.legal__facts > div {
  display: grid;
  grid-template-columns: minmax(0, 170px) minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--paper-line);
  font-size: 0.938rem;
  line-height: 1.5;
}
.legal__facts > div:first-child { border-top: 0; }
.legal__facts dt { font-weight: 700; color: var(--ink); }
.legal__facts dd { color: #4a4440; overflow-wrap: anywhere; }
.legal__facts .legal__facts-name { grid-template-columns: 1fr; }
.legal__facts .legal__facts-name dd { font-weight: 700; color: var(--ink); }

.legal__end {
  margin-top: 8px;
  padding-top: 28px;
  border-top: 1px solid var(--paper-line);
  font-size: 0.938rem;
  color: var(--on-light-mute);
}
.legal__end p + p { margin-top: 8px; }
.legal__end a { color: var(--ink); text-underline-offset: 3px; }

/* --- Smaller screens ----------------------------------------------------- */

@media (max-width: 900px) {
  .legal { grid-template-columns: 1fr; gap: 28px; }
  .legal__aside { position: static; max-height: none; overflow: visible; }
  .legal__toc {
    border: 1px solid var(--paper-line);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
  }
  .legal__toc summary { cursor: pointer; padding-bottom: 0; display: flex; justify-content: space-between; }
  .legal__toc summary::after { content: "+"; font-size: 1rem; letter-spacing: 0; color: var(--ink); }
  .legal__toc[open] summary { padding-bottom: 12px; }
  .legal__toc[open] summary::after { content: "–"; }
}

@media (max-width: 560px) {
  .legal__facts { padding: 4px 16px; }
  .legal__facts > div { grid-template-columns: 1fr; gap: 2px; }
  .legal-tabs { display: flex; width: 100%; }
  .legal-tabs a { flex: 1; text-align: center; padding-inline: 10px; }
}

/* --- Print: the text, without the site around it ------------------------- */

@media print {
  .masthead, .footer, .legal__aside, .legal-tabs, .skip-link { display: none !important; }
  .on-dark { background: none; color: #000; }
  .legal-hero__meta, .mute-dark { color: #444; }
  .legal { display: block; }
  .legal__body { max-width: none; }
  .legal__section { break-inside: avoid-page; padding-block: 18px; }
  .legal__section a::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #555; }
}

@media (prefers-reduced-motion: reduce) {
  .legal-tabs a, .legal__toc a { transition: none; }
}
