/* ==========================================================================
   LOCAL WEBFONTS (Subsetted & Localized)
   ========================================================================== */
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/instrument-serif-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/instrument-serif-400-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-300.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-400.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Noto Serif SC';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/noto-serif-sc-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Noto Serif SC';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/noto-serif-sc-600.woff2') format('woff2');
}

/* ==========================================================================
   AETHER — 以太观测站 | Stylesheet & Editorial Layout System
   Color Palette: Cosmic Near-Black (#04050a), Cold Cyan (#5ce1e6), Warm Gold (#f4c078)
   ========================================================================== */

:root {
  --bg-void: #04050a;
  --bg-glass: rgba(8, 12, 24, 0.56);
  --border-subtle: rgba(148, 163, 184, 0.16);
  --border-cyan: rgba(92, 225, 230, 0.42);
  --border-gold: rgba(244, 192, 120, 0.42);

  --text-primary: #f8fafc;
  --text-secondary: rgba(226, 232, 240, 0.78);
  --text-muted: rgba(148, 163, 184, 0.62);

  --accent-cyan: #5ce1e6;
  --accent-gold: #f4c078;

  --font-serif: 'Instrument Serif', 'Noto Serif SC', Georgia, serif;
  --font-zh: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Safe right gutter reserved across all chapters for the fixed right chapter nav */
  --hud-nav-safe-right: clamp(148px, 12.8vw, 190px);
}

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

html {
  background-color: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-zh);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  cursor: none;
}

html.is-touch,
html.is-touch * {
  cursor: auto !important;
}

body {
  background-color: var(--bg-void);
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
  selection-background-color: var(--accent-cyan);
}

::selection {
  background: rgba(92, 225, 230, 0.25);
  color: var(--text-primary);
}

button,
a {
  cursor: none;
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Fixed Full-Screen WebGL Canvas & Global Noise Overlay
   -------------------------------------------------------------------------- */
#webgl-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  display: block;
  pointer-events: none;
}

.noise-overlay {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 90;
  pointer-events: none;
  opacity: 0.042;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: noiseShift 6s steps(8) infinite;
}

@keyframes noiseShift {
  0% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-3%, 2%, 0); }
  50% { transform: translate3d(2%, -3%, 0); }
  75% { transform: translate3d(-2%, -2%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

/* --------------------------------------------------------------------------
   Custom Cursor (Dot + Lerp Ring)
   -------------------------------------------------------------------------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 120;
  will-change: transform;
}

.cursor-dot {
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 12px var(--accent-cyan);
  transition: width 0.25s ease, height 0.25s ease, margin 0.25s ease, background-color 0.25s ease;
}

.cursor-dot.is-hovered {
  width: 4px;
  height: 4px;
  margin-left: -2px;
  margin-top: -2px;
  background: var(--accent-gold);
}

.cursor-ring {
  width: 38px;
  height: 38px;
  margin-left: -19px;
  margin-top: -19px;
  border-radius: 50%;
  border: 1px solid rgba(92, 225, 230, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    margin 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.3s ease,
    background-color 0.3s ease;
}

.cursor-ring.is-hovered {
  width: 68px;
  height: 68px;
  margin-left: -34px;
  margin-top: -34px;
  border-color: var(--accent-gold);
  background: rgba(244, 192, 120, 0.08);
  backdrop-filter: blur(2px);
}

.cursor-ring.is-pressed {
  transform: scale(0.86);
}

.cursor-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--accent-gold);
  opacity: 0;
  transition: opacity 0.25s ease;
  text-transform: uppercase;
  white-space: nowrap;
}

.cursor-ring.has-label .cursor-label {
  opacity: 1;
}

html.is-touch .cursor-dot,
html.is-touch .cursor-ring {
  display: none;
}

/* --------------------------------------------------------------------------
   Chapter 0: Loader
   -------------------------------------------------------------------------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  background: radial-gradient(circle at center, rgba(9, 14, 28, 0.72), rgba(4, 5, 10, 0.94));
  pointer-events: all;
}

.loader.is-hidden {
  pointer-events: none;
  visibility: hidden;
}

.loader-inner {
  width: 100%;
  max-width: 960px;
  height: min(76vh, 640px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border-subtle);
  padding: clamp(1.5rem, 3.5vw, 3rem);
  background: rgba(5, 7, 15, 0.65);
  backdrop-filter: blur(12px);
}

.loader-top-meta,
.loader-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

.loader-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.loader-counter-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.loader-count {
  font-family: var(--font-serif);
  font-size: clamp(5rem, 13vw, 10.5rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-shadow: 0 0 40px rgba(92, 225, 230, 0.25);
}

.loader-unit {
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  color: var(--accent-gold);
}

.loader-subtitle {
  font-family: var(--font-zh);
  font-size: 0.92rem;
  letter-spacing: 0.32em;
  color: var(--text-secondary);
}

.loader-wave-canvas {
  margin-top: 0.5rem;
  opacity: 0.85;
}

.loader-bar-track {
  width: 100%;
  height: 2px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.loader-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-gold));
  transform: scaleX(0);
  transform-origin: left center;
}

.loader-status {
  color: var(--accent-cyan);
}

/* --------------------------------------------------------------------------
   Fixed Observatory HUD
   -------------------------------------------------------------------------- */
.hud {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.hud::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 110px;
  background: linear-gradient(
    180deg,
    rgba(4, 5, 10, 0.94) 0%,
    rgba(4, 5, 10, 0.68) 48%,
    rgba(4, 5, 10, 0) 100%
  );
  pointer-events: none;
  z-index: 0;
}

.hud-mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hud-accent {
  color: var(--accent-cyan);
}

.hud-muted {
  color: var(--text-muted);
}

.hud-top-left {
  position: absolute;
  top: clamp(1rem, 2.2vw, 1.85rem);
  left: clamp(1.25rem, 3vw, 2.75rem);
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  padding: 0.3rem 0.85rem;
  background: rgba(4, 6, 14, 0.78);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
}

.hud-logo {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0;
}

.hud-logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.hud-logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-gold);
  box-shadow: 0 0 12px var(--accent-gold);
}

