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

html {
  background: #05070c;
}

:root {
  --star-display-font: "Bank Gothic", "Copperplate Gothic Light", "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  --star-glow: 0 0 1px #ffffff, 0 0 5px rgba(0, 149, 255, 0.78), 0 0 10px rgba(0, 55, 255, 0.55);
  --star-glow-strong: 0 1px 0 #ffffff, 0 0 3px #ffffff, 0 0 9px rgba(0, 149, 255, 0.9), 0 0 16px rgba(0, 55, 255, 0.62);
}

body {
  margin: 0;
  min-height: 100%;
  padding-top: 70px;
  overflow-x: hidden;
  background: #05070c;
  color: #ffffff;
  font-family: "Muli", "Segoe UI", Arial, sans-serif;
}

.book-detail-page {
  min-height: calc(100vh - 70px);
  background:
    radial-gradient(circle at 18% 18%, rgba(106, 229, 255, 0.16), transparent 22rem),
    radial-gradient(circle at 82% 64%, rgba(169, 92, 255, 0.15), transparent 24rem),
    linear-gradient(rgba(3, 5, 10, 0.83), rgba(3, 5, 10, 0.95)),
    url("../img/space_bkg.svg") center top / cover fixed;
}

.detail-hero {
  position: relative;
  display: grid;
  min-height: 190px;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(111, 231, 255, 0.25);
  background:
    linear-gradient(90deg, rgba(2, 4, 9, 0.92), rgba(11, 22, 39, 0.66), rgba(2, 4, 9, 0.92)),
    linear-gradient(135deg, rgba(111, 231, 255, 0.2), transparent 40%),
    url("../img/space_bkg.svg") center / cover;
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4.5rem;
  background: linear-gradient(transparent, #05070c);
}

.detail-hero h1 {
  position: relative;
  z-index: 1;
  display: inline-block;
  width: min(100% - 2rem, 1100px);
  margin: 0;
  padding: 0 0.18em 0.08em;
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--star-display-font);
  font-size: clamp(2.25rem, 6vw, 4.8rem);
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  text-shadow: var(--star-glow-strong);
  text-transform: uppercase;
}

.detail-hero h1::after,
.reviews h2::after {
  content: "";
  display: block;
  height: 2px;
  margin: 0.1em auto 0;
  background: linear-gradient(90deg, transparent, #ff43d5 16%, #6fe7ff 50%, #ff43d5 84%, transparent);
  box-shadow: 0 0 8px rgba(111, 231, 255, 0.62);
}

.detail-hero h1::after {
  width: min(32rem, 70%);
}

.book-detail {
  width: min(100% - 2rem, 1080px);
  margin: 0 auto;
  padding: 4.5rem 0 2rem;
}

.book-detail__top {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.book-detail__cover {
  justify-self: center;
  width: min(100%, 350px);
}

.book-detail__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 1.5rem;
}

.book-detail__eyebrow {
  margin: 0 0 0.6rem;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--star-display-font);
  font-weight: 900;
  text-shadow: var(--star-glow);
  text-transform: uppercase;
}

.book-detail__copy p {
  margin: 0 0 1.25rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.55;
}

.book-detail__copy strong {
  color: #ffffff;
  font-weight: 800;
}

.excerpt-link {
  margin: 0.15rem 0 1.1rem;
  max-width: 100%;
}

body.excerpt-open {
  overflow: hidden;
}

.excerpt-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 2.5vw, 1.5rem);
  pointer-events: none;
  visibility: hidden;
}

.excerpt-modal.is-open {
  pointer-events: auto;
  visibility: visible;
}

.excerpt-modal__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at var(--excerpt-origin-x, 50%) var(--excerpt-origin-y, 50%), rgba(111, 231, 255, 0.16), transparent 18rem),
    rgba(1, 3, 8, 0.74);
  opacity: 0;
  transition: opacity 280ms ease;
}

.excerpt-modal.is-open .excerpt-modal__backdrop {
  opacity: 1;
}

