:root {
  --page-gutter: 24px;
  --content-width: 1120px;
  --reading-width: 820px;
  --ink: #211f28;
  --muted: #666370;
  --line: rgba(43, 39, 53, 0.09);
  --purple: #a671ff;
  --pink: #ff8fa3;
  --blue: #5c9bd6;
  --yellow: #ffd93d;
  --red: #ff6b6b;
  --paper: rgba(255, 255, 255, 0.97);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fffdfa;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.site-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.skip-link {
  position: fixed;
  z-index: 40;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: white;
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.legal-hero {
  padding: 172px var(--page-gutter) 82px;
}

.legal-layout,
.site-footer {
  width: min(var(--content-width), 100%);
  margin-inline: auto;
}

.legal-hero-inner {
  width: min(var(--content-width), 100%);
  margin-inline: auto;
  display: grid;
  gap: 22px;
}

.legal-kicker {
  margin: 0;
  color: var(--purple);
  font-size: 0.95rem;
  font-weight: 900;
}

.legal-hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(3rem, 7vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.legal-intro {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.7;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.legal-meta li {
  padding: 9px 13px;
  border-radius: 999px;
  color: #3f3a48;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 white, 0 0 20px rgba(73, 60, 98, 0.07);
  backdrop-filter: blur(14px);
  font-size: 0.86rem;
  font-weight: 750;
}

.legal-paper {
  padding: 72px var(--page-gutter) 96px;
  background: var(--paper);
}

.legal-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, var(--reading-width));
  justify-content: space-between;
  gap: 68px;
}

.legal-toc {
  align-self: start;
  position: sticky;
  top: 112px;
}

.legal-toc p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.legal-toc ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal-toc a {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
}

.legal-toc a:hover,
.legal-toc a:focus-visible {
  color: var(--ink);
  background: #f7f4fb;
  outline: none;
}

.legal-content {
  min-width: 0;
}

.legal-section {
  scroll-margin-top: 120px;
  padding: 0 0 36px;
  margin: 0 0 36px;
  border-bottom: 1px solid var(--line);
}

.legal-section:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.legal-section h2 {
  margin: 0 0 18px;
  font-size: 1.55rem;
  line-height: 1.25;
}

.legal-section h3 {
  margin: 24px 0 10px;
  font-size: 1.02rem;
}

.legal-section p,
.legal-section li {
  color: var(--muted);
  line-height: 1.72;
}

.legal-section p {
  margin: 0 0 14px;
}

.legal-section ul,
.legal-section ol {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding-left: 22px;
}

.legal-section strong {
  color: var(--ink);
}

.legal-note {
  padding: 18px 20px;
  margin: 18px 0;
  border-radius: 8px;
  color: #4e435f;
  background: #f6f0ff;
}

.legal-note p:last-child {
  margin-bottom: 0;
}

.data-table {
  width: 100%;
  margin: 18px 0 0;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
}

.data-table th {
  width: 34%;
  color: var(--ink);
  font-size: 0.9rem;
}

.data-table td {
  color: var(--muted);
  font-size: 0.9rem;
}

.subscription-plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.subscription-plan {
  display: grid;
  gap: 5px;
  padding: 18px;
  border-radius: 8px;
  background: #f8f5fb;
}

.subscription-plan strong {
  font-size: 1.35rem;
}

.subscription-plan span {
  color: var(--muted);
  font-size: 0.86rem;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.legal-content a:not(.plain-link),
.legal-links a {
  color: #6f45ba;
  font-weight: 800;
}

.legal-contact {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  font-style: normal;
}

.site-footer {
  padding: 34px var(--page-gutter) 46px;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .legal-toc {
    position: static;
  }

  .legal-toc ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  :root {
    --page-gutter: 16px;
  }

  .legal-hero {
    padding-top: 132px;
    padding-bottom: 58px;
  }

  .legal-hero h1 {
    font-size: 3rem;
  }

  .legal-intro {
    font-size: 1.02rem;
  }

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

  .legal-toc ol,
  .subscription-plans {
    grid-template-columns: 1fr;
  }

  .legal-toc {
    overflow-x: auto;
    margin-right: calc(var(--page-gutter) * -1);
    padding-right: var(--page-gutter);
    scrollbar-width: none;
  }

  .legal-toc::-webkit-scrollbar {
    display: none;
  }

  .legal-toc ol {
    display: flex;
    width: max-content;
    gap: 8px;
  }

  .legal-toc a {
    white-space: nowrap;
    background: #f7f4fb;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table th {
    padding-bottom: 4px;
    border-bottom: 0;
  }

  .data-table td {
    padding-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
