:root {
  color-scheme: dark;
  --gold: #efd28a;
  --gold-bright: #fff0b6;
  --deep-red: #2b0d0a;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: #fff2c5;
  background: #100906;
  font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", "STSong", serif;
}

a {
  font: inherit;
}

.genealogy-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.genealogy-stage {
  position: relative;
  container-type: size;
  width: min(100vw, 150vh);
  min-height: min(100vh, 66.666vw);
  aspect-ratio: 3 / 2;
  overflow: hidden;
  isolation: isolate;
  background: #160b08;
  box-shadow:
    0 0 0 1px rgba(255, 222, 147, 0.1),
    0 28px 96px rgba(0, 0, 0, 0.58);
}

.genealogy-bg {
  position: absolute;
  inset: 0;
  z-index: -6;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.mobile-fixed-ancestral-overlay {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: inset(45% 0 0);
  pointer-events: none;
  user-select: none;
}

.ancestral-tablets {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.top-tablet-platform {
  position: absolute;
  left: 37%;
  top: 61.3%;
  z-index: 0;
  width: 26%;
  height: auto;
  filter: drop-shadow(0 5px 5px rgba(20, 7, 3, 0.5));
  user-select: none;
}

.ancestor-tablet {
  position: absolute;
  left: var(--tablet-left);
  width: 3.7%;
  transform: translateX(-50%);
  filter:
    drop-shadow(0 5px 4px rgba(19, 7, 3, 0.72))
    drop-shadow(0 0 5px rgba(240, 178, 62, 0.2));
  user-select: none;
}

.ancestor-tablet-image {
  display: block;
  width: 100%;
  height: auto;
}

.ancestor-tablet-name {
  position: absolute;
  left: 50%;
  top: 22.5%;
  height: 54%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f2cb72;
  font-family: "LiSu", "隶书", "FZLiShu-S01T", "DFLiShu-Bd-BF", serif;
  font-size: clamp(0.52rem, 1.08cqw, 1.04rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
  text-orientation: upright;
  white-space: nowrap;
  -webkit-text-stroke: 0.25px rgba(91, 35, 14, 0.74);
  text-shadow:
    0 1px rgba(255, 247, 206, 0.78),
    0 2px 2px rgba(54, 13, 7, 0.82),
    0 0 7px rgba(255, 194, 74, 0.32);
  transform: translateX(-50%) scaleY(1.08);
}

.tablet-top {
  top: 49.8%;
  z-index: 1;
}

.tablet-middle {
  top: 55.4%;
  z-index: 2;
}

.tablet-front {
  top: 60.9%;
  z-index: 3;
}

.top-veil,
.hall-glow,
.floor-haze,
.floating-clouds {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.top-veil {
  z-index: -2;
  background: linear-gradient(180deg, rgba(5, 3, 2, 0.8) 0%, rgba(12, 6, 4, 0.3) 9%, transparent 18%);
}

.hall-glow {
  z-index: 2;
  opacity: 0.32;
  background: radial-gradient(ellipse at 50% 53%, rgba(255, 210, 118, 0.18), transparent 37%);
  mix-blend-mode: screen;
}

.floor-haze {
  left: -28%;
  width: 158%;
  height: 15%;
  z-index: 12;
  opacity: 0.055;
  filter: blur(20px);
  mix-blend-mode: screen;
  background:
    radial-gradient(ellipse at 15% 52%, rgba(255, 244, 221, 0.48), transparent 41%),
    radial-gradient(ellipse at 46% 55%, rgba(239, 225, 198, 0.4), transparent 44%),
    radial-gradient(ellipse at 79% 48%, rgba(255, 222, 166, 0.38), transparent 42%);
}

.floor-haze-a {
  top: 53%;
  animation: hall-haze-drift 108s linear infinite;
}

.floor-haze-b {
  top: 73%;
  opacity: 0.035;
  animation: hall-haze-drift 142s linear infinite reverse;
}

.floating-clouds {
  z-index: 26;
  overflow: hidden;
}

.floating-cloud {
  position: absolute;
  left: -34%;
  top: var(--top);
  width: var(--width);
  opacity: var(--opacity);
  filter: blur(var(--blur)) brightness(1.08);
  animation: cloud-pass var(--duration) linear infinite;
  animation-delay: var(--delay);
  will-change: transform;
}

.cloud-a {
  --top: 17%;
  --width: 38%;
  --opacity: 0.18;
  --blur: 1.3px;
  --duration: 78s;
  --delay: -20s;
}

.cloud-b {
  --top: 42%;
  --width: 46%;
  --opacity: 0.14;
  --blur: 1.8px;
  --duration: 96s;
  --delay: -58s;
}

.cloud-c {
  --top: 68%;
  --width: 34%;
  --opacity: 0.15;
  --blur: 1.5px;
  --duration: 88s;
  --delay: -10s;
}

.site-header {
  position: relative;
  z-index: 30;
  height: 8%;
  min-height: 66px;
}

.brand {
  position: absolute;
  left: 2.2%;
  top: 18%;
  width: 12.5%;
  min-width: 150px;
  line-height: 0;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.44));
}

.primary-nav {
  position: absolute;
  left: 22.2%;
  top: 17%;
  width: 52%;
  display: flex;
  justify-content: space-between;
  gap: 1.2vw;
}

.utility-nav {
  position: absolute;
  right: 2.4%;
  top: 17%;
  display: flex;
  gap: 1.2vw;
}

.nav-link,
.utility-link {
  position: relative;
  color: rgba(255, 230, 170, 0.9);
  text-decoration: none;
  text-shadow: 0 2px 9px rgba(0, 0, 0, 0.78);
  transition: color 220ms ease, text-shadow 220ms ease;
}

.nav-link {
  padding: 0.3rem 0.18rem 0.68rem;
  font-size: clamp(0.95rem, 1.28vw, 1.28rem);
  white-space: nowrap;
}

.utility-link {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  padding: 0.3rem 0.1rem;
  font-size: clamp(0.82rem, 1vw, 1rem);
}

.utility-icon {
  width: 1.32em;
  height: 1.32em;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 225, 153, 0.62);
  border-radius: 999px;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.28rem;
  width: 0;
  height: 1px;
  transform: translateX(-50%);
  opacity: 0;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  box-shadow: 0 0 12px rgba(255, 225, 143, 0.9);
  transition: width 220ms ease, opacity 220ms ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.is-active,
.utility-link:hover,
.utility-link:focus-visible {
  color: #fff3c6;
  text-shadow: 0 0 11px rgba(255, 222, 135, 0.88), 0 2px 12px rgba(0, 0, 0, 0.72);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  width: 86%;
  opacity: 1;
}

.ancestral-plaque {
  position: absolute;
  left: 39.3%;
  top: 18.25%;
  z-index: 8;
  width: 21.4%;
  height: 8.9%;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: center;
  column-gap: 1.05cqw;
  margin: 0;
  padding: 0 1.3cqw;
  color: #f4d27f;
  font-family: "LiSu", "隶书", "FZLiShu-S01T", "DFLiShu-Bd-BF", serif;
  font-size: clamp(1.6rem, 4cqw, 4rem);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  text-shadow:
    0 1px rgba(255, 247, 206, 0.78),
    0 3px 3px rgba(54, 13, 7, 0.82),
    0 0 13px rgba(255, 194, 74, 0.36);
  pointer-events: none;
}

.ancestral-plaque span {
  color: #f2cb72;
  -webkit-text-stroke: 0.45px rgba(91, 35, 14, 0.74);
  transform: scaleY(1.12);
}

.incense-smoke {
  position: absolute;
  left: 47.7%;
  top: 46%;
  z-index: 14;
  width: 4.6%;
  height: 18%;
  pointer-events: none;
}

.smoke {
  position: absolute;
  left: var(--smoke-left);
  bottom: 0;
  width: 32%;
  height: 78%;
  opacity: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, transparent 0%, rgba(244, 235, 213, 0.35) 43%, transparent 100%);
  filter: blur(6px);
  animation: incense-rise var(--smoke-duration) ease-in-out infinite;
  animation-delay: var(--smoke-delay);
  transform-origin: bottom center;
}

.smoke-a {
  --smoke-left: 12%;
  --smoke-duration: 8.6s;
  --smoke-delay: -1.4s;
}

.smoke-b {
  --smoke-left: 37%;
  --smoke-duration: 9.8s;
  --smoke-delay: -5.2s;
}

.smoke-c {
  --smoke-left: 61%;
  --smoke-duration: 10.7s;
  --smoke-delay: -7.6s;
}

.genealogy-entry {
  position: absolute;
  left: 58%;
  top: 66.4%;
  z-index: 24;
  width: 7.2%;
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.genealogy-entry::before {
  content: "";
  position: absolute;
  inset: 16%;
  border-radius: 50%;
  opacity: 0.76;
  background: rgba(255, 213, 95, 0.42);
  box-shadow:
    0 0 18px rgba(255, 212, 91, 0.78),
    0 0 42px rgba(255, 187, 57, 0.56),
    0 0 68px rgba(255, 174, 45, 0.28);
  animation: genealogy-entry-glow 2.8s ease-in-out infinite;
}

.genealogy-entry-icon {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  animation: genealogy-entry-float 4.2s ease-in-out infinite;
}

.genealogy-entry img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter:
    sepia(0.16)
    saturate(1.08)
    drop-shadow(0 5px 7px rgba(17, 6, 2, 0.64))
    drop-shadow(0 0 9px rgba(255, 218, 111, 0.74));
  transition: transform 240ms ease, filter 240ms ease;
}

.genealogy-entry:hover img,
.genealogy-entry:focus-visible img {
  transform: translateY(-2%) scale(1.08);
  filter:
    sepia(0.2)
    saturate(1.18)
    drop-shadow(0 7px 9px rgba(17, 6, 2, 0.7))
    drop-shadow(0 0 15px rgba(255, 226, 128, 0.96));
}

.genealogy-entry:focus-visible {
  outline: 2px solid rgba(255, 232, 158, 0.94);
  outline-offset: 5px;
}

.genealogy-overlay {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(91, 48, 16, 0.18), transparent 42%),
    rgba(17, 8, 4, 0.78);
  backdrop-filter: blur(5px) saturate(0.72);
  transition: opacity 360ms ease;
}

