:root {
  color-scheme: dark;
  --bg: #0c0e14;
  --surface: #151820;
  --card: #1c1f28;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f0ede8;
  --text-sub: #b8b4ae;
  --muted: #8a8690;
  --teal: #00d4aa;
  --teal-dim: rgba(0, 212, 170, 0.12);
  --max: 1180px;
  --reading: 74ch;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 4px;
  border-radius: 6px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  background: var(--teal);
  color: var(--bg);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
}

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

.legal-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 14, 20, 0.94);
  backdrop-filter: blur(16px);
}

.legal-nav {
  width: min(calc(100% - 40px), var(--max));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.legal-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legal-nav-links a {
  min-height: 44px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}

.legal-nav-links a:hover,
.legal-nav-links a[aria-current="page"] {
  color: var(--text);
  background: var(--surface);
  border-radius: 999px;
}

.legal-hero {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
  padding: 88px 0 62px;
  border-bottom: 1px solid var(--border);
  animation: legal-enter 520ms ease-out both;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.legal-hero h1 {
  max-width: 850px;
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(44px, 7vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.legal-summary {
  max-width: 720px;
  margin: 28px 0 0;
  color: var(--text-sub);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.55;
}

.legal-meta {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legal-meta span {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.legal-layout {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
  padding: 64px 0 92px;
  display: grid;
  grid-template-columns: 240px minmax(0, var(--reading));
  justify-content: space-between;
  gap: clamp(56px, 8vw, 120px);
}

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

.legal-toc p {
  margin: 0 0 16px;
  color: var(--text-sub);
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal-toc a {
  min-height: 42px;
  padding: 8px 0 8px 15px;
  display: flex;
  align-items: center;
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease;
}

.legal-toc a:hover {
  border-color: var(--teal);
  color: var(--text);
}

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

.legal-document section {
  padding: 0 0 50px;
  scroll-margin-top: 108px;
}

.legal-document section + section {
  padding-top: 50px;
  border-top: 1px solid var(--border);
}

.section-number {
  margin: 0 0 10px;
  color: var(--teal);
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.legal-document h2 {
  margin: 0 0 22px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.legal-document h3 {
  margin: 30px 0 10px;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  line-height: 1.3;
}

.legal-document p,
.legal-document li {
  color: var(--text-sub);
}

.legal-document p {
  margin: 0 0 18px;
}

.legal-document ul {
  margin: 0 0 22px;
  padding-left: 22px;
}

.legal-document li {
  margin: 8px 0;
  padding-left: 6px;
}

.legal-document li::marker {
  color: var(--teal);
}

.legal-document strong {
  color: var(--text);
  font-weight: 750;
}

.legal-document a {
  color: var(--teal);
  font-weight: 700;
  text-underline-offset: 3px;
}

.legal-note,
.contact-card {
  margin: 24px 0;
  padding: 22px 24px;
  border: 1px solid rgba(0, 212, 170, 0.24);
  border-radius: 20px;
  background: var(--teal-dim);
}

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

.contact-card address {
  color: var(--text-sub);
  font-style: normal;
}

.legal-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.legal-footer-inner {
  width: min(calc(100% - 40px), var(--max));
  min-height: 140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.legal-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.legal-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.legal-footer a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.legal-footer a:hover {
  color: var(--teal);
}

@keyframes legal-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .legal-hero {
    padding-top: 68px;
  }

  .legal-layout {
    grid-template-columns: 1fr;
    gap: 46px;
  }

  .legal-toc {
    position: static;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
  }

  .legal-toc ol {
    columns: 2;
  }

  .legal-toc a {
    break-inside: avoid;
  }
}

@media (max-width: 620px) {
  .legal-nav {
    width: min(calc(100% - 28px), var(--max));
  }

  .brand span {
    display: none;
  }

  .legal-nav-links {
    gap: 0;
  }

  .legal-nav-links a {
    padding-inline: 10px;
    font-size: 12px;
  }

  .legal-hero,
  .legal-layout,
  .legal-footer-inner {
    width: min(calc(100% - 32px), var(--max));
  }

  .legal-hero {
    padding: 52px 0 44px;
  }

  .legal-layout {
    padding: 40px 0 64px;
  }

  .legal-toc ol {
    columns: 1;
  }

  .legal-footer-inner {
    padding: 30px 0;
    align-items: flex-start;
    flex-direction: column;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
