/* ========================================
   I CHING REALM — LEGAL PAGES SHARED CSS
   Matches main app design language
   ======================================== */

:root {
  --black: #05070c;
  --black-2: #090d17;
  --ink: #10141f;
  --gold: #d9b968;
  --gold-2: #8c6d31;
  --paper: #f4ecdc;
  --muted: rgba(244, 236, 220, .68);
  --soft: rgba(244, 236, 220, .12);
  --line: rgba(217, 185, 104, .24);
  --jade: #4f907b;
  --cyan: #66afbd;
  --red: #9d3341;
  --cinnabar: #c23c2e;
  --font-serif: "Cormorant Garamond", "Noto Serif SC", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-han: "Ma Shan Zheng", "Noto Serif SC", serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --neon-cyan: #00e5ff;
  --neon-gold: #ffd54f;
  --neon-cyan-dim: rgba(0, 229, 255, .35);
  --neon-gold-dim: rgba(255, 213, 79, .25);
}

* { box-sizing: border-box; margin: 0; }

html {
  background: var(--black);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  color: var(--paper);
  background:
    radial-gradient(circle at 50% 8%, rgba(102,175,189,.14), transparent 32%),
    radial-gradient(circle at 80% 80%, rgba(194,60,46,.04), transparent 40%),
    linear-gradient(180deg, var(--black) 0%, #08101e 45%, #0b0908 100%);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Grid overlay — matches main app */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px);
  background-size: 76px 76px;
  mask-image: radial-gradient(ellipse at 50% 35%, black, transparent 74%);
  z-index: 0;
}

a {
  color: var(--neon-cyan);
  text-decoration: none;
  transition: color 200ms var(--ease), text-shadow 200ms var(--ease);
}
a:hover {
  color: var(--neon-gold);
  text-shadow: 0 0 12px rgba(255,213,79,.3);
}

/* ========================================
   LEGAL PAGE WRAPPER
   ======================================== */
.legal-page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ========================================
   HEADER
   ======================================== */
.legal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 54px);
  height: 64px;
  background: linear-gradient(180deg, rgba(5,7,12,.92), rgba(5,7,12,.6));
  border-bottom: 1px solid rgba(194,60,46,.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--paper);
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 500;
  transition: opacity 200ms var(--ease);
}
.legal-brand:hover {
  opacity: .85;
  color: var(--paper);
  text-shadow: none;
}

.brand-seal {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(194,60,46,.6);
  background: linear-gradient(145deg, rgba(194,60,46,.95), rgba(88,24,33,.95));
  color: var(--paper);
  font-family: var(--font-han);
  font-size: 16px;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(194,60,46,.25), 0 0 40px rgba(194,60,46,.08);
}

.legal-nav {
  display: flex;
  gap: clamp(10px, 2vw, 24px);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.legal-nav a {
  color: rgba(244,236,220,.6);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 200ms var(--ease), border-color 200ms var(--ease), text-shadow 200ms var(--ease);
}
.legal-nav a:hover {
  color: var(--neon-cyan);
  border-bottom-color: var(--neon-cyan-dim);
  text-shadow: 0 0 12px rgba(0,229,255,.4);
}
.legal-nav a.is-active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  text-shadow: 0 0 12px rgba(217,185,104,.3);
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.legal-content {
  flex: 1;
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  padding: 60px clamp(18px, 4vw, 54px) 80px;
}

.legal-content h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1;
  letter-spacing: 0;
  margin-bottom: 8px;
  text-shadow: 0 0 40px rgba(217,185,104,.15);
  color: var(--paper);
}

.legal-updated,
.legal-effective {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 4px;
}

/* Section styling */
.legal-content section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid rgba(194,60,46,.1);
  position: relative;
}
.legal-content section::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, rgba(194,60,46,.4), transparent);
}

.legal-content h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.2;
  letter-spacing: 0;
  margin-bottom: 16px;
  color: var(--paper);
}

.legal-content h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(17px, 2.2vw, 20px);
  line-height: 1.3;
  letter-spacing: 0;
  margin-top: 24px;
  margin-bottom: 12px;
  color: var(--gold);
}

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

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

.legal-content ul,
.legal-content ol {
  padding-left: 24px;
  margin-bottom: 14px;
}

.legal-content li {
  font-size: 15px;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 8px;
}

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

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

