@import url('https://fonts.googleapis.com/css2?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&family=Cinzel:wght@400;500&display=swap');

/* ── Variables ── */
:root {
  --bg:       #0c0a08;
  --surface:  #151210;
  --border:   #2a2420;
  --ink:      #ede5d8;
  --muted:    #8a7d6e;
  --faint:    #3a332b;
  --gold:     #c9a96e;
  --gold-dim: #8a6e42;
  --serif:    'EB Garamond', Georgia, serif;
  --display:  'Cormorant Garamond', Georgia, serif;
  --caps:     'Cinzel', serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Grain overlay ── */
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: 999;
  opacity: 0.5;
}

/* ── Track line decoration ── */
.track-line {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3rem 0;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-family: var(--caps);
}
.track-line::before,
.track-line::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--faint), transparent);
}

/* ── Top nav ── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 3rem;
  background: linear-gradient(to bottom, var(--bg) 60%, transparent);
}

.nav-wordmark {
  font-family: var(--caps);
  font-size: 13px;
  letter-spacing: 0.25em;
  color: var(--gold);
  text-decoration: none;
  text-transform: uppercase;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-family: var(--caps);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--gold); }

/* ── Chapter hero ── */
.chapter-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 8vw 8vh;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 40%, #1f1608 0%, var(--bg) 65%);
}

.chapter-number {
  font-family: var(--caps);
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--gold-dim);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.2s forwards;
}

.chapter-title {
  font-family: var(--display);
  font-size: clamp(3.5rem, 9vw, 8rem);
  font-weight: 300;
  line-height: 1.05;
  color: var(--ink);
  letter-spacing: -0.01em;
  max-width: 14ch;
  opacity: 0;
  animation: fadeUp 0.9s 0.4s forwards;
}

.chapter-title em {
  font-style: italic;
  color: var(--gold);
}

.chapter-subtitle {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  font-style: italic;
  color: var(--muted);
  margin-top: 1.5rem;
  max-width: 55ch;
  opacity: 0;
  animation: fadeUp 0.9s 0.6s forwards;
}

/* ── Window motif ── */
.window-motif {
  position: absolute;
  right: 8vw; top: 50%; transform: translateY(-50%);
  width: min(380px, 38vw);
  aspect-ratio: 3/4;
  border: 1px solid var(--faint);
  border-radius: 80px 80px 0 0;
  opacity: 0;
  animation: fadeIn 1.2s 0.8s forwards;
  overflow: hidden;
}

.window-motif::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, #1e1a0e 0%, #0a0806 100%);
}

.window-motif::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  height: 1px;
  background: var(--faint);
}

.window-cross {
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 1px;
  background: var(--faint);
}

/* ── Main content ── */
.chapter-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 8rem 2rem 6rem;
}

.chapter-content p {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.9;
  color: #d8cfc2;
  margin-bottom: 1.8rem;
  opacity: 0;
  animation: fadeIn 0.7s forwards;
}

/* Staggered paragraph animations */
.chapter-content p:nth-child(1) { animation-delay: 0.1s; }
.chapter-content p:nth-child(2) { animation-delay: 0.2s; }
.chapter-content p:nth-child(3) { animation-delay: 0.3s; }
.chapter-content p:nth-child(4) { animation-delay: 0.4s; }
.chapter-content p:nth-child(5) { animation-delay: 0.5s; }
.chapter-content p:nth-child(n+6) { animation-delay: 0.6s; }

/* ── Pull quote ── */
.pull-quote {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-style: italic;
  font-weight: 300;
  line-height: 1.4;
  color: var(--gold);
  padding: 3rem 0 3rem 2.5rem;
  border-left: 1px solid var(--gold-dim);
  margin: 3.5rem 0;
}

/* ── Dialogue styling ── */
.chapter-content p strong {
  color: var(--gold);
  font-weight: 500;
}

/* ── Section break ── */
.scene-break {
  text-align: center;
  color: var(--gold-dim);
  margin: 3rem 0;
  font-size: 22px;
  letter-spacing: 0.5em;
}

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

.ch-nav-link {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ch-nav-label {
  font-family: var(--caps);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--muted);
  text-transform: uppercase;
}

.ch-nav-title {
  font-family: var(--display);
  font-size: 22px;
  font-style: italic;
  color: var(--gold);
  transition: color 0.2s;
}
.ch-nav-link:hover .ch-nav-title { color: var(--ink); }

.ch-nav-link.right { text-align: right; }

.ch-nav-home {
  font-family: var(--caps);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
  white-space: nowrap;
}
.ch-nav-home:hover { color: var(--gold); }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 3rem;
  border-top: 1px solid var(--faint);
  font-family: var(--caps);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--faint);
  text-transform: uppercase;
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .site-nav { padding: 1rem 1.5rem; }
  .nav-links { display: none; }
  .chapter-hero { padding: 0 6vw 10vh; }
  .window-motif { display: none; }
  .chapter-content { padding: 5rem 1.5rem 4rem; }
  .chapter-nav { flex-direction: column; align-items: flex-start; }
  .ch-nav-link.right { text-align: left; }
}
