.chapter-reader {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 58% 24rem at 50% 0%, rgba(55, 165, 200, 0.035), transparent 78%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 58%, #010409 100%);
}

.chapter-reader::before,
.chapter-reader::after,
.chapter-reader .ambient-glow,
.chapter-reader .scanlines {
  display: none;
}

.chapter-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  height: 3px;
  background: rgba(127, 234, 255, 0.08);
}

.chapter-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--copper-bright));
  box-shadow: 0 0 10px rgba(127, 234, 255, 0.55);
}

.chapter-reader-header {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 12px;
}

.chapter-back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid rgba(127, 234, 255, 0.42);
  background: rgba(3, 12, 20, 0.86);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  color: #e5f9fc;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.chapter-back-link:hover,
.chapter-back-link:focus-visible {
  border-color: var(--copper-bright);
  box-shadow: 0 0 20px rgba(127, 234, 255, 0.16);
}

.chapter-back-link:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

.chapter-reader-main {
  position: relative;
  z-index: 1;
  padding: clamp(42px, 8vw, 90px) 20px clamp(80px, 12vw, 150px);
}

.chapter-document {
  width: min(780px, 100%);
  margin: 0 auto;
}

.chapter-heading {
  margin-bottom: clamp(48px, 8vw, 78px);
  padding-bottom: clamp(32px, 5vw, 48px);
  border-bottom: 1px solid rgba(127, 234, 255, 0.22);
  text-align: center;
}

.chapter-heading p {
  margin: 0;
  font-family: "Cascadia Mono", Consolas, monospace;
  letter-spacing: 0.15em;
}

.chapter-saga {
  color: var(--cyan);
  font-size: clamp(0.72rem, 2vw, 0.86rem);
  font-weight: 700;
}

.chapter-book {
  margin-top: 8px !important;
  color: var(--copper-bright);
  font-size: clamp(0.67rem, 1.8vw, 0.78rem);
}

.chapter-number {
  margin-top: clamp(34px, 6vw, 54px) !important;
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 700;
}

.chapter-heading h1 {
  margin: 16px auto 0;
  color: #f1f8fa;
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: clamp(2rem, 6vw, 3.65rem);
  font-weight: 400;
  line-height: 1.08;
  text-wrap: balance;
}

.chapter-text {
  color: #d9e5e8;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.73;
}

.chapter-text p {
  margin: 0 0 1.35em;
}

.chapter-epigraph {
  margin: 0 auto clamp(52px, 9vw, 82px);
  padding: 0 clamp(10px, 5vw, 40px);
  color: #c9d8dc;
  font-style: normal;
  line-height: 1.6;
  text-align: center;
}

.chapter-ending {
  margin-top: clamp(72px, 12vw, 120px);
  padding-top: clamp(38px, 7vw, 58px);
  border-top: 1px solid rgba(127, 234, 255, 0.22);
  text-align: center;
}

.chapter-end-marker {
  margin: 0;
  color: var(--copper-bright);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.chapter-ending-question {
  margin: 28px auto 20px;
  color: #e5eff1;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.3rem, 3vw, 1.65rem);
  line-height: 1.45;
}

.chapter-news-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 13px 24px;
  border: 1px solid var(--copper-bright);
  background: linear-gradient(135deg, #b7784f, #74513e);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32), 0 0 20px rgba(202, 160, 111, 0.16);
  color: #fff;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.chapter-news-button:hover,
.chapter-news-button:focus-visible {
  filter: brightness(1.12);
}

.chapter-news-button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

.chapter-back-link-bottom {
  width: fit-content;
  margin: 34px auto 0;
}

.chapter-copyright {
  margin: 32px 0 0;
  color: #8da0a6;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.72rem;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .chapter-reader-header {
    width: calc(100% - 28px);
    padding-top: 18px;
  }

  .chapter-back-link {
    width: 100%;
    justify-content: center;
  }

  .chapter-reader-main {
    padding-right: 22px;
    padding-left: 22px;
  }

  .chapter-text {
    font-size: 1.12rem;
    line-height: 1.72;
  }

  .chapter-back-link-bottom {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
