@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=ZCOOL+XiaoWei&display=swap");

:root {
  --sky-top: #12243f;
  --sky-mid: #2f4f73;
  --sky-low: #d48b6f;
  --fog: rgba(255, 227, 188, 0.14);
  --moon: #f8e9be;
  --paper: rgba(248, 239, 223, 0.9);
  --paper-strong: rgba(253, 245, 232, 0.96);
  --brass: #d0a465;
  --copper: #b97252;
  --teal: #6e8b85;
  --olive: #7f9366;
  --line: rgba(110, 79, 51, 0.2);
  --text: #4c3829;
  --muted: #775d4a;
  --shadow: 0 24px 60px rgba(34, 26, 19, 0.18);
  --radius-xl: 40px;
  --radius-lg: 28px;
  --radius-md: 22px;
  --font-sans: "Nunito", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-serif: "ZCOOL XiaoWei", "Songti SC", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body {
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 238, 200, 0.12), transparent 18%),
    radial-gradient(circle at 82% 18%, rgba(255, 220, 168, 0.14), transparent 18%),
    linear-gradient(180deg, #14253f 0%, var(--sky-mid) 18%, #7f6780 42%, var(--sky-low) 68%, #f0d7ad 100%);
}

.sky-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 40%, rgba(255, 255, 255, 0.16) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 24%, rgba(255, 255, 255, 0.1) 0 1px, transparent 2px),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 200px 200px, 240px 240px, 40px 40px, 40px 40px;
  opacity: 0.55;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: 28px 24px 100px;
}

.topbar {
  position: sticky;
  top: 18px;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  width: min(1180px, 100%);
  margin: 0 auto 32px;
  padding: 14px 18px;
  border: 1px solid rgba(247, 222, 183, 0.22);
  border-radius: 999px;
  background: rgba(28, 30, 43, 0.46);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 30px rgba(19, 16, 13, 0.2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff2d5;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff8dd, var(--brass));
  color: #6e4a2e;
  font-family: var(--font-serif);
  box-shadow: 0 10px 20px rgba(208, 164, 101, 0.28);
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.26rem;
  white-space: nowrap;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  color: rgba(255, 239, 209, 0.72);
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-link:hover,
.nav-link.is-active {
  background: rgba(255, 238, 203, 0.12);
  color: #fff5df;
  transform: translateY(-1px);
}

.app {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.chapter {
  margin-top: 128px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(420px, 0.86fr);
  gap: 42px;
  align-items: center;
  min-height: calc(100vh - 160px);
  margin-top: 0;
}

.hero-copy {
  max-width: 36rem;
}

.chapter-label,
.panel-kicker {
  margin: 0 0 14px;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f1d0a1;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 34px;
}

.arrival-heading {
  max-width: 1080px;
  margin-bottom: 36px;
}

.arrival-heading .chapter-label {
  margin-bottom: 16px;
}

.arrival-kicker-box {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid rgba(244, 222, 190, 0.18);
  background: rgba(255, 247, 228, 0.08);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 24px rgba(24, 20, 18, 0.12);
}

.hero h1,
.section-heading h2,
.panel h3,
.finale-card h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
}

.hero h1 {
  font-size: clamp(3rem, 6vw, 5.7rem);
  line-height: 1.04;
  color: #fff2d8;
}

.section-heading h2,
.finale-card h2 {
  font-size: clamp(2.2rem, 4vw, 4.1rem);
  line-height: 1.12;
  color: #fff1dd;
}

.arrival-heading h2 {
  display: inline-block;
  max-width: 1080px;
  font-size: clamp(2.15rem, 4.2vw, 3.45rem);
  line-height: 1.16;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.arrival-title-box {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12em;
  max-width: 100%;
  padding: 24px 34px 28px;
  border-radius: 34px;
  border: 1px solid rgba(244, 222, 190, 0.16);
  background: rgba(255, 247, 228, 0.1);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 42px rgba(24, 20, 18, 0.12);
}

.arrival-title-line {
  display: block;
}

.chapter-lead,
.chapter-body,
.narrative-panel p,
.quote-panel p,
.panel p,
.journey-step p {
  margin: 0;
  line-height: 1.9;
}

.chapter-lead {
  margin-top: 22px;
  font-size: 1.22rem;
  color: #fff2dc;
}

.chapter-body {
  max-width: 680px;
  margin-top: 18px;
  color: rgba(255, 236, 214, 0.82);
}

.highlight {
  color: #ffe4ad;
}

.hero-actions,
.finale-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button.primary {
  background: linear-gradient(180deg, #f2c171 0%, #d89867 100%);
  color: #563722;
  box-shadow: 0 16px 30px rgba(214, 142, 98, 0.24);
}

.button.secondary {
  border: 1px solid rgba(255, 238, 204, 0.24);
  background: rgba(255, 244, 225, 0.08);
  color: #fff3de;
}

.button:hover {
  transform: translateY(-2px);
}

.signal-list,
.journey-list {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.signal-list {
  display: grid;
  gap: 12px;
}

.signal-list li {
  color: rgba(255, 240, 220, 0.86);
}

.signal-list li::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f3cb83, #d07c61);
}

.hero-scene {
  position: relative;
}

.scene-frame,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(246, 223, 184, 0.18);
  box-shadow: var(--shadow);
}

.scene-frame {
  min-height: 760px;
  border-radius: 44px;
  background:
    radial-gradient(circle at 50% 90%, rgba(255, 204, 146, 0.24), transparent 22%),
    linear-gradient(180deg, rgba(17, 34, 59, 0.98) 0%, rgba(53, 76, 108, 0.95) 24%, rgba(124, 92, 114, 0.92) 54%, rgba(206, 139, 104, 0.9) 100%);
}

.scene-frame::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 180px;
  background: linear-gradient(180deg, rgba(44, 37, 35, 0), rgba(39, 30, 26, 0.5));
}

.scene-moon {
  position: absolute;
  top: 58px;
  right: 74px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffce9, var(--moon));
  box-shadow: 0 0 0 32px rgba(248, 233, 190, 0.14);
}

