/* Shared legal-page styling — matches ToolAudition prototype */
:root {
  --bg-overlay-1: rgba(8, 11, 22, 0.84);
  --bg-overlay-2: rgba(8, 11, 22, 0.96);
  --panel: rgba(18, 22, 38, 0.78);
  --panel-strong: rgba(22, 26, 44, 0.94);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-border-strong: rgba(255, 255, 255, 0.16);
  --text: #f1f3f9;
  --text-muted: #9aa3b8;
  --text-dim: #6b7388;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-soft: rgba(124, 92, 255, 0.18);
  --success: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --chip: rgba(255, 255, 255, 0.06);
  --chip-active: rgba(124, 92, 255, 0.22);
  --input-bg: rgba(8, 11, 22, 0.55);
}
html[data-theme="light"] {
  --bg-overlay-1: rgba(245, 247, 252, 0.84);
  --bg-overlay-2: rgba(245, 247, 252, 0.96);
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --panel-border: rgba(15, 23, 42, 0.08);
  --panel-border-strong: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --accent: #5b3df5;
  --accent-2: #0891b2;
  --accent-soft: rgba(91, 61, 245, 0.12);
  --success: #10b981;
  --warn: #d97706;
  --danger: #dc2626;
  --chip: rgba(15, 23, 42, 0.05);
  --chip-active: rgba(91, 61, 245, 0.14);
  --input-bg: rgba(255, 255, 255, 0.7);
}

* , *::before , *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background-color: #04060f;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}
html[data-theme="light"] body { background-color: #eef1f8; }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* Background */
.bg-stage { position: fixed; inset: 0; z-index: -2; overflow: hidden; }
.bg-stage::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, var(--bg-overlay-1) 0%, var(--bg-overlay-2) 100%);
}
.bg-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1200ms ease;
}
.bg-slide.active { opacity: 1; }
html[data-theme="light"] .bg-slide { filter: brightness(1.05) saturate(0.85); }

/* Header */
.header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  background: var(--panel); border-bottom: 1px solid var(--panel-border);
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 14px 28px;
  display: flex; align-items: center; gap: 18px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 18px;
  text-decoration: none; color: var(--text);
}
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
}
.logo-mark svg { width: 18px; height: 18px; stroke: white; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.header-spacer { flex: 1; }
.header-link {
  padding: 8px 12px; border-radius: 8px;
  color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 500;
}
.header-link:hover { background: var(--chip); color: var(--text); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--chip); border: 1px solid var(--panel-border);
  display: grid; place-items: center; cursor: pointer;
  color: var(--text);
}
.icon-btn svg { width: 16px; height: 16px; }

/* Page layout */
.legal-shell {
  max-width: 860px; margin: 0 auto;
  padding: 48px 32px 80px;
}
.legal-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 11px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.legal-title {
  font-size: clamp(32px, 4.5vw, 44px); font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.1;
  margin: 14px 0 6px;
}
.legal-meta {
  color: var(--text-muted); font-size: 13.5px;
  display: flex; flex-wrap: wrap; gap: 16px;
  margin-bottom: 24px;
}
.legal-meta b { color: var(--text); }

.notice {
  margin: 0 0 32px;
  padding: 16px 18px;
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid rgba(251, 191, 36, 0.30);
  border-radius: 11px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.6;
}
.notice b { color: var(--warn); }

.legal-content {
  background: var(--panel);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 36px 40px;
}
.legal-content h2 {
  font-size: 22px; font-weight: 800; letter-spacing: -0.01em;
  margin: 32px 0 8px;
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content h3 {
  font-size: 16px; font-weight: 700;
  margin: 22px 0 6px;
  color: var(--text);
}
.legal-content p, .legal-content li {
  color: var(--text);
  font-size: 14.5px; line-height: 1.7;
}
.legal-content p { margin: 8px 0 12px; }
.legal-content ul, .legal-content ol { padding-left: 22px; margin: 8px 0 14px; }
.legal-content li { margin-bottom: 4px; }
.legal-content a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.legal-content a:hover { color: var(--accent-2); }
.legal-content code {
  background: var(--input-bg); padding: 2px 6px; border-radius: 5px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
}
.legal-content table {
  width: 100%; border-collapse: collapse; margin: 14px 0;
  font-size: 13.5px;
}
.legal-content th, .legal-content td {
  text-align: left; padding: 9px 12px;
  border-bottom: 1px solid var(--panel-border);
  vertical-align: top;
}
.legal-content th {
  background: var(--input-bg); font-weight: 700;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted);
}
.legal-content blockquote {
  border-left: 3px solid var(--accent);
  background: var(--input-bg);
  margin: 14px 0; padding: 12px 18px;
  border-radius: 0 9px 9px 0;
  color: var(--text);
  font-size: 14px;
}

.contact-block {
  margin-top: 32px; padding: 18px 22px;
  background: var(--input-bg); border: 1px solid var(--panel-border);
  border-radius: 11px; font-size: 13.5px; color: var(--text-muted);
}
.contact-block b { color: var(--text); }

/* Cross-page nav */
.legal-nav {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 28px;
}
.legal-nav a {
  padding: 7px 12px; border-radius: 8px;
  background: var(--chip); border: 1px solid var(--panel-border);
  color: var(--text-muted); text-decoration: none;
  font-size: 12.5px; font-weight: 600;
  transition: all 150ms ease;
}
.legal-nav a:hover, .legal-nav a.active { background: var(--chip-active); color: var(--accent); }

.toc {
  background: var(--input-bg); border: 1px solid var(--panel-border);
  border-radius: 11px; padding: 16px 20px;
  margin-bottom: 28px;
}
.toc h4 { margin: 0 0 8px; font-size: 12px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; }
.toc ol { margin: 0; padding-left: 22px; columns: 2; column-gap: 20px; font-size: 13.5px; }
.toc ol a { color: var(--text); text-decoration: none; }
.toc ol a:hover { color: var(--accent); }
@media (max-width: 640px) { .toc ol { columns: 1; } }

/* Footer */
.legal-footer {
  max-width: 860px; margin: 24px auto 0;
  padding: 24px 32px 60px;
  border-top: 1px solid var(--panel-border);
  font-size: 12px; color: var(--text-dim);
  text-align: center;
}
