/* ============================================================================
   Legal pages — StealthLedger, v86.
   ---------------------------------------------------------------------------
   Scoped to terms.html and privacy.html only.
   Reuses the design tokens exposed by styles.css (--bg, --surface, --text,
   --accent, --hairline, --radius-*, --space-*, --font-ui, etc.) so the page
   feels native without pulling in the app shell.

   No inline styles because of require-trusted-types-for + no unsafe-inline.
   ========================================================================== */

.legal-shell {
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 60rem 32rem at 50% -6rem, var(--accent-subtle), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-ui);
}

.legal-wrap {
  width: min(46rem, 100% - 2.5rem);
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 3rem) 0 5rem;
}

/* --- Top bar --------------------------------------------------------------- */

.legal-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
}

.legal-brand-mark {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.4rem;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fff 0%));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}

.legal-top-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: 0.85rem;
}

.legal-top-links a {
  color: var(--text-faint);
  text-decoration: none;
  transition: color 160ms ease;
}

.legal-top-links a:hover { color: var(--text); }

.legal-top-home {
  color: var(--accent) !important;
  font-weight: 600;
}

/* --- Hero ------------------------------------------------------------------ */

.legal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: var(--space-3);
}

.legal-eyebrow-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.legal-h1 {
  font-size: clamp(1.9rem, 1.2rem + 3.2vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0 0 var(--space-4);
  color: var(--text);
}

.legal-lede {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-faint);
  max-width: 40rem;
  margin: 0 0 var(--space-6);
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  font-size: 0.82rem;
  color: var(--text-faint);
  padding-bottom: var(--space-6);
  margin-bottom: var(--space-7);
  border-bottom: 1px solid var(--hairline);
}

.legal-meta b { color: var(--text); font-weight: 600; }

/* --- Body content ---------------------------------------------------------- */

.legal-body {
  font-size: 1rem;
  line-height: 1.72;
  color: var(--text);
}

.legal-body h2 {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: var(--space-7) 0 var(--space-3);
  scroll-margin-top: 5rem;
}

.legal-body h3 {
  font-size: 1.06rem;
  font-weight: 600;
  margin: var(--space-5) 0 var(--space-2);
}

.legal-body p { margin: 0 0 var(--space-3); }

.legal-body ul,
.legal-body ol {
  margin: 0 0 var(--space-4);
  padding-left: 1.3rem;
}

.legal-body li { margin: 0 0 var(--space-2); line-height: 1.65; }

.legal-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.legal-body strong { font-weight: 600; color: var(--text); }

.legal-callout {
  margin: var(--space-5) 0;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md, 0.6rem);
  background: var(--surface);
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--text-faint);
}

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

/* --- Table for data types -------------------------------------------------- */

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 var(--space-5);
  font-size: 0.92rem;
}

.legal-table th,
.legal-table td {
  text-align: left;
  padding: var(--space-3);
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}

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

.legal-table td { color: var(--text-faint); }
.legal-table td:first-child { color: var(--text); font-weight: 600; }

/* --- Footer ---------------------------------------------------------------- */

.legal-foot {
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--hairline);
  font-size: 0.82rem;
  color: var(--text-faint);
  line-height: 1.6;
}

.legal-foot a { color: var(--accent); text-decoration: none; }
.legal-foot a:hover { text-decoration: underline; }

.legal-foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin-bottom: var(--space-3);
}

.legal-foot-links a {
  color: var(--text-faint);
}

.legal-foot-links a:hover { color: var(--text); }

@media (max-width: 30rem) {
  .legal-top-links a:not(.legal-top-home) { display: none; }
}
