/* ============== Maxwell — Legal document pages ============== */
/* Relies on tokens, fonts, .logo, .wordmark, .eyebrow from styles.css */

body.legal { margin: 0; background: var(--paper); color: var(--ink); }

.doc { max-width: 820px; margin: 0 auto; padding: 0 28px 96px; }

/* Top bar */
.doc__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 0 0;
}
.back-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'Geist', sans-serif; font-weight: 500; font-size: 14px;
  letter-spacing: -0.01em; color: var(--ink-2); text-decoration: none;
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper-2); transition: border-color .15s ease, color .15s ease;
}
.back-link:hover { border-color: var(--terra); color: var(--terra-deep); }

/* Masthead */
.doc__head { padding: 56px 0 28px; border-bottom: 1px solid var(--line); }
.doc__head .eyebrow { margin-bottom: 18px; }
.doc__title {
  font-family: 'Hanken Grotesk', sans-serif; font-weight: 700;
  font-size: 46px; line-height: 1.04; letter-spacing: -0.035em;
  color: var(--ink); margin: 0 0 16px; text-wrap: balance;
}
.doc__meta {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  font-family: 'Geist', sans-serif; font-size: 14px; color: var(--ink-3);
  letter-spacing: -0.01em;
}
.doc__meta b { color: var(--ink-2); font-weight: 600; }

/* Draft notice */
.notice {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--terra-soft); border: 1px solid var(--terra-tint);
  border-radius: 16px; padding: 18px 20px; margin: 28px 0 0;
}
.notice .ic {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: #fff; color: var(--terra-deep); display: grid; place-items: center;
}
.notice p {
  margin: 0; font-family: 'Geist', sans-serif; font-size: 14px; line-height: 1.55;
  color: var(--ink-2); letter-spacing: -0.01em;
}
.notice b { color: var(--terra-deep); font-weight: 600; }

/* Table of contents */
.toc { margin: 40px 0 8px; }
.toc h2 {
  font-family: 'Geist', sans-serif; font-weight: 700; font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3);
  margin: 0 0 16px;
}
.toc ol {
  list-style: none; margin: 0; padding: 0;
  columns: 2; column-gap: 36px;
}
.toc li { margin: 0 0 11px; break-inside: avoid; counter-increment: toc; }
.toc a {
  display: flex; gap: 12px; align-items: baseline;
  font-family: 'Geist', sans-serif; font-size: 15px; letter-spacing: -0.01em;
  color: var(--ink-2); text-decoration: none; line-height: 1.4;
}
.toc a:hover { color: var(--terra-deep); }
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-variant-numeric: tabular-nums; font-weight: 600;
  color: var(--terra); flex: none;
}
.toc ol { counter-reset: toc; }

/* Sections */
.doc__body { counter-reset: sec; }
.sec { padding: 40px 0 0; }
.sec h2 {
  font-family: 'Hanken Grotesk', sans-serif; font-weight: 700;
  font-size: 25px; line-height: 1.15; letter-spacing: -0.025em;
  color: var(--ink); margin: 0 0 16px; scroll-margin-top: 24px;
  display: flex; gap: 14px; align-items: baseline; counter-increment: sec;
}
.sec h2::before {
  content: counter(sec, decimal-leading-zero);
  font-family: 'Geist', sans-serif; font-size: 14px; font-weight: 600;
  color: var(--terra); font-variant-numeric: tabular-nums;
  position: relative; top: -2px; flex: none;
}
.sec h3 {
  font-family: 'Geist', sans-serif; font-weight: 600; font-size: 16.5px;
  letter-spacing: -0.01em; color: var(--ink); margin: 26px 0 8px;
}
.sec p, .sec li {
  font-family: 'Geist', sans-serif; font-size: 16px; line-height: 1.62;
  letter-spacing: -0.01em; color: var(--ink-2); margin: 0 0 14px;
  text-wrap: pretty;
}
.sec ul { margin: 0 0 14px; padding-left: 0; list-style: none; }
.sec ul li {
  position: relative; padding-left: 22px; margin: 0 0 9px;
}
.sec ul li::before {
  content: ""; position: absolute; left: 4px; top: 11px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--terra);
}
.sec a { color: var(--terra-deep); text-decoration: underline; text-underline-offset: 2px; }
.sec strong { color: var(--ink); font-weight: 600; }
.ph { color: var(--ink-3); font-style: italic; }

/* Callout inside a section */
.callout {
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px 20px; margin: 0 0 16px;
}
.callout .tag {
  font-family: 'Geist', sans-serif; font-weight: 700; font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--terra-deep);
  margin: 0 0 8px;
}
.callout p:last-child { margin-bottom: 0; }

/* Footer */
.doc__foot {
  margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
}
.doc__foot .links { display: flex; gap: 8px; flex-wrap: wrap; }
.doc__foot a {
  font-family: 'Geist', sans-serif; font-weight: 500; font-size: 14px;
  letter-spacing: -0.01em; color: var(--ink-2); text-decoration: none;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper-2); transition: border-color .15s ease, color .15s ease;
}
.doc__foot a:hover { border-color: var(--terra); color: var(--terra-deep); }
.doc__foot .copyright {
  font-family: 'Geist', sans-serif; font-size: 13.5px; color: var(--ink-3); letter-spacing: -0.01em;
}

@media (max-width: 620px) {
  .doc__title { font-size: 36px; }
  .toc ol { columns: 1; }
  .doc { padding: 0 20px 64px; }
}

/* Print */
@media print {
  body.legal { background: #fff; }
  .doc { max-width: none; padding: 0; }
  .doc__bar, .back-link, .doc__foot .links { display: none; }
  .notice { background: #fff; }
  .sec { padding-top: 26px; break-inside: avoid-page; }
  .sec h2 { break-after: avoid; }
  a { color: var(--ink) !important; text-decoration: none !important; }
}