.hud-logo-title {
  font-family: var(--font-serif);
  font-size: 1.38rem;
  letter-spacing: 0.18em;
  color: var(--text-primary);
  line-height: 1;
}

.hud-logo-zh {
  font-family: var(--font-zh);
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  border-left: 1px solid var(--border-subtle);
  padding-left: 0.65rem;
  line-height: 1;
}

.hud-telemetry-line {
  color: var(--text-muted);
  border-left: 1px solid var(--border-subtle);
  padding-left: 0.85rem;
  line-height: 1;
  white-space: nowrap;
}

.hud-top-right {
  position: absolute;
  top: clamp(1rem, 2.2vw, 1.85rem);
  right: clamp(1.25rem, 3vw, 2.75rem);
  z-index: 1;
  pointer-events: auto;
}

.hud-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.85rem;
  border: 1px solid var(--border-subtle);
  background: rgba(5, 8, 16, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-secondary);
}

.status-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: pulseBlink 2.2s infinite ease-in-out;
}

@keyframes pulseBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

/* Right-Side Chapter Progress Rail */
.hud-nav {
  position: absolute;
  right: clamp(0.6rem, 1.15vw, 1.15rem);
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  pointer-events: auto;
}

.hud-nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  padding: 0.15rem 0;
  text-align: right;
  transition: opacity 0.3s ease;
}

.hud-nav-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  transition: color 0.3s ease, transform 0.3s ease;
}

.hud-nav-name {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateX(4px);
  pointer-events: none;
  transition: max-width 0.3s ease, opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}

.hud-nav-item:hover .hud-nav-name,
.hud-nav-item.is-active .hud-nav-name {
  max-width: 150px;
  opacity: 1;
  transform: translateX(0);
}

.hud-nav-item.is-active .hud-nav-meta {
  color: var(--accent-gold);
}

.hud-nav-rail {
  width: 2px;
  height: 24px;
  background: rgba(148, 163, 184, 0.22);
  position: relative;
  overflow: hidden;
  transition: height 0.35s ease, width 0.25s ease;
}

.hud-nav-item.is-active .hud-nav-rail {
  height: 36px;
  width: 3px;
}

.hud-nav-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-gold));
  transform: scaleY(0);
  transform-origin: top center;
}

/* Bottom HUD Bar */
.hud-bottom {
  position: absolute;
  bottom: clamp(1rem, 2.2vw, 1.85rem);
  left: clamp(1.25rem, 3vw, 2.75rem);
  right: clamp(1.25rem, 3vw, 2.75rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hud-bottom-left,
.hud-bottom-center,
.hud-bottom-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.hud-divider {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.hud-scroll-track {
  width: clamp(90px, 14vw, 180px);
  height: 2px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.hud-scroll-bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-gold));
  transform: scaleX(0);
  transform-origin: left center;
}

.hud-fps {
  color: var(--accent-gold);
  padding: 0.18rem 0.5rem;
  border: 1px solid rgba(244, 192, 120, 0.32);
  background: rgba(8, 12, 22, 0.6);
}

/* --------------------------------------------------------------------------
   Typography Split-Char & Split-Line Masks
   -------------------------------------------------------------------------- */
.char-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.04em;
}

.char-inner {
  display: inline-block;
  will-change: transform, opacity;
}

.line-mask {
  display: block;
  overflow: hidden;
}

.line-inner {
  display: block;
  will-change: transform, opacity;
}

.chapter-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.chapter-tag,
.chapter-subcode {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.section-display-title {
  font-family: var(--font-serif);
  font-size: clamp(3.6rem, 8.5vw, 7.8rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.section-zh-title {
  font-family: var(--font-zh);
  font-weight: 400;
  font-size: clamp(1.05rem, 1.8vw, 1.45rem);
  line-height: 1.6;
  letter-spacing: 0.26em;
  color: var(--accent-gold);
  margin-top: 0.8rem;
  margin-bottom: 1.5rem;
}

.poetic-zh {
  font-family: var(--font-zh);
  font-size: clamp(0.98rem, 1.25vw, 1.15rem);
  line-height: 1.9;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
}

.poetic-en {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.05rem, 1.4vw, 1.28rem);
  line-height: 1.55;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Magnetic Buttons
   -------------------------------------------------------------------------- */
.magnetic-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.05rem 2.1rem;
  border: 1px solid var(--border-cyan);
  background: rgba(6, 10, 22, 0.58);
  backdrop-filter: blur(10px);
  pointer-events: auto;
  overflow: hidden;
  transition: border-color 0.35s ease, background-color 0.35s ease, box-shadow 0.35s ease;
}

.magnetic-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(92, 225, 230, 0.14), rgba(244, 192, 120, 0.14));
  opacity: 0;
  transition: opacity 0.35s ease;
}

