/* legal.css — shared styles for Agrei Consulting Inc. legal pages.
   Extends the Direction B system used on the home page.
   Adaptive: responsive layout + automatic light/dark via prefers-color-scheme. */
:root {
  --paper: #fdfdfb;     /* page background          */
  --surface: #1b2a44;   /* masthead / footer bands  */
  --heading: #1b2a44;   /* headings & emphasis ink  */
  --edge: #1b2a44;      /* strong accent rules      */
  --body: #4a5266;
  --muted: #98a0b0;
  --slate: #6f7d98;
  --accent: #7e8eaa;
  --hair: rgba(27, 42, 68, 0.14);
  --tint: #eef1f7;          /* intro / callout fill */
  --on-surface: #ffffff;    /* text on bands        */
  --band-sub: #aeb9d1;
  --band-sub-2: #8492ad;
  --pad: 104px;
  --maxw: 1180px;
  color-scheme: light;
  font-family: "Libre Franklin", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1726;
    --surface: #16243d;
    --heading: #e9eef7;
    --edge: #93a3c6;
    --body: #b9c2d4;
    --muted: #818da4;
    --slate: #9aa7c0;
    --accent: #93a3c6;
    --hair: rgba(255, 255, 255, 0.13);
    --tint: rgba(255, 255, 255, 0.045);
    --on-surface: #f3f6fc;
    --band-sub: #aab6cf;
    --band-sub-2: #8493ae;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  background: var(--paper);
  color: var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a {
  color: inherit;
}

.band {
  background: var(--surface);
}
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* ── Masthead ─────────────────────────────── */
.masthead {
  padding-top: 34px;
  padding-bottom: 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.wordmark {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--on-surface);
  margin: 0;
  text-decoration: none;
}
.wordmark:hover {
  opacity: 0.85;
}
.subline {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--band-sub);
  white-space: nowrap;
}

/* ── Document head ────────────────────────── */
main {
  padding-top: 60px;
  padding-bottom: 24px;
}
.crumb {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.crumb:hover {
  color: var(--heading);
}
.doc-title {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.6px;
  color: var(--heading);
  margin: 20px 0 0;
}
.doc-meta {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin: 14px 0 0;
}
.rule {
  height: 1px;
  background: var(--hair);
  margin: 34px 0 0;
}

/* ── Long-form content ────────────────────── */
.doc {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 56px;
  margin-top: 44px;
}

/* sticky table of contents */
.toc {
  position: sticky;
  top: 40px;
  align-self: start;
}
.toc-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}
.toc li {
  counter-increment: toc;
  margin-bottom: 11px;
}
.toc a {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--slate);
  text-decoration: none;
  display: flex;
  gap: 10px;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.toc a:hover {
  color: var(--heading);
}

.prose {
  max-width: 680px;
}
.prose section {
  scroll-margin-top: 28px;
}
.prose section + section {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--hair);
}
.prose h2 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 6px;
}
.prose h2 .n {
  color: var(--muted);
  margin-right: 10px;
  font-variant-numeric: tabular-nums;
}
.prose h3 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--heading);
  margin: 0 0 16px;
}
.prose p {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--body);
  margin: 0 0 16px;
}
.prose p:last-child {
  margin-bottom: 0;
}
.prose ul {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.prose li {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--body);
  padding-left: 24px;
  position: relative;
  margin-bottom: 11px;
}
.prose li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 11px;
  width: 6px;
  height: 6px;
  background: var(--accent);
}
.prose li strong,
.prose p strong {
  color: var(--heading);
  font-weight: 600;
}
.prose a {
  color: var(--heading);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--accent);
}
.callout {
  background: var(--tint);
  border-left: 3px solid var(--edge);
  padding: 20px 24px;
  margin: 0 0 16px;
}
.callout p {
  margin: 0;
  font-size: 14.5px;
}

/* ── Footer ───────────────────────────────── */
footer.band {
  margin-top: 56px;
}
.foot {
  padding-top: 26px;
  padding-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.foot .legalese {
  font-size: 12px;
  line-height: 1.7;
  color: var(--band-sub);
  margin: 0;
}
.foot .legalese .second {
  color: var(--band-sub-2);
}
.foot .links {
  display: flex;
  gap: 20px;
}
.foot .links a {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--band-sub);
  text-decoration: none;
}
.foot .links a[aria-current="page"] {
  color: var(--on-surface);
}
.foot .links a:hover {
  color: var(--on-surface);
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 1040px) {
  :root {
    --pad: 56px;
  }
  .doc {
    grid-template-columns: 200px 1fr;
    gap: 40px;
  }
}
@media (max-width: 760px) {
  :root {
    --pad: 24px;
  }
  .wordmark {
    font-size: 23px;
  }
  .subline {
    font-size: 11px;
    letter-spacing: 1.5px;
  }
  .doc-title {
    font-size: 30px;
  }
  .doc {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 32px;
  }
  .toc {
    position: static;
    margin-bottom: 36px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--hair);
  }
  .foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
}
