/* ------------------------------------------------------------------
   doc.css — reading styles for the full-length documents
   (spec + implementation companion), matching the site palette.
   Generated pages: competent-democracy-1.5.html,
   concept-implementation-1.5.html (see README, "Document pages").
------------------------------------------------------------------- */

:root {
  --deep: #0f3a4d;
  --deep-2: #0d2530;
  --ink: #0d1b2a;
  --ink-soft: #2a3a4d;
  --muted: #5a6b80;
  --accent: #b07a1c;
  --accent-soft: #d9a85a;
  --paper: #f6f4ef;
  --paper-2: #ffffff;
  --line: #d8dee7;
  --serif: "Fraunces", Georgia, "Times New Roman", 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: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-soft); color: var(--ink); }

/* ---------- Top bar ---------------------------------------------- */
.doc-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(246, 244, 239, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.doc-topbar-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.doc-topbar a {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--deep);
  text-decoration: none;
}
.doc-topbar a:hover { color: var(--accent); }
.doc-topbar .doc-meta {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- Document body ---------------------------------------- */
.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.doc h1, .doc h2, .doc h3, .doc h4 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.25;
  margin: 2.6em 0 0.6em;
}
.doc h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 600;
  margin-top: 0.5em;
}
.doc h2 {
  font-size: clamp(1.45rem, 3.5vw, 1.8rem);
  font-weight: 600;
  padding-top: 1.2em;
  border-top: 1px solid var(--line);
}
.doc hr + h2 { border-top: none; padding-top: 0; }
.doc h3 { font-size: 1.3rem; font-weight: 600; }
.doc h4 { font-size: 1.08rem; font-weight: 600; }

.doc p { margin: 0 0 1.1em; }

.doc a { color: var(--deep); text-decoration-color: var(--accent-soft); }
.doc a:hover { color: var(--accent); }

.doc strong { color: var(--ink); }

.doc blockquote {
  margin: 1.6em 0;
  padding: 0.4em 0 0.4em 1.3em;
  border-left: 3px solid var(--accent-soft);
  color: var(--ink-soft);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05em;
}
.doc blockquote p { margin-bottom: 0.4em; }

.doc hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.5em 0;
}

.doc ul, .doc ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.doc li { margin-bottom: 0.35em; }

.doc code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: #eceae3;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* ---------- Tables ------------------------------------------------ */
.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 0.9rem;
  line-height: 1.5;
  display: block;
  overflow-x: auto;
}
.doc th, .doc td {
  text-align: left;
  vertical-align: top;
  padding: 0.55em 0.8em;
  border-bottom: 1px solid var(--line);
  min-width: 7em;
}
.doc th {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid var(--deep);
}
.doc tr:nth-child(even) td { background: rgba(216, 222, 231, 0.16); }

/* ---------- Footer ------------------------------------------------ */
.doc-footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 1.5rem 3rem;
  max-width: 760px;
  margin: 0 auto;
  font-size: 0.85rem;
  color: var(--muted);
}
.doc-footer a { color: var(--deep); }

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .doc { padding-top: 2rem; }
}
