/* ========================================================
   SACRED GEOMETRY BOOK PAGE
   Palette from the cover: deep navy, indigo, periwinkle, plant purple, ink black
   ======================================================== */
:root {
  --book-navy: #101830;
  --book-navy-deep: #0c1226;
  --book-indigo: #171d41;
  --book-mid: #4050a8;
  --book-periwinkle: #c8c8e8;
  --book-lavender: #d0d0e8;
  --book-purple: #a890d0;
  --book-ink: #100808;
  --book-paper: #f5f4fa;
  --book-muted: rgba(245, 244, 250, 0.78);
  --book-soft: rgba(200, 200, 232, 0.16);
}

body.book-page {
  background-color: var(--book-navy);
  background-image:
    radial-gradient(ellipse 80% 55% at 18% 30%, rgba(64, 80, 168, 0.38), transparent 58%),
    radial-gradient(ellipse 55% 45% at 88% 12%, rgba(168, 144, 208, 0.2), transparent 52%),
    radial-gradient(ellipse 60% 50% at 70% 85%, rgba(23, 29, 65, 0.9), transparent 60%),
    linear-gradient(165deg, #101830 0%, #171d41 48%, #1a1540 100%);
  background-attachment: fixed;
  color: var(--book-paper);
  min-height: 100vh;
}

body.book-page :focus-visible {
  outline: 2px solid var(--book-periwinkle);
  outline-offset: 3px;
}

.book-main {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 8rem 0 4.5rem;
}

/* ---- Hero ---- */
.book-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 380px);
  gap: 4rem 3.5rem;
  align-items: center;
  margin-bottom: 4.5rem;
}

.book-hero-copy {
  text-align: right;
}

.book-eyebrow {
  font-family: "Noto Naskh Arabic", "Noto Kufi Arabic", serif;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--book-periwinkle);
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

body.book-page .book-title {
  font-family: "Noto Kufi Arabic", "Noto Naskh Arabic", sans-serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 3.85rem);
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--book-paper);
  margin: 0 0 1rem;
}

body.book-page .book-subtitle {
  font-family: "Noto Naskh Arabic", serif;
  font-weight: 500;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.85;
  color: var(--book-lavender);
  margin: 0 0 1.1rem;
}

body.book-page .book-author {
  font-family: "Noto Naskh Arabic", serif;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--book-muted);
  margin: 0 0 0.85rem;
}

body.book-page .book-en-line {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--book-periwinkle);
  opacity: 0.9;
  margin: 0 0 2rem;
  text-align: inherit;
}

body.book-page .book-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  background: var(--book-paper);
  color: var(--book-navy);
  text-decoration: none;
  border-radius: 50px;
  padding: 1.05rem 2.1rem;
  border: 2px solid var(--book-paper);
  box-shadow: 0 18px 40px rgba(8, 10, 28, 0.35);
  transition: transform 0.35s var(--ease-cinematic), background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}

body.book-page .book-download span,
body.book-page .book-download .book-download-en {
  font-family: "Noto Kufi Arabic", "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: 0;
  color: inherit;
}

body.book-page .book-download .book-download-en {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  opacity: 0.82;
  padding-inline-start: 0.55rem;
  border-inline-start: 1px solid rgba(16, 24, 48, 0.25);
}

body.book-page .book-download:hover {
  background: var(--book-mid);
  border-color: var(--book-mid);
  color: var(--book-paper);
  transform: translateY(-3px);
  box-shadow: 0 22px 50px rgba(64, 80, 168, 0.4);
}

body.book-page .book-download:hover .book-download-en {
  border-inline-start-color: rgba(245, 244, 250, 0.3);
}

.book-cover-wrap {
  position: relative;
  justify-self: center;
}

.book-cover-wrap::before {
  content: "";
  position: absolute;
  inset: 8% -12% -10% -12%;
  background: radial-gradient(ellipse at center, rgba(64, 80, 168, 0.55), rgba(168, 144, 208, 0.12) 55%, transparent 70%);
  filter: blur(18px);
  z-index: 0;
  pointer-events: none;
}

.book-cover-frame {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 380px;
  overflow: hidden;
  isolation: isolate;
  background: #fff;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(245, 244, 250, 0.08);
}

.book-cover {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
}