.magnetic-btn:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 0 32px rgba(92, 225, 230, 0.18);
}

.magnetic-btn:hover::before {
  opacity: 1;
}

.magnetic-btn-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.24rem;
}

.btn-label-en {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  color: var(--text-primary);
}

.btn-label-zh {
  font-family: var(--font-zh);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  color: var(--accent-gold);
}

.magnetic-btn-large {
  padding: 1.35rem 2.85rem;
}

/* --------------------------------------------------------------------------
   Main Scroll Container & Chapter Sections
   -------------------------------------------------------------------------- */
.scroll-container {
  position: relative;
  z-index: 10;
}

.chapter-section {
  position: relative;
  width: 100%;
  min-height: 120vh;
  padding: clamp(7.25rem, 14vh, 9.5rem) var(--hud-nav-safe-right) clamp(5.5rem, 10vh, 7.5rem) clamp(1.5rem, 5vw, 5.5rem);
  display: flex;
  align-items: center;
}

.chapter-inner {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Chapter 1: GENESIS / 起源
   -------------------------------------------------------------------------- */
.chapter-genesis {
  min-height: 100vh;
  padding-top: clamp(5.75rem, 10.5vh, 6.85rem);
  padding-right: var(--hud-nav-safe-right);
  padding-bottom: clamp(5.5rem, 10.5vh, 7rem);
  align-items: flex-start;
}

.genesis-layout {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: calc(100vh - clamp(5.75rem, 10.5vh, 6.85rem) - clamp(5.5rem, 10.5vh, 7rem));
  min-height: 360px;
  padding-top: 0;
  padding-bottom: 0;
}

.genesis-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.65rem;
}

.genesis-hero-center {
  position: relative;
  z-index: 2;
  text-align: center;
  margin: auto 0;
  padding: clamp(0.5rem, 1.6vh, 1.5rem) 1rem;
}

.genesis-hero-center::before {
  content: '';
  position: absolute;
  inset: -28% -12%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    ellipse 62% 56% at 50% 50%,
    rgba(3, 5, 12, 0.86) 0%,
    rgba(4, 6, 15, 0.58) 46%,
    rgba(4, 5, 10, 0) 100%
  );
  filter: blur(8px);
}

.hero-display-title {
  font-family: var(--font-serif);
  font-size: clamp(4.2rem, min(14vw, 18vh), 12.5rem);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: 0.1em;
  color: #ffffff;
  -webkit-text-stroke: 1.25px rgba(165, 243, 252, 0.42);
  paint-order: stroke fill;
  opacity: 1;
  text-shadow:
    0 2px 10px rgba(2, 4, 10, 0.98),
    0 6px 28px rgba(2, 4, 10, 0.96),
    0 0 56px rgba(2, 4, 10, 0.95),
    0 0 96px rgba(2, 4, 10, 0.9),
    0 0 26px rgba(92, 225, 230, 0.46),
    0 0 58px rgba(244, 192, 120, 0.26);
}

.hero-display-title .char-mask {
  overflow: visible;
  padding: 0.06em 0.03em;
}

.hero-display-title .char-inner {
  opacity: 1;
}

.hero-chinese-title {
  display: inline-block;
  font-family: var(--font-zh);
  font-size: clamp(0.88rem, min(1.4vw, 2.1vh), 1.25rem);
  font-weight: 600;
  letter-spacing: 0.36em;
  color: #ffd98e;
  margin-top: clamp(0.55rem, 1.4vh, 1.05rem);
  padding: 0.38rem 1.25rem;
  background: rgba(4, 6, 14, 0.68);
  border: 1px solid rgba(244, 192, 120, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-shadow:
    0 2px 10px rgba(2, 4, 10, 0.98),
    0 0 24px rgba(2, 4, 10, 0.95),
    0 0 16px rgba(244, 192, 120, 0.35);
}

.genesis-bottom-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  flex-wrap: nowrap;
}

.genesis-poetic-block {
  max-width: min(540px, 55vw);
  padding: clamp(0.95rem, 1.6vh, 1.35rem) clamp(1.15rem, 1.8vw, 1.65rem);
  background: rgba(4, 6, 14, 0.86);
  border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--accent-cyan);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
}

.genesis-poetic-block .poetic-zh {
  font-size: clamp(0.88rem, min(1.15vw, 1.9vh), 1.06rem);
  line-height: 1.72;
  margin-bottom: 0.55rem;
}

