/* Clarity Signal | the-last-interface/book.css | v1.0 — 2026-08-05 | New: book section styling (reuses Field Notes tokens) */

:root {
  --bg: #0c0d0f;
  --bg2: #111318;
  --text: #ddd8ce;
  --muted: #9a978c;
  --dim: #3a3830;
  --accent: #c8b98a;
  --accent2: #7a9e8a;
  --line: rgba(200,185,138,.12);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'EB Garamond', Georgia, serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

/* Header */
header {
  padding: 48px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp .8s ease .1s forwards;
}

.wordmark {
  font-size: 13px;
  font-family: 'DM Mono', monospace;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

.wordmark-sub {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}

.wordmark-sub:hover { color: var(--accent); }

.wordmark-sub::before { content: '— '; opacity: .5; }

/* ---- Book article ---- */
article {
  padding: 64px 0 32px;
  opacity: 0;
  animation: fadeUp .9s ease .25s forwards;
}

.book-mark {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.part-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
}

.chap-num {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 14px;
}

article h1.chap-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: -.01em;
  color: var(--text);
  margin-bottom: 28px;
}

.epigraph {
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--muted);
  font-style: italic;
  line-height: 1.55;
  max-width: 54ch;
  border-left: 2px solid var(--accent);
  padding-left: 20px;
  margin-bottom: 52px;
}

article h2 {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(21px, 2.8vw, 26px);
  font-weight: 600;
  color: var(--text);
  margin: 54px 0 20px;
  letter-spacing: -.005em;
}

article h3 {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--accent);
  margin: 36px 0 14px;
}

article p {
  font-size: clamp(17px, 2vw, 19px);
  color: var(--text);
  line-height: 1.78;
  margin-bottom: 22px;
  max-width: 62ch;
}

article p em { font-style: italic; }
article p strong { color: var(--accent); font-weight: 500; }

/* Dialogue / prompt lines */
.dialogue {
  border-left: 2px solid var(--accent2);
  background: rgba(122,158,138,.05);
  padding: 14px 22px;
  margin: 26px 0;
  max-width: 60ch;
  font-size: clamp(17px, 2vw, 19px);
  line-height: 1.6;
}

.dialogue .who { color: var(--accent2); font-style: normal; }
.dialogue.say { font-style: italic; color: var(--text); }

/* Pull line */
.lift {
  margin: 40px 0;
  padding: 24px 28px;
  border-left: 2px solid var(--accent);
  background: rgba(200,185,138,.03);
  font-style: italic;
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--text);
  line-height: 1.5;
  max-width: 60ch;
}

/* Chapter end + hand-off */
.chap-end {
  margin: 48px 0 0;
  text-align: center;
  color: var(--dim);
  font-size: 20px;
  letter-spacing: .4em;
}

.next-line {
  margin-top: 24px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.next-line a { color: var(--accent2); text-decoration: none; }
.next-line a:hover { color: var(--accent); }

/* Prev/next chapter nav */
.chap-nav {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.chap-nav a, .chap-nav span {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}

.chap-nav a:hover { color: var(--accent); }
.chap-nav .disabled { color: var(--dim); }

/* ---- Book landing page ---- */
.book-hero {
  padding: 64px 0 8px;
  opacity: 0;
  animation: fadeUp .9s ease .25s forwards;
}

.book-hero .book-mark { margin-bottom: 18px; }

.book-hero h1 {
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.015em;
  color: var(--text);
  margin-bottom: 18px;
}

.book-hero h1 em { font-style: italic; color: var(--accent); }

.book-hero .tagline {
  font-size: clamp(18px, 2.4vw, 22px);
  color: var(--muted);
  font-style: italic;
  line-height: 1.5;
  max-width: 46ch;
  margin-bottom: 40px;
}

.book-hero p {
  font-size: clamp(17px, 2vw, 19px);
  color: var(--text);
  line-height: 1.78;
  max-width: 60ch;
  margin-bottom: 22px;
}

.book-hero .note {
  color: var(--muted);
  font-style: italic;
  font-size: 16px;
}

.toc-part {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent2);
  margin: 48px 0 4px;
}

.toc-list {
  margin: 12px 0 40px;
  list-style: none;
  padding: 0;
}

.toc-list li {
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

.toc-list li:first-child { border-top: 1px solid var(--line); }

.toc-list a {
  display: block;
  text-decoration: none;
  color: var(--text);
  transition: color .15s;
}

.toc-list a:hover .toc-title { color: var(--accent); }

.toc-ch {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.toc-title {
  font-size: clamp(20px, 2.6vw, 24px);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 6px;
  transition: color .15s;
}

.toc-blurb {
  font-size: 15px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.55;
  max-width: 58ch;
}

.toc-list li.pending { opacity: .5; }
.toc-list li.pending .toc-title { color: var(--muted); }

/* Footer */
footer {
  padding: 48px 0 60px;
  margin-top: 48px;
  opacity: 0;
  animation: fadeIn .6s ease .8s forwards;
}

.footer-rule { height: 1px; background: var(--line); margin-bottom: 28px; }

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy { font-size: 13px; color: var(--muted); }

.footer-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color .15s;
}

.footer-link:hover { color: var(--accent); text-decoration: underline; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (max-width: 600px) {
  article { padding: 48px 0 24px; }
  article h2 { margin: 40px 0 16px; }
  .lift, .dialogue { padding: 16px 20px; }
}