/* Warm light leak over the illustration, kept off the title */
.book-cover-frame::after {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
  left: -50%;
  width: 200%;
  top: 18%;
  height: 95%;
  background:
    radial-gradient(ellipse 32% 50% at 28% 42%, rgba(255, 186, 130, 0.9), transparent 64%),
    radial-gradient(ellipse 38% 28% at 64% 60%, rgba(232, 140, 180, 0.55), transparent 62%),
    linear-gradient(118deg,
      transparent 30%,
      rgba(255, 210, 160, 0.05) 40%,
      rgba(255, 176, 130, 0.55) 49%,
      rgba(230, 130, 175, 0.38) 56%,
      transparent 70%);
  mix-blend-mode: screen;
  filter: blur(22px);
  opacity: 0.62;
  transform-origin: 50% 50%;
  animation: book-light-leak 8s ease-in-out infinite;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 16%, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 16%, #000 100%);
}

@keyframes book-light-leak {
  0%, 100% {
    transform: translate3d(-8%, 7%, 0) rotate(-10deg);
    opacity: 0.4;
  }
  50% {
    transform: translate3d(16%, -8%, 0) rotate(8deg);
    opacity: 0.7;
  }
}

@media (prefers-reduced-motion: reduce) {
  .book-cover-frame::after,
  .book-invite-cover-link::after {
    animation: none !important;
    transform: translate3d(4%, 0, 0) rotate(-4deg);
    opacity: 0.45;
  }
}

/* ---- Sections ---- */
.book-about,
.book-english {
  max-width: 760px;
  margin-inline: auto;
  margin-bottom: 4.25rem;
}

.book-chapters {
  max-width: 960px;
  margin-inline: auto;
  margin-bottom: 4.25rem;
}

body.book-page .book-section-title {
  font-family: "Noto Kufi Arabic", "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  letter-spacing: 0;
  color: var(--book-paper);
  margin: 0 0 1.4rem;
}

body.book-page .book-english .book-section-title {
  font-family: "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.02em;
}

.book-prose p,
.book-english p,
.chapter-list p {
  font-family: "Noto Naskh Arabic", serif;
  font-weight: 400;
  font-size: 1.18rem;
  line-height: 2.05;
  color: var(--book-paper);
  margin: 0 0 1.15rem;
}

.book-english p {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 300;
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--book-lavender);
}

.book-english p span[lang="ar"] {
  font-family: "Noto Naskh Arabic", serif;
  font-weight: 600;
  color: var(--book-paper);
}

/* ---- Chapters ---- */
.chapter-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.85rem 1rem;
  margin: 0;
  padding: 0;
}

.chapter-list li {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: var(--book-soft);
  border: 1px solid rgba(200, 200, 232, 0.14);
  border-radius: 16px;
  padding: 1rem 1.1rem;
}

.chapter-num {
  font-family: "Noto Kufi Arabic", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--book-purple);
  line-height: 1.6;
  min-width: 1.4rem;
  text-align: center;
}

body.book-page .chapter-list h3 {
  font-family: "Noto Kufi Arabic", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0;
  color: var(--book-paper);
  margin: 0 0 0.2rem;
}

body.book-page .chapter-list p {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--book-muted);
  margin: 0;
}

.book-cta {
  display: flex;
  justify-content: center;
  margin: 0 0 2rem;
}

/* Footer stays the light studio footer */
body.book-page footer {
  background: rgba(243, 239, 233, 0.96);
  color: var(--text-black);
}

@media (max-width: 900px) {
  .book-main {
    width: min(1120px, calc(100% - 1.75rem));
    padding-top: 7rem;
  }

  .book-hero {
    grid-template-columns: 1fr;
    gap: 2.25rem;
    margin-bottom: 3.5rem;
    text-align: center;
  }

  .chapter-list {
    grid-template-columns: 1fr;
  }

  .book-hero-copy {
    text-align: center;
    order: 2;
  }

  .book-cover-wrap {
    order: 1;
  }

  .book-cover-frame,
  .book-cover {
    max-width: 260px;
    margin: 0 auto;
  }

  body.book-page .book-en-line {
    text-align: center;
  }

  body.book-page .book-download {
    width: 100%;
    max-width: 22rem;
  }

  .book-hero-copy .book-download {
    margin-top: 0.25rem;
  }

  .book-about,
  .book-chapters,
  .book-english {
    margin-bottom: 3.25rem;
  }
}

@media (max-width: 480px) {
  body.book-page .book-title {
    font-size: 2.15rem;
  }

  .book-cover-frame,
  .book-cover {
    max-width: 230px;
  }

  .book-prose p {
    font-size: 1.08rem;
    line-height: 1.95;
  }
}

body.book-page footer::before {
  content: none;
}
