/* legal.css — Albahub branded template for legal/doc pages */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700;800&family=DM+Sans:wght@400;500&display=swap');

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

:root {
  --red: #DC2828;
  --red-dim: rgba(220,40,40,0.8);
  --red-glass: rgba(220,40,40,0.08);
  --red-border: rgba(220,40,40,0.3);
  --text: #e0e0e0;
  --text-muted: rgba(255,255,255,0.45);
  --bg: #000;
  --border: rgba(255,255,255,0.10);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
}

/* ── Animated accents ── */
.top-bar {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(220,40,40,0.5), transparent);
  z-index: 100;
  animation: scan 4s ease-in-out infinite;
}

.side-bar {
  position: fixed;
  top: 0; left: 2rem; bottom: 0; width: 1px;
  background: rgba(255,255,255,0.04);
  z-index: 2;
  pointer-events: none;
}
.side-bar::after {
  content: '';
  position: absolute;
  left: 0; width: 100%; height: 25%;
  background: linear-gradient(to bottom, transparent, rgba(220,40,40,0.35), transparent);
  animation: side-scan 7s ease-in-out infinite;
}

@keyframes scan {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
@keyframes side-scan {
  0% { top: -25%; }
  100% { top: 110%; }
}

/* ── Nav ── */
.legal-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 3rem;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-logo img { height: 34px; width: auto; display: block; }
.nav-back {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-back:hover { color: var(--red); }

/* ── Layout ── */
.legal-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

/* ── Header ── */
.legal-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.last-updated {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--red-border);
  border-radius: 100px;
  background: var(--red-glass);
  font-size: 0.63rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(220,40,40,0.9);
  margin-bottom: 1.1rem;
}
.last-updated-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

.legal-header h1 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(to bottom, #fff 0%, rgba(255,255,255,0.72) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 0.85rem;
}

.legal-header .lead {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 580px;
  line-height: 1.7;
}

/* ── Table of contents ── */
.toc {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.4rem;
  margin-bottom: 3rem;
}
.toc-title {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}
.toc ol {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.3rem 1.5rem;
  counter-reset: toc;
}
.toc li { counter-increment: toc; font-size: 0.82rem; }
.toc a {
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  transition: color 0.2s;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.65rem;
  color: rgba(220,40,40,0.5);
  flex-shrink: 0;
}
.toc a:hover { color: var(--red); }

/* ── Sections ── */
.legal-section {
  margin-bottom: 2.75rem;
  scroll-margin-top: 5rem;
}
.legal-section h2 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 0.9rem;
  padding-left: 0.9rem;
  border-left: 3px solid var(--red);
  line-height: 1.3;
}
.legal-section h3 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  margin: 1.25rem 0 0.4rem;
}
.legal-section p {
  color: var(--text-muted);
  margin-bottom: 0.65rem;
  font-size: 0.95rem;
}
.legal-section ul, .legal-section ol {
  margin: 0.4rem 0 0.65rem 1.4rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.legal-section li { margin-bottom: 0.35rem; line-height: 1.65; }
.legal-section strong { color: var(--text); font-weight: 600; }
.legal-section a { color: var(--red); text-decoration: none; transition: opacity 0.2s; }
.legal-section a:hover { opacity: 0.8; text-decoration: underline; }

/* ── Data table ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1.25rem;
  font-size: 0.85rem;
}
.data-table th {
  text-align: left;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(220,40,40,0.8);
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--red-border);
}
.data-table td {
  padding: 0.55rem 0.9rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: top;
}
.data-table tr:hover td { background: rgba(220,40,40,0.03); }
.data-table code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.78rem;
  color: rgba(220,40,40,0.7);
  background: rgba(220,40,40,0.06);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* ── Footer ── */
.legal-footer {
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.06em;
}
.legal-footer a { color: rgba(255,255,255,0.25); text-decoration: none; transition: color 0.2s; }
.legal-footer a:hover { color: var(--red); }
.legal-footer .footer-links { display: flex; gap: 1rem; align-items: center; }
.legal-footer .footer-links span { color: rgba(255,255,255,0.1); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .legal-nav { padding: 0.85rem 1.25rem; }
  .legal-wrap { padding: 2rem 1.25rem 4rem; }
  .side-bar { display: none; }
  .toc ol { grid-template-columns: 1fr; }
  .data-table { font-size: 0.78rem; }
  .data-table th, .data-table td { padding: 0.45rem 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
