/* ============================================
   LEGAL PAGES — privacy.html & terms.html
   Shared styles for readable legal content
   with Awwwards-level dark design system.
   ============================================ */

/* ── WebGL canvas override for legal pages ── */
.legal-page {
  position: relative;
  min-height: 100vh;
}

.legal-page > canvas,
.legal-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Reading progress bar ── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--gradient-gold);
  z-index: 1001;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ── Legal hero ── */
.legal-hero {
  position: relative;
  z-index: 1;
  padding: clamp(120px, 16vw, 200px) 24px clamp(40px, 6vw, 80px);
  text-align: center;
  background: radial-gradient(ellipse at top center, rgba(212, 175, 55, 0.06) 0%, transparent 60%);
}

.legal-hero .section-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
  display: inline-block;
}

.legal-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 16px;
  line-height: 1.15;
}

.legal-hero-title .text-gold {
  color: var(--gold);
}

.legal-hero-subtitle {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--white-70);
  max-width: 540px;
  margin: 0 auto 20px;
  line-height: 1.7;
}

.legal-effective-date {
  display: inline-block;
  padding: 6px 18px;
  background: var(--gold-dim);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 20px;
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ── Table of Contents ── */
.legal-toc {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto 48px;
  padding: 0 24px;
}

.legal-toc-inner {
  background: var(--gradient-card);
  border: 1px solid var(--white-10);
  border-radius: var(--radius);
  padding: 28px 32px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.legal-toc h2 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--white-50);
  margin-bottom: 16px;
}

.legal-toc ol {
  list-style: none;
  counter-reset: toc-counter;
  padding: 0;
  margin: 0;
  columns: 2;
  column-gap: 24px;
}

.legal-toc li {
  counter-increment: toc-counter;
  margin-bottom: 8px;
  break-inside: avoid;
}

.legal-toc li a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--white-70);
  text-decoration: none;
  transition: color 0.3s var(--ease-out);
  line-height: 1.5;
}

.legal-toc li a::before {
  content: counter(toc-counter, decimal-leading-zero);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold);
  flex-shrink: 0;
  min-width: 1.4em;
}

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

@media (max-width: 580px) {
  .legal-toc ol {
    columns: 1;
  }
}

/* ── Content container ── */
.legal-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px clamp(60px, 8vw, 120px);
}

/* ── Section blocks ── */
.legal-section {
  margin-bottom: 48px;
}

.legal-section h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 20px;
  padding-left: 20px;
  border-left: 4px solid var(--gold);
  line-height: 1.35;
}

.legal-section h3 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white-90);
  margin-top: 28px;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.legal-section p {
  font-size: 0.9375rem;
  color: var(--white-70);
  line-height: 1.8;
  margin-bottom: 12px;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section strong {
  color: var(--white-90);
  font-weight: 600;
}

.legal-section a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.3s var(--ease-out);
  border-bottom: 1px solid transparent;
}

.legal-section a:hover {
  color: var(--gold-light);
  border-bottom-color: var(--gold-light);
}

/* ── Lists ── */
.legal-section ul,
.legal-section ol {
  padding-left: 1.5rem;
  margin-top: 12px;
  margin-bottom: 12px;
}

.legal-section li {
  font-size: 0.9375rem;
  color: var(--white-70);
  line-height: 1.8;
  margin-bottom: 8px;
}

.legal-section li::marker {
  color: var(--gold);
}

.legal-section li strong {
  color: var(--white-90);
}

/* ── Data tables ── */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  margin-bottom: 16px;
}

.legal-table th,
.legal-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--white-05);
  font-size: 0.9rem;
  vertical-align: top;
}

.legal-table th {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.legal-table td {
  color: var(--white-70);
  line-height: 1.7;
}

.legal-table thead th {
  border-bottom: 1px solid var(--white-10);
}

.legal-table tr:last-child td,
.legal-table tr:last-child th {
  border-bottom: none;
}

/* ── Highlight / callout box ── */
.legal-callout {
  background: rgba(212, 175, 55, 0.04);
  border-left: 3px solid var(--gold);
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 16px;
  margin-bottom: 16px;
}

.legal-callout p {
  font-size: 0.9rem;
  color: var(--white-70);
  margin-bottom: 0;
}

/* ── Third-party service cards ── */
.legal-vendor-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 16px;
}

.legal-vendor-card {
  background: var(--gradient-card);
  border: 1px solid var(--white-10);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  transition: border-color 0.3s var(--ease-out);
}

.legal-vendor-card:hover {
  border-color: var(--white-20);
}

.legal-vendor-card h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--white);
  margin-bottom: 6px;
}

.legal-vendor-card p {
  font-size: 0.875rem;
  margin-bottom: 8px;
}

.legal-vendor-card a {
  font-size: 0.85rem;
}

/* ── Back to top button ── */
.legal-back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  padding: 10px 20px;
  background: var(--gold-dim);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-sm);
  color: var(--gold);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s var(--ease-out);
  cursor: pointer;
}

.legal-back-to-top:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold-glow);
  transform: translateY(-2px);
}

.legal-back-to-top svg {
  width: 14px;
  height: 14px;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .legal-hero {
    padding: clamp(100px, 14vw, 160px) 16px clamp(32px, 5vw, 60px);
  }

  .legal-toc-inner {
    padding: 20px 20px;
  }

  .legal-content {
    padding: 0 16px clamp(40px, 6vw, 80px);
  }

  .legal-section h2 {
    font-size: 1.25rem;
    padding-left: 16px;
  }

  .legal-table th,
  .legal-table td {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .legal-table th {
    font-size: 0.7rem;
  }
}
