:root {
  --ink: #0e0e10;
  --ash: #18181b;
  --ash-2: #202024;
  --paper: #e8e4dc;
  --paper-dim: #b9b5ac;
  --ember: #8a3324;
  --ember-bright: #b8492f;
  --smoke: #6b6b6f;
  --frost: #33383e;
  --frost-soft: #24272b;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  background: var(--ink);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Landing page ---------- */

.landing {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero {
  width: 100%;
  max-width: 760px;
  padding: 14vh 24px 8vh;
  text-align: center;
  position: relative;
}

.hero::after {
  content: '';
  display: block;
  width: 1px;
  height: 64px;
  margin: 40px auto 0;
  background: linear-gradient(to bottom, var(--ember) 0%, transparent 100%);
  opacity: 0.7;
}

.kicker {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--smoke);
  margin: 0 0 22px;
}

.title {
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  font-weight: 400;
  line-height: 1.08;
  margin: 0;
  color: var(--paper);
  letter-spacing: 0.01em;
}

.byline {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--smoke);
  margin: 22px 0 0;
  text-transform: uppercase;
}

.note {
  max-width: 480px;
  margin: 36px auto 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--paper-dim);
  font-style: italic;
}

/* ---------- Chapter list (signature element) ---------- */

.toc {
  width: 100%;
  max-width: 780px;
  padding: 4vh 24px 14vh;
}

.toc-label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--smoke);
  border-bottom: 1px solid var(--frost);
  padding-bottom: 14px;
  margin-bottom: 6px;
}

.chapter-row {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 22px 4px;
  border-bottom: 1px solid var(--frost-soft);
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease;
}

.chapter-row:hover {
  border-color: var(--frost);
}

.chapter-row:hover .ghost-num {
  color: var(--ember);
  opacity: 0.5;
}

.chapter-row:hover .chapter-preview {
  color: var(--paper);
}

.ghost-num {
  font-size: clamp(2.6rem, 6vw, 3.6rem);
  font-weight: 400;
  color: var(--smoke);
  opacity: 0.85;
  line-height: 1;
  min-width: 64px;
  flex-shrink: 0;
  transition: color 0.25s ease, opacity 0.25s ease;
  font-variant-numeric: oldstyle-nums;
}

.chapter-meta {
  flex: 1;
  min-width: 0;
}

.chapter-title {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--smoke);
  margin: 0 0 8px;
}

.chapter-preview {
  font-size: 16px;
  line-height: 1.5;
  color: var(--paper-dim);
  margin: 0;
  transition: color 0.25s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.chapter-words {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--smoke);
  flex-shrink: 0;
  align-self: center;
  min-width: 60px;
  text-align: right;
}

.footer-note {
  text-align: center;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--frost);
  padding: 0 24px 8vh;
  letter-spacing: 0.04em;
}

/* ---------- Chapter reading page ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(14, 14, 16, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--frost-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  font-family: var(--sans);
}

.topbar a.home-link {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--smoke);
}

.topbar a.home-link:hover { color: var(--paper); }

.topbar .progress {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--smoke);
}

.chapter-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 8vh 24px 12vh;
}

.chapter-heading {
  text-align: center;
  margin-bottom: 8vh;
}

.chapter-heading .num {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ember-bright);
  display: block;
  margin-bottom: 14px;
}

.chapter-heading h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 400;
  margin: 0;
  color: var(--paper);
}

.prose {
  font-size: 19px;
  line-height: 1.5;
  color: var(--paper);
}

.prose p {
  margin: 0;
  text-indent: 1.6em;
}

.prose p:first-of-type,
.prose .scene-break + p {
  text-indent: 0;
}

.scene-break {
  text-align: center;
  color: var(--smoke);
  letter-spacing: 0.4em;
  margin: 2.6em 0;
  font-size: 14px;
}

.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10vh;
  padding-top: 4vh;
  border-top: 1px solid var(--frost-soft);
  font-family: var(--sans);
}

.chapter-nav a, .chapter-nav span.disabled {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--paper-dim);
  padding: 10px 4px;
}

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

.chapter-nav span.disabled {
  color: var(--frost);
}

.chapter-nav .center-link {
  font-size: 11px;
  color: var(--smoke);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.chapter-nav .center-link:hover { color: var(--paper); }

@media (max-width: 600px) {
  .prose { font-size: 18px; line-height: 1.5; }
  .chapter-row { gap: 14px; padding: 18px 2px; }
  .ghost-num { min-width: 48px; font-size: 2.2rem; }
  .chapter-words { display: none; }
}