.excerpt-modal__page {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 1040px);
  min-height: min(86vh, 820px);
  max-height: calc(100vh - clamp(1.5rem, 5vw, 3rem));
  padding: clamp(2rem, 5vw, 3.5rem);
  overflow: hidden;
  color: #f7fbff;
  background:
    linear-gradient(135deg, rgba(111, 231, 255, 0.16), transparent 32%),
    linear-gradient(315deg, rgba(255, 67, 213, 0.13), transparent 34%),
    linear-gradient(180deg, rgba(10, 22, 43, 0.96), rgba(3, 7, 18, 0.98));
  border: 1px solid rgba(111, 231, 255, 0.6);
  clip-path: polygon(1.1rem 0, 100% 0, 100% calc(100% - 1.1rem), calc(100% - 1.1rem) 100%, 0 100%, 0 1.1rem);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 2rem rgba(0, 149, 255, 0.14),
    0 2rem 5rem rgba(0, 0, 0, 0.58),
    0 0 2.3rem rgba(111, 231, 255, 0.28);
  transform: translate(
      calc(var(--excerpt-origin-x, 50vw) - 50vw),
      calc(var(--excerpt-origin-y, 50vh) - 50vh)
    )
    scale(0.16)
    rotateX(18deg)
    rotateZ(-4deg);
  transform-origin: center;
  opacity: 0;
  transition: transform 420ms cubic-bezier(0.2, 0.86, 0.28, 1.08), opacity 240ms ease;
}

.excerpt-modal.is-open .excerpt-modal__page {
  transform: translate(0, 0) scale(1) rotateX(0) rotateZ(0);
  opacity: 1;
}

.excerpt-modal__page::before,
.excerpt-modal__page::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.excerpt-modal__page::before {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(111, 231, 255, 0.18), transparent 12%, transparent 88%, rgba(255, 67, 213, 0.12)),
    repeating-linear-gradient(0deg, rgba(111, 231, 255, 0.045) 0 1px, transparent 1px 2.1rem);
}

.excerpt-modal__page::after {
  inset: 0.75rem;
  border-top: 1px solid rgba(111, 231, 255, 0.56);
  border-bottom: 1px solid rgba(255, 67, 213, 0.42);
  clip-path: polygon(0.65rem 0, 100% 0, 100% 100%, 0 100%, 0 0.65rem);
  box-shadow: inset 0 0 1.4rem rgba(0, 149, 255, 0.11);
}

.excerpt-modal__close {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  padding: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  border: 0;
  background: transparent;
}

.excerpt-modal__close,
.excerpt-modal__label,
.excerpt-modal__page h2,
.excerpt-modal__copy {
  position: relative;
  z-index: 1;
}

.excerpt-modal__close:hover,
.excerpt-modal__close:focus {
  color: #ffffff;
  text-shadow: var(--star-glow);
  outline: none;
}

.excerpt-modal__label {
  margin: 0 0 0.55rem;
  color: rgba(111, 231, 255, 0.92);
  font-family: var(--star-display-font);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.excerpt-modal__page h2 {
  flex: 0 0 auto;
  margin: 0 0 1.35rem;
  color: rgba(255, 255, 255, 0.96);
  font-family: var(--star-display-font);
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.04;
  text-shadow: var(--star-glow-strong);
  text-transform: uppercase;
}

.excerpt-modal__copy {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.75rem;
  scrollbar-color: rgba(111, 231, 255, 0.75) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.excerpt-modal__copy::-webkit-scrollbar {
  width: 0.45rem;
}

.excerpt-modal__copy::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

.excerpt-modal__copy::-webkit-scrollbar-thumb {
  background: rgba(111, 231, 255, 0.75);
}

.excerpt-modal__copy p {
  margin: 0 0 1.1rem;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1.02rem, 2vw, 1.16rem);
  font-weight: 400;
  line-height: 1.68;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.72), 0 0 5px rgba(113, 190, 255, 0.16);
}

.excerpt-modal__copy h3 {
  margin: 1.5rem 0 1rem;
  color: rgba(255, 255, 255, 0.96);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.4;
}