.genealogy-overlay[hidden] {
  display: none;
}

.genealogy-overlay.is-open {
  opacity: 1;
}

.book-scene {
  position: relative;
  width: 92%;
  height: 88%;
  perspective: 1800px;
}

.genealogy-book {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.book-pages {
  position: absolute;
  inset: 2% 0;
  opacity: 0;
  overflow: hidden;
  border: 2px solid rgba(137, 82, 28, 0.72);
  border-radius: 8px 4px 8px 4px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 248, 218, 0.52), transparent 54%),
    linear-gradient(135deg, #dfc28a 0%, #f2dda9 8%, #f5e4b9 50%, #edd4a0 92%, #d8b77e 100%);
  box-shadow:
    0 26px 68px rgba(0, 0, 0, 0.62),
    inset 0 0 42px rgba(100, 58, 18, 0.28),
    inset 15px 0 22px rgba(91, 50, 16, 0.13),
    inset -15px 0 22px rgba(91, 50, 16, 0.13);
  transform: scaleX(0.04) scaleY(0.92);
  transform-origin: center;
}

.genealogy-overlay.is-open .book-pages {
  animation: book-pages-open 980ms cubic-bezier(0.2, 0.76, 0.22, 1) forwards;
}

.book-paper {
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: #4b2b17;
  opacity: 0;
  background:
    radial-gradient(circle at 15% 18%, rgba(125, 80, 32, 0.07) 0 1px, transparent 2px),
    radial-gradient(circle at 78% 66%, rgba(125, 80, 32, 0.06) 0 1px, transparent 2px),
    repeating-linear-gradient(0deg, transparent 0 11px, rgba(104, 65, 25, 0.018) 12px);
  background-size: 19px 19px, 23px 23px, auto;
}