/* Emphasis blocks — key callouts */
.legal-content em {
  color: rgba(194,60,46,.9);
  font-style: normal;
}

/* Links within content */
.legal-content a {
  color: var(--neon-cyan);
  border-bottom: 1px solid rgba(0,229,255,.2);
  transition: border-color 200ms var(--ease), text-shadow 200ms var(--ease);
}
.legal-content a:hover {
  border-bottom-color: var(--neon-cyan);
  text-shadow: 0 0 12px rgba(0,229,255,.3);
}

/* ========================================
   FOOTER
   ======================================== */
.legal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px clamp(18px, 4vw, 54px);
  border-top: 1px solid rgba(194,60,46,.1);
  background: linear-gradient(0deg, rgba(5,7,12,.6), rgba(5,7,12,.3));
}

.legal-footer p {
  color: rgba(244,236,220,.4);
  font-size: 13px;
}

.legal-footer nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.legal-footer nav a {
  color: rgba(244,236,220,.45);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 500;
  border-bottom: none;
  transition: color 200ms var(--ease);
}
.legal-footer nav a:hover {
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(0,229,255,.3);
}

/* ========================================
   REGIONAL TAG — small badge for GDPR/LGPD/CCPA pages
   ======================================== */
.legal-region-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  margin-bottom: 16px;
  border: 1px solid rgba(194,60,46,.2);
  border-radius: 4px;
  background: rgba(194,60,46,.04);
  color: var(--cinnabar);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ========================================
   TABLE — for cookie categories, data categories, etc.
   ======================================== */
.legal-table-wrap {
  overflow-x: auto;
  margin: 16px 0 20px;
  border: 1px solid rgba(194,60,46,.12);
  border-radius: 6px;
  background: rgba(5,7,12,.4);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.legal-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(194,60,46,.06);
  border-bottom: 1px solid rgba(194,60,46,.15);
}

.legal-table td {
  padding: 10px 16px;
  color: var(--muted);
  border-bottom: 1px solid rgba(194,60,46,.06);
  vertical-align: top;
}

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

.legal-table tr:hover td {
  background: rgba(0,229,255,.02);
}

/* ========================================
   CALLOUT BOX — important notices
   ======================================== */
.legal-callout {
  padding: 16px 20px;
  margin: 16px 0 20px;
  border-left: 3px solid var(--cinnabar);
  border-radius: 0 6px 6px 0;
  background: rgba(194,60,46,.06);
}

.legal-callout p {
  margin-bottom: 0;
  color: rgba(244,236,220,.82);
}

.legal-callout p strong {
  color: var(--paper);
}

.legal-callout--info {
  border-left-color: var(--neon-cyan);
  background: rgba(0,229,255,.04);
}

.legal-callout--gold {
  border-left-color: var(--gold);
  background: rgba(217,185,104,.04);
}

/* ========================================
   RIGHTS LIST — for data subject rights
   ======================================== */
.legal-rights-list {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.legal-rights-list li {
  padding: 12px 16px;
  margin-bottom: 6px;
  border: 1px solid rgba(194,60,46,.08);
  border-radius: 6px;
  background: rgba(5,7,12,.3);
  transition: border-color 200ms var(--ease), background 200ms var(--ease);
}

.legal-rights-list li:hover {
  border-color: rgba(0,229,255,.15);
  background: rgba(0,229,255,.02);
}

.legal-rights-list li strong {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 14px;
}

.legal-rights-list li .right-ref {
  display: inline-block;
  font-size: 11px;
  color: var(--cinnabar);
  font-weight: 600;
  letter-spacing: .04em;
  margin-bottom: 6px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .legal-header {
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 8px;
  }
  .legal-nav {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .legal-nav::-webkit-scrollbar { display: none; }
  .legal-nav a {
    white-space: nowrap;
    font-size: 11px;
    padding: 4px 8px;
  }
  .legal-content {
    padding: 40px 16px 60px;
  }
  .legal-content section {
    margin-top: 32px;
    padding-top: 24px;
  }
  .legal-footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 16px;
  }
}

@media (max-width: 480px) {
  .legal-brand span:not(.brand-seal) {
    font-size: 16px;
  }
  .legal-content h1 {
    font-size: 32px;
  }
  .legal-content h2 {
    font-size: 20px;
  }
}

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