/* chapter.css — shared reading styles for The Ashlight Accords
   Place at /srv/totemicworld/site/stories/chapter.css
   Referenced by every chapter file produced by parse_chapters.py
*/

:root {
  --ink:       #0e0d0b;
  --parchment: #e8dcc8;
  --ember:     #c8621a;
  --ash:       #7a6e62;
  --smoke:     #1a1814;
  --gold:      #b8882a;
  --dim:       #2a2420;
  --flame:     #e07830;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--parchment);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 19px;
  line-height: 1.6;
  min-height: 100vh;
}

/* Grain */
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='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  opacity: 0.4;
}

/* ── Site nav ── */
.site-nav {
  border-bottom: 1px solid var(--dim);
  padding: 1.1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav a {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ash);
  text-decoration: none;
  transition: color 0.2s;
}

.site-nav a:hover { color: var(--flame); }

.site-nav .brand {
  font-family: 'GFS Didot', Georgia, serif;
  font-size: 1rem;
  letter-spacing: 0.05em;
  color: var(--parchment);
  text-decoration: none;
}

/* ── Chapter header ── */
.chapter-header {
  max-width: 68ch;
  margin: 0 auto;
  padding: 5rem 2rem 3rem;
  border-bottom: 1px solid var(--dim);
}

.chapter-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.63rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--flame);
  display: block;
  margin-bottom: 0.9rem;
  opacity: 0.8;
}

.chapter-title {
  font-family: 'GFS Didot', Georgia, serif;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.1;
  color: var(--parchment);
}

.chapter-title em { font-style: italic; }

/* ── Body text ── */
.chapter-body {
  max-width: 68ch;
  margin: 0 auto;
  padding: 3.5rem 2rem 5rem;
}

.chapter-body p {
  font-size: 1.05rem;
  font-weight: 300;
  font-style: normal;
  color: rgba(232,220,200,0.88);
  line-height: 1.95;
  margin-bottom: 1.4em;
}

/* Drop cap on the opening paragraph */
.chapter-body p:first-of-type::first-letter {
  font-family: 'GFS Didot', Georgia, serif;
  font-size: 3.8em;
  float: left;
  line-height: 0.78;
  margin-right: 0.08em;
  margin-top: 0.1em;
  color: var(--flame);
}

/* Italics / internal monologue */
.chapter-body em {
  font-style: italic;
  color: rgba(232,220,200,0.6);
}

/* Bold / in-world text (plaques, notices, letters) */
.chapter-body strong {
  font-weight: 600;
  color: rgba(232,220,200,1);
  letter-spacing: 0.02em;
}

/* Section break marker */
.chapter-body .break {
  display: block;
  text-align: center;
  color: var(--dim);
  font-size: 1rem;
  letter-spacing: 0.5em;
  margin: 2.5rem 0;
  user-select: none;
}

/* ── Chapter nav ── */
.chapter-nav {
  max-width: 68ch;
  margin: 0 auto;
  padding: 2rem 2rem 5rem;
  border-top: 1px solid var(--dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.chapter-nav a {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ash);
  text-decoration: none;
  transition: color 0.2s;
}

.chapter-nav a:hover { color: var(--flame); }

.chapter-nav .index-link {
  color: var(--dim);
  font-size: 0.6rem;
}

.chapter-nav .index-link:hover { color: var(--ash); }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--dim);
  padding: 2rem;
  text-align: center;
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ash);
}
