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

:root {
  --legal-bg: #0B0C15;
  --legal-surface: #151724;
  --legal-border: #232637;
  --legal-text: #D4D8E5;
  --legal-heading: #F0F2F8;
  --legal-muted: #7C83A0;
  --legal-accent: #22C55E;
  --legal-accent-dim: rgba(34, 197, 94, 0.12);
  --radius: 8px;
  --radius-lg: 14px;
}

html { scroll-behavior: smooth; }

.legal-page {
  background-color: #0B0C15;
  color: #D4D8E5;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.8;
  font-size: 16px;
  min-height: 100vh;
}

.legal-page a {
  color: var(--legal-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.legal-page a:hover { color: #16A34A; }

/* ========== LEGAL HEADER ========== */
.legal-header {
  background: linear-gradient(180deg, #151724 0%, #0B0C15 100%);
  border-bottom: 1px solid var(--legal-border);
  padding: 50px 0 40px;
  text-align: center;
}

.legal-header .container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.legal-header h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  color: #F0F2F8;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.legal-header .updated {
  color: var(--legal-muted);
  font-size: 14px;
}

.legal-header .back-home {
  display: inline-block;
  margin-top: 16px;
  color: var(--legal-accent);
  font-size: 14px;
  font-weight: 500;
}

.legal-header .back-home:hover { color: #16A34A; }

/* ========== LEGAL CONTENT ========== */
.legal-content {
  padding: 50px 0 60px;
}

.legal-content .container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Scope isolation: prevent homepage section styles from leaking into legal pages */
.legal-page .legal-content section {
  background-color: transparent !important;
}

.legal-content .intro {
  font-size: 16px;
  color: var(--legal-muted);
  line-height: 1.8;
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--legal-border);
}

/* ========== TABLE OF CONTENTS ========== */
.toc {
  background: var(--legal-surface);
  border: 1px solid var(--legal-border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 40px;
}

.toc h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--legal-heading);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.toc ol {
  list-style: none;
  counter-reset: toc-counter;
}

.toc ol li {
  counter-increment: toc-counter;
  margin-bottom: 6px;
}

.toc ol li::before {
  content: counter(toc-counter) ".";
  color: var(--legal-accent);
  font-weight: 600;
  margin-right: 8px;
  font-size: 13px;
}

.toc ol li a {
  color: var(--legal-muted);
  font-size: 14px;
  transition: color 0.2s ease;
}

.toc ol li a:hover { color: var(--legal-heading); }

/* ========== LEGAL SECTIONS ========== */
.legal-content section {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--legal-border);
}

.legal-content section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.legal-content h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--legal-heading);
  margin-bottom: 14px;
  letter-spacing: -0.3px;
  padding-top: 8px;
}

.legal-content p {
  margin-bottom: 14px;
  color: var(--legal-text);
  font-size: 15px;
}

.legal-content ul,
.legal-content ol {
  margin: 10px 0 14px 20px;
  color: var(--legal-text);
  font-size: 15px;
}

.legal-content ul li,
.legal-content ol li {
  margin-bottom: 8px;
}

.legal-content strong {
  color: var(--legal-heading);
  font-weight: 600;
}

/* ========== LEGAL FOOTER ========== */
.legal-footer {
  border-top: 1px solid var(--legal-border);
  padding: 30px 0;
  text-align: center;
  background: #0B0C15;
}

.legal-footer .container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.legal-footer p {
  color: var(--legal-muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.legal-footer a {
  color: var(--legal-accent);
  font-size: 13px;
}

.legal-footer a:hover { color: #16A34A; }

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
  .legal-header { padding: 36px 0 28px; }
  .legal-header h1 { font-size: 24px; }
  .legal-content { padding: 36px 0 40px; }
  .toc { padding: 20px; }
  .legal-content h2 { font-size: 18px; }
}
