/* ============================================================
   LEGAL PAGES — Terms of Service · Privacy Policy
   Shares the inner-page theme (page-base.css). Adds a centered
   document hero, a sticky table-of-contents rail, and clean,
   readable long-form prose. green-ink palette · serif accents.
   ============================================================ */

/* ---- HERO ---- */
.legal-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  text-align: center;
  background: linear-gradient(165deg, #244233 0%, #1f3a2e 48%, #16291f 100%);
  color: #fff;
  padding: calc(var(--nav-h, 66px) + clamp(56px, 10vh, 120px)) 0 clamp(48px, 8vh, 96px);
  width: 96%;
  max-width: 1720px;
  margin-inline: auto;
  border-radius: 0 0 clamp(24px, 3vw, 40px) clamp(24px, 3vw, 40px);
}
.legal-hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: 460px; height: 460px;
  top: -160px; left: -80px;
  border-radius: 50%;
  filter: blur(80px);
  background: radial-gradient(circle, rgba(138,170,124,0.30), transparent 70%);
}
.legal-hero::after {
  content: '';
  position: absolute;
  z-index: -1;
  width: 380px; height: 380px;
  bottom: -160px; right: -60px;
  border-radius: 50%;
  filter: blur(80px);
  background: radial-gradient(circle, rgba(220,239,202,0.16), transparent 70%);
}
.legal-hero .container { position: relative; max-width: 860px; }

.legal-crumb {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  color: rgba(255,255,255,0.72);
  margin-bottom: 18px;
}
.legal-crumb a { color: rgba(255,255,255,0.72); text-decoration: none; transition: color 0.2s; }
.legal-crumb a:hover { color: #fff; }
.legal-crumb-sep { color: rgba(255,255,255,0.4); }
.legal-crumb [aria-current] { color: #dcefca; }

.legal-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(220,239,202,0.85);
  margin-bottom: 14px;
}
.legal-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.03em;
  margin: 0;
  padding-bottom: 0.1em;
}
.legal-hero h1 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: #dcefca;
}
.legal-hero-sub {
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.6;
  color: rgba(255,255,255,0.86);
  max-width: 640px;
  margin: 18px auto 0;
  text-wrap: balance;
}
.legal-updated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  padding: 7px 16px;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.legal-updated svg { opacity: 0.8; }

/* ---- BODY LAYOUT: sticky TOC + document ---- */
.legal-body {
  padding: clamp(48px, 8vh, 96px) 0 clamp(56px, 9vh, 110px);
}
.legal-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: clamp(36px, 5vw, 80px);
  align-items: start;
  max-width: 1120px;
  margin-inline: auto;
}

/* Table of contents */
.legal-toc {
  position: sticky;
  top: calc(var(--nav-h, 66px) + 28px);
}
.legal-toc-title {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 14px;
}
.legal-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}
.legal-toc li { margin: 0; }
.legal-toc a {
  counter-increment: toc;
  display: flex;
  gap: 10px;
  padding: 8px 12px;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--ink-soft);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.legal-toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-variant-numeric: tabular-nums;
  font-size: 0.74rem;
  color: var(--ink-faint);
  padding-top: 0.15em;
}
.legal-toc a:hover,
.legal-toc a.is-active {
  color: var(--sage-deep);
  background: rgba(138,170,124,0.10);
  border-left-color: var(--sage-deep);
}
.legal-toc a:hover::before,
.legal-toc a.is-active::before { color: var(--sage-deep); }

/* Document prose */
.legal-doc {
  max-width: 720px;
  font-size: 1.02rem;
  line-height: 1.72;
  color: var(--ink);
}
.legal-doc .legal-intro {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--ink-soft);
  padding-bottom: clamp(20px, 3vh, 32px);
  margin-bottom: clamp(24px, 4vh, 40px);
  border-bottom: 1px solid var(--line);
}
.legal-section { scroll-margin-top: calc(var(--nav-h, 66px) + 28px); }
.legal-section + .legal-section { margin-top: clamp(34px, 5vh, 52px); }
.legal-section h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 14px;
}
.legal-section h2 .legal-num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 0.92em;
  color: var(--sage-deep);
}
.legal-doc h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin: 26px 0 8px;
}
.legal-doc p { margin: 0 0 16px; }
.legal-doc a { color: var(--sage-deep); text-decoration: underline; text-underline-offset: 2px; }
.legal-doc a:hover { color: var(--ink); }
.legal-doc strong { font-weight: 600; color: var(--ink); }
.legal-doc ul {
  margin: 0 0 16px;
  padding-left: 0;
  list-style: none;
}
.legal-doc ul li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
}
.legal-doc ul li::before {
  content: '';
  position: absolute;
  left: 4px; top: 0.62em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--sage);
}

/* Callout — disclaimer / important notes */
.legal-callout {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  margin: 24px 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--sage-deep);
  border-radius: 12px;
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.legal-callout svg { flex: none; margin-top: 2px; color: var(--sage-deep); }
.legal-callout strong { color: var(--ink); }

/* Contact card at the foot of the document */
.legal-contact {
  margin-top: clamp(40px, 6vh, 64px);
  padding: clamp(24px, 4vw, 34px);
  background: linear-gradient(160deg, #244233, #1f3a2e);
  border-radius: 18px;
  color: #fff;
}
.legal-contact h2 { color: #fff; font-size: 1.3rem; margin: 0 0 8px; }
.legal-contact p { color: rgba(255,255,255,0.84); margin: 0 0 16px; }
.legal-contact a { color: #dcefca; text-decoration: none; }
.legal-contact a:hover { text-decoration: underline; }
.legal-contact-reach {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: 0.96rem;
}
.legal-contact-reach span { display: inline-flex; align-items: center; gap: 8px; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .legal-layout { grid-template-columns: 1fr; gap: 28px; }
  .legal-toc {
    position: static;
    padding: 18px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
  }
  .legal-toc ol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 12px;
  }
}
@media (max-width: 520px) {
  .legal-toc ol { grid-template-columns: 1fr; }
  .legal-doc { font-size: 0.98rem; }
}
