*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body.legal-page-body {
  font-family: var(--font1);
  background: var(--bg);
  color: var(--t1);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  position: relative;
}

/* ─────────────────────────────────────────
    BACKGROUND
───────────────────────────────────────── */
.bg-mesh {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
    radial-gradient(ellipse 70% 55% at 5%  -5%,  var(--bg-mesh-blue) 0%, transparent 58%),
    radial-gradient(ellipse 55% 45% at 95%  8%,  var(--bg-mesh-green) 0%, transparent 52%),
    radial-gradient(ellipse 45% 50% at 50% 105%, var(--bg-mesh-blue-soft) 0%, transparent 55%);
}
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(var(--bg-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--bg-grid-line) 1px, transparent 1px);
    background-size: 52px 52px;
    background-position: 0 0;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 12%, black 72%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0%, black 12%, black 72%, transparent 100%);
    animation: drift-grid 10s linear infinite;
}
@keyframes drift-grid {
    from {
        background-position: 0 0, 0 0;
    }
    to {
        background-position: 52px 0, 52px 0;
    }
}

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

.legal-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 24px 48px;
  position: relative;
  z-index: 1;
}

.legal-topbar,
.legal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--nav-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color .3s, box-shadow .3s;
}

.legal-topbar:hover,
.legal-footer:hover {
  border-color: var(--outline-border-hover);
  box-shadow: 0 8px 40px var(--shadow-dark-sm);
}

#nav {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 14px 0 0;
  margin-bottom: 24px;
}

.nav-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px 10px 14px;
  border-radius: 14px;
  background: var(--nav-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  transition: border-color .3s, box-shadow .3s;
}

#nav.scrolled .nav-pill,
.nav-pill:hover {
  border-color: var(--outline-border-hover);
  box-shadow: 0 8px 40px var(--shadow-dark-sm);
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--blue-soft), var(--green-soft));
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-sup {
  font-family: var(--font3);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--t3);
  line-height: 1;
}

.brand-name {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
  background: linear-gradient(90deg, var(--brand-grad-start) 0%, var(--brand-grad-end) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  border: 1px solid transparent;
  white-space: nowrap;
  font-family: inherit;
}

.btn-sm {
  padding: 7px 15px;
  font-size: 13px;
}

.btn-ghost {
  color: var(--t2);
  background: transparent;
}

.btn-ghost:hover {
  color: var(--t1);
  background: var(--surface-soft-hover);
}

.btn-cta {
  color: var(--white);
  border: none;
  background: linear-gradient(130deg, var(--blue) 0%, var(--btn-cta-green) 100%);
  box-shadow: 0 6px 28px var(--blue-glow);
}

.btn-cta:hover {
  opacity: .92;
  transform: translateY(-2px);
  box-shadow: 0 12px 36px var(--shadow-blue-cta);
}

@media (max-width: 700px) {
  .nav-link {
    display: none !important;
  }
}

.legal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legal-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--blue-soft), var(--green-soft));
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.legal-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.legal-brand-kicker {
  font-family: var(--font3);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--t3);
  line-height: 1;
}

.legal-brand-name {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
  background: linear-gradient(90deg, var(--brand-grad-start) 0%, var(--brand-grad-end) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.legal-actions,
.legal-footer-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.legal-btn,
.legal-footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 15px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  border: 1px solid var(--border);
  white-space: nowrap;
  font-family: inherit;
}

.legal-btn,
.legal-footer-link {
  color: var(--t2);
  background: var(--surface-soft);
}

.legal-btn:hover,
.legal-footer-link:hover {
  color: var(--t1);
  border-color: var(--outline-border-hover);
  transform: translateY(-1px);
}

.legal-btn-primary {
  color: var(--white);
  border: none;
  background: linear-gradient(130deg, var(--blue) 0%, var(--btn-cta-green) 100%);
  box-shadow: 0 6px 28px var(--blue-glow);
}

.legal-btn-primary:hover {
  opacity: .92;
  transform: translateY(-2px);
  box-shadow: 0 12px 36px var(--shadow-blue-cta);
}

footer {
  margin-top: 24px;
  padding: 28px 24px 32px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  position: relative;
  z-index: 1;
}

.foot {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.foot-copy {
  font-size: 13px;
  color: var(--t3);
  margin-top: 8px;
}

.foot-links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.foot-link {
  font-size: 13px;
  color: var(--t3);
  padding: 6px 12px;
  border-radius: 8px;
  transition: color .2s, background .2s;
}

.foot-link:hover {
  color: var(--t1);
  background: var(--surface-soft-hover);
}

.legal-hero {
  margin-top: 24px;
  border-radius: var(--r-xl);
  padding: 44px 40px;
  background:
    radial-gradient(ellipse 65% 90% at 0% 50%, var(--blue-surface-mid), transparent 55%),
    radial-gradient(ellipse 65% 90% at 100% 50%, var(--green-surface-mid), transparent 55%),
    var(--surface);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.legal-kicker {
  font-family: var(--font3);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--blue);
  display: block;
  margin-bottom: 14px;
}

.legal-hero h1 {
  font-size: clamp(38px, 5.8vw, 64px);
  font-weight: 700;
  line-height: 1.07;
  letter-spacing: -.03em;
  margin-bottom: 16px;
  max-width: 840px;
}

.legal-hero p {
  color: var(--t2);
  font-size: clamp(15px, 1.5vw, 16px);
  line-height: 1.8;
  max-width: 860px;
}

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

.legal-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--info-text);
  background: var(--blue-soft);
  border: 1px solid var(--blue-border-soft);
}

