/* ModIns — legal document styling
   Palette anchored to the app's own primary (#4f46e5) so the site reads as
   the same product, not a disconnected marketing page. Everything else is
   quiet and disciplined on purpose — this is a legal document people need
   to actually read, not a page that needs to impress. */

:root {
  --ink: #16181f;
  --ink-soft: #4b5060;
  --ink-faint: #8a8fa3;
  --paper: #fdfdfc;
  --paper-shade: #f4f5fb;
  --line: #e4e5f2;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --accent-line: #c7d2fe;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Reading progress — functional, tied to an actual long document, not decorative ── */
.progress-rail {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 100%;
  background: var(--line);
  z-index: 100;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.1s linear;
}

/* ── Top bar ───────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 3px;
  z-index: 90;
  background: rgba(253, 253, 252, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.brand-mark span { color: var(--accent); }
.brand-tag {
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.topnav { display: flex; gap: 28px; }
.topnav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.topnav a:hover, .topnav a.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ── Document shell: sidebar + column, like an actual paper document ── */
.doc-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 32px 120px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 64px;
  align-items: start;
}

.doc-header { grid-column: 1 / -1; margin-bottom: 8px; }
.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.doc-title {
  font-family: var(--serif);
  font-size: clamp(32px, 4.4vw, 48px);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 14px;
}
.doc-sub {
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 0;
}

/* ── Sidebar TOC — sticky, real navigation, not decoration ──────────── */
.toc {
  position: sticky;
  top: 96px;
}
.toc-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 14px;
}
.toc ol {
  list-style: none;
  margin: 0; padding: 0;
  border-left: 1px solid var(--line);
}
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 7px 0 7px 16px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13.5px;
  line-height: 1.4;
}
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

/* ── Document body ─────────────────────────────────────────────────── */
.doc-body { min-width: 0; }

.doc-intro {
  font-size: 15px;
  font-style: italic;
  color: var(--ink-soft);
  background: var(--paper-shade);
  border-left: 3px solid var(--accent-line);
  padding: 18px 22px;
  border-radius: 4px;
  margin-bottom: 44px;
}

section.clause { scroll-margin-top: 100px; margin-bottom: 40px; }
.clause-num {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}
.clause h2 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 12px;
  letter-spacing: -0.005em;
}
.clause p {
  font-size: 15.5px;
  color: var(--ink-soft);
  line-height: 1.75;
  margin: 0 0 12px;
  text-align: justify;
  hyphens: auto;
}
.clause strong { color: var(--ink); font-weight: 600; }

.controller-box {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  padding: 20px 22px;
  margin: 14px 0 12px;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.7;
}
.controller-box .label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 8px; }

.doc-footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  font-style: italic;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Footer ────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 32px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-faint);
}
.site-footer a { color: var(--ink-faint); }

/* ── Mobile ────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .doc-shell { grid-template-columns: 1fr; gap: 8px; padding: 32px 20px 80px; }
  .toc { position: static; margin-bottom: 36px; }
  .toc ol { display: flex; flex-wrap: wrap; gap: 4px 0; border-left: none; }
  .toc li { width: 50%; }
  .toc a { border-left: none; border-bottom: 2px solid transparent; padding: 6px 10px 6px 0; }
  .toc a.active { border-left: none; border-bottom-color: var(--accent); }
  .topnav { display: none; }
  .doc-title { font-size: 28px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .progress-fill { transition: none; }
}

/* Visible keyboard focus, always */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Placeholder banner — visible only until company-info.js is filled in ── */
.placeholder-banner {
  display: none;
  background: #fef3c7;
  border-bottom: 1px solid #fbbf24;
  color: #78350f;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  padding: 10px 20px;
  position: sticky;
  top: 3px;
  z-index: 95;
}
