/* ============================================================
   Legal documents — /terms and any sibling policy page.
   Long-form reading treatment: narrow measure, hairline rules,
   mono chrome, sticky clause rail on wide screens.
   Deliberately independent of whitepaper.css so a redesign of
   the whitepaper can never silently restyle a legal document.
   ============================================================ */

/* ---- Reading progress --------------------------------------------------- */
.lg-progress {
  position: fixed; inset: 0 0 auto 0; z-index: 70;
  height: 2px; background: transparent; pointer-events: none;
}
.lg-progress i {
  display: block; height: 100%; width: 0;
  background: var(--grad-blue);
  box-shadow: 0 0 12px -2px rgba(var(--halo-cyan-rgb), .8);
}

/* ---- Shell -------------------------------------------------------------- */
.lg-main { position: relative; overflow-x: clip; padding-bottom: var(--s-10); }
.lg-wrap {
  position: relative; z-index: 1;
  max-width: 1160px; margin-inline: auto; padding-inline: var(--s-5);
}

/* ---- Masthead ----------------------------------------------------------- */
.lg-hero {
  padding: calc(var(--header-h) + clamp(40px, 6vw, 76px)) 0 clamp(28px, 4vw, 48px);
  border-bottom: 1px solid var(--glass-bd);
  margin-bottom: var(--s-7);
}
.lg-hero .eyebrow {
  margin: 0 0 var(--s-3);
  font: 600 11px/1 var(--font-mono);
  letter-spacing: .18em; text-transform: uppercase; color: var(--ink-50);
}
.lg-hero h1 {
  margin: 0 0 var(--s-4);
  font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.08; letter-spacing: -.02em;
}
.lg-hero .meta {
  margin: 0; color: var(--ink-50);
  font: 400 13px/1.7 var(--font-mono);
}
.lg-hero .meta b { color: var(--ink-70); font-weight: 600; }

/* ---- Layout ------------------------------------------------------------- */
.lg-layout { display: block; }
.lg-toc { display: none; }

.lg-article { max-width: 74ch; margin-inline: auto; min-width: 0; }

/* ---- Summary panel ------------------------------------------------------ */
/* Plain-language orientation. Explicitly NOT part of the agreement — the
   clause text governs, and the panel says so. */
.lg-summary {
  border: 1px solid var(--glass-bd);
  border-radius: 14px;
  background: rgba(255, 255, 255, .022);
  padding: var(--s-5) var(--s-5) var(--s-4);
  margin-bottom: var(--s-8);
}
/* The caveat leads the panel unlabelled, so the reader learns the bullets are
   not the agreement before reading them — not after. */
.lg-summary__caveat {
  margin: 0 0 var(--s-4);
  font-size: .9rem; line-height: 1.65; color: var(--ink-50);
}
.lg-summary ul { margin: 0; padding-left: 0; list-style: none; }
.lg-summary li {
  position: relative; padding-left: 22px; margin-bottom: var(--s-3);
  color: var(--ink-70); line-height: 1.7;
}
.lg-summary li:last-child { margin-bottom: 0; }
.lg-summary li::before {
  content: ''; position: absolute; left: 4px; top: .68em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent-ink);
}
.lg-summary strong { color: var(--ink); }

/* ---- Sections ----------------------------------------------------------- */
.lg-section { scroll-margin-top: calc(var(--header-h) + 32px); padding-top: var(--s-7); }
.lg-section > h2 {
  margin: 0 0 var(--s-5);
  font-size: clamp(1.25rem, 2.2vw, 1.55rem); line-height: 1.25; letter-spacing: -.01em;
}
.lg-section > h2 .n {
  display: inline-block; min-width: 2.2ch; margin-right: 10px;
  font-family: var(--font-mono); font-size: .74em; font-weight: 500; color: var(--ink-30);
}
.lg-section h3 {
  margin: var(--s-6) 0 var(--s-3);
  font-size: 1.02rem; line-height: 1.4; color: var(--ink);
}