.genesis-poetic-block .poetic-en {
  font-size: clamp(0.92rem, min(1.25vw, 2vh), 1.14rem);
  line-height: 1.45;
}

.genesis-action-block {
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Infinite Velocity-Reactive Marquee Band
   -------------------------------------------------------------------------- */
.marquee-band {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(4, 6, 14, 0.72);
  backdrop-filter: blur(8px);
  padding: 0.95rem 0;
}

.marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.marquee-group {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  padding-right: 2.2rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.marquee-dot {
  color: var(--accent-gold);
}

/* --------------------------------------------------------------------------
   Chapter 2: MEDIUM / 介质
   -------------------------------------------------------------------------- */
.chapter-medium {
  min-height: 135vh;
  padding-left: clamp(1.25rem, 3vw, 2.75rem);
  padding-right: var(--hud-nav-safe-right);
}

.chapter-medium .chapter-inner {
  max-width: 1640px;
}

.two-col-asymmetric {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(220px, 300px);
  justify-content: space-between;
  align-items: end;
  gap: 2.5rem;
}

.section-header-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.narrative-body,
.telemetry-card {
  padding: 1.6rem 1.85rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
}

.telemetry-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-top: 2px solid var(--accent-gold);
}

.telemetry-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.telemetry-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.t-key {
  color: var(--text-muted);
  letter-spacing: 0.12em;
}

.t-val {
  color: var(--accent-cyan);
  letter-spacing: 0.08em;
}

/* --------------------------------------------------------------------------
   Chapter 3: TERRAIN / 地形 (10x Extended 5-Stage Low-Altitude Journey)
   -------------------------------------------------------------------------- */
.chapter-terrain {
  min-height: 1450vh;
  padding: 0;
  display: block;
  position: relative;
}

.terrain-sticky-ui {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100vh;
  padding: clamp(4.2rem, 7.8vh, 5.25rem) var(--hud-nav-safe-right) clamp(3.6rem, 6.8vh, 4.65rem) clamp(1.25rem, 3vw, 2.75rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  z-index: 28;
  opacity: 0;
  visibility: hidden;
  will-change: transform, opacity;
}

.terrain-layout {
  width: 100%;
  max-width: 1640px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.terrain-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
}

.terrain-header-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.95rem;
  background: rgba(4, 6, 14, 0.46);
  border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--accent-cyan);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  will-change: opacity, transform;
}

.terrain-header-group .chapter-kicker {
  margin-bottom: 0.05rem;
  font-size: 0.64rem;
}

.terrain-title-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
}

.chapter-terrain .section-display-title {
  font-size: clamp(1.75rem, min(3vw, 5vh), 2.55rem);
  line-height: 1;
}

.chapter-terrain .section-zh-title {
  font-size: clamp(0.78rem, 1vw, 0.94rem);
  letter-spacing: 0.18em;
  margin: 0;
}

/* Compact single-line ALTITUDE telemetry pill in top-right beneath OPTICAL LINK */
.terrain-hud-box {
  position: absolute;
  top: clamp(3.35rem, 5.6vh, 4.35rem);
  right: clamp(1.25rem, 3vw, 2.75rem);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.28rem 0.72rem;
  background: rgba(4, 7, 16, 0.34);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-right: 2px solid var(--accent-gold);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.hud-metric {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.38rem;
  font-family: var(--font-mono);
}

.terrain-hud-sep {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: rgba(148, 163, 184, 0.36);
}

.m-label {
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.m-value {
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--accent-gold);
  white-space: nowrap;
}

#terrain-hud-stage {
  color: var(--accent-cyan);
}

.hud-metric-mode .m-value {
  color: var(--text-muted);
  font-size: 0.6rem;
}

.terrain-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  width: 100%;
  margin-top: auto;
}

.terrain-bottom-dock {
  width: min(340px, 86vw);
  max-width: 340px;
  display: flex;
  flex-direction: column;
}

/* Minimal 5-dot stage indicator in bottom-right corner */
.terrain-stage-rail {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.28rem 0.52rem;
  background: rgba(4, 6, 14, 0.32);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: auto;
  margin-left: auto;
}

.terrain-stage-pip {
  width: 6px;
  height: 6px;
  padding: 0;
  border-radius: 999px;
  font-size: 0;
  line-height: 0;
  color: transparent;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.35);
  border: none;
  transition: width 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
  cursor: none;
}

.terrain-stage-pip:hover {
  background: rgba(92, 225, 230, 0.75);
}

.terrain-stage-pip.is-active {
  width: 18px;
  background: var(--accent-gold);
  box-shadow: 0 0 8px rgba(244, 192, 120, 0.65);
}

.terrain-stage-deck {
  display: grid;
  grid-template-areas: 'stage-card';
  position: relative;
}

.terrain-stage-card {
  grid-area: stage-card;
  width: 100%;
  max-width: 340px;
  padding: 0.72rem 0.92rem;
  background: rgba(4, 7, 16, 0.56);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-left: 2px solid var(--accent-gold);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  pointer-events: none;
  will-change: opacity, transform;
}

