:root {
  color-scheme: dark;
  --deep-space: #0f081b;
  --moon-purple: #5c2c84;
  --twilight-blue: #173567;
  --emerald: #46b787;
  --platinum: #edf0f7;
  --gold: #f6d489;
  --ruby: #d85a6a;
  --glass: rgba(14, 8, 26, 0.75);
  --glow: 0 0 25px rgba(196, 151, 255, 0.45);
  font-size: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.heir-page {
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  background:
    radial-gradient(circle at top, #3d1a5f, var(--deep-space) 60%),
    linear-gradient(145deg, #0d132b, #080a16 70%);
  color: var(--platinum);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.starfield span {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  animation:
    twinkle var(--twinkle-duration, 6s) infinite ease-in-out,
    drift var(--drift-duration, 30s) infinite linear;
  animation-delay: var(--twinkle-delay, 0s), var(--drift-delay, 0s);
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

@keyframes drift {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(var(--drift-x, 30px), var(--drift-y, -30px));
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(6, 3, 12, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
  will-change: transform;
}

.site-header.is-hidden {
  transform: translateY(-110%);
  opacity: 0;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 4.5vw;
  gap: 2rem;
}

.brand-logo {
  width: 140px;
}

.nav-links {
  display: flex;
  gap: 1.2rem;
  list-style: none;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a,
.nav-links button {
  color: var(--platinum);
  text-decoration: none;
  font-weight: 600;
  background: rgba(12, 8, 26, 0.55);
  border: 1px solid rgba(246, 212, 133, 0.35);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
}

.nav-links a:hover,
.nav-links button:hover {
  color: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.3);
}

.dropdown {
  position: relative;
}

.dropdown-toggle::after {
  content: "▾";
  font-size: 0.7em;
  opacity: 0.75;
  margin-left: 0.4rem;
  transition: transform 0.2s ease;
}

.dropdown.is-open .dropdown-toggle::after {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 120%;
  right: 0;
  background: rgba(12, 6, 26, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.75rem;
  min-width: 220px;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
}

.dropdown.is-open .dropdown-menu {
  display: flex;
}

.dropdown-link {
  color: var(--platinum);
  text-decoration: none;
  font-size: 0.9rem;
}

.dropdown-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(230, 233, 242, 0.6);
}

.dropdown-link.is-disabled {
  color: rgba(230, 233, 242, 0.3);
}

main {
  position: relative;
  z-index: 1;
}

.hero {
  padding: 6rem 6vw 4rem;
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: center;
  position: relative;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-cover {
  width: min(100%, 240px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.4);
}

.series-tag {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--gold);
}

.hero h1 {
  font-size: clamp(2.6rem, 5vw, 4.5rem);
  text-shadow: var(--glow);
}

.hero-copy {
  font-size: 1.1rem;
  line-height: 1.7;
  color: rgba(230, 233, 242, 0.88);
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.button {
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  background: linear-gradient(130deg, var(--moon-purple), var(--twilight-blue));
  color: white;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 0 18px rgba(125, 93, 194, 0.5);
}

.button.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.motifs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: rgba(230, 233, 242, 0.75);
}

.hero-card {
  background: var(--glass);
  padding: 2rem;
  border-radius: 22px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-card-body {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 240px);
  align-items: center;
}

.hero-card h2 {
  margin-bottom: 1rem;
}

.sigils {
  display: flex;
  gap: 0.5rem;
  color: var(--gold);
  font-size: 1.4rem;
  margin-top: 1rem;
}

.where-to-get {
  padding-top: 1rem;
}

.where-to-get-card {
  background: var(--glass);
  border-radius: 22px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.where-to-get-details {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rating {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  font-weight: 600;
}

.rating-stars {
  color: var(--gold);
  font-size: 1.1rem;
  letter-spacing: 0.15rem;
}

.rating-score {
  color: rgba(230, 233, 242, 0.8);
  font-size: 0.95rem;
}

.author-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(230, 233, 242, 0.9);
}

.question-hint {
  color: var(--gold);
  font-weight: 700;
  margin-top: 0.6rem;
}

.purchase-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}

.purchase-option {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(18, 18, 28, 0.6);
  color: rgba(230, 233, 242, 0.95);
  padding: 1.1rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  box-shadow: 0 0 18px rgba(51, 42, 94, 0.3);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.purchase-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 24px rgba(12, 10, 28, 0.4);
}

.purchase-option .format {
  font-weight: 700;
  font-size: 1rem;
}

.purchase-option .details {
  font-size: 0.9rem;
  color: rgba(230, 233, 242, 0.7);
}

.purchase-option .price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  margin-top: 0.35rem;
}

.price-note {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(246, 212, 133, 0.2);
  border: 1px solid rgba(246, 212, 133, 0.5);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.5rem;
}

.kindle-option .price-note {
  margin-left: 0;
  width: fit-content;
}

.retailer-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.45rem;
}

.retailer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(246, 212, 133, 0.55);
  background: rgba(246, 212, 133, 0.12);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.retailer-button:hover {
  background: rgba(246, 212, 133, 0.24);
  transform: translateY(-1px);
}

.moon-orbit {
  position: absolute;
  inset: auto 4vw 0 auto;
  width: 180px;
  height: 180px;
  pointer-events: none;
}

.moon-orbit--bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.moon {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, #f7f1ff, #9a7ee0 70%);
  box-shadow: 0 0 35px rgba(173, 136, 255, 0.6);
  animation: float 6s ease-in-out infinite;
}

.moon-orbit--bg .moon {
  opacity: 0.45;
  filter: blur(0.3px);
}

.moon-xl {
  width: 240px;
  height: 240px;
  top: 8%;
  left: 6%;
  animation-duration: 10s;
}

.moon-lg {
  width: 190px;
  height: 190px;
  top: 16%;
  right: 10%;
  animation-duration: 12s;
}

.moon-md {
  width: 150px;
  height: 150px;
  bottom: 18%;
  left: 18%;
  animation-duration: 11s;
}

.moon-sm {
  width: 110px;
  height: 110px;
  bottom: 22%;
  right: 22%;
  background: radial-gradient(circle, #f5f7ff, #6bb0ff 70%);
  animation-duration: 9s;
}

.moon-xs {
  width: 70px;
  height: 70px;
  top: 58%;
  right: 6%;
  background: radial-gradient(circle, #f5f7ff, #6bb0ff 70%);
  animation-duration: 8s;
}

.moon-glow {
  width: 210px;
  height: 210px;
  top: 45%;
  left: 55%;
  opacity: 0.3;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.9),
    rgba(154, 126, 224, 0.1) 70%
  );
  animation-duration: 14s;
}

.moon-large {
  width: 120px;
  height: 120px;
  top: 10px;
  right: 20px;
}

.moon-small {
  width: 55px;
  height: 55px;
  bottom: 10px;
  left: 15px;
  background: radial-gradient(circle, #f5f7ff, #6bb0ff 70%);
  animation-delay: 1.4s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-12px);
  }
}

.section {
  padding: 4rem 6vw;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.section-header h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.section-header p {
  max-width: 720px;
  line-height: 1.6;
  color: rgba(230, 233, 242, 0.8);
}

.lore-grid,
.portrait-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.lore-card,
.portrait-card,
.blurb-card,
.author-panel,
.spoiler-card {
  background: rgba(13, 8, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1.8rem;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.25);
}

.comments-feedback {
  display: grid;
  gap: 1rem;
}

.ask-question-button {
  justify-self: flex-start;
  font-size: 0.75rem;
  line-height: 1.2;
  min-height: unset;
  max-width: fit-content;
}

.answered-questions {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
}

.answered-questions h3 {
  margin: 0;
  font-size: 1.1rem;
}

.answered-questions__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}

.answered-question {
  border-radius: 16px;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(230, 233, 242, 0.15);
  background: rgba(13, 8, 26, 0.4);
}

.answered-question__question {
  margin: 0;
  font-weight: 600;
  font-size: 1rem;
}

.answered-question__meta {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  opacity: 0.75;
}

.answered-question__answer {
  margin: 0.6rem 0 0;
  color: rgba(230, 233, 242, 0.9);
}

.question-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
  z-index: 10;
}

.question-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.question-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 3, 12, 0.75);
  backdrop-filter: blur(4px);
}

