:root {
  color-scheme: light dark;
  --background: #f5f6f8;
  --surface: #ffffff;
  --surface-muted: #f0f1f3;
  --border: #dde0e5;
  --text: #17191d;
  --muted: #686e78;
  --accent: #ff6338;
  --accent-soft: #fff0ea;
  --focus: #b73b1b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #111316;
    --surface: #1c1f24;
    --surface-muted: #252930;
    --border: #313640;
    --text: #f4f5f7;
    --muted: #a4a9b3;
    --accent-soft: #3b2119;
    --focus: #ff8a68;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.62;
}

a {
  color: var(--focus);
  text-underline-offset: 3px;
}

a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 92%, transparent);
  backdrop-filter: blur(18px);
}

.site-header__inner,
.page,
.site-footer__inner {
  width: min(100% - 32px, 920px);
  margin-inline: auto;
}

.site-header__inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand picture {
  display: block;
  line-height: 0;
}

.brand img {
  display: block;
  width: 126px;
  height: auto;
}

.site-header__label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.page {
  padding-block: 42px 64px;
}

.document,
.legal-index__intro {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.06);
}

.document {
  padding: clamp(24px, 5vw, 52px);
}

.document h1,
.legal-index__intro h1 {
  margin-top: 0;
  letter-spacing: 0;
  line-height: 1.16;
}

.document h1 {
  font-size: clamp(30px, 6vw, 44px);
}

.document h2 {
  margin: 2.2em 0 0.7em;
  font-size: 24px;
  line-height: 1.25;
}

.document h3 {
  margin: 1.7em 0 0.6em;
  font-size: 19px;
  line-height: 1.3;
}

.document p,
.document li {
  max-width: 78ch;
}

.document ul,
.document ol {
  padding-left: 1.35em;
}

.document li + li {
  margin-top: 0.35em;
}

.document code {
  border-radius: 4px;
  background: var(--surface-muted);
  padding: 0.12em 0.35em;
  font-size: 0.92em;
}

.table-wrap {
  overflow-x: auto;
  margin-block: 20px;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

th,
td {
  border: 1px solid var(--border);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-muted);
}

.document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 36px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  color: var(--muted);
  font-size: 13px;
}

.document-meta code {
  overflow-wrap: anywhere;
}

.legal-index__intro {
  padding: clamp(24px, 5vw, 44px);
}

.legal-index__intro p {
  max-width: 66ch;
  color: var(--muted);
}

.legal-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.legal-link {
  display: block;
  min-height: 118px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
  color: var(--text);
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.legal-link:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.legal-link strong,
.legal-link span {
  display: block;
}

.legal-link span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer {
  border-top: 1px solid var(--border);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 24px 38px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 680px) {
  .site-header__label {
    display: none;
  }

  .page {
    padding-top: 20px;
  }

  .document {
    padding: 22px 18px 30px;
  }

  .document h1 {
    font-size: 30px;
  }

  .document h2 {
    font-size: 21px;
  }

  .legal-list {
    grid-template-columns: 1fr;
  }
}