.terrain-stage-card.is-active {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.terrain-stage-card[data-terrain-card="1"],
.terrain-stage-card[data-terrain-card="2"] {
  border-left-color: var(--accent-cyan);
}

.terrain-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.28rem;
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.1em;
}

.terrain-card-num {
  color: var(--accent-gold);
}

.terrain-card-badge {
  color: var(--accent-cyan);
  padding: 0.08rem 0.38rem;
  border: 1px solid var(--border-cyan);
  background: rgba(92, 225, 230, 0.05);
}

.terrain-card-title {
  font-family: var(--font-zh);
  font-size: clamp(0.86rem, 1.05vw, 0.96rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  margin-bottom: 0.28rem;
}

.terrain-stage-card .poetic-zh {
  font-size: clamp(0.74rem, min(0.9vw, 1.5vh), 0.81rem);
  line-height: 1.54;
  margin-bottom: 0.26rem;
}

.terrain-stage-card .poetic-en {
  font-size: clamp(0.75rem, min(0.92vw, 1.55vh), 0.83rem);
  line-height: 1.32;
}

/* --------------------------------------------------------------------------
   Chapter 4: METAMORPH / 变形 (4 Stage Morph Sequence)
   -------------------------------------------------------------------------- */
.chapter-metamorph {
  min-height: 335vh;
  padding-bottom: clamp(16rem, 48vh, 30rem);
  align-items: flex-start;
}

.metamorph-layout {
  max-width: 540px;
  margin-left: 0;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
  padding-top: 0.5rem;
  will-change: opacity, transform;
}

.metamorph-lead {
  font-family: var(--font-zh);
  font-size: 0.96rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.metamorph-stages {
  display: flex;
  flex-direction: column;
  gap: 24vh;
}

.stage-card {
  padding: 1.75rem 2rem;
  background: rgba(5, 8, 18, 0.82);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid rgba(148, 163, 184, 0.3);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
}

.stage-card.is-active {
  border-left-color: var(--accent-cyan);
  border-color: rgba(92, 225, 230, 0.38);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 28px rgba(92, 225, 230, 0.12);
  transform: translateX(8px);
}

.stage-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
}

.stage-num {
  color: var(--accent-gold);
}

.stage-badge {
  color: var(--accent-cyan);
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--border-cyan);
}

.stage-title {
  font-family: var(--font-zh);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.stage-zh {
  font-size: 0.96rem;
  line-height: 1.85;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
}

.stage-en {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Chapter 5: ARCHIVE / 档案 (Pinned Horizontal Gallery)
   -------------------------------------------------------------------------- */
.chapter-archive {
  height: 100vh;
  min-height: 100vh;
  padding: 0;
  overflow: hidden;
  pointer-events: none;
}

.archive-pinned-ui {
  width: 100%;
  height: 100vh;
  padding: clamp(6.75rem, 13.5vh, 8.75rem) var(--hud-nav-safe-right) clamp(4.2rem, 7.5vh, 5.5rem) clamp(1.5rem, 5vw, 5rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.archive-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  row-gap: 0.85rem;
  column-gap: 1.5rem;
}

.archive-title-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

.archive-title-group .chapter-kicker {
  margin-bottom: 0.1rem;
  line-height: 1.4;
}

.archive-heading {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 4.6vw, 4.2rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0.03em;
  margin: 0.1rem 0 0.2rem;
}

.archive-zh-sub {
  display: block;
  font-family: var(--font-zh);
  font-size: 0.92rem;
  line-height: 1.65;
  letter-spacing: 0.22em;
  color: var(--accent-gold);
  margin-top: 0.25rem;
}

.archive-instruction {
  padding: 0.5rem 0.95rem;
  background: rgba(6, 10, 22, 0.78);
  border: 1px solid var(--border-cyan);
  color: var(--accent-cyan);
  line-height: 1.5;
  margin-top: 0.25rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.archive-dom-viewport {
  width: 100%;
  overflow: hidden;
  margin-top: auto;
  margin-bottom: 1.15rem;
}

.archive-dom-track {
  display: flex;
  gap: 4.5rem;
  width: max-content;
  padding: 0 12vw;
  will-change: transform;
}

.archive-dom-marker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 0.35rem 0.85rem;
  border-left: 2px solid var(--accent-gold);
  background: rgba(5, 8, 18, 0.52);
}

.archive-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.archive-counter {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.archive-progress-rail {
  flex: 1;
  max-width: 480px;
  height: 2px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.archive-progress-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-gold));
  transform: scaleX(0);
  transform-origin: left center;
}

.archive-tech-note {
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Chapter 6: SINGULARITY / 奇点 + Magnetic CTA & Observatory Footer
   -------------------------------------------------------------------------- */
.chapter-singularity {
  min-height: 220vh;
  padding-top: clamp(5.25rem, 10.5vh, 6.75rem);
  padding-right: var(--hud-nav-safe-right);
  padding-bottom: clamp(2.85rem, 5.4vh, 3.75rem);
  align-items: stretch;
}

.singularity-layout {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: calc(220vh - clamp(8.1rem, 15.9vh, 10.5rem));
  padding-top: 0;
  padding-bottom: 0;
}

.singularity-top-content {
  max-width: clamp(290px, 30vw, 410px);
}

.chapter-singularity .section-display-title {
  font-size: clamp(2.2rem, min(4.2vw, 7vh), 3.6rem);
}

.chapter-singularity .section-zh-title {
  font-size: clamp(0.82rem, 1.1vw, 0.98rem);
  letter-spacing: 0.14em;
  margin-top: 0.35rem;
  margin-bottom: 0.65rem;
}

.singularity-narrative {
  margin-top: 0.5rem;
  padding: 0.9rem 1.15rem;
  background: rgba(4, 6, 14, 0.72);
  border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--accent-gold);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.48);
}

.singularity-narrative .poetic-zh {
  font-size: clamp(0.78rem, 1.05vw, 0.9rem);
  line-height: 1.56;
  margin-bottom: 0.4rem;
}

.singularity-narrative .poetic-en {
  font-size: clamp(0.8rem, 1.1vw, 0.94rem);
  line-height: 1.36;
}

.singularity-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.tech-pill {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--accent-cyan);
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border-subtle);
  background: rgba(6, 10, 22, 0.72);
}

