:root {
  --bg: #14070b;
  --bg-soft: #251018;
  --paper: #f8ecd8;
  --paper-edge: #e4cda9;
  --ink: #2d1320;
  --ink-soft: rgba(45, 19, 32, 0.72);
  --gold: #d4a84f;
  --champagne: #f6d89a;
  --ruby: #8d1835;
  --rose: #d26579;
  --shadow: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Manrope', sans-serif;
  color: var(--paper);
  background:
    radial-gradient(circle at top, rgba(210, 101, 121, 0.12), transparent 25%),
    radial-gradient(circle at bottom left, rgba(212, 168, 79, 0.2), transparent 30%),
    linear-gradient(160deg, #090305 0%, var(--bg) 50%, #220914 100%);
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

.stage-glow {
  position: fixed;
  inset: auto;
  width: 24rem;
  height: 24rem;
  border-radius: 999px;
  filter: blur(45px);
  pointer-events: none;
  opacity: 0.55;
}

.stage-glow--left {
  top: 6rem;
  left: -8rem;
  background: rgba(141, 24, 53, 0.45);
}

.stage-glow--right {
  right: -6rem;
  bottom: 5rem;
  background: rgba(212, 168, 79, 0.28);
}

.hero {
  position: relative;
  padding: 4.5rem 6vw 2rem;
}

.hero__copy {
  max-width: 48rem;
  margin: 0 auto;
  text-align: center;
}

.hero__logo {
  width: min(75%, 28.5rem);
  height: auto;
  margin: 0.4rem auto 1.2rem;
  object-fit: contain;
  filter: drop-shadow(0 12px 35px rgba(0, 0, 0, 0.36));
}

.page__kicker,
.toc-panel__label,
.entry-tag,
.page-turn__note {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.page h2,
.page h3 {
  font-family: 'Cormorant Garamond', serif;
  line-height: 0.95;
  margin: 0;
}

.hero__lede {
  max-width: 42rem;
  font-size: 1.02rem;
  line-height: 1.8;
  color: rgba(248, 236, 216, 0.82);
}

.layout {
  display: grid;
  grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr);
  gap: 2rem;
  padding: 1rem 6vw 4rem;
  align-items: start;
}

.toc-panel {
  position: sticky;
  top: 1.5rem;
  padding: 1.35rem;
  border: 1px solid rgba(246, 216, 154, 0.12);
  border-radius: 1.5rem;
  background: rgba(19, 8, 12, 0.74);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.menu-header--sections {
  margin-top: 1.4rem;
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(45, 19, 32, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  font: inherit;
}

.menu-toggle__icon {
  display: grid;
  gap: 0.18rem;
}

.menu-toggle__icon span {
  display: block;
  width: 1rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.menu-toggle__text {
  font-size: 0.85rem;
  font-weight: 700;
}

.menu-toggle--sections {
  margin-bottom: 0.9rem;
}

.chapter-nav {
  display: grid;
  gap: 0.75rem;
}

.chapter-button,
.section-button {
  width: 100%;
  border: 0;
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.chapter-button {
  padding: 1rem 1.05rem;
  border-radius: 1rem;
  color: var(--paper);
  background: linear-gradient(135deg, rgba(141, 24, 53, 0.45), rgba(37, 16, 24, 0.8));
  border: 1px solid transparent;
}

.chapter-button strong,
.section-button strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 1rem;
}

.chapter-button span,
.section-button span,
.page__description,
.entry-copy p,
.section-subtitle {
  color: var(--ink-soft);
}

.chapter-button span {
  color: rgba(248, 236, 216, 0.74);
}

.chapter-button:hover,
.chapter-button.is-active,
.section-button:hover,
.section-button.is-active {
  transform: translateY(-2px);
}

.chapter-button.is-active {
  border-color: rgba(246, 216, 154, 0.45);
  background: linear-gradient(135deg, rgba(210, 101, 121, 0.55), rgba(73, 20, 33, 0.94));
}

.book-shell {
  perspective: 2200px;
}

.book-shadow {
  position: absolute;
  inset: auto 8% -1rem 8%;
  height: 2rem;
  background: rgba(0, 0, 0, 0.35);
  filter: blur(18px);
  border-radius: 999px;
}

.book {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 44rem;
  border-radius: 1.8rem;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.32);
  transform-style: preserve-3d;
}

.page {
  position: relative;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent),
    linear-gradient(180deg, #fff8ec 0%, var(--paper) 70%, #edd8b7 100%);
  color: var(--ink);
}

.page--left {
  border-right: 1px solid rgba(45, 19, 32, 0.08);
}

.page__inner {
  height: 100%;
  padding: 2.2rem;
}

.page h2 {
  font-size: clamp(2.5rem, 4vw, 4rem);
  margin-top: 0.2rem;
}

.page h3 {
  font-size: clamp(2.1rem, 3vw, 3.35rem);
  margin-top: 0.25rem;
}

.page__description {
  line-height: 1.8;
  margin-bottom: 1.4rem;
}

.section-list {
  display: grid;
  gap: 0.8rem;
}

.section-button {
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  background: rgba(45, 19, 32, 0.04);
  border: 1px solid rgba(45, 19, 32, 0.08);
}

.section-button.is-active {
  background: linear-gradient(135deg, rgba(212, 168, 79, 0.18), rgba(210, 101, 121, 0.16));
  border-color: rgba(141, 24, 53, 0.22);
}

.page--right {
  overflow: hidden;
}

.page-turn {
  position: relative;
  height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
}

.page-turn.is-turning {
  animation: turnPage 900ms cubic-bezier(0.7, 0.02, 0.2, 1);
}

.page-turn__front,
.page-turn__back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}

.page-turn__face {
  height: 100%;
  transition: opacity 120ms linear;
}

.page-turn__face.is-concealed {
  opacity: 0;
}

.page-turn__back {
  display: grid;
  place-items: center;
  transform: rotateY(180deg);
  color: rgba(45, 19, 32, 0.3);
  background: linear-gradient(180deg, #f6e3c0 0%, #ecd1a5 100%);
}

.section-subtitle {
  margin-top: 0.4rem;
  margin-bottom: 1.5rem;
}

.section-content {
  display: grid;
  gap: 1rem;
}

.entry-card {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.entry-figure {
  margin: 0;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid rgba(45, 19, 32, 0.08);
  background: linear-gradient(135deg, rgba(210, 101, 121, 0.12), rgba(212, 168, 79, 0.24));
}

.entry-copy {
  line-height: 1.8;
}

.entry-tag {
  margin: 0 0 0.55rem;
  color: var(--ruby);
  font-weight: 700;
}

@keyframes turnPage {
  0% {
    transform: rotateY(0deg);
  }

  48% {
    transform: rotateY(-96deg);
  }

  52% {
    transform: rotateY(96deg);
  }

  100% {
    transform: rotateY(0deg);
  }
}

@media (max-width: 1100px) {
  .hero {
    padding-inline: 5vw;
  }

  .layout {
    grid-template-columns: 1fr;
    padding-inline: 5vw;
  }

  .toc-panel {
    position: static;
  }

  .book {
    min-height: 0;
  }
}

@media (max-width: 820px) {
  .hero {
    padding: 2.8rem 1rem 1.35rem;
  }

  .hero__logo {
    width: min(75%, 21rem);
  }

  .hero__lede {
    font-size: 0.95rem;
    line-height: 1.65;
  }

  .layout {
    gap: 1.25rem;
    padding: 0.5rem 1rem 2.25rem;
  }

  .book {
    grid-template-columns: 1fr;
    border-radius: 1.25rem;
    overflow: visible;
  }

  .page--left {
    border-right: 0;
    border-bottom: 1px solid rgba(45, 19, 32, 0.08);
  }

  .page__inner {
    padding: 1.35rem;
  }

  .page--right {
    overflow: visible;
  }

  .page--right .page__inner {
    min-height: 0;
    display: block;
    height: auto;
  }

  .page-turn {
    height: auto;
    min-height: 0;
  }

  .page-turn__front,
  .page-turn__back {
    position: relative;
    inset: auto;
  }

  .page-turn__back {
    display: none;
  }

  .page-turn__face {
    height: auto;
    overflow: visible;
    max-height: none;
    padding-right: 0;
  }

  .section-content {
    overflow: visible;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .chapter-nav,
  .section-list {
    overflow: hidden;
    max-height: 1200px;
    transition: max-height 220ms ease, opacity 220ms ease, margin-top 220ms ease;
  }

  .chapter-nav.is-collapsed,
  .section-list.is-collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
  }

  .menu-header {
    margin-bottom: 0.7rem;
  }

  .menu-toggle--sections {
    display: inline-flex;
    margin-bottom: 0.85rem;
  }

  .chapter-button,
  .section-button {
    padding-inline: 0.9rem;
  }

  .entry-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .toc-panel {
    padding: 1rem;
    border-radius: 1rem;
  }

  .page h2 {
    font-size: clamp(2rem, 9vw, 2.7rem);
  }

  .page h3 {
    font-size: clamp(1.75rem, 8vw, 2.35rem);
  }

  .section-list,
  .chapter-nav {
    gap: 0.65rem;
  }

  .entry-copy {
    line-height: 1.65;
  }
}