/* Legal pages: same violet smoked glass + AeroShards as the store and dashboard. */
:root {
  --bg: #150d1c;
  --text: #ecd6ff;
  --muted: #a9a3b6;
  --faint: #6f6a7a;
  --accent: #e7cbff;
  --line: rgba(255, 255, 255, .08);
  --card: rgba(24, 16, 31, .7);
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--text); background: var(--bg);
  min-height: 100vh; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---- Background ------------------------------------------------------ */
.aero-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(90% 60% at 50% 0%, #211030 0%, #150d1c 70%);
}
.aero-bg > div { width: 100%; height: 100%; }
.aero-shards { position: relative; width: 100%; height: 100%; overflow: hidden; }
.aero-shards-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

/* ---- Buttons + top bar ----------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  padding: 6px 15px; font-size: 13.5px; font-weight: 600; white-space: nowrap;
  transition: filter .2s, box-shadow .25s, border-color .25s;
}
.btn-primary {
  color: #26103f; background: linear-gradient(180deg, #dcb4ff, #dbb1ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 24px -10px rgba(218, 176, 255, .8);
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 0 26px rgba(218, 176, 255, .55); }
.btn-ghost { color: var(--text); background: rgba(41, 33, 48, .8); border-color: rgba(255, 255, 255, .12); }
.btn-ghost:hover { border-color: rgba(231, 203, 255, .6); box-shadow: 0 0 20px rgba(218, 176, 255, .3); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(12, 7, 16, .45); border-bottom: 1px solid rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto; height: 56px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-logo { width: 28px; height: 28px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(218, 176, 255, .6)); }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.topbar-actions { display: flex; gap: 8px; }

/* ---- Layout ---------------------------------------------------------- */
.legal { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 56px 24px 64px; }

.legal-hero { text-align: center; margin-bottom: 40px; animation: rise .6s cubic-bezier(.22, 1, .36, 1) backwards; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.legal-hero h1 {
  font-family: var(--font-display); font-size: clamp(32px, 4.4vw, 52px); font-weight: 700;
  letter-spacing: -.035em; line-height: 1.05; margin-top: 8px;
  background: linear-gradient(180deg, #fff 30%, #ecd6ff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.legal-sub { color: var(--muted); font-size: 16px; line-height: 1.55; margin: 12px auto 0; max-width: 560px; }

.legal-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }

/* Side menu */
.toc { position: sticky; top: 84px; animation: rise .7s cubic-bezier(.22, 1, .36, 1) .08s backwards; }
.toc-title { font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin: 0 0 10px 12px; }
.toc ol { list-style: none; display: flex; flex-direction: column; gap: 1px; border-left: 1px solid var(--line); }
.toc a {
  display: block; padding: 6px 12px; margin-left: -1px; border-left: 1px solid transparent;
  font-size: 13.5px; color: var(--muted); transition: color .2s, border-color .2s;
}
.toc a:hover { color: var(--text); }
.toc a.is-active { color: #fff; border-left-color: var(--accent); }

/* Content card */
.card {
  position: relative; min-width: 0;
  background: var(--card); border: 1px solid rgba(218, 176, 255, .3); border-radius: 14px;
  padding: clamp(24px, 4vw, 44px);
  -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 0 60px -24px rgba(218, 176, 255, .45), 0 40px 80px -30px rgba(0, 0, 0, .9);
  animation: rise .7s cubic-bezier(.22, 1, .36, 1) .12s backwards;
}
.card::before {
  content: ""; position: absolute; left: 10%; right: 10%; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, #ebd5ff 30%, #fff 50%, #ebd5ff 70%, transparent);
  box-shadow: 0 0 12px 1px rgba(220, 180, 255, .9);
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.prose section + section { margin-top: 34px; padding-top: 34px; border-top: 1px solid var(--line); }
.prose h2 {
  display: flex; align-items: baseline; gap: 12px;
  font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 12px;
}
.prose h2 span { font-size: 13px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.prose p, .prose li { color: #ecd6ff; font-size: 15px; line-height: 1.7; }
.prose p + p, .prose ul + p, .prose p + ul { margin-top: 12px; }
.prose ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.prose li { position: relative; padding-left: 20px; }
.prose li::before {
  content: ""; position: absolute; left: 4px; top: .7em; width: 6px; height: 6px; border-radius: 2px;
  background: var(--accent); box-shadow: 0 0 8px rgba(218, 176, 255, .8); transform: rotate(45deg);
}
.prose a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

.legal-foot { margin-top: 40px; display: flex; gap: 10px; justify-content: center; color: var(--faint); font-size: 13.5px; }
.legal-foot a { color: var(--muted); transition: color .2s; }
.legal-foot a:hover { color: var(--accent); }

/* ---- Responsive ------------------------------------------------------ */
@media (max-width: 860px) {
  .legal-grid { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 520px) {
  .topbar-inner { padding: 0 16px; }
  .legal { padding: 36px 16px 48px; }
  .prose h2 { font-size: 19px; }
  .prose p, .prose li { font-size: 14.5px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .legal-hero, .toc, .card { animation: none; }
}

/* ---- Print / PDF: plain black-on-white document ---------------------- */
@media print {
  @page { margin: 18mm 16mm; }
  html, body { background: #fff !important; color: #111; }
  .aero-bg, .topbar, .toc, .legal-foot { display: none !important; }
  .legal { max-width: none; padding: 0; }
  .legal-grid { display: block; }
  .legal-hero { text-align: left; margin-bottom: 18px; animation: none; }
  .legal-hero h1 { background: none; color: #111; -webkit-text-fill-color: #111; font-size: 26pt; }
  .eyebrow { color: #555; }
  .legal-sub { color: #444; margin: 8px 0 0; max-width: none; font-size: 11pt; }
  .card { background: none; border: 0; box-shadow: none; padding: 0; animation: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .card::before { display: none; }
  .prose section + section { margin-top: 16px; padding-top: 14px; border-top: 1px solid #ddd; }
  .prose section { break-inside: avoid-page; }
  .prose h2 { font-size: 14pt; color: #111; break-after: avoid; }
  .prose h2 span { color: #666; }
  .prose p, .prose li { color: #222; font-size: 10.5pt; line-height: 1.55; }
  .prose li::before { background: #444; box-shadow: none; }
  .prose a { color: #111; }
}
