/* ─── Primust Docs — Unified Stylesheet ─── */

:root {
  --bg: #ffffff;
  --ink: #1a1a1a;
  --mid: #444444;
  --muted: #555555;
  --border: #e5e5e5;
  --surface: #f7f7f7;
  --code-bg: #f5f5f5;
  --amber: #b37a00;
  --bounded: #2b6cb0;
  --sidebar-w: 260px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink);
  font-family: 'IBM Plex Mono', monospace;
  overflow-x: hidden; font-size: 14px; line-height: 1.7;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--amber); }

/* ─── TOPNAV ─── */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 52px; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
}
.topnav-logo { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.mark {
  background: var(--ink); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 0;
}
.wordmark {
  font-family: 'Syne', sans-serif; font-weight: 500;
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  padding-right: 0.2em; color: var(--ink);
}
.docs-badge {
  font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--amber); margin-left: 4px;
}
.topnav-links { display: flex; align-items: center; gap: 24px; }
.topnav-links a {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); transition: color 0.15s;
}
.topnav-links a:hover { color: var(--ink); }
.topnav-links a.active { color: var(--ink); font-weight: 500; }

/* Mobile menu toggle */
.menu-toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: 8px; color: var(--ink);
}

/* ─── SIDEBAR ─── */
.sidebar {
  position: fixed; top: 52px; left: 0; bottom: 0;
  width: var(--sidebar-w); overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 24px 0; background: var(--bg);
  z-index: 50;
}
.sidebar-group { margin-bottom: 20px; }
.sidebar-group-label {
  font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--amber); padding: 8px 24px 6px;
  font-weight: 500;
}
.sidebar a {
  display: block; padding: 6px 24px; font-size: 12px;
  color: var(--muted); transition: color 0.12s, background 0.12s;
  letter-spacing: 0.02em;
}
.sidebar a:hover { color: var(--ink); background: var(--surface); }
.sidebar a.active { color: var(--ink); border-right: 2px solid var(--amber); background: var(--surface); }
.sidebar a.indent { padding-left: 40px; font-size: 11px; }

/* ─── CONTENT ─── */
.content {
  margin-left: var(--sidebar-w); margin-top: 52px;
  padding: 48px 56px 120px;
  max-width: 920px;
}
.content h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 48px; letter-spacing: 0.04em; color: var(--ink);
  margin-bottom: 8px; line-height: 0.95;
}
.content .page-sub {
  font-family: 'Libre Baskerville', serif;
  font-size: 15px; color: var(--mid); font-style: italic;
  margin-bottom: 40px; line-height: 1.6;
}
.content h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px; letter-spacing: 0.04em; color: var(--ink);
  margin: 48px 0 16px; padding-top: 24px;
  border-top: 1px solid var(--border);
}
.content h2:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.content h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px; letter-spacing: 0.04em; color: var(--ink);
  margin: 32px 0 12px;
}
.content p {
  font-family: 'Libre Baskerville', serif;
  font-size: 14px; line-height: 1.75; color: var(--mid);
  margin-bottom: 16px;
}
.content p strong { color: var(--ink); font-weight: 700; }
.content ul, .content ol {
  margin: 0 0 16px 20px; font-size: 13px; color: var(--mid);
  font-family: 'Libre Baskerville', serif; line-height: 1.75;
}
.content li { margin-bottom: 6px; }
.content li strong { color: var(--ink); }

/* ─── CODE ─── */
.content pre {
  background: var(--surface); border: 1px solid var(--border);
  padding: 16px 20px; font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; line-height: 1.7; color: var(--mid);
  overflow-x: auto; margin: 0 0 20px; position: relative;
  border-radius: 4px;
}
.content code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; color: var(--ink);
  background: var(--surface); padding: 1px 5px;
  border-radius: 3px;
}
.content pre code { background: none; padding: 0; color: var(--mid); }
.code-label {
  position: absolute; top: -1px; right: -1px;
  font-size: 8px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--bg); background: var(--ink); padding: 3px 8px;
}

