/* LEVR — Due Diligence Documentation
   Light monochrome. Geist for text, JetBrains Mono for kickers and labels. */

:root {
  --bg: #ffffff;
  --surface: #fbfbfb;
  --surface-2: #f4f4f4;
  --ink: #0b0b0b;
  --ink-2: #333333;
  --muted: #6d6d6d;
  --faint: #9a9a9a;
  --line: #e4e4e4;
  --line-strong: #c9c9c9;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --measure: 74ch;
  --shell: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.68;
  font-weight: 400;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

/* ---------- password gate ---------- */

#gate {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.gate-card {
  width: 100%;
  max-width: 380px;
}

.gate-card h1 {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0.5rem 0 1.75rem;
}

.gate-card label {
  display: block;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.gate-card input {
  width: 100%;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 0.7rem 0.8rem;
  outline: none;
}

.gate-card input:focus { border-color: var(--ink); }

.gate-card button {
  margin-top: 0.75rem;
  width: 100%;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 0.75rem 1rem;
  cursor: pointer;
}

.gate-card button:hover { background: var(--ink-2); border-color: var(--ink-2); }

.gate-error {
  min-height: 1.4em;
  margin: 0.75rem 0 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ---------- shell ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.wordmark {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.topnav {
  display: flex;
  gap: 1.4rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.topnav a { color: var(--muted); text-decoration: none; }
.topnav a:hover, .topnav a[aria-current="page"] { color: var(--ink); }

.wrap {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 2rem 7rem;
}

.narrow { max-width: var(--measure); }

/* ---------- typography ---------- */

.kicker {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 0.9rem;
}

.doc-head {
  padding: 5rem 0 2.5rem;
  border-bottom: 1px solid var(--ink);
}

.doc-head h1 {
  font-size: clamp(2rem, 4.4vw, 3rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin: 0 0 1.5rem;
  max-width: 20ch;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2.5rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.doc-meta span strong {
  font-weight: 500;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-right: 0.6rem;
}

h2 {
  font-size: 1.55rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0 0 1.4rem;
  max-width: 26ch;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 2.6rem 0 0.9rem;
}

h4 {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2rem 0 0.7rem;
}

p { margin: 0 0 1.15rem; max-width: var(--measure); }

a { color: var(--ink); text-underline-offset: 3px; }

strong { font-weight: 600; }

ul, ol { max-width: var(--measure); padding-left: 1.15rem; margin: 0 0 1.25rem; }
li { margin-bottom: 0.5rem; }
li::marker { color: var(--faint); }

.lede {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.mono { font-family: var(--mono); font-size: 0.9em; }

.note {
  font-size: 0.88rem;
  color: var(--muted);
  max-width: var(--measure);
}

/* ---------- sections ---------- */

section {
  padding: 4.5rem 0 0;
  border-top: 1px solid var(--line);
  margin-top: 4.5rem;
}

section:first-of-type { border-top: none; }

.section-grid {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.section-grid > * { min-width: 0; }

.section-num {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--faint);
  padding-top: 0.45rem;
}

/* ---------- tables ---------- */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  border: 1px solid var(--line);
  margin: 1.5rem 0 2rem;
  background: var(--bg);
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  font-family: var(--mono);
  font-size: 0.63rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

tbody th {
  font-weight: 600;
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-width: 9rem;
  overflow-wrap: break-word;
}

tbody td {
  vertical-align: top;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  color: var(--ink-2);
}

tbody tr:last-child th, tbody tr:last-child td { border-bottom: none; }
tbody td:last-child, tbody th:last-child { border-right: none; }

table .num { font-family: var(--mono); font-size: 0.85em; white-space: nowrap; }

caption {
  caption-side: bottom;
  text-align: left;
  padding: 0.7rem 0.9rem;
  font-size: 0.78rem;
  color: var(--faint);
  border-top: 1px solid var(--line);
}

/* ---------- key/value blocks ---------- */

.kv {
  border: 1px solid var(--line);
  margin: 1.5rem 0 2.25rem;
}

.kv-row {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.kv-row:last-child { border-bottom: none; }

.kv-row > * { min-width: 0; overflow-wrap: break-word; }

.kv-row dt {
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.8rem 0.9rem;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.kv-row dd {
  margin: 0;
  padding: 0.8rem 0.9rem;
  font-size: 0.9rem;
  color: var(--ink-2);
}

/* ---------- callouts ---------- */

.callout {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 1.4rem 1.5rem;
  margin: 2rem 0;
}

.callout .kicker { margin-bottom: 0.6rem; color: var(--muted); }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }

/* ---------- index page ---------- */

.hero {
  padding: 8rem 0 5rem;
  max-width: 30ch;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin: 0;
}

.doc-list {
  border-top: 1px solid var(--ink);
  margin-bottom: 4rem;
}

.doc-card {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: start;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.doc-card:hover { background: var(--surface); }

.doc-card > * { min-width: 0; }

.doc-card .idx {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--faint);
  padding-top: 0.4rem;
}

.doc-card h2 {
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
  max-width: none;
}

.doc-card p { margin: 0; font-size: 0.93rem; color: var(--muted); max-width: 62ch; }

.doc-card .arrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--faint);
  padding-top: 0.5rem;
}

.doc-card:hover .arrow { color: var(--ink); }

/* ---------- table of contents ---------- */

.toc {
  columns: 2;
  column-gap: 3rem;
  padding: 0;
  margin: 2.5rem 0 0;
  list-style: none;
  max-width: none;
}

.toc li {
  break-inside: avoid;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.toc a {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 0;
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--ink-2);
}

.toc a:hover { color: var(--ink); }

.toc .n {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--faint);
  padding-top: 0.18rem;
  min-width: 1.6rem;
}

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  margin-top: 5rem;
  padding: 2rem 0 4rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  justify-content: space-between;
}

.footer a { color: var(--faint); text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .wrap, .topbar-inner { padding-left: 1.25rem; padding-right: 1.25rem; }
  .section-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .section-num { padding-top: 0; }
  .kv-row { grid-template-columns: 1fr; }
  .kv-row dt { border-right: none; border-bottom: 1px solid var(--line); }
  .toc { columns: 1; }
  .doc-card { grid-template-columns: 1fr; gap: 0.75rem; }
  .doc-card .arrow { display: none; }
  .hero { padding: 4.5rem 0 3rem; }
  .doc-head { padding-top: 3rem; }
}

@media print {
  .topbar, .gate-card { display: none; }
  body { font-size: 11pt; }
}