.question-modal__content {
  position: relative;
  width: min(90vw, 540px);
  background: rgba(13, 8, 26, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 1.8rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  z-index: 1;
}

.question-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.question-modal__close {
  background: none;
  border: none;
  color: var(--platinum);
  font-size: 1.6rem;
  cursor: pointer;
}

.question-form {
  display: grid;
  gap: 1rem;
}

.question-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: rgba(230, 233, 242, 0.85);
}

.question-form input,
.question-form textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(9, 6, 18, 0.7);
  color: var(--platinum);
  font-family: inherit;
  font-size: 0.95rem;
}

.question-form textarea {
  resize: vertical;
  min-height: 120px;
}

.question-form .button {
  justify-self: flex-start;
}

.form-status {
  font-size: 0.95rem;
  color: var(--gold);
  min-height: 1.2em;
}

.lore-image {
  height: 160px;
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(92, 44, 132, 0.8),
    rgba(23, 119, 168, 0.8)
  );
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.lore-image::after {
  content: "";
  position: absolute;
  inset: 20% 15% 30% 20%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.lore-image.alt {
  background: linear-gradient(
    135deg,
    rgba(48, 136, 91, 0.8),
    rgba(210, 95, 106, 0.8)
  );
}

.lore-image.radiant {
  background: linear-gradient(
    135deg,
    rgba(91, 153, 203, 0.8),
    rgba(243, 200, 125, 0.7)
  );
}

.portrait {
  width: 100%;
  height: fit-content;
  border-radius: 18px;
  background: radial-gradient(
    circle at top,
    #e4d6ff,
    #5c2c84 60%,
    #20102f 100%
  );
  margin-bottom: 1rem;
  box-shadow: 0 0 18px rgba(122, 93, 194, 0.5);
  overflow: hidden;
}

.portrait img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.portrait.shadow {
  background: radial-gradient(
    circle at top,
    #b8c6ff,
    #2c1a4a 55%,
    #0d0916 100%
  );
}

.portrait.tide {
  background: radial-gradient(
    circle at top,
    #c4f5ea,
    #21558e 55%,
    #0b1535 100%
  );
}

.portrait-card h3 {
  margin-bottom: 0.4rem;
}

.portrait-card .role {
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.portrait-card ul {
  margin-top: 0.8rem;
  padding-left: 1.2rem;
  color: rgba(230, 233, 242, 0.75);
}

.blurb-card {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  line-height: 1.7;
}

.blurb-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--emerald);
}