/* ---- Prose -------------------------------------------------------------- */
.lg-prose { color: var(--ink-70); font-size: 1.02rem; line-height: 1.78; }
.lg-prose p { margin: 0 0 var(--s-5); }
.lg-prose strong { color: var(--ink); font-weight: 700; }
.lg-prose a { color: var(--accent-ink); text-underline-offset: 3px; }
.lg-prose ul { margin: 0 0 var(--s-5); padding-left: 0; list-style: none; }
.lg-prose ul li { position: relative; padding-left: 22px; margin-bottom: var(--s-3); }
.lg-prose ul li::before {
  content: ''; position: absolute; left: 5px; top: .78em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--ink-30);
}
.lg-prose code {
  font-family: var(--font-mono); font-size: .88em;
  padding: 1px 5px; border-radius: 5px;
  background: rgba(255, 255, 255, .05); color: var(--ink);
  overflow-wrap: anywhere;
}

/* Clauses that carry legal weight in a limitation/disclaimer sense are set in
   the same measure but flagged, so a reader skimming cannot miss them. */
.lg-callout {
  border-left: 2px solid var(--accent-amber);
  padding: 2px 0 2px var(--s-4);
  margin: 0 0 var(--s-5);
  color: var(--ink-70);
}
.lg-callout strong { color: var(--ink); }

/* ---- Definition list ---------------------------------------------------- */
.lg-defs { margin: 0 0 var(--s-5); }
.lg-defs dt {
  color: var(--ink); font-weight: 700;
  margin-top: var(--s-4);
}
.lg-defs dt:first-child { margin-top: 0; }
.lg-defs dd { margin: 4px 0 0; }

/* ---- Footer note -------------------------------------------------------- */
.lg-foot {
  margin-top: var(--s-8); padding-top: var(--s-5);
  border-top: 1px solid var(--glass-bd);
  font-size: .88rem; line-height: 1.7; color: var(--ink-50);
}
.lg-foot a { color: var(--ink-70); }

/* ---- Wide screens: sticky clause rail ----------------------------------- */
@media (min-width: 1080px) {
  .lg-layout {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: var(--s-8);
    align-items: start;
  }
  .lg-article { margin-inline: 0; }
  .lg-toc {
    display: block; position: sticky;
    top: calc(var(--header-h) + 24px);
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
  }
  .lg-toc h2 {
    margin: 0 0 var(--s-3);
    font: 600 11px/1 var(--font-mono);
    letter-spacing: .16em; text-transform: uppercase; color: var(--ink-50);
  }
  .lg-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: lgtoc; }
  .lg-toc a {
    display: block; padding: 5px 0 5px 12px;
    border-left: 1px solid var(--glass-bd);
    color: var(--ink-50); text-decoration: none;
    font-size: .84rem; line-height: 1.45;
    transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  }
  .lg-toc a::before {
    counter-increment: lgtoc; content: counter(lgtoc) '. ';
    font-family: var(--font-mono); font-size: .9em; color: var(--ink-30);
  }
  .lg-toc a:hover { color: var(--ink); }
  .lg-toc a.on { color: var(--accent-ink); border-left-color: var(--accent-ink); }
  .lg-toc a.on::before { color: var(--accent-ink); }
}

/* ---- Print -------------------------------------------------------------- */
/* A legal document has to survive being printed or saved to PDF. */
@media print {
  .lg-progress, .lg-toc, .site-header, .site-footer { display: none !important; }
  .lg-main { padding: 0; }
  .lg-hero { padding-top: 0; }
  .lg-article { max-width: none; }
  .lg-prose, .lg-summary li, .lg-callout { color: #000; }
  .lg-section { break-inside: auto; page-break-inside: auto; }
  .lg-section > h2 { break-after: avoid; page-break-after: avoid; }
}