/* ─── TABLES ─── */
.content table {
  width: 100%; border-collapse: collapse; margin: 0 0 24px;
  font-size: 12px; display: block; overflow-x: auto;
}
.content thead, .content tbody, .content tr { display: table; width: 100%; table-layout: fixed; }
.content table { display: table; }
.table-wrap { overflow-x: auto; margin: 0 0 24px; }
.content th {
  font-weight: 500; font-size: 9px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted);
  text-align: left; padding: 8px 12px;
  border-bottom: 1px solid var(--border); background: var(--surface);
}
.content td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  color: var(--mid); vertical-align: top;
  font-family: 'Libre Baskerville', serif; font-size: 13px;
}
.content td:first-child { color: var(--ink); }
.content td code { white-space: nowrap; }

/* ─── CALLOUTS ─── */
.callout {
  border: 1px solid var(--border); padding: 16px 20px;
  margin: 0 0 20px; background: var(--surface);
  border-radius: 4px;
}
.callout-label {
  font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--amber); margin-bottom: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
}
.callout p { margin-bottom: 0; font-size: 13px; }
.callout-warn, .callout.warning { border-left: 3px solid var(--amber); }
.callout.warning .callout-label { color: var(--amber); }
.callout-info, .callout.info { border-left: 3px solid var(--bounded); }
.callout.info .callout-label { color: var(--bounded); }

/* ─── BADGES ─── */
.proof-badge {
  display: inline-block; font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; padding: 2px 8px; border-radius: 3px;
}
.proof-mathematical { background: rgba(0,150,100,0.1); color: #00805a; }
.proof-verifiable { background: rgba(0,140,120,0.1); color: #008060; }
.proof-bounded { background: rgba(43,108,176,0.1); color: var(--bounded); }
.proof-execution { background: rgba(180,130,60,0.1); color: #9a6e1a; }
.proof-witnessed { background: rgba(80,120,160,0.1); color: #3a6a8a; }
.proof-attestation { background: rgba(100,100,100,0.12); color: #666; }
.badge {
  display: inline-block; font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; padding: 2px 8px; border-radius: 3px;
  background: rgba(43,108,176,0.1); color: var(--bounded);
}

/* ─── PAGE NAV (next/prev) ─── */
.page-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 64px; padding-top: 32px;
  border-top: 1px solid var(--border);
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
}
.page-nav a {
  color: var(--muted); text-decoration: none;
  padding: 8px 16px; border: 1px solid var(--border);
  border-radius: 4px; transition: all 0.15s;
}
.page-nav a:hover {
  color: var(--ink); border-color: var(--ink);
  background: var(--surface);
}

/* ─── CHECKLIST ─── */
.checklist { list-style: none; margin-left: 0; }
.checklist li { padding-left: 20px; position: relative; }
.checklist li::before {
  content: ''; position: absolute; left: 0; top: 8px;
  width: 10px; height: 10px; border: 1px solid var(--border);
}

/* ─── TAB LABEL ─── */
.tab-label {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 6px;
}

/* ─── FOOTER ─── */
.site-footer {
  margin-left: var(--sidebar-w);
  padding: 32px 56px;
  border-top: 1px solid var(--border);
  font-size: 11px; color: var(--muted);
  display: flex; justify-content: space-between; align-items: center;
}
.site-footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--ink); }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .topnav-links { display: none; }
  .menu-toggle { display: block; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 280px;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.08);
  }
  .content { margin-left: 0; padding: 32px 24px 80px; max-width: 100%; }
  .content table { display: block; overflow-x: auto; }
  .content thead, .content tbody, .content tr { display: table; width: 100%; }
  .site-footer { margin-left: 0; padding: 24px; flex-direction: column; gap: 8px; }
  .page-nav { flex-direction: column; gap: 12px; }
  .page-nav a { text-align: center; }
}

@media (max-width: 600px) {
  .topnav { padding: 0 16px; }
  .content { padding: 24px 16px 80px; }
  .content h1 { font-size: 36px; }
  .content h2 { font-size: 24px; }
}