/* Observatory Footer — Low-profile bottom dock below the black hole photon ring */
.observatory-footer {
  margin-top: auto;
  padding: clamp(0.75rem, 1.5vh, 1.15rem) clamp(1.1rem, 2vw, 1.65rem);
  display: flex;
  flex-direction: column;
  gap: clamp(0.55rem, 1.1vh, 0.85rem);
  background: linear-gradient(180deg, rgba(4, 6, 14, 0.68) 0%, rgba(4, 5, 10, 0.9) 100%);
  border: 1px solid var(--border-subtle);
  border-top: 1px solid rgba(92, 225, 230, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

.footer-cta-wrap {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  text-align: left;
  gap: 0.65rem 1.25rem;
}

.observatory-footer .magnetic-btn-large {
  padding: 0.55rem 1.3rem;
}

.cta-pre {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--text-secondary);
}

.footer-colophon {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
}

.colophon-col {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.colophon-right {
  text-align: right;
}

.colophon-title {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--text-primary);
}

.colophon-sub {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints (Width & Short/Wide Viewport Height Adaptations)
   -------------------------------------------------------------------------- */
@media (max-height: 900px) and (min-width: 901px) {
  .chapter-medium {
    padding-top: clamp(4.5rem, 9vh, 6rem);
    padding-bottom: clamp(4.25rem, 8.5vh, 5.5rem);
    padding-left: clamp(1.15rem, 2.4vw, 2.15rem);
    padding-right: var(--hud-nav-safe-right);
  }

  .two-col-asymmetric {
    grid-template-columns: minmax(230px, 330px) minmax(200px, 270px);
    gap: 2rem;
  }

  .chapter-medium .section-display-title {
    font-size: clamp(2.5rem, min(4.8vw, 8vh), 4rem);
  }

  .chapter-medium .section-zh-title {
    font-size: clamp(0.86rem, 1.15vw, 1.02rem);
    letter-spacing: 0.16em;
    margin-top: 0.4rem;
    margin-bottom: 0.75rem;
  }

  .chapter-medium .narrative-body,
  .chapter-medium .telemetry-card {
    padding: 1rem 1.2rem;
  }

  .chapter-medium .poetic-zh {
    font-size: 0.86rem;
    line-height: 1.62;
    margin-bottom: 0.45rem;
  }

  .chapter-medium .poetic-en {
    font-size: 0.88rem;
    line-height: 1.38;
  }

  .chapter-medium .telemetry-card {
    gap: 0.6rem;
  }

  .chapter-medium .telemetry-row {
    padding-bottom: 0.45rem;
    font-size: 0.66rem;
  }
}

@media (max-height: 800px) {
  .hud-top-left,
  .hud-top-right {
    top: clamp(0.75rem, 1.8vh, 1.1rem);
  }

  .hud-bottom {
    bottom: clamp(0.65rem, 1.6vh, 1rem);
  }

  .hud-nav {
    gap: 0.4rem;
  }

  .hud-nav-rail {
    height: 16px;
  }

  .hud-nav-item.is-active .hud-nav-rail {
    height: 24px;
  }

  /* GENESIS first-screen layout for short/wide viewports (<= 800px height) */
  .chapter-genesis {
    min-height: 100vh;
    padding-top: clamp(4.75rem, 11.2vh, 5.35rem);
    padding-right: var(--hud-nav-safe-right);
    padding-bottom: clamp(4.5rem, 10.2vh, 5.25rem);
  }

  .genesis-layout {
    height: calc(100vh - clamp(4.75rem, 11.2vh, 5.35rem) - clamp(4.5rem, 10.2vh, 5.25rem));
    min-height: 270px;
  }

  .genesis-meta-top {
    padding-bottom: 0.42rem;
  }

  .genesis-meta-top .chapter-kicker {
    margin-bottom: 0;
    font-size: 0.66rem;
  }

  .genesis-meta-top .chapter-tag {
    font-size: 0.62rem;
  }

  .genesis-hero-center {
    padding: 0.25rem 0.5rem;
  }

  .hero-display-title {
    font-size: clamp(3.1rem, min(12vw, 15.5vh), 6.6rem);
  }

  .hero-chinese-title {
    font-size: clamp(0.76rem, 1.85vh, 0.96rem);
    letter-spacing: 0.28em;
    margin-top: clamp(0.3rem, 1vh, 0.6rem);
    padding: 0.25rem 0.9rem;
  }

  .genesis-poetic-block {
    max-width: min(460px, 52vw);
    padding: clamp(0.65rem, 1.3vh, 0.95rem) clamp(0.9rem, 1.4vw, 1.25rem);
  }

  .genesis-poetic-block .poetic-zh {
    font-size: clamp(0.76rem, 1.75vh, 0.88rem);
    line-height: 1.5;
    margin-bottom: 0.3rem;
  }

  .genesis-poetic-block .poetic-en {
    font-size: clamp(0.78rem, 1.8vh, 0.9rem);
    line-height: 1.32;
  }

  #hero-explore-btn {
    padding: clamp(0.6rem, 1.3vh, 0.85rem) clamp(1.15rem, 1.8vw, 1.65rem);
  }

  /* MEDIUM chapter layout for short/wide viewports (<= 800px height) */
  .chapter-medium {
    min-height: 115vh;
    padding-top: clamp(3.75rem, 8vh, 4.75rem);
    padding-bottom: clamp(3.5rem, 7.5vh, 4.5rem);
    padding-left: clamp(1rem, 2vw, 1.75rem);
    padding-right: var(--hud-nav-safe-right);
  }

  .two-col-asymmetric {
    grid-template-columns: minmax(210px, 295px) minmax(185px, 245px);
    gap: 1.5rem;
    align-items: center;
  }

  .chapter-medium .chapter-kicker {
    font-size: 0.64rem;
    margin-bottom: 0.2rem;
  }

  .chapter-medium .chapter-subcode {
    font-size: 0.6rem;
  }

  .chapter-medium .section-display-title {
    font-size: clamp(2rem, min(4.2vw, 7.2vh), 3.1rem);
  }

  .chapter-medium .section-zh-title {
    font-size: clamp(0.78rem, 1.05vw, 0.92rem);
    letter-spacing: 0.12em;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
  }

  .chapter-medium .narrative-body,
  .chapter-medium .telemetry-card {
    padding: 0.75rem 0.95rem;
  }

  .chapter-medium .poetic-zh {
    font-size: clamp(0.76rem, 1.65vh, 0.84rem);
    line-height: 1.48;
    margin-bottom: 0.35rem;
  }

  .chapter-medium .poetic-en {
    font-size: clamp(0.76rem, 1.65vh, 0.85rem);
    line-height: 1.3;
  }

  .chapter-medium .telemetry-card {
    gap: 0.42rem;
  }

  .chapter-medium .telemetry-row {
    padding-bottom: 0.35rem;
    font-size: 0.62rem;
  }
}

@media (max-height: 600px) {
  .chapter-genesis {
    padding-top: 3.25rem;
    padding-bottom: 5.5rem;
  }

  .genesis-layout {
    height: calc(100vh - 8.75rem);
    min-height: 220px;
  }

  .hero-display-title {
    font-size: clamp(2.5rem, 13.5vh, 4.2rem);
  }

  .hero-chinese-title {
    font-size: 0.72rem;
    margin-top: 0.2rem;
    padding: 0.18rem 0.7rem;
  }

  .genesis-poetic-block {
    padding: 0.48rem 0.8rem;
  }

  .genesis-poetic-block .poetic-zh {
    font-size: 0.72rem;
    line-height: 1.38;
    margin-bottom: 0.18rem;
  }

  .genesis-poetic-block .poetic-en {
    font-size: 0.72rem;
    line-height: 1.24;
  }

  #hero-explore-btn {
    padding: 0.48rem 1rem;
  }

  #hero-explore-btn .btn-label-en {
    font-size: 0.68rem;
  }

  #hero-explore-btn .btn-label-zh {
    font-size: 0.64rem;
  }
}