.genealogy-overlay.is-open .book-paper {
  animation: book-content-reveal 420ms ease 720ms forwards;
}

.book-paper::before {
  content: "";
  position: absolute;
  inset: 3.6%;
  z-index: 1;
  border: 1px solid rgba(121, 71, 27, 0.22);
  box-shadow: inset 0 0 0 4px rgba(207, 158, 80, 0.08);
  pointer-events: none;
}

.book-paper::after {
  content: "";
  position: absolute;
  inset: 2.2%;
  border: 1px solid rgba(126, 77, 28, 0.34);
  box-shadow:
    inset 0 0 0 4px rgba(217, 171, 92, 0.12),
    inset 0 0 28px rgba(104, 61, 22, 0.12);
  pointer-events: none;
}

.book-heading {
  position: absolute;
  top: 4.2%;
  left: 7%;
  right: 7%;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2%;
  color: #6f3b1d;
  text-align: center;
}

.book-heading h2 {
  margin: 0;
  font-family: "LiSu", "隶书", "STLiti", serif;
  font-size: clamp(1.65rem, 2.45cqw, 2.65rem);
  font-weight: 400;
  letter-spacing: 0;
  text-shadow: 0 1px rgba(255, 244, 201, 0.72);
}

.book-heading > span {
  position: relative;
  font-size: clamp(0.72rem, 0.88cqw, 0.95rem);
  letter-spacing: 0.26em;
}

