/* ============================================
   NEONARC v2 — LEGAL PAGES (privacy + terms)
   Depends on: v2-base.css (tokens, nav, glass,
               section-tag, btn, reveal, footer)
   ============================================ */

/* ============================================
   PAGE CHROME — body padding for fixed nav
   ============================================ */
body {
  cursor: auto;           /* legal pages: normal cursor */
  background: var(--bg);
  color: var(--on-surface);
  font-family: var(--f-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--cyan); color: var(--bg); }

/* Nav on legal pages is always "scrolled" (glass) */
.nav {
  background: rgba(17, 17, 37, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ============================================
   DOCUMENT LAYOUT — sticky TOC + main column
   ============================================ */
.doc-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 64px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
  padding-top: 120px;   /* clear fixed nav */
  padding-bottom: 100px;
  align-items: start;
}

/* ============================================
   TOC — glassmorphism panel, sticky
   ============================================ */
.doc-toc {
  position: sticky;
  top: 88px;            /* nav height + 8px breathing room */
  background: rgba(26, 26, 46, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 24px 20px;
  /* accent edge — overridden per-page below */
  border-top-color: rgba(0, 242, 255, 0.45);
}
.doc-toc::before {
  content: "";
  position: absolute;
  top: -1px; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--toc-accent, var(--cyan)), transparent);
  filter: blur(1px);
}

.doc-toc h5 {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--toc-accent, var(--cyan));
  margin-bottom: 14px;
  font-weight: 500;
}

.doc-toc ol {
  list-style: none;
  padding: 0;
}
.doc-toc li {
  padding: 7px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.doc-toc li:first-child { border-top: none; }
.doc-toc li a {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-surface-var);
  display: block;
  transition: color 0.2s;
}
.doc-toc li a:hover { color: var(--toc-accent, var(--cyan)); }

/* ============================================
   MAIN DOCUMENT COLUMN
   ============================================ */
.doc-page {
  min-width: 0;           /* prevent overflow in grid */
  max-width: 72ch;        /* ~680px comfortable measure */
}

/* Back link */
.doc-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--on-surface-var);
  margin-bottom: 36px;
  transition: color 0.25s;
}
.doc-back:hover { color: var(--doc-accent, var(--cyan)); }

/* Pill row (type + read-time badges) */
.pill-row {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.pill {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  /* default = accent-coloured; see per-page overrides */
  background: rgba(0, 242, 255, 0.08);
  color: var(--doc-accent, var(--cyan));
  border: 1px solid rgba(0, 242, 255, 0.3);
}
.pill.secondary {
  background: rgba(163, 241, 0, 0.06);
  color: var(--lime);
  border-color: rgba(163, 241, 0, 0.3);
}

/* ============================================
   HERO AREA — decorative glow
   ============================================ */
.doc-hero {
  position: relative;
  overflow: hidden;
  padding-top: 16px;
}
.doc-hero::before {
  content: "";
  position: absolute;
  top: 0; right: -160px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--doc-glow, rgba(0,242,255,0.07)), transparent 65%);
  pointer-events: none;
}

/* Document H1 */
.doc-page h1 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(52px, 9vw, 110px);
  line-height: 0.93;
  letter-spacing: -0.03em;
  color: var(--on-surface);
  margin-bottom: 20px;
}

/* Doc meta line */
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--on-surface-var);
  margin-bottom: 48px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.doc-meta span:first-child { color: var(--doc-accent, var(--cyan)); }

/* Lead paragraph */
.doc-intro {
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.65;
  color: var(--on-surface-var);
  max-width: 65ch;
  margin-bottom: 20px;
  border-left: 2px solid var(--doc-accent, var(--cyan));
  padding-left: 20px;
}

/* ============================================
   CALLOUT BLOCKS — glassmorphism
   ============================================ */
/* Privacy — "Our promise" box */
.doc-promise {
  margin: 36px 0;
  padding: 24px 28px;
  background: rgba(26, 26, 46, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(163, 241, 0, 0.22);
  border-top-color: rgba(163, 241, 0, 0.5);
  border-radius: 14px;
  position: relative;
}
.doc-promise::before {
  content: "";
  position: absolute;
  top: -1px; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--lime), transparent);
  filter: blur(1px);
}
.doc-promise h3 {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 10px;
  font-weight: 500;
}
.doc-promise p {
  font-size: 15px;
  color: var(--on-surface);
  line-height: 1.6;
  margin-bottom: 0;
}

/* Terms — definitions box */
.definitions {
  margin: 36px 0;
  padding: 28px;
  background: rgba(26, 26, 46, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}
.definitions h3 {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--on-surface-var);
  margin-bottom: 18px;
  font-weight: 500;
}
.definitions dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px 24px;
  font-size: 14px;
}
.definitions dt {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--on-surface);
  align-self: start;
  padding-top: 2px;
}
.definitions dd {
  color: var(--on-surface-var);
  line-height: 1.55;
  margin: 0;
}