@media (max-width: 1024px) {
  .hud-nav {
    right: 0.75rem;
  }

  .hud-nav-name {
    display: none;
  }

  .footer-colophon {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .colophon-right {
    text-align: left;
  }
}

@media (max-width: 900px) {
  .two-col-asymmetric {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .chapter-section {
    padding: 6.5rem 1.25rem 5.5rem;
  }

  .chapter-genesis {
    padding-top: 4.5rem;
    padding-bottom: 6.5rem;
  }

  .genesis-bottom-grid {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .genesis-poetic-block {
    max-width: 100%;
  }

  .hud-top-right,
  .archive-tech-note,
  .hud-logo-zh {
    display: none;
  }

  .chapter-terrain {
    padding: 0;
  }

  .terrain-sticky-ui {
    padding: 4.5rem 1.25rem 3.5rem;
  }

  .terrain-hud-box {
    top: 1.1rem;
    right: 1.25rem;
    gap: 0.45rem;
    padding: 0.24rem 0.6rem;
  }

  .terrain-hud-box .hud-metric-mode {
    display: none;
  }

  .terrain-bottom-dock {
    max-width: min(320px, 82vw);
  }

  .metamorph-stages {
    gap: 16vh;
  }
}

/* --------------------------------------------------------------------------
   Mobile Portrait (<=600px, e.g. 390x844)
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  /* Prevent horizontal overflow across entire document */
  html,
  body {
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
  }

  .chapter-section {
    padding-left: 16px;
    padding-right: 16px;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .chapter-inner {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* 1. 右侧固定章节导航在手机上会压住正文 → 直接隐藏 */
  .hud-nav {
    display: none !important;
  }

  /* 2. 顶部与底部固定 HUD 栏适配 */
  .hud-top {
    left: 16px;
    right: 16px;
  }

  .hud-bottom {
    left: 16px;
    right: 16px;
    flex-wrap: nowrap;
    white-space: nowrap;
    gap: 0.5rem;
    font-size: 0.62rem;
  }

  .hud-bottom .hud-mono {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
  }

  /* 只留章节名和百分比：速度前的斜杠、速度值、进度条、RENDER/FPS 全部隐藏 */
  .hud-bottom-left .hud-divider,
  #hud-velocity,
  .hud-scroll-track,
  .hud-bottom-right {
    display: none !important;
  }

  /* ========================================================================
     Chapter 3: TERRAIN Mobile Adaptations (390x844)
     ======================================================================== */
  .chapter-terrain {
    padding: 0;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .terrain-sticky-ui {
    padding: 4.2rem 16px 3.2rem;
    max-width: 100vw;
    box-sizing: border-box;
  }

  /* 右上角 ALT 读数在手机上只显示高度数字 */
  .terrain-hud-box {
    top: 1.1rem;
    right: 16px;
    gap: 0.35rem;
    padding: 0.22rem 0.55rem;
  }

  .terrain-hud-box .terrain-hud-sep,
  .terrain-hud-box #terrain-hud-stage,
  .terrain-hud-box .hud-metric-mode {
    display: none !important;
  }

  #terrain-hud-altitude {
    display: inline-block;
    max-width: 6.8ch;
    overflow: hidden;
    white-space: nowrap;
    vertical-align: bottom;
  }

  /* 航段卡片宽度改为 calc(100vw - 32px), 字号缩小, 放在底部 HUD 之上 */
  .terrain-bottom-row {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
    width: 100%;
    margin-top: auto;
  }

  .terrain-bottom-dock {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }

  .terrain-stage-deck {
    width: 100%;
  }

  .terrain-stage-card {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    padding: 0.55rem 0.75rem;
    box-sizing: border-box;
  }

  .terrain-card-title {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
  }

  .terrain-stage-card .poetic-zh {
    font-size: 0.7rem;
    line-height: 1.42;
    margin-bottom: 0.2rem;
  }

  .terrain-stage-card .poetic-en {
    font-size: 0.68rem;
    line-height: 1.25;
  }

  /* 右下角 5 个小圆点保留 */
  .terrain-stage-rail {
    margin-left: auto;
    align-self: flex-end;
  }

  /* ========================================================================
     Chapter 4: METAMORPH Mobile Overflow Prevention
     ======================================================================== */
  .stage-card {
    padding: 1.25rem 1.25rem;
    max-width: 100%;
    box-sizing: border-box;
  }

  .stage-card.is-active {
    transform: none !important;
  }

  /* ========================================================================
     Chapter 5: ARCHIVE Mobile Overflow Prevention
     ======================================================================== */
  .archive-pinned-ui {
    padding: 4.5rem 16px 3.5rem;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .archive-progress-rail {
    max-width: 100%;
  }

  /* ========================================================================
     Chapter 6: SINGULARITY Mobile Adaptations (390x844)
     ======================================================================== */
  .chapter-singularity {
    padding-left: 16px;
    padding-right: 16px;
    padding-top: 4.5rem;
    padding-bottom: 3.5rem;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .singularity-top-content {
    max-width: calc(100vw - 32px);
  }

  .chapter-singularity .section-display-title {
    font-size: clamp(2rem, 10vw, 2.75rem);
  }

  .chapter-singularity .section-zh-title {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
  }

  /* 左侧大段说明在手机上缩成 3 行以内 */
  .singularity-narrative {
    padding: 0.6rem 0.8rem;
    margin-top: 0.35rem;
    box-sizing: border-box;
  }

  .singularity-narrative .poetic-zh {
    font-size: 0.72rem;
    line-height: 1.45;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .singularity-narrative .poetic-en {
    display: none;
  }

  /* 三个技术标签隐藏 */
  .singularity-badges {
    display: none !important;
  }

  /* 页脚三列改为单列 */
  .observatory-footer {
    padding: 0.85rem 1rem;
    margin-top: auto;
    max-width: 100%;
    box-sizing: border-box;
  }

  .footer-cta-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .cta-pre {
    font-size: 0.62rem;
  }

  .observatory-footer .magnetic-btn-large {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .footer-colophon {
    grid-template-columns: 1fr !important;
    gap: 0.65rem;
    padding-top: 0.65rem;
  }

  .colophon-col,
  .colophon-right {
    text-align: left !important;
  }
}
