:root {
  --bg: #05040c;
  --panel: rgba(255,255,255,.08);
  --panel-strong: rgba(255,255,255,.12);
  --text: #ffffff;
  --muted: rgba(255,255,255,.72);
  --soft: rgba(255,255,255,.52);
  --purple: #9b6cff;
  --pink: #ff5cc8;
  --cyan: #4ed7ff;
  --yellow: #ffd84b;
  --shadow: 0 30px 80px rgba(0,0,0,.42);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: ui-rounded, "SF Pro Rounded", "Inter", "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 8%, rgba(155,108,255,.26), transparent 32%),
    radial-gradient(circle at 88% 10%, rgba(255,92,200,.16), transparent 28%),
    radial-gradient(circle at 55% 90%, rgba(78,215,255,.13), transparent 34%),
    var(--bg);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: .16;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.42) 1px, transparent 1.5px),
    linear-gradient(135deg, transparent 0 42%, rgba(255,255,255,.10) 42% 43%, transparent 43% 100%);
  background-size: 22px 22px, 160px 160px;
  mask-image: linear-gradient(to bottom, #000, transparent 86%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(22px);
  background: rgba(5,4,12,.62);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.nav-inner {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
}

.brand-logo {
  width: 118px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 10px 30px rgba(155,108,255,.25);
}

.nav-links {
  display: flex;
  gap: 22px;
  color: var(--muted);
  font-weight: 750;
  font-size: 14px;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: #fff;
}

.ghost-btn,
.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 850;
  white-space: nowrap;
}

.ghost-btn {
  padding: 13px 18px;
  border: 1px solid rgba(255,255,255,.18);
  color: var(--text);
  background: rgba(255,255,255,.06);
}

.pill-btn {
  padding: 12px 17px;
  background: #fff;
  color: #120d24;
  box-shadow: 0 16px 40px rgba(255,255,255,.14);
}

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

.legal-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.82);
  font-size: 14px;
  font-weight: 850;
  margin-bottom: 22px;
}

.spark {
  color: var(--yellow);
}

.legal-hero h1 {
  font-size: clamp(44px, 8vw, 84px);
  line-height: 1;
  letter-spacing: 0;
  margin: 0 0 22px;
  max-width: 900px;
}

.legal-intro {
  color: var(--muted);
  line-height: 1.65;
  font-size: clamp(17px, 2vw, 21px);
  max-width: 760px;
  margin: 0 0 26px;
}

.legal-meta,
.legal-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.legal-meta {
  margin-bottom: 22px;
}

.meta-chip {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.82);
  font-size: 13px;
  font-weight: 780;
}

.legal-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  padding: 18px 0 94px;
}

.toc {
  position: sticky;
  top: 102px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 24px;
  background: rgba(255,255,255,.055);
  box-shadow: 0 18px 52px rgba(0,0,0,.20);
  max-height: calc(100vh - 126px);
  overflow: auto;
}

.toc-title {
  margin: 0 0 14px;
  color: #fff;
  font-weight: 900;
}

.toc a {
  display: block;
  padding: 8px 0;
  color: rgba(255,255,255,.66);
  font-size: 13px;
  line-height: 1.35;
  border-top: 1px solid rgba(255,255,255,.07);
}

.toc a:hover {
  color: #fff;
}

.legal-article {
  min-width: 0;
  padding: 10px 0 0;
  color: rgba(255,255,255,.86);
}

.legal-article h2,
.legal-article h3 {
  color: #fff;
  line-height: 1.18;
  letter-spacing: 0;
  scroll-margin-top: 104px;
}

.legal-article h2 {
  margin: 52px 0 16px;
  font-size: clamp(27px, 3vw, 39px);
}

.legal-article h2:first-child {
  margin-top: 0;
}

.legal-article h3 {
  margin: 34px 0 12px;
  font-size: clamp(21px, 2.2vw, 27px);
}

.legal-article p {
  margin: 0 0 16px;
  color: rgba(255,255,255,.78);
  line-height: 1.78;
  font-size: 16px;
}

.legal-article a {
  color: #d7c9ff;
  border-bottom: 1px solid rgba(215,201,255,.46);
}

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

.legal-article li {
  margin: 0 0 10px;
  color: rgba(255,255,255,.79);
  line-height: 1.7;
  font-size: 16px;
}

.table-wrap {
  overflow-x: auto;
  margin: 18px 0 28px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  background: rgba(255,255,255,.055);
}

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

th,
td {
  padding: 15px 16px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  vertical-align: top;
  text-align: left;
  line-height: 1.55;
  font-size: 14px;
}

th {
  color: #fff;
  background: rgba(255,255,255,.08);
  font-weight: 900;
}

td {
  color: rgba(255,255,255,.76);
}

tr:last-child td {
  border-bottom: 0;
}

footer {
  padding: 0 0 56px;
  color: rgba(255,255,255,.56);
  font-size: 14px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid rgba(255,255,255,.10);
  padding-top: 28px;
}

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

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

  .toc {
    position: relative;
    top: auto;
    max-height: none;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 26px, 1120px);
  }

  .nav-inner {
    height: 66px;
  }

  .nav-links {
    display: none;
  }

  .brand-logo {
    width: 96px;
    height: 38px;
    border-radius: 10px;
  }

  .ghost-btn,
  .pill-btn {
    width: 100%;
  }

  .nav .ghost-btn {
    width: auto;
    padding-inline: 14px;
  }

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

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

  .legal-layout {
    padding-bottom: 68px;
  }

  .legal-article p,
  .legal-article li {
    font-size: 15.5px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