.book-heading > span::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 46%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(111, 59, 29, 0.48));
}

.book-heading > span:first-child::after {
  right: -3%;
}

.book-heading > span:last-child::after {
  left: -3%;
  transform: scaleX(-1);
}

.lineage-chart {
  position: absolute;
  inset: 15% 3.5% 4%;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  scrollbar-color: rgba(120, 71, 26, 0.42) transparent;
}

.genealogy-diagram {
  position: relative;
  flex: 0 0 auto;
  width: min(100%, 1120px);
  aspect-ratio: 1320 / 620;
  margin: 0 auto;
}

.genealogy-connections {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.genealogy-person {
  position: absolute;
  z-index: 2;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(112, 63, 26, 0.72);
  border-radius: 2px;
  background:
    linear-gradient(90deg, rgba(255, 249, 224, 0.5), transparent 30%, rgba(125, 76, 31, 0.08)),
    #ead19b;
  box-shadow:
    inset 0 0 0 2px rgba(190, 137, 63, 0.12),
    0 2px 5px rgba(76, 40, 14, 0.14);
}

.genealogy-person.is-deceased {
  border-color: rgba(100, 52, 19, 0.9);
  background:
    linear-gradient(90deg, rgba(255, 247, 213, 0.58), transparent 34%, rgba(122, 70, 26, 0.1)),
    #e5c687;
  box-shadow:
    inset 0 0 0 2px rgba(147, 88, 31, 0.18),
    0 3px 7px rgba(76, 40, 14, 0.18);
}

.genealogy-person-name {
  color: #4a2816;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: clamp(0.58rem, 1.08cqw, 0.9rem);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.book-seal {
  position: absolute;
  right: 5.2%;
  bottom: 7%;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(151, 47, 29, 0.72);
  color: rgba(151, 47, 29, 0.74);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 1.35rem;
  transform: rotate(-5deg);
}

.book-cover {
  position: absolute;
  top: 4%;
  bottom: 4%;
  left: 50%;
  z-index: 12;
  width: 46%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.4cqh;
  border: 2px solid #a76b2d;
  border-radius: 4px;
  color: #efcd7c;
  background:
    linear-gradient(135deg, rgba(255, 220, 132, 0.1), transparent 30%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 7px),
    #58291b;
  box-shadow:
    inset 0 0 0 6px #3e1c13,
    inset 0 0 0 8px rgba(203, 139, 54, 0.62),
    inset 0 0 42px rgba(26, 8, 5, 0.72),
    0 18px 38px rgba(0, 0, 0, 0.55);
  transform: translateX(-50%) rotateY(0);
  transform-origin: left center;
  transform-style: preserve-3d;
}

.book-cover span {
  font-family: "LiSu", "隶书", "STLiti", serif;
  font-size: clamp(2rem, 3.2cqw, 3.4rem);
  text-shadow:
    0 2px #5b2515,
    0 0 14px rgba(255, 205, 101, 0.4);
}

.genealogy-overlay.is-open .book-cover {
  animation: book-cover-open 980ms cubic-bezier(0.24, 0.72, 0.18, 1) forwards;
}

.book-close {
  position: absolute;
  top: 0;
  right: -1.5%;
  z-index: 30;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(239, 205, 126, 0.74);
  border-radius: 50%;
  color: #f4da9a;
  background: rgba(48, 20, 12, 0.88);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.42);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.book-close:hover,
.book-close:focus-visible {
  color: #fff2c2;
  background: rgba(94, 47, 24, 0.96);
  transform: scale(1.06);
}

.book-close:focus-visible {
  outline: 2px solid #ffe3a0;
  outline-offset: 3px;
}

.genealogy-modal-open {
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes hall-haze-drift {
  from { transform: translateX(-7%); }
  to { transform: translateX(18%); }
}

@keyframes cloud-pass {
  from {
    transform: translate3d(-5vw, 0, 0);
  }

  to {
    transform: translate3d(150vw, 0, 0);
  }
}

@keyframes genealogy-entry-float {
  0%, 100% { transform: translateY(-3%); }
  50% { transform: translateY(5%); }
}

@keyframes genealogy-entry-glow {
  0%, 100% { opacity: 0.54; transform: scale(0.88); }
  50% { opacity: 0.9; transform: scale(1.12); }
}

@keyframes book-pages-open {
  0% {
    opacity: 0;
    transform: scaleX(0.04) scaleY(0.92);
  }
  34% {
    opacity: 1;
  }
  72% {
    transform: scaleX(1.025) scaleY(1);
  }
  100% {
    opacity: 1;
    transform: scaleX(1) scaleY(1);
  }
}

@keyframes book-cover-open {
  0% {
    opacity: 1;
    transform: translateX(-50%) rotateY(0);
  }
  62% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) rotateY(-168deg);
    visibility: hidden;
  }
}