.scene-haze {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 70% 16%, rgba(248, 233, 190, 0.18), transparent 18%),
    radial-gradient(circle at 18% 30%, rgba(255, 226, 178, 0.08), transparent 24%),
    linear-gradient(180deg, transparent 30%, rgba(250, 212, 164, 0.08) 72%, rgba(255, 226, 178, 0.14) 100%);
}

.scene-stars {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle, rgba(255, 248, 219, 0.9) 0 1px, transparent 2px);
  background-size: 120px 120px;
  opacity: 0.38;
}

.scene-cloud {
  position: absolute;
  height: 34px;
  border-radius: 999px;
  background: rgba(245, 230, 217, 0.16);
  box-shadow:
    24px -10px 0 10px rgba(245, 230, 217, 0.14),
    58px -2px 0 10px rgba(245, 230, 217, 0.16),
    84px -10px 0 7px rgba(245, 230, 217, 0.12);
  animation: drift 16s ease-in-out infinite;
}

.cloud-a {
  top: 140px;
  left: 80px;
  width: 90px;
}

.cloud-b {
  top: 112px;
  left: 260px;
  width: 100px;
  animation-delay: -4s;
}

.cloud-c {
  top: 182px;
  right: 180px;
  width: 86px;
  animation-delay: -8s;
}

.ridge {
  position: absolute;
  bottom: 220px;
  border-radius: 50% 50% 0 0;
}

.ridge-back {
  left: -8%;
  width: 72%;
  height: 230px;
  background: rgba(55, 77, 98, 0.7);
}

.ridge-mid {
  right: -6%;
  width: 64%;
  height: 210px;
  background: rgba(74, 92, 102, 0.72);
}

.town-silhouette {
  position: absolute;
  right: 20px;
  bottom: 164px;
  width: 240px;
  height: 130px;
  background:
    linear-gradient(90deg, transparent 0 10%, rgba(45, 40, 39, 0.95) 10% 20%, transparent 20% 24%, rgba(45, 40, 39, 0.95) 24% 36%, transparent 36% 40%, rgba(45, 40, 39, 0.95) 40% 56%, transparent 56% 60%, rgba(45, 40, 39, 0.95) 60% 76%, transparent 76% 80%, rgba(45, 40, 39, 0.95) 80% 100%);
  clip-path: polygon(0 100%, 0 48%, 10% 48%, 14% 34%, 24% 34%, 24% 24%, 32% 24%, 32% 48%, 40% 48%, 45% 18%, 54% 18%, 54% 40%, 62% 40%, 62% 30%, 70% 30%, 70% 50%, 80% 50%, 86% 26%, 100% 26%, 100% 100%);
  opacity: 0.88;
}