.author-panel {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: 1fr;
}

.author-sigil {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold), rgba(92, 44, 132, 0.9));
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  color: #1b0f2b;
  box-shadow: 0 0 20px rgba(243, 200, 125, 0.5);
}

.section-header--author h2 {
  margin-bottom: 0.25rem;
}

.section-header--author p {
  color: rgba(230, 233, 242, 0.7);
  font-style: italic;
}

.author-name {
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
}

.author-intro {
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.author-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.author-contact {
  opacity: 0.85;
}

.author-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(230, 233, 242, 0.18);
  background: rgba(230, 233, 242, 0.08);
  color: #e6e9f2;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.author-contact-link:hover,
.author-contact-link:focus {
  transform: translateY(-1px);
  background: rgba(230, 233, 242, 0.14);
  border-color: rgba(230, 233, 242, 0.3);
}

.author-contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
}

.author-contact-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.author-contact-email {
  margin-bottom: 1.75rem;
}

.author-note {
  border-left: 3px solid rgba(230, 233, 242, 0.35);
  padding-left: 1rem;
  margin-top: 2rem;
  line-height: 1.75;
  font-size: 0.95rem;
  color: rgba(230, 233, 242, 0.8);
}

.author-note-title {
  display: block;
  margin-bottom: 0.5rem;
}

.spoiler {
  background: linear-gradient(180deg, rgba(92, 44, 132, 0.3), transparent);
}

.spoiler-card summary {
  cursor: pointer;
  font-weight: 600;
}

.chapter-excerpt {
  font-size: 1.02rem;
  line-height: 1.85;
  color: rgba(230, 233, 242, 0.9);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chapter-excerpt p + p {
  margin-top: 1.25rem;
  text-indent: 1.5rem;
}

.chapter-excerpt .chapter-title {
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.85rem;
  color: var(--gold);
  text-indent: 0;
}

.chapter-excerpt .chapter-break {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
  color: rgba(230, 233, 242, 0.7);
  letter-spacing: 0.2em;
}

.site-footer {
  display: none;
}

footer {
  background: #0f1d32;
  color: #ffffff;
  padding: 48px 24px 18px;
  position: relative;
  z-index: 1;
}

.footer-inner {
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 32px;
  align-items: start;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
}

.footer-logo {
  width: 120px;
  height: auto;
}

.footer-title {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.footer-links {
  list-style: none;
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 0;
}

.footer-inner a {
  color: rgba(255, 255, 255, 0.85);
}

.footer-inner a:hover,
.footer-inner a:focus {
  color: #ffffff;
}

.footer-bottom {
  max-width: 1180px;
  margin: 18px auto 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 12px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
}

@media (max-width: 720px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links,
  .dropdown,
  .dropdown-toggle {
    width: 100%;
  }

  .dropdown-toggle {
    text-align: left;
  }

  .dropdown-menu {
    position: static;
    right: auto;
    left: 0;
    min-width: 0;
    width: 100%;
    margin-top: 0.5rem;
    box-shadow: none;
  }

  .moon-orbit:not(.moon-orbit--bg) {
    display: none;
  }

  .hero-card-body {
    grid-template-columns: 1fr;
  }

  .spoiler-card {
    padding: 1.2rem;
  }

  .spoiler-card summary {
    font-size: 0.98rem;
    line-height: 1.5;
  }

  .chapter-excerpt {
    font-size: 0.98rem;
    line-height: 1.75;
  }

  .chapter-excerpt p + p {
    text-indent: 0;
    margin-top: 1rem;
  }

  .chapter-excerpt .chapter-title {
    letter-spacing: 0.12em;
  }

  .chapter-excerpt .chapter-break {
    margin: 1.4rem 0;
  }
}