/* Terms — caveat / warning box */
.caveat {
  margin: 36px 0;
  padding: 24px 28px;
  background: rgba(26, 26, 46, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 36, 228, 0.18);
  border-top-color: rgba(255, 36, 228, 0.45);
  border-radius: 14px;
  position: relative;
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.caveat::before {
  content: "";
  position: absolute;
  top: -1px; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--magenta), transparent);
  filter: blur(1px);
}
.caveat-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border: 1px solid var(--magenta);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--magenta);
  font-weight: 700;
  font-family: var(--f-mono);
  font-size: 14px;
}
.caveat h3 {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--magenta);
  margin-bottom: 8px;
  font-weight: 500;
}
.caveat p {
  color: var(--on-surface);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 0 !important; /* override generic p rule */
}

/* ============================================
   BODY TYPOGRAPHY
   ============================================ */
.doc-page h2 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--on-surface);
  margin-top: 56px;
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.doc-page h2 .h2-num {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--doc-accent, var(--cyan));
  font-weight: 400;
  flex-shrink: 0;
}

.doc-page h3 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--on-surface);
  margin-top: 32px;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.doc-page p {
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.75;
  color: var(--on-surface-var);
  margin-bottom: 16px;
  max-width: 70ch;
}

.doc-page ul,
.doc-page ol {
  padding-left: 22px;
  margin-bottom: 16px;
}
.doc-page li {
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.75;
  color: var(--on-surface-var);
  margin-bottom: 8px;
  max-width: 70ch;
}

.doc-page strong { color: var(--on-surface); font-weight: 600; }

.doc-page code {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--doc-accent, var(--cyan));
  background: rgba(0, 242, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Links within doc text */
.doc-page a[href] {
  color: var(--doc-accent, var(--cyan));
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: opacity 0.2s;
}
.doc-page a[href]:hover { opacity: 0.8; }

/* End-of-document marker */
.doc-end {
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-surface-var);
  opacity: 0.5;
}

/* ============================================
   CHIP TAGS (subset from v2-sections)
   ============================================ */
.chip {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 242, 255, 0.06);
  border: 1px solid rgba(0, 242, 255, 0.25);
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip.magenta {
  background: rgba(255, 36, 228, 0.06);
  border-color: rgba(255, 36, 228, 0.25);
  color: var(--magenta);
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

/* ============================================
   FOOTER — v2 chrome
   ============================================ */
.footer {
  background: var(--surface-lowest);
  border-top: 1px solid rgba(0, 242, 255, 0.15);
  padding: 80px 32px 40px;
  position: relative;
}
.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-brand-block h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 28px;
  color: var(--cyan);
  text-shadow: 0 0 16px rgba(0, 242, 255, 0.35);
  margin-bottom: 12px;
}
.footer-brand-block p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--on-surface-var);
  max-width: 36ch;
}
.footer-brand-block .chip-row {
  margin-top: 14px;
  display: flex;
  gap: 8px;
}
.footer h4 {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 14px;
}
.footer ul {
  list-style: none;
  padding: 0;
}
.footer ul li { padding: 4px 0; }
.footer ul li a {
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--on-surface-var);
  transition: color 0.2s;
}
.footer ul li a:hover { color: var(--cyan); }
.footer-bottom {
  max-width: 1100px;
  margin: 56px auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--on-surface-var);
}
.footer-bottom b { color: var(--cyan); font-weight: 500; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .doc-layout {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 100px;
  }
  .doc-toc {
    position: static;
    border-radius: 12px;
    padding: 16px 16px 12px;
  }
  /* Scrollable horizontal chip strip on tablet */
  .doc-toc ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .doc-toc li {
    border-top: none;
    border-right: none;
    padding: 0;
  }
  .doc-toc li a {
    display: block;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    font-size: 9px;
    white-space: nowrap;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .doc-layout {
    padding: 84px 16px 60px;
    gap: 20px;
  }
  /* On mobile, hide the TOC to keep the document flowing cleanly */
  .doc-toc {
    display: none;
  }
  .doc-page h1 {
    font-size: clamp(40px, 13vw, 72px);
  }
  .doc-page h2 { font-size: 20px; margin-top: 44px; }
  .doc-page p,
  .doc-page li { font-size: 14px; }
  .definitions dl {
    grid-template-columns: 1fr;
    gap: 4px 0;
  }
  .definitions dt { padding-top: 10px; }
  .definitions dt:first-child { padding-top: 0; }
  .caveat { flex-direction: column; gap: 12px; }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer { padding: 60px 20px 32px; }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