.legal-grid {
  display: grid;
  grid-template-columns: minmax(0, 290px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 24px;
}

.legal-card,
.legal-doc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  position: relative;
  overflow: hidden;
}

.legal-card::before,
.legal-doc::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--panel-overlay-blue), transparent 55%, var(--panel-overlay-green));
  pointer-events: none;
}

.legal-card > *,
.legal-doc > * {
  position: relative;
  z-index: 1;
}

.legal-card {
  padding: 24px 22px;
  position: sticky;
  top: 18px;
  align-self: start;
}

.legal-card h2,
.legal-doc h2 {
  font-size: clamp(24px, 2.5vw, 32px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.025em;
  color: var(--t1);
}

.legal-card h2 {
  margin-bottom: 12px;
}

.legal-card p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--t2);
}

.legal-toc {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.legal-toc a {
  color: var(--t2);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  transition: all .2s;
}

.legal-toc a:hover {
  color: var(--t1);
  border-color: var(--outline-border-hover);
  transform: translateY(-1px);
}

.legal-doc {
  padding: 30px 30px 34px;
}

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

.legal-doc h2 {
  margin-bottom: 12px;
}

.legal-doc h3 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.01em;
  color: var(--t1);
  margin-bottom: 12px;
}

.legal-doc p,
.legal-doc li {
  font-size: 15px;
  color: var(--t2);
  line-height: 1.82;
}

.legal-doc p {
  margin-bottom: 12px;
}

.legal-doc p:last-child {
  margin-bottom: 0;
}

.legal-doc ul {
  list-style: disc;
  padding-left: 22px;
  margin: 0 0 12px;
}

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

.legal-doc a {
  color: var(--info-text);
  text-decoration: underline;
  text-decoration-color: var(--blue-link-underline);
  text-underline-offset: 3px;
}

.legal-doc a:hover {
  color: var(--t1);
}

.legal-callout {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(79,111,255,.2);
  background: var(--blue-soft);
  color: var(--t2);
}

.legal-callout strong {
  color: var(--t1);
}

.legal-placeholder {
  color: var(--warning-text-soft);
  font-weight: 700;
}

.legal-muted {
  color: var(--t3) !important;
}

.legal-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface-softest);
}

.legal-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.legal-table th,
.legal-table td {
  text-align: left;
  vertical-align: top;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.7;
}

.legal-table tr:last-child td {
  border-bottom: none;
}

.legal-table th {
  color: var(--t1);
  font-weight: 600;
  background: var(--surface-soft);
}

.legal-table td {
  color: var(--t2);
}

.legal-footer {
  margin-top: 24px;
}

.legal-footer-copy {
  max-width: 700px;
  font-size: 13px;
  color: var(--t3);
  line-height: 1.8;
}

code {
  font-family: var(--font3);
  font-size: .94em;
  color: var(--code-text);
  background: var(--surface-soft);
  border: 1px solid var(--surface-soft-track);
  padding: 2px 6px;
  border-radius: 8px;
}

.legal-section-dots {
  position: fixed;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 999px;
  background: var(--bg-overlay);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-soft-track);
}

.legal-section-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface-soft-dot);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform .2s, background .2s, box-shadow .2s;
}

.legal-section-dot:hover {
  transform: scale(1.15);
  background: var(--surface-soft-dot-hover);
}

.legal-section-dot.is-active {
  background: linear-gradient(180deg, var(--blue) 0%, var(--btn-cta-green) 100%);
  box-shadow: 0 0 14px var(--shadow-blue-strong);
  transform: scale(1.2);
}

.nav-divider {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 2px;
  display: inline-block;
}

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

  .legal-card {
    position: static;
  }
}

@media (max-width: 680px) {
  .legal-shell {
    padding: 16px 16px 36px;
  }

  .legal-section-dots {
    display: none;
  }

  .legal-hero,
  .legal-card,
  .legal-doc {
    border-radius: 20px;
  }

  .legal-hero {
    padding: 30px 22px;
  }

  .legal-doc,
  .legal-card {
    padding: 22px 18px;
  }

  .legal-hero h1 {
    font-size: clamp(30px, 10vw, 40px);
  }

  .legal-topbar,
  .legal-footer {
    padding: 12px 12px;
  }

  .foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .foot-copy,
  .foot-link {
    font-size: 12px;
  }
}
