@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=EB+Garamond:ital,wght@0,400;0,500;1,400;1,500&display=swap');

:root {
  --bg-deep: #0a0a0f;
  --bg-page: #0e0e16;
  --bg-card: #13131f;
  --gold-bright: #d4a843;
  --gold-muted: #a8893a;
  --gold-pale: #c9b06b;
  --silver: #b0b8c8;
  --text-body: #c8c4bc;
  --text-muted: #8a8680;
  --text-light: #e8e4dc;
  --accent-blue: #3a5a8a;
  --accent-indigo: #2a2a5a;
  --accent-ember: #6a2a1a;
  --border-subtle: rgba(212, 168, 67, 0.12);
  --border-glow: rgba(212, 168, 67, 0.25);
  --shadow-deep: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 40px rgba(212, 168, 67, 0.06);
}

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

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

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(42, 42, 90, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(106, 42, 26, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.page-wrapper {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

/* Navigation */
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0 2rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 3rem;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-bar a {
  color: var(--gold-muted);
  text-decoration: none;
  transition: color 0.3s;
}

.nav-bar a:hover {
  color: var(--gold-bright);
}

.nav-home {
  color: var(--gold-pale) !important;
}

.nav-prev-next {
  display: flex;
  gap: 2rem;
}

/* Section & Chapter Headers */
.section-label {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold-muted);
  text-align: center;
  margin-bottom: 0.5rem;
}

.chapter-number {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 0.75rem;
}

h1 {
  font-family: 'Cinzel', serif;
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--gold-bright);
  text-align: center;
  line-height: 1.25;
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
}

h1.book-title {
  font-size: 3rem;
  margin-bottom: 0.3rem;
}

.subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-style: italic;
  font-weight: 300;
  color: var(--gold-pale);
  text-align: center;
  margin-bottom: 2rem;
  letter-spacing: 0.06em;
}

.essence {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--text-muted);
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3rem;
  line-height: 1.7;
}

/* Decorative dividers */
.divider {
  text-align: center;
  margin: 2.5rem 0;
  color: var(--gold-muted);
  font-size: 1.2rem;
  letter-spacing: 0.5em;
  opacity: 0.5;
}

.divider-ornate {
  text-align: center;
  margin: 3rem 0;
  position: relative;
}

.divider-ornate::before {
  content: '';
  display: block;
  width: 200px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-muted), transparent);
  margin: 0 auto 0.75rem;
}

.divider-ornate::after {
  content: '◆';
  color: var(--gold-muted);
  font-size: 0.6rem;
  opacity: 0.6;
}

/* Body text */
.chapter-body p {
  margin-bottom: 1.4rem;
  text-indent: 1.5rem;
}

.chapter-body p:first-of-type {
  text-indent: 0;
}

.chapter-body p:first-of-type::first-letter {
  font-family: 'Cinzel', serif;
  font-size: 3.5rem;
  float: left;
  line-height: 0.8;
  padding-right: 0.12em;
  padding-top: 0.08em;
  color: var(--gold-bright);
}

.no-dropcap p:first-of-type::first-letter {
  font-family: inherit;
  font-size: inherit;
  float: none;
  line-height: inherit;
  padding: 0;
  color: inherit;
}

/* Verse / poetry blocks */
.verse {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.08rem;
  color: var(--text-light);
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  border-left: 2px solid var(--border-glow);
  background: linear-gradient(135deg, rgba(212, 168, 67, 0.03), transparent);
  line-height: 2;
}

.verse p {
  text-indent: 0 !important;
  margin-bottom: 0.5rem;
}

.verse p:last-child {
  margin-bottom: 0;
}

/* Dialogue */
.dialogue {
  margin: 2rem 0;
  padding: 0 1rem;
}

.dialogue .speaker {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-muted);
  margin-bottom: 0.5rem;
}

.dialogue .speech {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-light);
  line-height: 1.9;
  padding-left: 1rem;
  border-left: 2px solid var(--border-glow);
}

.dialogue .speech p {
  text-indent: 0 !important;
  margin-bottom: 0.8rem;
}

/* Teaching / instruction blocks */
.teaching {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  padding: 2rem 2.2rem;
  margin: 2.5rem 0;
  box-shadow: var(--shadow-glow);
}

.teaching p {
  text-indent: 0 !important;
}

/* Table of Contents */
.toc {
  margin: 2rem 0;
}

.toc-section {
  margin-bottom: 2.5rem;
}

.toc-section-title {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.toc-chapter {
  display: block;
  padding: 0.6rem 0 0.6rem 1.5rem;
  color: var(--text-body);
  text-decoration: none;
  transition: all 0.3s;
  position: relative;
  font-size: 1.05rem;
}

.toc-chapter::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 1px;
  background: var(--gold-muted);
  opacity: 0.4;
  transition: all 0.3s;
}

.toc-chapter:hover {
  color: var(--gold-pale);
  padding-left: 2rem;
}

.toc-chapter:hover::before {
  width: 12px;
  opacity: 1;
  background: var(--gold-bright);
}

.toc-chapter .ch-num {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-right: 0.5rem;
  letter-spacing: 0.1em;
}

.toc-special {
  display: block;
  padding: 0.6rem 0 0.6rem 1.5rem;
  color: var(--gold-pale);
  text-decoration: none;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.05rem;
  transition: all 0.3s;
}

.toc-special:hover {
  color: var(--gold-bright);
  padding-left: 2rem;
}

/* Bottom navigation */
.bottom-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bottom-nav a {
  color: var(--gold-muted);
  text-decoration: none;
  transition: color 0.3s;
  max-width: 45%;
}

.bottom-nav a:hover {
  color: var(--gold-bright);
}

.bottom-nav .next {
  text-align: right;
  margin-left: auto;
}

/* Invocation / special pages */
.invocation-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  line-height: 2.1;
  color: var(--text-light);
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.invocation-text p {
  margin-bottom: 1.8rem;
  text-indent: 0;
}

/* Responsive */
@media (max-width: 768px) {
  html { font-size: 16px; }
  .page-wrapper { padding: 2rem 1.2rem 3rem; }
  h1 { font-size: 1.8rem; }
  h1.book-title { font-size: 2.2rem; }
  .verse { padding: 1rem 1.2rem; }
  .teaching { padding: 1.5rem; }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
  .page-wrapper { padding: 1.5rem 1rem 2.5rem; }
  h1 { font-size: 1.5rem; }
  h1.book-title { font-size: 1.8rem; }
  .nav-bar { font-size: 0.65rem; }
}

/* Print styles */
@media print {
  body { background: white; color: #1a1a1a; }
  body::before { display: none; }
  .nav-bar, .bottom-nav { display: none; }
  .page-wrapper { max-width: 100%; padding: 1cm; }
  h1 { color: #333; }
  .section-label, .chapter-number { color: #666; }
  .verse { border-left-color: #999; background: none; }
}
