/* ─────────────────────────────────────────────────────────────
   Maki — Legal page styles (Terms + Privacy)
   ─────────────────────────────────────────────────────────────
   One CSS module, two pages: the chrome (top rail, hero, TOC,
   prose, footer) is identical so the brand feels coherent. The
   only thing each page personalises is its title and section
   content (handled in HTML + i18n).

   Reading first
     • Long-form text needs measure < 75 ch and good line-height.
     • Background is intentionally calm — no anime art, no
       particles, no parallax. A soft aurora gradient is enough.
     • Sticky TOC on desktop, jump-pill drawer on mobile.
   ───────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Italiana&display=swap');

:root {
  --lg-serif: 'Italiana', 'Cormorant Garamond', Georgia, serif;
  --lg-prose-w: 70ch;
  --lg-rail-w: 240px;
}

body.lg-body {
  min-height: 100vh;
  background: var(--bg-primary);
  /* Long-form content needs natural text flow; restore selection. */
  user-select: text;
  -webkit-user-select: text;
}

/* ─────────────────────────────────────
   Background — calm aurora, no images.
   Pure gradients = zero asset cost.
───────────────────────────────────── */
.lg-bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 18% 12%, rgba(34,211,238,0.18) 0%, transparent 60%),
    radial-gradient(50% 45% at 90% 80%, rgba(56,189,248,0.14) 0%, transparent 60%),
    radial-gradient(80% 60% at 50% 110%, rgba(8,34,51,0.55) 0%, transparent 70%),
    var(--bg-primary);
}
.lg-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg,
      rgba(255,255,255,0.03) 0,
      rgba(255,255,255,0.03) 1px,
      transparent 1px,
      transparent 3px);
  opacity: 0.45;
  mix-blend-mode: overlay;
}

/* The top rail (brand / lang / back) now comes from the shared
   `.topbar` + maki-topbar.js. Page-local `.lg-rail*` rules have
   been removed from this file. */

/* ─────────────────────────────────────
   Page shell — hero + grid (TOC | prose)
───────────────────────────────────── */
.lg-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 110px 32px 80px;
}

.lg-hero {
  margin: 0 0 44px;
  max-width: 760px;
}
.lg-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 9px;
  background: rgba(186,224,255,0.06);
  border: 1px solid rgba(186,224,255,0.12);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ice-3);
  margin-bottom: 18px;
}
.lg-hero-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ice-3);
  box-shadow: 0 0 8px rgba(103,232,249,0.6);
}
.lg-hero h1 {
  font-family: var(--lg-serif);
  font-weight: 400;
  font-size: clamp(40px, 5.6vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.8px;
  color: var(--ice-1);
  margin: 0 0 16px;
}
.lg-hero h1 em {
  font-style: italic;
  background: linear-gradient(135deg, #ecfeff 0%, #67e8f9 50%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.lg-hero-sub {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 64ch;
}

/* Meta strip: version · last updated · jurisdiction */
.lg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding: 14px 16px;
  background: rgba(8,14,26,0.5);
  border: 1px solid rgba(186,224,255,0.10);
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.lg-meta dt {
  display: inline;
  color: var(--text-muted);
  margin-right: 4px;
}
.lg-meta dd {
  display: inline;
  color: var(--ice-2);
  margin: 0 18px 0 0;
  font-weight: 600;
}

/* ─────────────────────────────────────
   Grid (sticky TOC + prose)
───────────────────────────────────── */
.lg-grid {
  display: grid;
  grid-template-columns: var(--lg-rail-w) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* Sticky TOC on desktop */
.lg-toc {
  position: sticky;
  top: 100px;
  align-self: start;
  padding: 18px 18px 16px;
  background: rgba(8,14,26,0.65);
  border: 1px solid rgba(186,224,255,0.10);
  border-radius: 14px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
}
.lg-toc-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.lg-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: lg-toc;
}
.lg-toc li {
  counter-increment: lg-toc;
  margin: 2px 0;
}
.lg-toc a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  border-left: 2px solid transparent;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.lg-toc a::before {
  content: counter(lg-toc, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  flex-shrink: 0;
}
.lg-toc a:hover {
  color: var(--text-primary);
  background: rgba(186,224,255,0.04);
}
.lg-toc a.is-active {
  color: var(--ice-2);
  background: rgba(103,232,249,0.06);
  border-left-color: var(--ice-3);
}

/* ─────────────────────────────────────
   Prose
───────────────────────────────────── */
.lg-prose {
  max-width: var(--lg-prose-w);
  color: var(--text-primary);
  font-size: 15.5px;
  line-height: 1.78;
}
.lg-prose section { scroll-margin-top: 90px; }
.lg-prose section + section { margin-top: 56px; }

.lg-prose h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 26px);
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--ice-1);
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(186,224,255,0.10);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.lg-prose h2 .lg-hash {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ice-3);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 500;
}
.lg-prose h3 {
  font-family: var(--font-main);
  font-size: 16.5px;
  font-weight: 600;
  color: var(--ice-2);
  margin: 28px 0 8px;
}
.lg-prose p { margin: 0 0 14px; color: var(--text-secondary); }
.lg-prose p strong { color: var(--text-primary); font-weight: 600; }
.lg-prose a {
  color: var(--ice-3);
  border-bottom: 1px dashed rgba(103,232,249,0.4);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.lg-prose a:hover { color: var(--ice-2); border-bottom-color: var(--ice-2); }

.lg-prose ul, .lg-prose ol {
  padding-left: 22px;
  margin: 0 0 16px;
  color: var(--text-secondary);
}
.lg-prose ul li, .lg-prose ol li { margin: 6px 0; }
.lg-prose ul li::marker { color: var(--ice-3); }
.lg-prose ol li::marker { color: var(--ice-3); font-family: var(--font-mono); font-size: 0.9em; }

.lg-prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(165,243,252,0.08);
  color: var(--ice-2);
  padding: 1px 6px;
  border-radius: 6px;
  letter-spacing: 0.2px;
}

