/* MMO Maid /privacy and /terms — cinematic legal-page styling matching
   the rest of the site. Pulls colors and fonts from tokens.css and the
   nav/footer chrome from home.css. Scopes layout, typography, and
   table styling specific to long-form legal documents. */

body { padding-top: 64px; }

.legal-host {
  position: relative;
  flex: 1 1 auto;
  padding: 2.5rem 1.5rem 3rem;
}

/* ── Drifting nebula background ─────────────────────────────────────── */
.legal-nebula {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  filter: blur(60px);
}
.legal-nebula-blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}
.legal-nebula-blob-1 {
  width: 60vw; height: 60vw;
  background: radial-gradient(circle,
    rgba(255, 198, 110, 0.16) 0%,
    rgba(201, 168, 76, 0.06) 40%,
    transparent 75%);
  top: -25vw; right: -10vw;
  animation: legalNebulaDrift1 54s ease-in-out infinite;
}
.legal-nebula-blob-2 {
  width: 55vw; height: 55vw;
  background: radial-gradient(circle,
    rgba(96, 156, 210, 0.06) 0%,
    rgba(96, 156, 210, 0.02) 40%,
    transparent 75%);
  top: 25vw; left: -25vw;
  animation: legalNebulaDrift2 60s ease-in-out infinite;
}
.legal-nebula-blob-3 {
  width: 50vw; height: 50vw;
  background: radial-gradient(circle,
    rgba(201, 168, 76, 0.10) 0%,
    rgba(150, 100, 40, 0.04) 45%,
    transparent 78%);
  bottom: -20vw; right: 18vw;
  animation: legalNebulaDrift3 50s ease-in-out infinite;
}
@keyframes legalNebulaDrift1 {
  0%, 100% { transform: translate(0, 0)        scale(1);    }
  35%      { transform: translate(-14vw, 12vh) scale(1.1);  }
  70%      { transform: translate(8vw, 18vh)   scale(0.92); }
}
@keyframes legalNebulaDrift2 {
  0%, 100% { transform: translate(0, 0)       scale(1);    }
  45%      { transform: translate(20vw, -8vh) scale(1.15); }
  75%      { transform: translate(28vw, 14vh) scale(0.95); }
}
@keyframes legalNebulaDrift3 {
  0%, 100% { transform: translate(0, 0)         scale(1);    }
  30%      { transform: translate(-18vw, -16vh) scale(1.05); }
  65%      { transform: translate(-8vw, -24vh)  scale(0.9);  }
}
@media (prefers-reduced-motion: reduce) {
  .legal-nebula-blob { animation: none; }
}

/* ── Content shell ─────────────────────────────────────────────────── */
.legal-shell {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  background:
    linear-gradient(135deg, rgba(201, 168, 76, 0.04), rgba(7, 8, 13, 0.0)),
    rgba(7, 8, 13, 0.55);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3rem 3rem 2.5rem;
  box-shadow: 0 0 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ── Header ────────────────────────────────────────────────────────── */
.legal-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.legal-header .eyebrow {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 0.5rem;
}
.legal-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  font-weight: 800;
  line-height: 1.05;
  margin: 0 0 0.7rem;
  color: var(--text);
  letter-spacing: -0.005em;
}
.legal-title em {
  font-style: normal;
  background: linear-gradient(90deg, var(--gold), var(--gold-light) 60%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.legal-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}
.legal-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(201, 168, 76, 0.1);
  border: 1px solid var(--gold-dim);
  padding: 3px 9px;
  border-radius: 999px;
}
.legal-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ── Intro paragraph ───────────────────────────────────────────────── */
.legal-intro {
  font-family: var(--font-prose);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
  font-style: italic;
  padding: 1rem 1.25rem;
  margin: 0 0 2rem;
  border-left: 3px solid var(--gold);
  background: rgba(201, 168, 76, 0.03);
  border-radius: 0 8px 8px 0;
}

/* ── Body typography ───────────────────────────────────────────────── */
.legal-shell h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gold-light);
  margin: 2.6rem 0 0.85rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.005em;
  scroll-margin-top: 90px;
}
.legal-shell h2:first-of-type { margin-top: 0; }
.legal-shell h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.6rem 0 0.6rem;
  letter-spacing: 0.005em;
}
.legal-shell p {
  font-family: var(--font-prose);
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 0.85rem;
}
.legal-shell ul,
.legal-shell ol {
  padding-left: 1.4rem;
  margin: 0 0 1rem;
}
.legal-shell li {
  font-family: var(--font-prose);
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.legal-shell strong { color: var(--text); font-weight: 700; }
.legal-shell code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid var(--gold-dim);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--gold-light);
}
.legal-shell a {
  color: var(--gold-light);
  text-decoration: underline;
  text-decoration-color: var(--gold-dim);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}
.legal-shell a:hover { text-decoration-color: var(--gold); }

