/* ── Reset & Variables ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-deep: #ffffff;
  --bg-primary: #f7f8fa;
  --bg-card: #ffffff;
  --bg-elevated: #f0f1f5;
  --red: #e63946;
  --red-dark: #c1121f;
  --red-glow: rgba(230,57,70,0.1);
  --text-primary: #1a1d26;
  --text-muted: #5a6070;
  --text-dim: #8b92a8;
  --border: rgba(0,0,0,0.08);
  --green: #0d9488;
  --font-heading: 'DM Serif Display', serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── SVG Noise Overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.015;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

/* ── Grid Background Pattern ── */
.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
  background-image:
    linear-gradient(rgba(0,0,0,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.06) 1px, transparent 1px);
  background-size: 80px 80px;
}

/* ── Container ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Footer ── */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer p {
  font-size: 0.8rem;
  color: var(--text-dim);
}
.footer a {
  color: var(--text-dim);
  text-decoration: none;
}
.footer a:hover {
  color: var(--text-muted);
}
.footer span {
  color: var(--text-muted);
}

/* ── Legal Pages ── */
.legal-header {
  text-align: center;
  padding: 80px 0 40px;
  border-bottom: 1px solid var(--border);
}
.legal-header .back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
}
.legal-header .back-link:hover {
  color: var(--text-primary);
}
.legal-header h1 {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 400;
  margin-bottom: 8px;
}
.legal-header .updated {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.legal-content {
  padding: 48px 0 80px;
  position: relative;
  z-index: 1;
}
.legal-content .container {
  max-width: 800px;
}
.legal-content h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 400;
  margin: 40px 0 16px;
  color: var(--text-primary);
}
.legal-content h2:first-child {
  margin-top: 0;
}
.legal-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--text-primary);
}
.legal-content p {
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.legal-content ul {
  margin-bottom: 16px;
  padding-left: 24px;
}
.legal-content li {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 8px;
}
.legal-content strong {
  color: var(--text-primary);
}
.legal-content code {
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.85rem;
}
.legal-content a {
  color: var(--red);
  text-decoration: none;
}
.legal-content a:hover {
  text-decoration: underline;
}
.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
}
.legal-content th,
.legal-content td {
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.legal-content th {
  color: var(--text-primary);
  font-weight: 600;
}
.legal-content td {
  color: var(--text-muted);
}
.legal-content .disclaimer {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: 4px;
  padding: 20px 24px;
  margin: 24px 0;
}
.legal-content .disclaimer p {
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.legal-content .disclaimer p:last-child {
  margin-bottom: 0;
}
.legal-content .disclaimer ul {
  margin-bottom: 12px;
}
.legal-content .disclaimer li {
  color: var(--text-primary);
  font-size: 0.9rem;
}