@keyframes book-content-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes incense-rise {
  0% {
    opacity: 0;
    transform: translate3d(0, 8%, 0) scaleX(0.7);
  }
  18% {
    opacity: 0.26;
  }
  58% {
    opacity: 0.15;
    transform: translate3d(16%, -36%, 0) scaleX(1.1);
  }
  100% {
    opacity: 0;
    transform: translate3d(-18%, -82%, 0) scaleX(1.45);
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .genealogy-page {
    display: block;
  }

  .genealogy-stage {
    width: 100%;
    min-height: 100svh;
    aspect-ratio: auto;
  }

  .genealogy-bg {
    top: 100px;
    height: calc(100% - 100px);
    object-position: 50% center;
  }

  .ancestral-tablets {
    top: 100px;
    height: calc(100% - 100px);
  }

  .ancestor-tablet {
    left: var(--mobile-left);
    width: 10.4%;
  }

  .ancestor-tablet-name {
    font-size: clamp(0.72rem, 2cqw, 1rem);
  }

  .top-tablet-platform {
    left: 21.5%;
    width: 57%;
  }

  .site-header {
    min-height: 126px;
  }

  .brand {
    left: 3.5%;
    top: 10px;
    width: 158px;
    min-width: 0;
  }

  .utility-nav {
    right: 3.5%;
    top: 12px;
  }

  .utility-link {
    font-size: 0.72rem;
  }

  .utility-link span:last-child {
    display: none;
  }

  .primary-nav {
    left: 3.5%;
    right: 3.5%;
    top: 73px;
    width: auto;
    justify-content: flex-start;
    gap: 0.65rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .primary-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    flex: 0 0 auto;
    padding-inline: 0.08rem;
    font-size: 0.8rem;
  }

  .ancestral-plaque {
    left: 18%;
    top: 26.5%;
    width: 64%;
    height: 10%;
    column-gap: 2.6cqw;
    padding: 0 3cqw;
    font-size: clamp(2.1rem, 11.5cqw, 3rem);
  }

  .genealogy-entry {
    left: 72%;
    right: auto;
    top: 67%;
    width: 14%;
  }

  .book-scene {
    width: 94%;
    height: 74%;
  }

  .book-heading {
    top: 3.3%;
    left: 5%;
    right: 5%;
    display: block;
  }

  .book-heading > span {
    display: none;
  }

  .book-heading h2 {
    font-size: clamp(1.4rem, 7cqw, 2rem);
  }

  .lineage-chart {
    inset: 14% 2.5% 4%;
    justify-content: flex-start;
  }

  .genealogy-diagram {
    width: 1120px;
    margin-inline: auto;
  }

  .genealogy-person-name {
    font-size: 0.7rem;
  }

  .book-cover {
    width: 72%;
  }

  .book-cover span {
    font-size: clamp(1.8rem, 9cqw, 2.6rem);
  }

  .book-close {
    top: -4px;
    right: 0;
  }

  .incense-smoke {
    left: 44%;
    top: 52%;
    width: 12%;
    height: 16%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .smoke {
    opacity: 0.12;
    animation: none !important;
  }

  .genealogy-entry-icon,
  .genealogy-entry::before {
    animation: none !important;
  }

  .floating-cloud {
    animation: none !important;
  }

  .genealogy-overlay.is-open .book-pages {
    opacity: 1;
    transform: none;
  }

  .genealogy-overlay.is-open .book-paper {
    opacity: 1;
    transform: none;
  }

  .genealogy-overlay.is-open .book-cover {
    opacity: 0;
    visibility: hidden;
  }
}