.excerpt-modal__copy .excerpt-scene-break {
  text-align: center;
  margin: 1.5em 0;
}

.excerpt-modal__copy .excerpt-page-label,
.excerpt-modal__copy .excerpt-source-range {
  font-size: 0.85em;
  opacity: 0.75;
}

.excerpt-modal__copy .excerpt-page-label {
  text-align: right;
  border-top: 1px solid currentColor;
  padding-top: 0.7em;
  margin-top: 1.5em;
}

.excerpt-download {
  margin: 0 0 1.1rem;
  max-width: 100%;
}

.excerpt-modal__copy h3:first-child {
  margin-top: 0;
}

.book-actions {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.excerpt-link,
.primary-action,
.secondary-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0 1.5rem;
  overflow: hidden;
  border: 1px solid rgba(111, 231, 255, 0.82);
  background:
    linear-gradient(90deg, rgba(255, 67, 213, 0.22), transparent 18%, transparent 82%, rgba(111, 231, 255, 0.28)),
    linear-gradient(180deg, rgba(11, 28, 55, 0.98), rgba(5, 8, 19, 0.98));
  clip-path: polygon(0.8rem 0, 100% 0, 100% calc(100% - 0.8rem), calc(100% - 0.8rem) 100%, 0 100%, 0 0.8rem);
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--star-display-font);
  font-size: 1rem;
  font-weight: 900;
  text-decoration: none;
  text-shadow: var(--star-glow);
  text-transform: uppercase;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    inset 0 0 1.15rem rgba(0, 149, 255, 0.2),
    0 0 0.85rem rgba(0, 149, 255, 0.32);
  transition: color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.primary-action {
  min-width: 18rem;
}

.excerpt-link,
.secondary-action {
  min-width: 12.5rem;
}

.excerpt-link::before,
.primary-action::before,
.secondary-action::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 0 35%, rgba(255, 255, 255, 0.5) 47%, transparent 60% 100%);
  transform: translateX(-120%);
  transition: transform 320ms ease;
}

.excerpt-link::after,
.primary-action::after,
.secondary-action::after {
  content: "";
  position: absolute;
  inset: 0.35rem;
  border-top: 1px solid rgba(111, 231, 255, 0.55);
  border-bottom: 1px solid rgba(255, 67, 213, 0.45);
  clip-path: polygon(0.45rem 0, 100% 0, 100% 100%, 0 100%, 0 0.45rem);
  pointer-events: none;
}

.excerpt-link:hover,
.primary-action:hover,
.excerpt-link:focus,
.primary-action:focus,
.secondary-action:hover,
.secondary-action:focus {
  border-color: #ff43d5;
  color: #ffffff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    inset 0 0 1.2rem rgba(255, 67, 213, 0.28),
    0 0 0.9rem rgba(255, 67, 213, 0.45),
    0 0 1.6rem rgba(0, 149, 255, 0.36);
  transform: translateY(-2px);
}

.excerpt-link:hover::before,
.primary-action:hover::before,
.excerpt-link:focus::before,
.primary-action:focus::before,
.secondary-action:hover::before,
.secondary-action:focus::before {
  transform: translateX(120%);
}

.reviews {
  padding: 5rem 0 1rem;
  text-align: center;
}

.reviews__label {
  margin: 0 0 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--star-display-font);
  font-size: 1rem;
  font-weight: 900;
  text-shadow: var(--star-glow);
  text-transform: uppercase;
}

.reviews h2 {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  display: inline-block;
  font-family: var(--star-display-font);
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.08;
  text-transform: uppercase;
  text-shadow: var(--star-glow-strong);
}

.reviews h2::after {
  width: min(28rem, 68%);
}

.review-carousel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  align-items: center;
  margin-top: 2.75rem;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem;
}

.review {
  display: none;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
}

.review.is-active {
  display: block;
}

.review blockquote {
  margin: 0;
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 700;
  line-height: 1.55;
}

.review figcaption {
  margin-top: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--star-display-font);
  font-weight: 900;
  text-shadow: var(--star-glow);
}

