/* Isolated 3D Xiangqi landing portal & center-split unseal overlay */
html.route-pending {
  background: #0b0b0c;
}

html.route-pending body,
body.landing-open:has(.landing-overlay) > :not(.landing-overlay) {
  visibility: hidden;
}

body.landing-open {
  overflow: hidden;
}

.landing-overlay {
  --landing-bg: #0b0b0c;
  --landing-fg: #ffffff;
  --landing-accent: #ff2d16;
  --landing-coral: #e8746d;
  --landing-display: "Fraunces", "Noto Serif SC", "STSong", "Songti SC", Georgia, serif;
  --landing-sans: "Instrument Sans", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  --landing-mono: "Sometype Mono", ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;

  position: fixed;
  inset: 0;
  z-index: 60;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: var(--landing-bg);
  color: var(--landing-fg);
  font-family: var(--landing-sans);
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
  scrollbar-width: thin;
}

.landing-overlay ::selection {
  background: rgba(255, 45, 22, 0.35);
  color: #ffffff;
}

.landing-main {
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
  background: var(--landing-bg);
}

/* Hero Section */
.landing-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 620px;
  background-color: var(--landing-bg);
  overflow: hidden;
}

.landing-hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: grab;
  touch-action: pan-y;
}

.landing-hero-canvas.is-dragging {
  cursor: grabbing;
}

.landing-canvas-snapshot {
  width: 100%;
  height: 100%;
  display: block;
}

.hud-bracket {
  position: absolute;
  width: 26px;
  height: 26px;
  pointer-events: none;
  z-index: 12;
  opacity: 0.55;
}

.hud-bracket--tl {
  top: 22px;
  left: 22px;
  border-top: 1px solid var(--landing-accent);
  border-left: 1px solid var(--landing-accent);
}

.hud-bracket--tr {
  top: 22px;
  right: 22px;
  border-top: 1px solid var(--landing-accent);
  border-right: 1px solid var(--landing-accent);
}

.hud-bracket--bl {
  bottom: 22px;
  left: 22px;
  border-bottom: 1px solid var(--landing-accent);
  border-left: 1px solid var(--landing-accent);
}

.hud-bracket--br {
  bottom: 22px;
  right: 22px;
  border-bottom: 1px solid var(--landing-accent);
  border-right: 1px solid var(--landing-accent);
}