/* ── Tables ────────────────────────────────────────────────────────── */
.legal-table-wrap {
  margin: 1rem 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(7, 8, 13, 0.4);
}
.legal-shell table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.legal-shell th,
.legal-shell td {
  text-align: left;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-prose);
  vertical-align: top;
}
.legal-shell tr:last-child td { border-bottom: none; }
.legal-shell th {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(201, 168, 76, 0.05);
}
.legal-shell td:first-child { color: var(--text); font-weight: 500; }

/* ── Footer actions ────────────────────────────────────────────────── */
.legal-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.legal-back,
.legal-pair {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s;
}
.legal-back:hover,
.legal-pair:hover { color: var(--gold-light); }

/* ── Mobile ────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .legal-shell {
    padding: 2rem 1.25rem 1.75rem;
    border-radius: 12px;
  }
  .legal-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .legal-shell table { min-width: 480px; }
  .legal-footer-actions { flex-direction: column; align-items: flex-start; gap: 0.85rem; }
}

/* ──────────────────────────────────────────────────────────────────────
   Consolidated /legal page — anchor sections (#privacy, #terms, #cookies)
   Adds: TOC nav, doc-level meta header, callouts, subsection h4, list
   styling. Ported from ESS styles.css (lines 1199-1297, 2380-2475) and
   recolored to MMO Maid tokens.
   ──────────────────────────────────────────────────────────────────── */

/* ── Table of contents nav (sticky on desktop, in-flow on mobile) ── */
.legal-toc {
  position: sticky;
  top: 80px;
  z-index: 5;
  margin: 0 0 2rem;
  padding: 0.65rem 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  background: rgba(7, 8, 13, 0.78);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.legal-toc a {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid transparent;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}
.legal-toc a:hover {
  color: var(--gold-light);
  background: rgba(201, 168, 76, 0.06);
  border-color: var(--gold-dim);
  text-decoration: none;
}
.legal-toc a.is-active {
  color: var(--gold);
  background: rgba(201, 168, 76, 0.10);
  border-color: var(--gold);
}

/* ── Doc section anchors ─────────────────────────────────────────── */
.legal-doc {
  scroll-margin-top: 100px;
  padding-top: 1rem;
}
.legal-doc + .legal-doc {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

/* ── Per-doc meta header (effective / last updated dates) ────────── */
.legal-doc-meta {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.legal-doc-meta h2 { margin-top: 0; }
.legal-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}
.legal-meta-badge {
  display: inline-flex;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted2);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

/* ── Callout (warning / commitment notice) ───────────────────────── */
.legal-callout {
  margin: 0.85rem 0;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  background: rgba(201, 168, 76, 0.06);
  color: var(--muted);
  font-family: var(--font-prose);
  font-size: 0.94rem;
  font-style: italic;
  line-height: 1.65;
}

/* ── Section numbered headings (ported from ESS .legal-copy h3) ──── */
.legal-shell .legal-copy h3 {
  margin: 1.75rem 0 0.6rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
  letter-spacing: 0.005em;
  scroll-margin-top: 100px;
}

/* ── Subsection headers (e.g. "3.1 Data Collected Automatically…") ── */
h4.legal-subsection {
  margin: 1.25rem 0 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold-light);
  text-transform: uppercase;
}

/* ── Bullet lists with gold dot ──────────────────────────────────── */
.legal-list {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0.6rem;
  display: grid;
  gap: 0.45rem;
}
.legal-list li {
  position: relative;
  padding-left: 1.1rem;
  font-family: var(--font-prose);
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--muted);
}
.legal-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: linear-gradient(180deg, var(--gold), var(--gold-light));
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.34);
}
.legal-list li strong { color: var(--text); }
.legal-contact-list li { font-size: 1rem; }

/* ── Cookie-settings button at top of #cookies section ───────────── */
.legal-cookie-action {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin: 1rem 0 1.75rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--gold-dim);
  border-radius: 12px;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(201, 168, 76, 0.07), transparent 60%),
    rgba(255, 255, 255, 0.015);
}
.legal-cookie-action__copy {
  flex: 1 1 260px;
  font-family: var(--font-prose);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
}
.legal-cookie-action .cookie-settings-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: rgba(201, 168, 76, 0.12);
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.legal-cookie-action .cookie-settings-link:hover {
  background: rgba(201, 168, 76, 0.22);
  color: var(--text);
  border-color: var(--gold-light);
  text-decoration: none;
}

/* ── Mobile: TOC stays in-flow, no longer sticky ─────────────────── */
@media (max-width: 720px) {
  .legal-toc {
    position: relative;
    top: auto;
    border-radius: 12px;
    justify-content: center;
  }
  .legal-toc a {
    flex: 1 1 auto;
    justify-content: center;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
  }
  .legal-cookie-action {
    flex-direction: column;
    align-items: flex-start;
  }
}
