:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #071223;
  color: #dbeafe;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 5%, rgba(37, 99, 235, 0.18), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(14, 165, 233, 0.12), transparent 25rem),
    linear-gradient(180deg, #071223 0%, #09172b 48%, #071223 100%);
}

a {
  color: #7dd3fc;
}

a:hover {
  color: #bae6fd;
}

.legal-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.legal-topbar {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  padding: 14px 18px;
  background: rgba(8, 20, 39, 0.84);
  box-shadow: 0 20px 55px rgba(2, 6, 23, 0.28);
  backdrop-filter: blur(18px);
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #f8fafc;
  font-weight: 900;
  text-decoration: none;
}

.legal-brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.28);
}

.legal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legal-nav a {
  border-radius: 10px;
  padding: 9px 12px;
  color: #a9bdd4;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.legal-nav a[aria-current="page"] {
  background: rgba(37, 99, 235, 0.2);
  color: #bfdbfe;
}

.legal-nav a:hover {
  background: rgba(56, 189, 248, 0.1);
  color: #e0f2fe;
}

.legal-layout {
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: 104px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  padding: 20px;
  background: rgba(11, 26, 48, 0.68);
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.22);
}

.legal-toc strong {
  display: block;
  margin-bottom: 12px;
  color: #f8fafc;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.legal-toc nav {
  display: grid;
  gap: 4px;
}

.legal-toc a {
  border-radius: 8px;
  padding: 8px 9px;
  color: #9fb1c8;
  font-size: 0.79rem;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}

.legal-toc a:hover {
  background: rgba(56, 189, 248, 0.08);
  color: #dbeafe;
}

.legal-document {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 20px;
  background: rgba(8, 20, 39, 0.78);
  box-shadow: 0 35px 100px rgba(2, 6, 23, 0.34);
}

.legal-hero {
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  padding: 42px 46px 34px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.18), transparent 55%),
    rgba(15, 31, 55, 0.38);
}

.legal-eyebrow {
  margin: 0 0 10px;
  color: #38bdf8;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.legal-hero h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(2.2rem, 5vw, 4.1rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.legal-summary {
  max-width: 780px;
  margin: 20px 0 0;
  color: #b7c6d8;
  font-size: 1rem;
  line-height: 1.75;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.legal-meta span {
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.48);
  color: #a9bdd4;
  font-size: 0.76rem;
  font-weight: 800;
}

.legal-content {
  padding: 20px 46px 48px;
}

.legal-content section {
  scroll-margin-top: 112px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  padding: 30px 0;
}

.legal-content section:last-child {
  border-bottom: 0;
}

.legal-content h2 {
  margin: 0 0 14px;
  color: #f8fafc;
  font-size: 1.3rem;
  line-height: 1.25;
}

.legal-content h3 {
  margin: 22px 0 9px;
  color: #dbeafe;
  font-size: 1rem;
}

.legal-content p,
.legal-content li {
  color: #aebdd0;
  font-size: 0.94rem;
  line-height: 1.75;
}

.legal-content p {
  margin: 0 0 13px;
}

.legal-content ul,
.legal-content ol {
  margin: 12px 0 14px;
  padding-left: 22px;
}

.legal-content li + li {
  margin-top: 8px;
}

.legal-content strong {
  color: #e2e8f0;
}

.legal-callout {
  margin: 16px 0;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  padding: 16px 18px;
  background: rgba(14, 165, 233, 0.08);
}

.legal-callout p:last-child {
  margin-bottom: 0;
}

.legal-footer {
  margin-top: 24px;
  color: #71839a;
  font-size: 0.76rem;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 860px) {
  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-toc {
    position: static;
  }

  .legal-toc nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .legal-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .legal-topbar {
    top: 8px;
    align-items: flex-start;
    flex-direction: column;
  }

  .legal-nav {
    width: 100%;
    overflow-x: auto;
  }

  .legal-hero,
  .legal-content {
    padding-left: 24px;
    padding-right: 24px;
  }

  .legal-toc nav {
    grid-template-columns: 1fr;
  }
}