/* Definition-style callout box for important clauses */
.lg-callout {
  margin: 18px 0;
  padding: 14px 16px;
  background: rgba(165,243,252,0.04);
  border: 1px solid rgba(165,243,252,0.12);
  border-left: 3px solid var(--ice-3);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}
.lg-callout strong { color: var(--ice-2); }

/* "Plain English" sidebar inside long sections */
.lg-tldr {
  margin: 14px 0 4px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(34,211,238,0.06), rgba(56,189,248,0.04));
  border: 1px dashed rgba(103,232,249,0.30);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--ice-2);
}
.lg-tldr::before {
  content: 'TL;DR — ';
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ice-3);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-right: 6px;
}

/* ─────────────────────────────────────
   Foot — sister-page nav + contact
───────────────────────────────────── */
.lg-foot {
  margin-top: 72px;
  padding: 24px 22px;
  background: rgba(8,14,26,0.55);
  border: 1px solid rgba(186,224,255,0.10);
  border-radius: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.lg-foot-text {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 56ch;
}
.lg-foot-text strong { color: var(--text-primary); font-weight: 600; }
.lg-foot-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.lg-foot-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.lg-foot-btn.is-primary {
  background: linear-gradient(135deg, #ecfeff 0%, #67e8f9 50%, #06b6d4 100%);
  color: #061121;
  box-shadow: 0 4px 14px rgba(34,211,238,0.30);
}
.lg-foot-btn.is-ghost {
  background: rgba(186,224,255,0.05);
  border: 1px solid rgba(186,224,255,0.12);
  color: var(--text-primary);
}
.lg-foot-btn:hover { transform: translateY(-1px); }
.lg-foot-btn svg { width: 14px; height: 14px; }

/* ─────────────────────────────────────
   Responsive
───────────────────────────────────── */
@media (max-width: 980px) {
  .lg-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  /* Collapse the sticky TOC into a compact accordion */
  .lg-toc {
    position: static;
    max-height: none;
    padding: 14px 14px 12px;
  }
  .lg-toc ol {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .lg-toc li { margin: 0; }
  .lg-toc a {
    padding: 6px 10px;
    font-size: 12px;
    background: rgba(186,224,255,0.05);
    border: 1px solid rgba(186,224,255,0.10);
    border-left: 1px solid rgba(186,224,255,0.10);
    border-radius: 999px;
  }
  .lg-toc a.is-active {
    background: rgba(103,232,249,0.12);
    border-color: rgba(103,232,249,0.30);
  }
}

@media (max-width: 640px) {
  .lg-page { padding: 96px 16px 56px; }

  .lg-hero h1 { font-size: clamp(32px, 9vw, 44px); letter-spacing: -0.4px; }
  .lg-hero-sub { font-size: 15px; }
  .lg-meta { padding: 12px 14px; font-size: 10.5px; gap: 10px; }
  .lg-meta dd { margin-right: 10px; }

  .lg-prose { font-size: 15px; line-height: 1.72; }
  .lg-prose section + section { margin-top: 44px; }
  .lg-prose h2 { font-size: 20px; }

  .lg-foot { padding: 18px 16px; gap: 12px; }
  .lg-foot-actions { width: 100%; }
  .lg-foot-btn { flex: 1 1 auto; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .lg-brand:hover,
  .lg-foot-btn:hover { transform: none; }
}
