:root {
  --legal-bg-0: #04070d;
  --legal-bg-1: #09111b;
  --legal-bg-2: #0d1521;
  --legal-panel: rgba(10, 15, 24, 0.72);
  --legal-panel-strong: rgba(10, 15, 24, 0.88);
  --legal-border: rgba(255, 255, 255, 0.09);
  --legal-border-soft: rgba(255, 255, 255, 0.06);
  --legal-text: #edf2fb;
  --legal-muted: #b0bfd7;
  --legal-muted-strong: #c7d3e7;
  --legal-accent: #99d9ff;
  --legal-accent-soft: rgba(153, 217, 255, 0.16);
  --legal-warm: #f2d5a7;
  --legal-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --legal-radius-lg: 24px;
  --legal-radius-md: 18px;
  --font-display: "Space Grotesk", "Segoe UI Variable Display", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI Variable Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--legal-text);
  background:
    linear-gradient(180deg, var(--legal-bg-0) 0%, var(--legal-bg-1) 48%, var(--legal-bg-2) 100%);
  overflow-x: hidden;
  position: relative;
}

a {
  color: var(--legal-accent);
}

a:hover {
  color: #ffffff;
}

.skip-link {
  position: absolute;
  left: 14px;
  top: -64px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 999px;
  background: #0e1624;
  color: #fff;
  text-decoration: none;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 14px;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 0;
  background:
    linear-gradient(rgba(164, 187, 220, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(164, 187, 220, 0.04) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.38), transparent 78%);
  opacity: 0.28;
}

body::after {
  z-index: 1;
  inset: auto auto 58vh 62vw;
  width: 30vw;
  height: 30vw;
  min-width: 240px;
  min-height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(72, 158, 255, 0.14) 0%, transparent 72%);
  filter: blur(28px);
  opacity: 0.7;
}

.legal-page {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 54px;
}

.legal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 0 20px;
  border-bottom: 1px solid var(--legal-border-soft);
}

.legal-header__brand-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.legal-header__brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--legal-border);
  background: linear-gradient(180deg, rgba(18, 27, 42, 0.88), rgba(10, 14, 22, 0.94));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.legal-header__brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.legal-header__brand-copy {
  display: grid;
  gap: 3px;
}

.legal-header__brand-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.legal-header__brand-meta {
  color: rgba(205, 216, 234, 0.68);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.legal-header__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.legal-header__nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: rgba(231, 237, 247, 0.84);
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.legal-header__nav-link:hover,
.legal-header__nav-link.is-active {
  border-color: var(--legal-border);
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.legal-main {
  display: grid;
  gap: 32px;
  padding-top: 26px;
}

.legal-intro {
  max-width: 54rem;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--legal-border-soft);
}

.legal-intro__eyebrow {
  margin: 0 0 12px;
  color: rgba(210, 220, 237, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.78rem;
  font-weight: 700;
}

.legal-intro h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.8vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.legal-intro__lead {
  max-width: 48rem;
  margin: 14px 0 0;
  color: var(--legal-muted-strong);
  font-size: 1.05rem;
  line-height: 1.7;
}

.legal-document-shell {
  display: grid;
  gap: 32px;
}

.legal-document-shell--with-toc {
  grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: 24px;
  padding: 18px 18px 16px;
  border: 1px solid var(--legal-border);
  border-radius: var(--legal-radius-md);
  background: linear-gradient(180deg, rgba(11, 17, 27, 0.8), rgba(8, 12, 19, 0.72));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
}

.legal-toc__title {
  margin: 0 0 14px;
  color: rgba(217, 226, 240, 0.72);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.legal-toc__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal-toc__list a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--legal-border-soft);
  color: rgba(228, 234, 245, 0.84);
  text-decoration: none;
}

.legal-toc__list li:first-child a {
  padding-top: 0;
  border-top: 0;
}

.legal-toc__list a:hover {
  color: #fff;
}

.legal-toc__number {
  color: rgba(242, 213, 167, 0.86);
  font-size: 0.82rem;
  font-weight: 700;
}

.legal-toc__label {
  line-height: 1.45;
}

.legal-document {
  width: 100%;
  max-width: 52rem;
}

.legal-document--compact {
  max-width: 48rem;
}

.legal-section {
  padding-top: 26px;
  margin-top: 26px;
  border-top: 1px solid var(--legal-border-soft);
}

.legal-document > .legal-section:first-child {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}

.legal-section__header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
}

.legal-section__index {
  flex: 0 0 auto;
  min-width: 24px;
  color: rgba(242, 213, 167, 0.86);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.legal-section__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.32rem, 2vw, 1.7rem);
  line-height: 1.14;
  letter-spacing: -0.03em;
}

.legal-prose {
  color: rgba(235, 240, 248, 0.88);
  font-size: 1rem;
  line-height: 1.78;
}

.legal-prose p {
  margin: 0;
}

.legal-prose p + p,
.legal-prose ul,
.legal-prose ol {
  margin-top: 14px;
}

.legal-prose ul,
.legal-prose ol {
  padding-left: 1.3rem;
}

.legal-prose li + li {
  margin-top: 8px;
}

.legal-prose strong {
  color: #ffffff;
  font-weight: 650;
}

.legal-prose a {
  color: var(--legal-accent);
  text-decoration-color: rgba(153, 217, 255, 0.4);
  text-underline-offset: 0.18em;
}

.legal-prose a:hover {
  color: #ffffff;
  text-decoration-color: rgba(255, 255, 255, 0.68);
}

.legal-address {
  display: grid;
  gap: 3px;
}

.legal-note {
  color: rgba(199, 211, 231, 0.78);
}

.legal-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--legal-border-soft);
}

.legal-footer__meta {
  display: grid;
  gap: 6px;
}

.legal-footer__eyebrow {
  margin: 0;
  color: rgba(210, 220, 237, 0.68);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.legal-footer__brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.legal-footer__line {
  margin: 0;
  color: rgba(228, 235, 246, 0.8);
  line-height: 1.6;
}

.legal-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
}

.legal-footer__links a {
  color: rgba(231, 237, 247, 0.8);
  text-decoration: none;
}

.legal-footer__links a:hover {
  color: #ffffff;
}

@media (max-width: 980px) {
  .legal-document-shell--with-toc {
    grid-template-columns: 1fr;
  }

  .legal-toc {
    position: static;
  }

  .legal-document {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .legal-page {
    width: min(100% - 24px, 1120px);
    padding-top: 20px;
  }

  .legal-header {
    flex-direction: column;
    align-items: stretch;
  }

  .legal-header__nav {
    justify-content: flex-start;
  }

  .legal-main {
    gap: 28px;
  }

  .legal-intro {
    padding-bottom: 16px;
  }

  .legal-intro__lead {
    font-size: 1rem;
  }

  .legal-section {
    padding-top: 22px;
    margin-top: 22px;
  }

  .legal-section__header {
    gap: 10px;
  }

  .legal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .legal-footer__links {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .legal-header__nav {
    gap: 8px;
  }

  .legal-header__nav-link {
    min-height: 38px;
    padding: 0 12px;
  }

  .legal-toc {
    padding: 16px;
  }

  .legal-section__header {
    align-items: flex-start;
  }
}

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