/*
 * CoLateral - standalone legal page styling (Privacy Policy, Terms of Service).
 * -------------------------------------------------------------------------
 * Sleek, minimalist document layout that paints with the shared theme
 * vocabulary (--bg, --s0/--s1, --tx/--tx2/--tx3, --blue, --bd/--bd2) so the
 * page follows whichever theme the user picked on the dashboard - including
 * the light theme. Fallbacks reproduce the default CoLateral Dark palette
 * for the case where no theme block is active.
 *
 * Pair with:
 *   <link rel="stylesheet" href="src/styles/themes.css" />
 *   <script src="src/scripts/apply-theme.js"></script>
 * -------------------------------------------------------------------------
 */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg, #070b10);
  color: var(--tx, #edf4fb);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--blue, #4da6ff); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Cinematic background layers (same stack as the home page hero and
   tools.html), repainted with the shared theme vocabulary so the glow
   and dot grid follow light themes too. --------------------------------- */
.legal-bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% -8%, color-mix(in srgb, var(--blue, #4da6ff) 22%, transparent), transparent 40%),
    radial-gradient(circle at 84% 6%, color-mix(in srgb, var(--blue, #0078d4) 16%, transparent), transparent 42%),
    radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--green, #1ed96b) 10%, transparent), transparent 46%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--bg, #070c12) 94%, #000) 0%,
      var(--bg, #070c12) 44%,
      color-mix(in srgb, var(--bg, #070c12) 92%, #000) 100%);
}
/* drifting aurora glow */
.legal-bg:before {
  content: "";
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(closest-side, color-mix(in srgb, var(--blue, #4da6ff) 14%, transparent), transparent),
    radial-gradient(closest-side, color-mix(in srgb, var(--blue, #0078d4) 10%, transparent), transparent);
  background-position: 20% 28%, 80% 62%;
  background-size: 55% 55%, 50% 50%;
  background-repeat: no-repeat;
  filter: blur(46px);
  opacity: .6;
  animation: legal-drift 34s ease-in-out infinite alternate;
}
@keyframes legal-drift {
  0% { transform: translate3d(-4%, -2%, 0) scale(1); }
  50% { transform: translate3d(3%, 2%, 0) scale(1.08); }
  100% { transform: translate3d(-2%, 4%, 0) scale(1.02); }
}
/* canvas dot grid overlay (matches the project canvas feel) */
.legal-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--tx2, #8ca5bc) 18%, transparent) 1px, transparent 1.5px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at 50% 38%, rgba(0, 0, 0, .9), transparent 82%);
  -webkit-mask-image: radial-gradient(circle at 50% 38%, rgba(0, 0, 0, .9), transparent 82%);
  opacity: 0;
  animation: legal-grid-in 2.4s ease forwards .2s;
}
@keyframes legal-grid-in { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .legal-bg:before, .legal-grid { animation: none; }
  .legal-grid { opacity: 1; }
}

/* Top bar --------------------------------------------------------------- */
.legal-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: color-mix(in srgb, var(--bg, #070b10) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bd, rgba(184, 207, 228, .16));
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--tx, #edf4fb);
  font-size: 17px;
}
.legal-brand:hover { text-decoration: none; }
.legal-brand span { color: var(--blue, #4da6ff); }
.legal-brand svg { width: 26px; height: 26px; }

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--bd2, rgba(77,166,255, .34));
  color: var(--tx2, #9cafc2);
  transition: border-color .15s ease, color .15s ease;
}
.legal-back:hover {
  text-decoration: none;
  color: var(--tx, #edf4fb);
  border-color: var(--blue, #4da6ff);
}

/* Document -------------------------------------------------------------- */
.legal-doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}

.legal-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blue, #4da6ff);
  margin-bottom: 14px;
}

.legal-doc h1 {
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 850;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin: 0 0 12px;
  color: var(--tx, #edf4fb);
}

.legal-meta {
  font-size: 13px;
  color: var(--tx3, #6f8498);
  margin: 0 0 8px;
}

.legal-lede {
  font-size: 17px;
  color: var(--tx2, #9cafc2);
  margin: 8px 0 0;
  max-width: 62ch;
}

.legal-rule {
  height: 1px;
  border: 0;
  background: var(--bd, rgba(184, 207, 228, .16));
  margin: 34px 0 0;
}

.legal-doc h2 {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.01em;
  color: var(--tx, #edf4fb);
  margin: 40px 0 12px;
  scroll-margin-top: 84px;
}

.legal-doc p,
.legal-doc li {
  font-size: 15.5px;
  color: var(--tx2, #9cafc2);
  margin: 0 0 14px;
}

.legal-doc strong { color: var(--tx, #edf4fb); font-weight: 650; }

.legal-doc ul {
  margin: 0 0 14px;
  padding-left: 22px;
}
.legal-doc li { margin-bottom: 8px; }
.legal-doc li::marker { color: var(--blue, #4da6ff); }

.legal-doc .legal-legalese {
  font-size: 13.5px;
  color: var(--tx3, #6f8498);
  background: var(--s1, #101823);
  border: 1px solid var(--bd, rgba(184, 207, 228, .16));
  border-radius: 12px;
  padding: 16px 18px;
}

/* Footer ---------------------------------------------------------------- */
.legal-footer {
  border-top: 1px solid var(--bd, rgba(184, 207, 228, .16));
  padding: 26px 24px;
  text-align: center;
}
.legal-footer p {
  margin: 0;
  font-size: 13px;
  color: var(--tx3, #6f8498);
}
.legal-footer a { margin: 0 8px; font-weight: 600; }

@media (max-width: 560px) {
  .legal-topbar { padding: 12px 16px; }
  .legal-doc { padding: 40px 18px 72px; }
}
