/* The Cognitive Lichen — UltimateLaw Press */
:root {
  --text: #1a1a1a; --bg: #fefefe; --accent: #8b0000;
  --muted: #666; --border: #ddd; --max-width: 42em;
}
@media (prefers-color-scheme: dark) {
  :root { --text: #d4d4d4; --bg: #1a1a1a; --accent: #cc4444; --muted: #999; --border: #333; }
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  font-size: 1.08rem; line-height: 1.7; color: var(--text);
  background: var(--bg); -webkit-font-smoothing: antialiased;
}
header {
  border-bottom: 1px solid var(--border); padding: 0.8em 1.5em;
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
nav {
  max-width: var(--max-width); margin: 0 auto; display: flex;
  align-items: center; gap: 1.5em; flex-wrap: wrap;
}
.site-title { font-weight: bold; font-size: 1.1em; text-decoration: none; color: var(--text); }
.nav-chapters { display: flex; gap: 1em; flex-wrap: wrap; margin-left: auto; }
nav a { color: var(--accent); text-decoration: none; font-size: 0.95em; }
nav a:hover { text-decoration: underline; }
main { max-width: var(--max-width); margin: 0 auto; padding: 2em 1.5em 4em; }

.paper-title { text-align: center; font-size: 2.1em; font-weight: normal; margin: 1em 0 0.2em; line-height: 1.2; }
.paper-subtitle { text-align: center; font-style: italic; font-size: 1.15em; color: var(--muted); margin-bottom: 0.8em; }
.paper-byline { text-align: center; font-size: 1.1em; margin-bottom: 0.2em; }
.paper-meta { text-align: center; color: var(--muted); font-size: 0.9em; margin-bottom: 2em; }

.abstract {
  margin: 2em 0; padding: 1.2em 1.6em; border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--bg) 95%, var(--text)); font-size: 0.98em;
}
.abstract h2 { font-size: 1em; font-style: italic; font-weight: normal; margin-bottom: 0.4em; }
.abstract p { text-align: justify; hyphens: auto; }

section { margin: 1.8em 0; }
section h2 { font-size: 1.3em; font-weight: normal; margin: 1.5em 0 0.5em; }
.paper p { margin: 0.7em 0; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.paper ol { margin: 0.7em 0 0.7em 1.8em; }
.paper li { margin-bottom: 0.5em; }

.cite { white-space: nowrap; }
.cite a { color: var(--accent); text-decoration: none; }
.cite a:hover { text-decoration: underline; }

table.rules {
  width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 0.92em;
  border-top: 2px solid var(--text); border-bottom: 2px solid var(--text);
}
table.rules thead th { border-bottom: 1px solid var(--text); }
table.rules th, table.rules td { text-align: left; padding: 0.45em 0.7em; vertical-align: top; }
table.rules th { font-weight: bold; }
.caption { font-size: 0.88em; color: var(--muted); text-align: left; margin-top: -0.6em; }

.references { margin-top: 2.5em; border-top: 1px solid var(--border); padding-top: 1em; }
.references h2 { font-size: 1.2em; }
.references ol { margin-left: 1.6em; font-size: 0.92em; }
.references li { margin-bottom: 0.5em; line-height: 1.5; }
.references li:target { background: color-mix(in srgb, var(--bg) 80%, var(--accent)); }

.fn-ref { text-decoration: none; color: var(--accent); vertical-align: super; font-size: 0.75em; }
.author-note {
  margin-top: 2.5em; padding-top: 1em; border-top: 1px solid var(--border);
  font-size: 0.85em; color: var(--muted); text-align: left;
}

footer {
  max-width: var(--max-width); margin: 0 auto; padding: 2em 1.5em;
  border-top: 1px solid var(--border); text-align: center; font-size: 0.85em; color: var(--muted);
}
footer a { color: var(--accent); text-decoration: none; }

@media (max-width: 600px) {
  body { font-size: 1rem; }
  main { padding: 1.2em 1em 3em; }
  .paper-title { font-size: 1.6em; }
  table.rules { font-size: 0.85em; }
}