.track {
  position: absolute;
  left: 46%;
  bottom: 0;
  width: 170px;
  height: 300px;
  transform: translateX(-50%);
  border-radius: 54% 54% 0 0;
  background: linear-gradient(180deg, rgba(233, 196, 145, 0.8) 0%, rgba(164, 110, 79, 0.92) 100%);
}

.track::before,
.track::after {
  content: "";
  position: absolute;
  inset: 0;
}

.track::before {
  left: 18px;
  width: 4px;
  background: rgba(95, 57, 43, 0.6);
  box-shadow: 126px 0 0 rgba(95, 57, 43, 0.6);
}

.track::after {
  background:
    linear-gradient(180deg, transparent 0 8%, rgba(101, 66, 51, 0.55) 8% 10%, transparent 10% 18%, rgba(101, 66, 51, 0.55) 18% 20%, transparent 20% 28%, rgba(101, 66, 51, 0.55) 28% 30%, transparent 30% 38%, rgba(101, 66, 51, 0.55) 38% 40%, transparent 40% 48%, rgba(101, 66, 51, 0.55) 48% 50%, transparent 50% 58%, rgba(101, 66, 51, 0.55) 58% 60%, transparent 60% 68%, rgba(101, 66, 51, 0.55) 68% 70%, transparent 70% 78%, rgba(101, 66, 51, 0.55) 78% 80%, transparent 80% 88%, rgba(101, 66, 51, 0.55) 88% 90%, transparent 90%);
}

.moving-city {
  position: absolute;
  left: 48%;
  bottom: 132px;
  width: 430px;
  height: 330px;
  transform: translateX(-50%);
  animation: sway 6.2s ease-in-out infinite;
}

.city-shadow {
  position: absolute;
  bottom: -8px;
  left: 50px;
  width: 320px;
  height: 58px;
  border-radius: 50%;
  background: rgba(39, 25, 19, 0.34);
  filter: blur(12px);
}

.city-smoke {
  position: absolute;
  border-radius: 50%;
  background: rgba(226, 222, 216, 0.3);
  filter: blur(1px);
}

.smoke-a {
  top: 8px;
  left: 120px;
  width: 46px;
  height: 46px;
  animation: smoke 4.5s ease-in-out infinite;
}

.smoke-b {
  top: -10px;
  left: 150px;
  width: 36px;
  height: 36px;
  animation: smoke 4.5s ease-in-out infinite 1s;
}

.smoke-c {
  top: 14px;
  left: 182px;
  width: 24px;
  height: 24px;
  animation: smoke 4.5s ease-in-out infinite 2s;
}