.review-control {
  position: relative;
  display: inline-grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  padding: 0;
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--star-display-font);
  font-size: 2rem;
  line-height: 1;
  text-shadow: var(--star-glow);
  cursor: pointer;
  border: 1px solid rgba(111, 231, 255, 0.68);
  background:
    linear-gradient(90deg, rgba(255, 67, 213, 0.18), transparent 78%, rgba(111, 231, 255, 0.24)),
    linear-gradient(180deg, rgba(11, 28, 55, 0.86), rgba(5, 8, 19, 0.94));
  clip-path: polygon(0.6rem 0, 100% 0, 100% calc(100% - 0.6rem), calc(100% - 0.6rem) 100%, 0 100%, 0 0.6rem);
  box-shadow: inset 0 0 0.85rem rgba(0, 149, 255, 0.16), 0 0 0.7rem rgba(0, 149, 255, 0.24);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.review-control:hover,
.review-control:focus {
  border-color: #ff43d5;
  box-shadow: inset 0 0 0.9rem rgba(255, 67, 213, 0.22), 0 0 0.9rem rgba(255, 67, 213, 0.38);
  transform: translateY(-2px);
}

.cta-section {
  padding: 4rem 1rem;
  text-align: center;
  background:
    linear-gradient(90deg, rgba(5, 7, 12, 0.96), rgba(12, 22, 41, 0.84), rgba(5, 7, 12, 0.96)),
    url("../img/lunar-stars.svg") center / cover;
  border-top: 1px solid rgba(111, 231, 255, 0.25);
}

.cta-section h3 {
  margin: 0 0 1.25rem;
  color: #ffffff;
  font-family: var(--star-display-font);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  text-shadow: var(--star-glow-strong);
  text-transform: uppercase;
}

.cta-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 9rem;
  min-height: 3rem;
  padding: 0 1.5rem;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--star-display-font);
  font-weight: 900;
  text-decoration: none;
  text-shadow: var(--star-glow);
  text-transform: uppercase;
  border: 1px solid rgba(111, 231, 255, 0.82);
  background:
    linear-gradient(90deg, rgba(255, 67, 213, 0.22), transparent 18%, transparent 82%, rgba(111, 231, 255, 0.28)),
    linear-gradient(180deg, rgba(11, 28, 55, 0.98), rgba(5, 8, 19, 0.98));
  clip-path: polygon(0.75rem 0, 100% 0, 100% calc(100% - 0.75rem), calc(100% - 0.75rem) 100%, 0 100%, 0 0.75rem);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), inset 0 0 1.15rem rgba(0, 149, 255, 0.2), 0 0 0.85rem rgba(0, 149, 255, 0.32);
}

.cta-link:hover,
.cta-link:focus {
  border-color: #ff43d5;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), inset 0 0 1.2rem rgba(255, 67, 213, 0.28), 0 0 0.9rem rgba(255, 67, 213, 0.45), 0 0 1.6rem rgba(0, 149, 255, 0.36);
}

.book-cover--large {
  width: 100%;
  max-width: 350px;
}

@media screen and (max-width: 780px) {
  body {
    padding-top: 62px;
  }

  .book-detail {
    padding-top: 3rem;
  }

  .book-detail__top {
    grid-template-columns: 1fr;
  }

  .review-carousel {
    grid-template-columns: 1fr;
  }

  .review-grid {
    grid-template-columns: 1fr;
  }

  .review-control {
    justify-self: center;
  }

  .book-detail__copy {
    align-items: center;
    padding-top: 0;
    text-align: center;
  }

  .book-actions {
    justify-content: center;
  }

  .excerpt-modal__page {
    width: 100%;
    min-height: 100vh;
    max-height: 100vh;
    padding: 4.5rem 1.25rem 2rem;
    clip-path: none;
    border-right: 0;
    border-left: 0;
  }

  .excerpt-modal {
    padding: 0;
  }

  .excerpt-modal__close {
    position: fixed;
    top: 0.85rem;
    right: 1rem;
  }
}