.landing-skip-btn {
  position: absolute;
  top: 28px;
  right: 54px;
  z-index: 14;
  background: rgba(18, 18, 21, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--landing-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, background-color 0.25s ease;
}

.landing-skip-btn:hover {
  border-color: var(--landing-accent);
  color: #ffffff;
  background: rgba(255, 45, 22, 0.14);
}

.landing-ruler {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  z-index: 10;
  pointer-events: none;
}

.landing-ruler-major {
  width: 16px;
  height: 1px;
  background: #ffffff;
  opacity: 0.4;
}

.landing-ruler-minor {
  width: 8px;
  height: 1px;
  background: #ffffff;
  opacity: 0.2;
}

.landing-hero-copy {
  position: relative;
  z-index: 8;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  text-align: center;
  pointer-events: none;
}

.landing-hero-brand {
  display: block;
  width: clamp(108px, 11vw, 146px);
  height: auto;
  margin-bottom: 18px;
  padding: 3px 5px;
  filter: drop-shadow(0 2px 4px #0b0b0c);
}

.landing-hero-title {
  margin: 0;
  font-family: var(--landing-display);
  font-variation-settings: "opsz" 120, "WONK" 1;
  font-weight: 600;
  font-size: clamp(34px, 6.2vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 6px 32px rgba(0, 0, 0, 0.55);
}

@keyframes landingWordReveal {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-word {
  display: inline-block;
  animation: landingWordReveal 0.85s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.hero-word--2 {
  animation-delay: 40ms;
}

.hero-word--3 {
  animation-delay: 80ms;
}

.landing-hero-sub {
  margin: 18px 0 0;
  font-family: var(--landing-sans);
  font-size: 17px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.06em;
  text-shadow: 0 2px 14px rgba(11, 11, 12, 0.98), 0 0 28px rgba(11, 11, 12, 0.95);
}

.landing-hero-hud {
  position: absolute;
  left: clamp(44px, 4.5vw, 60px);
  right: clamp(44px, 4.5vw, 60px);
  bottom: 26px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  row-gap: 4px;
  column-gap: 16px;
  font-family: var(--landing-mono);
  font-size: clamp(8px, 1.8vw, 9px);
  letter-spacing: clamp(0.08em, 0.16vw, 0.2em);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.46);
  z-index: 10;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.landing-hero-hud-group {
  display: flex;
  gap: clamp(10px, 2vw, 20px);
}

/* Anatomy Section */
.landing-anatomy {
  position: relative;
  width: 100%;
  height: 320vh;
  background-color: var(--landing-bg);
}

.landing-anatomy-sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  min-height: 620px;
  overflow: hidden;
  background-color: var(--landing-bg);
}

.landing-anatomy-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.landing-anatomy-header {
  position: relative;
  z-index: 10;
  padding: clamp(22px, 4vw, 48px);
  max-width: 520px;
  pointer-events: none;
}

.landing-eyebrow {
  font-family: var(--landing-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--landing-accent);
}

.landing-anatomy-title {
  margin: 12px 0 0;
  font-family: var(--landing-display);
  font-variation-settings: "opsz" 120, "WONK" 1;
  font-weight: 600;
  font-size: clamp(24px, 3.2vw, 44px);
  line-height: 1.18;
  letter-spacing: -0.03em;
  color: #ffffff;
  text-shadow: 0 2px 16px rgba(11, 11, 12, 0.85);
}

.landing-anatomy-desc {
  margin: 14px 0 0;
  font-family: var(--landing-mono);
  font-size: 12px;
  line-height: 1.68;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 2px 12px rgba(11, 11, 12, 0.9);
}

.landing-stage-bar {
  position: absolute;
  left: clamp(24px, 5vw, 56px);
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--landing-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  z-index: 10;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.landing-stage-num {
  color: rgba(255, 255, 255, 0.28);
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
  transition: color 240ms ease, border-color 240ms ease;
}

.landing-stage-num.is-active {
  color: var(--landing-accent);
  border-bottom-color: var(--landing-accent);
}

.landing-stage-pct {
  color: rgba(255, 255, 255, 0.36);
  margin-left: 4px;
}

/* Launch Section */
.landing-launch {
  position: relative;
  width: 100%;
  min-height: 48vh;
  background-color: var(--landing-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px 80px;
  overflow: hidden;
}

.landing-launch-rule {
  position: absolute;
  top: 0;
  left: clamp(24px, 5vw, 56px);
  right: clamp(24px, 5vw, 56px);
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 45, 22, 0.38) 50%, transparent 100%);
}

.landing-launch-diamond {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translateX(-50%) rotate(45deg);
  border: 1px solid var(--landing-accent);
  background-color: var(--landing-bg);
}

.landing-launch-eyebrow {
  margin-bottom: 20px;
  text-align: center;
}

.landing-launch-heading {
  margin: 0 0 34px;
  font-family: var(--landing-display);
  font-variation-settings: "opsz" 120, "WONK" 1;
  font-weight: 600;
  font-size: clamp(26px, 3.6vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-align: center;
}

.portal-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 20px 44px;
  background: rgba(18, 18, 21, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0;
  color: #ffffff;
  font-family: var(--landing-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  overflow: visible;
  transition: border-color 0.35s ease, background-color 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.portal-cta:hover {
  border-color: rgba(255, 45, 22, 0.78);
  background: rgba(255, 45, 22, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(255, 45, 22, 0.18), inset 0 0 24px rgba(255, 45, 22, 0.08);
}

.portal-cta:active {
  transform: translateY(0);
}

.portal-cta__corner {
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.35s ease;
}

.portal-cta__corner--tl {
  top: -5px;
  left: -5px;
  border-top: 1.5px solid var(--landing-accent);
  border-left: 1.5px solid var(--landing-accent);
}

.portal-cta__corner--tr {
  top: -5px;
  right: -5px;
  border-top: 1.5px solid var(--landing-accent);
  border-right: 1.5px solid var(--landing-accent);
}

.portal-cta__corner--bl {
  bottom: -5px;
  left: -5px;
  border-bottom: 1.5px solid var(--landing-accent);
  border-left: 1.5px solid var(--landing-accent);
}

.portal-cta__corner--br {
  bottom: -5px;
  right: -5px;
  border-bottom: 1.5px solid var(--landing-accent);
  border-right: 1.5px solid var(--landing-accent);
}

.portal-cta:hover .portal-cta__corner--tl { transform: translate(-4px, -4px); }
.portal-cta:hover .portal-cta__corner--tr { transform: translate(4px, -4px); }
.portal-cta:hover .portal-cta__corner--bl { transform: translate(-4px, 4px); }
.portal-cta:hover .portal-cta__corner--br { transform: translate(4px, 4px); }

.portal-cta__sheen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.portal-cta__sheen::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 68, 42, 0.25), transparent);
  transform: skewX(-20deg);
  transition: left 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.portal-cta:hover .portal-cta__sheen::after {
  left: 130%;
}

.portal-cta__label {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.portal-cta__arrow {
  display: inline-block;
  color: var(--landing-accent);
  transition: transform 0.3s ease;
}

.portal-cta:hover .portal-cta__arrow {
  transform: translateX(5px);
}

.landing-launch-note {
  margin-top: 18px;
  font-family: var(--landing-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.56);
  text-align: center;
}

/* Center-Split Unseal Twin Doors */
.landing-split {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  pointer-events: none;
}

.landing-door {
  position: absolute;
  inset: 0;
  transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1), opacity 490ms ease;
}

.landing-door--left {
  clip-path: inset(0 50% 0 0);
  transform: translateX(0);
}

.landing-door--right {
  clip-path: inset(0 0 0 50%);
  transform: translateX(0);
}

.landing-split.is-open .landing-door--left {
  transform: translateX(-52%);
  opacity: 0.15;
}

.landing-split.is-open .landing-door--right {
  transform: translateX(52%);
  opacity: 0.15;
}

.landing-door-viewport {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #0b0b0c;
}

.landing-seam-track {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-1px);
  opacity: 1;
  transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease 160ms;
}

.landing-split.is-open .landing-seam-track--left {
  transform: translateX(-51vw);
  opacity: 0;
}

.landing-split.is-open .landing-seam-track--right {
  transform: translateX(51vw);
  opacity: 0;
}

.landing-seam-beam {
  width: 100%;
  height: 100%;
  background: #ff2d16;
  box-shadow: 0 0 18px 2px rgba(255, 45, 22, 0.78);
  transform: scaleY(0);
  transition: transform 120ms cubic-bezier(0.22, 1, 0.36, 1);
}

.landing-split.is-seamed .landing-seam-beam {
  transform: scaleY(1);
}

@media (max-width: 680px) {
  .landing-skip-btn {
    top: 18px;
    right: 36px;
    padding: 6px 10px;
    font-size: 10px;
  }
  .landing-hero-copy {
    padding: 24px;
  }
  .landing-hero-sub {
    font-size: 15px;
  }
  .portal-cta {
    padding: 16px 26px;
    font-size: 11px;
    letter-spacing: 0.16em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-door,
  .landing-seam-track,
  .landing-seam-beam {
    transition-duration: 180ms;
  }
}