.city-core,
.city-annex,
.city-turret {
  position: absolute;
  border: 1px solid rgba(249, 218, 171, 0.16);
  background: linear-gradient(180deg, #766055 0%, #4d3c36 100%);
}

.city-core {
  left: 88px;
  bottom: 78px;
  width: 210px;
  height: 122px;
  border-radius: 36px 28px 24px 22px;
}

.city-annex.annex-a {
  left: 42px;
  bottom: 108px;
  width: 106px;
  height: 82px;
  border-radius: 26px 22px 18px 20px;
}

.city-annex.annex-b {
  right: 52px;
  bottom: 100px;
  width: 118px;
  height: 88px;
  border-radius: 22px 26px 20px 18px;
}

.city-turret.turret-a {
  left: 116px;
  bottom: 178px;
  width: 60px;
  height: 82px;
  border-radius: 18px 18px 12px 12px;
}

.city-turret.turret-b {
  left: 184px;
  bottom: 190px;
  width: 48px;
  height: 98px;
  border-radius: 20px 20px 12px 12px;
}

.city-turret.turret-c {
  right: 96px;
  bottom: 170px;
  width: 54px;
  height: 86px;
  border-radius: 20px 20px 12px 12px;
}

.city-turret::before,
.city-annex::before {
  content: "";
  position: absolute;
  top: -22px;
  left: -10px;
  width: calc(100% + 20px);
  height: 34px;
  background: linear-gradient(180deg, #b36f58 0%, #7c4d42 100%);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.city-window,
.city-door {
  position: absolute;
  background: linear-gradient(180deg, #ffeb9c 0%, #f0ba64 100%);
  box-shadow: 0 0 14px rgba(255, 212, 119, 0.32);
}

.city-window {
  width: 14px;
  height: 20px;
  border-radius: 6px;
}

.window-a {
  left: 86px;
  bottom: 136px;
}

.window-b {
  left: 128px;
  bottom: 126px;
}

.window-c {
  left: 196px;
  bottom: 138px;
}

.window-d {
  right: 116px;
  bottom: 132px;
}

.window-e {
  right: 88px;
  bottom: 148px;
}

.window-f {
  left: 208px;
  bottom: 222px;
}

.city-door {
  left: 170px;
  bottom: 82px;
  width: 24px;
  height: 40px;
  border-radius: 12px 12px 8px 8px;
}

.city-leg {
  position: absolute;
  bottom: 32px;
  width: 24px;
  height: 104px;
  border-radius: 999px;
  background: linear-gradient(180deg, #7d6959 0%, #3f322e 100%);
  transform-origin: top center;
}

.leg-a {
  left: 104px;
  transform: rotate(14deg);
}

.leg-b {
  left: 166px;
  height: 112px;
  transform: rotate(-8deg);
}

.leg-c {
  right: 132px;
  transform: rotate(10deg);
}

.leg-d {
  right: 82px;
  height: 116px;
  transform: rotate(-14deg);
}

.city-leg::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: -8px;
  width: 42px;
  height: 16px;
  border-radius: 999px;
  background: #4b3b34;
}

.city-gear {
  position: absolute;
  border-radius: 50%;
  border: 6px solid #7f6559;
  box-shadow:
    0 -18px 0 -12px #7f6559,
    0 18px 0 -12px #7f6559,
    18px 0 0 -12px #7f6559,
    -18px 0 0 -12px #7f6559;
  animation: spin 10s linear infinite;
}

.gear-a {
  left: 118px;
  bottom: 86px;
  width: 38px;
  height: 38px;
}

.gear-b {
  right: 122px;
  bottom: 92px;
  width: 28px;
  height: 28px;
  animation-direction: reverse;
}

.scene-note {
  position: absolute;
  padding: 14px 16px;
  border: 1px solid rgba(249, 224, 183, 0.16);
  border-radius: 18px;
  background: rgba(36, 31, 34, 0.46);
  backdrop-filter: blur(12px);
  color: #fff0d9;
}

.scene-note p {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f5d2a2;
}

.scene-note strong {
  display: block;
  margin-top: 6px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.3rem;
}

.note-top {
  left: 40px;
  top: 42px;
}

.note-left {
  left: 36px;
  bottom: 174px;
}

.note-right {
  right: 38px;
  bottom: 148px;
}

.chapter-grid,
.engine-layout,
.map-layout {
  display: grid;
  gap: 20px;
}

.chapter-grid {
  grid-template-columns: minmax(320px, 0.88fr) minmax(0, 1.12fr);
  align-items: stretch;
}

.arrival-grid {
  grid-template-columns: minmax(320px, 1080px);
  justify-content: start;
}

.engine-layout {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
}

.engine-notes {
  display: grid;
  gap: 18px;
}

.panel {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--paper);
}

.panel h3 {
  margin: 12px 0;
  font-size: 2rem;
  color: #593f2d;
}

.quote-panel strong {
  display: block;
  margin-bottom: 14px;
  max-width: 12ch;
  font-size: clamp(1.8rem, 2.8vw, 2.7rem);
  line-height: 1.28;
  color: #5c412d;
}

.quote-panel,
.narrative-panel {
  height: 100%;
}

.quote-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.quote-panel > p:last-of-type {
  font-family: var(--font-sans);
  font-size: 1.02rem;
  line-height: 1.95;
  color: #684f3d;
}

.narrative-panel {
  display: grid;
  align-content: start;
  gap: 18px;
}

.narrative-panel p {
  font-family: var(--font-serif);
  font-size: 1.14rem;
  line-height: 1.96;
  color: #644c3a;
}

.arrival-note {
  color: #6a503d;
}

.quote-panel,
.narrative-panel,
.engine-core,
.note-card,
.law-card,
.journey-step,
.finale-card {
  background:
    linear-gradient(180deg, rgba(255, 251, 243, 0.94) 0%, rgba(244, 234, 216, 0.94) 100%);
}

.boiler-illustration {
  position: relative;
  width: 180px;
  height: 180px;
  margin-bottom: 22px;
}

.boiler-ring,
.boiler-fire {
  position: absolute;
  inset: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.boiler-ring {
  border: 2px solid rgba(160, 112, 75, 0.28);
}

.ring-a {
  width: 180px;
  height: 180px;
}

.ring-b {
  width: 128px;
  height: 128px;
}

.boiler-fire {
  width: 74px;
  height: 74px;
  background: radial-gradient(circle at 40% 35%, #fff3c4, #ed8f53);
  box-shadow: 0 0 30px rgba(237, 143, 83, 0.26);
}

.boiler-spark {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f3c580;
  box-shadow: 0 0 12px rgba(243, 197, 128, 0.26);
  animation: pulse 2s ease-in-out infinite;
}

.spark-a {
  top: 18px;
  left: 82px;
}

.spark-b {
  right: 22px;
  top: 82px;
  animation-delay: -0.6s;
}

.spark-c {
  left: 36px;
  bottom: 28px;
  animation-delay: -1.2s;
}

.district-journey {
  display: grid;
  gap: 20px;
}

.district-stop {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 26px;
  border: 1px solid rgba(247, 223, 186, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(47, 34, 30, 0.34);
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 42px rgba(43, 30, 23, 0.14);
}

.stop-index,
.step-number {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 1.35rem;
}

.stop-index {
  background: linear-gradient(180deg, #f1c47b, #cc8a62);
  color: #573d2d;
}

.stop-copy h3 {
  font-size: 2.1rem;
  color: #fff0dd;
}

.stop-copy p {
  color: rgba(255, 236, 214, 0.86);
}

.law-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.journey-list {
  display: grid;
  gap: 20px;
}

.journey-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 28px 30px;
  border-left: 6px solid rgba(220, 154, 101, 0.28);
}

.step-number {
  background: linear-gradient(180deg, #f3cb84, #d88f66);
  color: #5f412c;
}

.journey-step h3 {
  margin-top: 8px;
}

.finale-card {
  text-align: center;
  border: 1px solid rgba(167, 125, 82, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 251, 244, 0.98) 0%, rgba(245, 235, 218, 0.96) 100%);
}

.finale-card p {
  max-width: 760px;
  margin: 18px auto 0;
  color: #654a38;
}

.finale-card .chapter-label {
  color: #c7915f;
}

.finale-card h2 {
  max-width: 1100px;
  margin: 0 auto;
  color: #5a3d2c;
  text-wrap: balance;
}

.finale-card .button.secondary {
  border-color: rgba(173, 126, 85, 0.28);
  background: rgba(231, 196, 144, 0.16);
  color: #6a4730;
}

.finale-card .button.secondary:hover {
  background: rgba(231, 196, 144, 0.24);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms ease, transform 700ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

.floating-phrases {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.floating-phrases span {
  position: absolute;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 247, 227, 0.08);
  color: rgba(255, 233, 199, 0.38);
  font-size: 0.82rem;
  backdrop-filter: blur(8px);
  animation: drift 15s ease-in-out infinite;
}

.floating-phrases span:nth-child(1) {
  top: 14%;
  left: 2%;
}

.floating-phrases span:nth-child(2) {
  top: 24%;
  right: 4%;
  animation-delay: -3s;
}

.floating-phrases span:nth-child(3) {
  bottom: 24%;
  left: 4%;
  animation-delay: -7s;
}

.floating-phrases span:nth-child(4) {
  right: 8%;
  bottom: 18%;
  animation-delay: -10s;
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-10px) translateX(8px);
  }
}

@keyframes sway {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-7px);
  }
}

@keyframes smoke {
  0% {
    transform: translateY(0) scale(0.9);
    opacity: 0.16;
  }
  50% {
    transform: translateY(-18px) scale(1.1);
    opacity: 0.34;
  }
  100% {
    transform: translateY(-34px) scale(1.24);
    opacity: 0;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

@media (max-width: 1100px) {
  .hero,
  .chapter-grid,
  .engine-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }
}

.resident-grid,
.ritual-grid {
  display: grid;
  gap: 20px;
}

.resident-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ritual-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.resident-card,
.ritual-card {
  min-height: 240px;
}

.resident-card {
  display: grid;
  grid-template-columns: minmax(210px, 250px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.resident-portrait {
  position: relative;
  width: 100%;
  min-height: 280px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 248, 236, 0.96) 0%, rgba(234, 220, 198, 0.98) 100%);
  border: 1px solid rgba(160, 118, 82, 0.14);
  overflow: hidden;
}

.portrait-aura,
.portrait-floor,
.figure-hair,
.figure-head,
.figure-neck,
.figure-coat,
.figure-apron,
.figure-arm,
.figure-leg,
.figure-boot,
.figure-prop {
  position: absolute;
}

.portrait-aura {
  inset: 26px 40px auto;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 223, 161, 0.42), transparent 70%);
}

.portrait-floor {
  left: 22px;
  right: 22px;
  bottom: 18px;
  height: 28px;
  border-radius: 50%;
  background: rgba(127, 96, 65, 0.14);
  filter: blur(4px);
}

.figure-head {
  top: 56px;
  left: 50%;
  width: 66px;
  height: 74px;
  margin-left: -33px;
  border-radius: 44% 44% 48% 48%;
  background: #efcfb0;
  z-index: 3;
}

.figure-hair {
  top: 42px;
  left: 50%;
  width: 90px;
  height: 86px;
  margin-left: -45px;
  border-radius: 45px 45px 30px 30px;
  z-index: 2;
}

.figure-neck {
  top: 118px;
  left: 50%;
  width: 18px;
  height: 20px;
  margin-left: -9px;
  border-radius: 10px;
  background: #e2b896;
  z-index: 2;
}

.figure-coat {
  left: 50%;
  top: 126px;
  width: 116px;
  height: 108px;
  margin-left: -58px;
  border-radius: 34px 34px 24px 24px;
  z-index: 1;
}

.figure-apron {
  left: 50%;
  top: 144px;
  width: 60px;
  height: 82px;
  margin-left: -30px;
  border-radius: 20px 20px 18px 18px;
  z-index: 2;
}

.figure-arm {
  top: 142px;
  width: 22px;
  height: 84px;
  border-radius: 20px;
  z-index: 0;
}

.arm-left {
  left: 50%;
  margin-left: -66px;
  transform: rotate(14deg);
}

.arm-right {
  right: 50%;
  margin-right: -66px;
  transform: rotate(-16deg);
}

.figure-leg {
  top: 218px;
  width: 22px;
  height: 54px;
  border-radius: 18px;
}

.leg-left {
  left: 50%;
  margin-left: -28px;
}

.leg-right {
  left: 50%;
  margin-left: 6px;
}

.figure-boot {
  top: 258px;
  width: 34px;
  height: 16px;
  border-radius: 16px;
}

.boot-left {
  left: 50%;
  margin-left: -34px;
}

.boot-right {
  left: 50%;
  margin-left: 4px;
}

.portrait-lan .figure-hair {
  background: linear-gradient(180deg, #c8c0bb 0%, #8e8279 100%);
}

.portrait-lan .figure-coat,
.portrait-lan .figure-arm,
.portrait-lan .figure-leg,
.portrait-lan .figure-boot {
  background: linear-gradient(180deg, #78675f 0%, #51413a 100%);
}

.portrait-lan .figure-apron {
  background: linear-gradient(180deg, #b89770 0%, #8b6b4d 100%);
}

.portrait-lan .figure-prop {
  top: 70px;
  left: 50%;
  width: 92px;
  height: 20px;
  margin-left: -46px;
  border-radius: 999px;
  background: linear-gradient(90deg, #c99960 0%, #7b5c3b 100%);
  z-index: 4;
}

.portrait-bai .figure-hair {
  background: linear-gradient(180deg, #4f5d58 0%, #34423d 100%);
}

.portrait-bai .figure-coat,
.portrait-bai .figure-arm,
.portrait-bai .figure-leg,
.portrait-bai .figure-boot {
  background: linear-gradient(180deg, #5e776b 0%, #3b4e45 100%);
}

.portrait-bai .figure-apron {
  background: linear-gradient(180deg, rgba(245, 245, 245, 0.38) 0%, rgba(208, 223, 220, 0.18) 100%);
}

.portrait-bai .figure-prop {
  top: 78px;
  right: 46px;
  width: 18px;
  height: 104px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(169, 204, 211, 0.28) 100%);
  z-index: 4;
}

.portrait-jin .figure-hair {
  background: linear-gradient(180deg, #403737 0%, #221e1f 100%);
}

.portrait-jin .figure-coat,
.portrait-jin .figure-arm,
.portrait-jin .figure-leg,
.portrait-jin .figure-boot {
  background: linear-gradient(180deg, #64544c 0%, #3e322d 100%);
}

.portrait-jin .figure-apron {
  background: linear-gradient(180deg, #7c695f 0%, #5a4942 100%);
}

.portrait-jin .figure-prop {
  right: 22px;
  bottom: 52px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(180deg, #d0a06a 0%, #8a6444 100%);
  box-shadow:
    0 -18px 0 -12px #8a6444,
    0 18px 0 -12px #8a6444,
    18px 0 0 -12px #8a6444,
    -18px 0 0 -12px #8a6444;
}

.portrait-ge .figure-hair {
  background: linear-gradient(180deg, #5d4b62 0%, #342a39 100%);
}

.portrait-ge .figure-coat,
.portrait-ge .figure-arm,
.portrait-ge .figure-leg,
.portrait-ge .figure-boot {
  background: linear-gradient(180deg, #6e5d75 0%, #433449 100%);
}

.portrait-ge .figure-apron {
  background: linear-gradient(180deg, rgba(255, 221, 151, 0.18) 0%, rgba(255, 210, 123, 0.08) 100%);
}

.portrait-ge .figure-prop {
  top: 86px;
  right: 30px;
  width: 20px;
  height: 86px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f2c777 0%, #d8925e 100%);
  box-shadow: 0 0 14px rgba(242, 199, 119, 0.22);
}

.resident-copy {
  display: grid;
  gap: 8px;
}

.resident-visual {
  margin-bottom: 4px;
  color: #6d5644;
  font-style: italic;
}

.resident-line {
  margin-top: 2px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(223, 201, 176, 0.34);
  color: #563e2f;
  font-weight: 700;
  line-height: 1.7;
}

.resident-body {
  padding-top: 10px;
  border-top: 1px solid rgba(126, 90, 58, 0.16);
}

.interlude {
  margin-top: 88px;
}

.interlude-band {
  max-width: 840px;
  margin: 0 auto;
  padding: 22px 26px;
  border: 1px solid rgba(246, 221, 181, 0.16);
  border-radius: 999px;
  background: rgba(31, 28, 35, 0.32);
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 34px rgba(32, 25, 21, 0.12);
}

.interlude-band p:last-child {
  margin: 0;
  color: rgba(255, 240, 219, 0.82);
  line-height: 1.9;
  text-align: center;
}

.ritual-card {
  display: grid;
  align-content: start;
  gap: 10px;
}

.ritual-card-wide {
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 22px 28px;
  align-items: start;
}

.ritual-card-wide .panel-kicker,
.ritual-card-wide h3,
.ritual-card-wide .ritual-lead {
  grid-column: 1;
}

.ritual-card-wide .ritual-list {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: stretch;
}

.ritual-lead {
  color: #654b39;
  font-size: 1.04rem;
  line-height: 1.92;
}

.ritual-list {
  margin: 0;
  padding: 18px 20px 18px 38px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(244, 231, 212, 0.88) 0%, rgba(233, 214, 188, 0.8) 100%);
  color: #624938;
  line-height: 1.85;
}

.ritual-list li + li {
  margin-top: 10px;
}

@media (max-width: 860px) {
  .page-shell {
    padding-inline: 16px;
  }

  .topbar {
    position: sticky;
    top: 10px;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 28px;
  }

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

  .resident-grid,
  .ritual-grid {
    grid-template-columns: 1fr;
  }

  .scene-frame {
    min-height: 680px;
  }

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

  .ritual-card-wide .ritual-list {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 14px 12px 72px;
  }

  .topbar {
    position: sticky;
    top: 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 24px;
    padding: 12px;
    border-radius: 32px;
    background: rgba(23, 31, 49, 0.72);
    box-shadow: 0 18px 36px rgba(15, 17, 23, 0.28);
  }

  .brand {
    justify-content: flex-start;
    gap: 12px;
    padding: 2px 2px 0;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
  }

  .brand-name {
    font-size: 1.36rem;
    line-height: 1;
  }

  .topnav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    gap: 8px;
    padding: 2px 2px 4px;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, transparent 0, black 12px, black calc(100% - 12px), transparent 100%);
  }

  .topnav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    flex: 0 0 auto;
    padding: 11px 15px;
    text-align: center;
    font-size: 0.94rem;
    white-space: nowrap;
    background: rgba(255, 245, 224, 0.04);
    border: 1px solid rgba(255, 236, 205, 0.08);
  }

  .chapter {
    margin-top: 74px;
  }

  .hero {
    gap: 18px;
    min-height: auto;
  }

  .hero h1 {
    font-size: clamp(2.8rem, 14vw, 4.05rem);
    line-height: 0.98;
  }

  .hero-copy {
    max-width: none;
  }

  .chapter-label {
    margin-bottom: 10px;
    font-size: 0.74rem;
    letter-spacing: 0.16em;
  }

  .section-heading h2,
  .finale-card h2 {
    font-size: clamp(1.95rem, 9.5vw, 2.9rem);
    line-height: 1.18;
  }

  .arrival-heading h2 {
    font-size: clamp(1.85rem, 8.8vw, 2.55rem);
    line-height: 1.2;
  }

  .arrival-title-box {
    padding: 18px 18px 20px;
    border-radius: 28px;
  }

  .chapter-lead {
    margin-top: 16px;
    padding: 16px 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 246, 225, 0.06) 0%, rgba(255, 245, 224, 0.03) 100%);
    border: 1px solid rgba(255, 236, 205, 0.08);
    font-size: 1.02rem;
    line-height: 1.82;
    box-shadow: 0 14px 28px rgba(17, 21, 32, 0.14);
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
  }

  .hero-actions .button {
    width: 100%;
    min-height: 56px;
    padding: 0 14px;
    font-size: 0.98rem;
    border-radius: 22px;
  }

  .hero-actions .button.primary {
    box-shadow: 0 18px 28px rgba(214, 142, 98, 0.26);
  }

  .signal-list {
    margin-top: 18px;
    padding: 16px 18px;
    gap: 12px;
    border-radius: 24px;
    background: rgba(255, 246, 225, 0.04);
    border: 1px solid rgba(255, 236, 205, 0.08);
  }

  .signal-list li {
    font-size: 0.98rem;
    line-height: 1.72;
  }

  .scene-frame {
    min-height: 390px;
    border-radius: 30px;
  }

  .moving-city {
    left: 50%;
    width: 310px;
    transform: translateX(-50%) scale(0.79);
    transform-origin: center bottom;
  }

  .town-silhouette {
    right: 12px;
    width: 180px;
  }

  .track {
    width: 130px;
  }

  .scene-note {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    margin: 10px;
    border-radius: 16px;
  }

  .floating-phrases {
    display: none;
  }

  .resident-card {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 22px 20px;
  }

  .resident-portrait {
    min-height: 210px;
  }

  .resident-copy h3,
  .ritual-card h3,
  .law-card h3,
  .journey-step h3 {
    font-size: 1.74rem;
  }

  .resident-copy,
  .ritual-card p,
  .law-card p,
  .journey-step p,
  .finale-card p {
    line-height: 1.85;
  }

  .resident-line {
    padding: 10px 12px;
    font-size: 0.98rem;
    line-height: 1.72;
  }

  .resident-body {
    padding-top: 8px;
  }

  .interlude {
    margin-top: 62px;
  }

  .interlude-band {
    padding: 16px 18px;
    border-radius: 28px;
  }

  .interlude-band p:last-child {
    text-align: left;
    font-size: 0.98rem;
    line-height: 1.82;
  }

  .ritual-grid {
    gap: 14px;
  }

  .ritual-card,
  .ritual-card-wide {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ritual-card-wide {
    grid-column: auto;
  }

  .ritual-list {
    padding: 14px 16px 14px 30px;
    border-radius: 18px;
    line-height: 1.78;
  }

  .ritual-card,
  .law-card,
  .journey-step,
  .finale-card {
    min-height: auto;
  }

  .journey-step {
    padding: 22px 20px;
    gap: 14px;
  }
}
