/* Header */

.legal-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding-block: 56px 72px;
}

.legal-head h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 88px;
  line-height: 88px;
  letter-spacing: -0.01em;
}

.legal-head__meta {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--color-accent-tint);
  color: var(--color-accent);
  font-weight: 600;
  font-size: 14px;
  line-height: 18px;
}

.legal-head__lede {
  max-width: 760px;
  padding-top: 8px;
  font-size: 22px;
  line-height: 34px;
  color: var(--color-body);
  text-wrap: pretty;
}

/* Contents and body */

.legal {
  display: grid;
  grid-template-columns: 280px minmax(0, 720px);
  gap: 120px;
  padding-bottom: 140px;
}

.toc {
  position: sticky;
  top: 32px;
  align-self: start;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}

.toc__title {
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 15px;
  line-height: 22px;
  color: var(--color-ink);
}

.toc a {
  display: flex;
  gap: 12px;
  padding-block: 6px;
  font-weight: 500;
  font-size: 15px;
  line-height: 22px;
  color: var(--color-body);
  transition: color 150ms ease;
}

.toc a:hover { color: var(--color-accent); }

.toc__no {
  flex-shrink: 0;
  width: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-label);
}

.legal__body {
  font-size: 18px;
  line-height: 30px;
  color: var(--color-body);
}

.sec { scroll-margin-top: 32px; }
.sec + .sec { margin-top: 72px; }
.sec > * + * { margin-top: 20px; }

.sec__no {
  display: block;
  font-weight: 600;
  font-size: 15px;
  line-height: 22px;
  font-variant-numeric: tabular-nums;
  color: var(--color-accent);
}

.sec > .sec__title {
  margin-top: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 36px;
  line-height: 42px;
  color: var(--color-ink);
}

.sec > h3 {
  margin-top: 36px;
  font-weight: 700;
  font-size: 20px;
  line-height: 28px;
  color: var(--color-ink);
}

.sec > h3 + p { margin-top: 10px; }

.sec strong { font-weight: 600; color: var(--color-ink); }

.sec a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: rgba(72, 73, 249, 0.35);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.sec a:hover { text-decoration-color: currentColor; }

.sec ul {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-left: 28px;
}

.sec li { position: relative; }

.sec li::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 11px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--color-accent);
}

/* Tablet */

@media (max-width: 1180px) {
  .legal-head h1 { font-size: 72px; line-height: 74px; }
  .legal { grid-template-columns: 240px minmax(0, 1fr); gap: 64px; }
}

@media (max-width: 900px) {
  .legal-head { padding-block: 40px 48px; }
  .legal-head h1 { font-size: 56px; line-height: 58px; }

  .legal { grid-template-columns: minmax(0, 1fr); gap: 56px; padding-bottom: 96px; }

  .toc {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 24px 24px 18px;
    border-radius: 24px;
    background: var(--color-bg-alt);
  }
}

/* Phone */

@media (max-width: 640px) {
  .legal-head { gap: 16px; padding-block: 24px 40px; }
  .legal-head h1 { font-size: 44px; line-height: 46px; }
  .legal-head__meta { padding: 4px 10px; font-size: 13px; }
  .legal-head__lede { padding-top: 4px; font-size: 18px; line-height: 28px; }

  .legal { gap: 48px; padding-bottom: 72px; }

  .toc { padding: 20px 20px 14px; }
  .toc a { padding-block: 5px; }

  .legal__body { font-size: 16px; line-height: 26px; }
  .sec + .sec { margin-top: 56px; }
  .sec > * + * { margin-top: 16px; }
  .sec > .sec__title { font-size: 28px; line-height: 34px; }
  .sec > h3 { margin-top: 28px; font-size: 18px; line-height: 26px; }
  .sec ul { gap: 12px; }
  .sec li::before { top: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .toc a { transition: none; }
}
