/* ============================================
   CHAPTER PAGE STYLES
   ============================================ */

/* === Chapter Hero === */
.chapter-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.chapter-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.35) saturate(1.2);
  transform: scale(1.05);
  transition: transform 8s ease;
}

.chapter-hero:hover .chapter-hero-bg {
  transform: scale(1.1);
}

.chapter-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(10, 10, 26, 0.6) 60%,
    var(--color-bg) 100%
  );
  z-index: 1;
}

.chapter-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 40px 20px;
  max-width: 800px;
}

.chapter-number {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 8px;
  text-transform: uppercase;
  color: var(--color-accent);
  opacity: 0.7;
  margin-bottom: 15px;
  animation: fadeInUp 1s ease 0.3s both;
}

.chapter-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 40px rgba(0, 247, 255, 0.3), 0 0 80px rgba(0, 247, 255, 0.1);
  line-height: 1.15;
  margin-bottom: 20px;
  animation: fadeInUp 1s ease 0.6s both;
}

.chapter-epigraph {
  font-family: var(--font-story);
  font-style: italic;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 1px;
  line-height: 1.8;
  animation: fadeInUp 1s ease 0.9s both;
}

.chapter-scroll-hint {
  margin-top: 50px;
  animation: fadeInUp 1s ease 1.2s both;
}

.chapter-scroll-hint span {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 10px;
}

.chapter-scroll-hint .arrow-down {
  width: 20px;
  height: 20px;
  border-right: 1.5px solid rgba(0, 247, 255, 0.4);
  border-bottom: 1.5px solid rgba(0, 247, 255, 0.4);
  transform: rotate(45deg);
  margin: 0 auto;
  animation: float 3s ease-in-out infinite;
}

/* === Chapter Content === */
.chapter-content {
  max-width: 740px;
  margin: 0 auto;
  padding: 80px 24px 60px;
}

.chapter-body p {
  font-family: var(--font-story);
  font-size: 1.3rem;
  line-height: 2;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 32px;
  letter-spacing: 0.01em;
}

.chapter-body p:first-child::first-letter {
  font-family: var(--font-display);
  font-size: 4rem;
  float: left;
  line-height: 1;
  margin-right: 12px;
  margin-top: 6px;
  color: var(--color-accent);
  text-shadow: 0 0 20px rgba(0, 247, 255, 0.4);
}

.chapter-body .scene-image {
  width: 100%;
  border-radius: 20px;
  margin: 40px 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 247, 255, 0.08);
  transition: transform 0.6s ease, box-shadow 0.6s ease;
}

.chapter-body .scene-image:hover {
  transform: scale(1.02);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 247, 255, 0.15);
}

/* Section divider */
.section-divider {
  text-align: center;
  margin: 50px 0;
  color: var(--color-accent);
  opacity: 0.3;
  font-size: 1.5rem;
  letter-spacing: 10px;
}

/* Quote / pull-quote styling */
.chapter-quote {
  border-left: 2px solid var(--color-accent);
  padding: 20px 30px;
  margin: 40px 0;
  background: rgba(0, 247, 255, 0.03);
  border-radius: 0 12px 12px 0;
}

.chapter-quote p {
  font-family: var(--font-story);
  font-style: italic;
  font-size: 1.4rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.9;
  margin-bottom: 0;
}

/* === Chapter Navigation === */
.chapter-nav {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.chapter-nav a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  padding: 16px 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.4s ease;
  flex: 1;
  min-width: 0;
}

.chapter-nav a:hover {
  border-color: rgba(0, 247, 255, 0.3);
  background: rgba(0, 247, 255, 0.05);
  box-shadow: 0 5px 30px rgba(0, 247, 255, 0.1);
  transform: translateY(-2px);
}

.chapter-nav a .nav-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.chapter-nav a .nav-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--color-accent);
  letter-spacing: 1px;
}

.chapter-nav .nav-prev {
  text-align: left;
}

.chapter-nav .nav-next {
  text-align: right;
}

.chapter-nav .nav-back {
  text-align: center;
  align-items: center;
  justify-content: center;
  flex: 0.6;
}

.chapter-nav .nav-back .nav-title {
  color: rgba(255, 255, 255, 0.5);
}

.chapter-nav .nav-back:hover .nav-title {
  color: #fff;
}

/* === Top Bar nav === */
.chapter-topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(10, 10, 26, 0);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  transition: all 0.5s ease;
}

.chapter-topbar.scrolled {
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.topbar-home {
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.3s ease;
}

.topbar-home:hover {
  color: var(--color-accent);
}

.topbar-chapter {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.chapter-topbar.scrolled .topbar-chapter {
  opacity: 1;
}

.topbar-music {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.topbar-music:hover {
  background: rgba(0, 247, 255, 0.15);
  border-color: var(--color-accent);
}

/* === Chapter Footer === */
.chapter-footer {
  text-align: center;
  padding: 40px 20px 30px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.2);
}

.chapter-footer .footer-glow {
  width: 150px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-accent2), transparent);
  margin: 0 auto 20px;
  opacity: 0.3;
}

/* === Reading Progress for chapters === */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent2));
  box-shadow: 0 0 10px var(--color-accent);
  z-index: 10001;
  width: 0%;
  transition: width 0.05s linear;
}

/* === Chapter End Mark === */
.chapter-end-mark {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 6px;
  color: var(--color-accent);
  margin-top: 60px;
  opacity: 0.7;
  text-shadow: 0 0 20px rgba(0,247,255,0.4);
}

/* === Responsive === */
@media screen and (max-width: 768px) {
  .chapter-hero-content {
    padding: 30px 16px;
  }

  .chapter-title {
    font-size: 2rem;
  }

  .chapter-body p {
    font-size: 1.1rem;
    line-height: 1.85;
  }

  .chapter-body p:first-child::first-letter {
    font-size: 3rem;
  }

  .chapter-content {
    padding: 50px 18px 40px;
  }

  .chapter-nav {
    flex-direction: column;
  }

  .chapter-nav a {
    width: 100%;
  }

  .chapter-nav .nav-back {
    order: -1;
  }

  .chapter-quote p {
    font-size: 1.15rem;
  }
}
