:root {
  color-scheme: dark;
  --obsidian: #080a09;
  --obsidian-soft: #0f1411;
  --deep-green: #17221d;
  --champagne: #b89a63;
  --muted-gold: #8d7750;
  --ivory: #eee9df;
  --ivory-dim: rgba(238, 233, 223, 0.58);
  --line: rgba(238, 233, 223, 0.14);
  --safe-top: max(22px, env(safe-area-inset-top));
  --safe-bottom: max(22px, env(safe-area-inset-bottom));
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--obsidian);
}

body {
  overflow: hidden;
  color: var(--ivory);
  font-family: "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

a:focus-visible {
  outline: 1px solid var(--champagne);
  outline-offset: 6px;
}

.landing {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 590px;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 46%, rgba(38, 54, 45, 0.22), transparent 34%),
    linear-gradient(145deg, #0d110f 0%, var(--obsidian) 62%, #0b0e0c 100%);
  perspective: 1200px;
}

.landing::after {
  position: absolute;
  z-index: 30;
  inset: 0;
  border: 1px solid rgba(238, 233, 223, 0.055);
  pointer-events: none;
  content: "";
}

.webgl-canvas,
.fallback-space,
.depth-vignette,
.film-grain,
.opening-veil,
.handoff-occluder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.webgl-canvas {
  z-index: 2;
  display: block;
  opacity: 0;
  transition: opacity 850ms ease;
  touch-action: none;
}

.landing.has-webgl .webgl-canvas {
  opacity: 1;
}

.depth-vignette {
  z-index: 4;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 44%, transparent 24%, rgba(2, 4, 3, 0.12) 62%, rgba(2, 4, 3, 0.72) 110%),
    linear-gradient(180deg, rgba(4, 6, 5, 0.38), transparent 24%, transparent 72%, rgba(4, 6, 5, 0.5));
}

.film-grain {
  z-index: 5;
  opacity: 0.065;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.48'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.opening-veil {
  z-index: 20;
  opacity: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 54%, rgba(14, 19, 16, 0.65), rgba(4, 5, 5, 0.98) 62%),
    var(--obsidian);
  transition: opacity 980ms cubic-bezier(.2,.7,.2,1);
}

.landing.is-awake .opening-veil {
  opacity: 0;
}

.handoff-occluder {
  z-index: 24;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 76% 46%, rgba(15, 18, 14, 0) 0%, rgba(7, 9, 8, 0.35) 28%, rgba(3, 4, 4, 0.96) 73%),
    #020302;
  transition: opacity 150ms cubic-bezier(.36,.02,.68,.2);
}

.landing.is-handoff-cover .handoff-occluder {
  opacity: 1;
}

.landing-header {
  position: absolute;
  z-index: 14;
  top: var(--safe-top);
  left: max(22px, env(safe-area-inset-left));
  right: max(22px, env(safe-area-inset-right));
  display: flex;
  justify-content: space-between;
  color: rgba(238, 233, 223, 0.34);
  font: 8px/1.2 monospace;
  letter-spacing: 0.2em;
  pointer-events: none;
}

.landing-header p {
  margin: 0;
}

.landing-ui {
  position: absolute;
  z-index: 12;
  left: clamp(28px, 8vw, 132px);
  top: 50%;
  width: min(82vw, 760px);
  padding: clamp(30px, 4.2vw, 60px) clamp(28px, 4.5vw, 66px);
  opacity: 0;
  filter: blur(12px);
  transform: translate3d(0, 36px, 50px) rotateY(-1.5deg);
  transform-origin: left center;
  transition:
    opacity 1100ms ease,
    filter 1300ms cubic-bezier(.2,.7,.2,1),
    transform 1450ms cubic-bezier(.16,.75,.2,1);
  pointer-events: none;
}

.landing-ui::before {
  position: absolute;
  z-index: -1;
  inset: -12% 12% -12% -8%;
  background:
    linear-gradient(90deg, rgba(6, 9, 8, 0.3), rgba(6, 9, 8, 0.08) 48%, transparent 76%),
    radial-gradient(circle at 22% 50%, rgba(31, 43, 37, 0.13), transparent 60%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  content: "";
  -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.55) 58%, transparent 92%);
  mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.55) 58%, transparent 92%);
}

.landing.is-ui-visible .landing-ui {
  opacity: 1;
  filter: blur(0);
  transform: translate3d(0, -50%, 0) rotateY(-0.35deg);
  pointer-events: auto;
}

.ui-axis {
  position: absolute;
  top: 0;
  left: -8px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--champagne);
}

.ui-axis span {
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(184, 154, 99, 0.72));
}

.ui-axis i {
  width: 5px;
  height: 5px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.brand {
  margin: 0 0 16px;
  color: var(--champagne);
  font-size: 10px;
  letter-spacing: 0.36em;
}

.brand-cn {
  margin: 0 0 15px;
  color: rgba(238, 233, 223, 0.56);
  font-size: 12px;
  letter-spacing: 0.32em;
}

.landing-ui h1 {
  margin: 0;
  max-width: 720px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(54px, 7.2vw, 104px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.055em;
  text-shadow: 0 14px 44px rgba(0, 0, 0, 0.24);
}

.landing-subtitle {
  margin: 26px 0 0;
  color: var(--ivory-dim);
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: 0.13em;
}

.enter-link {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  width: min(100%, 390px);
  min-height: 62px;
  margin-top: 38px;
  padding: 0 18px;
  border-top: 1px solid rgba(238, 233, 223, 0.3);
  border-bottom: 1px solid rgba(238, 233, 223, 0.12);
  background: rgba(8, 11, 9, 0.2);
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 700ms ease,
    transform 800ms cubic-bezier(.16,.75,.2,1),
    background 220ms ease;
  cursor: default;
}

.landing.is-cta-visible .enter-link {
  opacity: 1;
  transform: none;
  cursor: pointer;
}

.enter-link > span {
  font-size: 13px;
  letter-spacing: 0.14em;
}

.enter-link > i {
  height: 1px;
  background: linear-gradient(90deg, rgba(184, 154, 99, 0.75), transparent);
  transform-origin: left;
}

.enter-link > b {
  color: var(--champagne);
  font: 8px/1 monospace;
  letter-spacing: 0.2em;
}

.enter-link:active {
  background: rgba(184, 154, 99, 0.08);
  transform: translateY(2px) scaleY(0.975) !important;
}

.prototype-note {
  position: absolute;
  right: 12%;
  bottom: 20px;
  margin: 0;
  color: rgba(238, 233, 223, 0.22);
  font: 7px/1 monospace;
  letter-spacing: 0.19em;
  writing-mode: vertical-rl;
}

.depth-key {
  position: absolute;
  z-index: 13;
  right: max(24px, 3vw);
  bottom: max(28px, var(--safe-bottom));
  display: grid;
  grid-template-columns: auto 86px auto;
  align-items: center;
  gap: 9px;
  color: rgba(238, 233, 223, 0.24);
  font: 7px/1 monospace;
  letter-spacing: 0.14em;
  opacity: 0;
  transition: opacity 900ms ease;
  pointer-events: none;
}

.depth-key i {
  height: 1px;
  background: linear-gradient(90deg, rgba(238, 233, 223, 0.08), rgba(184, 154, 99, 0.5));
}

.landing.is-ui-visible .depth-key {
  opacity: 1;
}

.landing.is-opening .landing-ui {
  opacity: 0;
  filter: blur(9px);
  transform: translate3d(-1.5vw, -50%, -80px) rotateY(2deg);
  transition-duration: 720ms;
}

.landing.is-opening .depth-key,
.landing.is-opening .landing-header {
  opacity: 0;
  transition: opacity 420ms ease;
}

.landing.is-opening .depth-vignette {
  background:
    radial-gradient(circle at 50% 44%, transparent 12%, rgba(2, 4, 3, 0.06) 56%, rgba(2, 4, 3, 0.62) 115%),
    linear-gradient(180deg, rgba(4, 6, 5, 0.18), transparent 28%, transparent 76%, rgba(4, 6, 5, 0.3));
}

.fallback-space {
  z-index: 1;
  overflow: hidden;
  opacity: 0.78;
  transform-style: preserve-3d;
  transition: opacity 800ms ease;
  pointer-events: none;
}

.landing.has-webgl .fallback-space {
  opacity: 0.08;
}

.landing.webgl-failed .fallback-space {
  opacity: 1;
}

.fallback-haze {
  position: absolute;
  width: 72vw;
  height: 58vh;
  border-radius: 50%;
  filter: blur(70px);
}

.haze-a {
  left: -22%;
  bottom: -11%;
  background: rgba(38, 67, 53, 0.16);
}

.haze-b {
  top: -25%;
  right: -18%;
  background: rgba(154, 124, 76, 0.08);
}

.fallback-track {
  position: absolute;
  left: -12%;
  top: 57%;
  width: 126%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(184, 154, 99, 0.12) 20%, rgba(184, 154, 99, 0.66) 57%, transparent 86%);
  box-shadow: 0 0 24px rgba(184, 154, 99, 0.07);
  transform: perspective(560px) rotateX(52deg) rotateZ(-8deg);
}

.fallback-crystal {
  position: absolute;
  width: 34px;
  height: 180px;
  border: 1px solid rgba(184, 154, 99, 0.25);
  background: linear-gradient(130deg, rgba(184, 154, 99, 0.1), rgba(28, 46, 37, 0.17) 52%, transparent);
  box-shadow: inset 9px 0 24px rgba(238, 233, 223, 0.018);
  transform-style: preserve-3d;
}

.fallback-crystal::before {
  position: absolute;
  top: -84px;
  bottom: -90px;
  left: 50%;
  width: 1px;
  background: linear-gradient(transparent, rgba(184, 154, 99, 0.34), transparent);
  content: "";
}

.fallback-crystal i {
  position: absolute;
  inset: 0;
  border-right: 9px solid rgba(16, 29, 23, 0.18);
  transform: translateZ(-16px) skewY(-12deg);
}

.crystal-a {
  left: -2%;
  top: 18%;
  width: 78px;
  height: 330px;
  opacity: 0.4;
  filter: blur(3px);
  transform: rotate(-4deg) perspective(700px) rotateY(18deg);
}

.crystal-b {
  left: 26%;
  bottom: 4%;
  width: 25px;
  height: 150px;
  opacity: 0.46;
  transform: perspective(600px) rotateY(-18deg);
}

.crystal-c {
  right: 9%;
  top: 6%;
  width: 62px;
  height: 290px;
  opacity: 0.42;
  filter: blur(2px);
  transform: rotate(3deg) perspective(650px) rotateY(-21deg);
}

.crystal-d {
  right: 30%;
  bottom: 10%;
  width: 18px;
  height: 98px;
  opacity: 0.34;
  filter: blur(0.5px);
}

.fallback-note {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 180px;
  height: 78px;
  padding: 12px 18px;
  border: 1px solid rgba(184, 154, 99, 0.24);
  background: linear-gradient(135deg, rgba(43, 57, 48, 0.45), rgba(11, 15, 13, 0.6));
  color: rgba(184, 154, 99, 0.46);
  font-family: Georgia, serif;
  letter-spacing: 0.18em;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
}

.fallback-note span {
  font-size: 30px;
}

.fallback-note b {
  font-size: 10px;
}

.note-a {
  left: 7%;
  top: 30%;
  opacity: 0.22;
  filter: blur(2px);
  transform: perspective(800px) rotateY(54deg) rotateZ(-14deg) scale(1.2);
}

.note-b {
  right: 13%;
  top: 46%;
  opacity: 0.34;
  transform: perspective(700px) rotateX(23deg) rotateY(-38deg) rotateZ(9deg) scale(.76);
}

.note-c {
  left: 42%;
  top: 14%;
  opacity: 0.18;
  filter: blur(1px);
  transform: perspective(700px) rotateX(-18deg) rotateY(28deg) rotateZ(-8deg) scale(.48);
}

.landing.webgl-failed .fallback-crystal,
.landing.webgl-failed .fallback-note,
.landing.webgl-failed .fallback-track {
  animation: fallback-breathe 8s ease-in-out infinite alternate;
}

.landing.webgl-failed .note-b,
.landing.webgl-failed .crystal-c {
  animation-delay: -3.2s;
}

@keyframes fallback-breathe {
  to { translate: 1.2vw -1.4vh; }
}

.fallback-message {
  position: absolute;
  z-index: 14;
  left: max(22px, env(safe-area-inset-left));
  bottom: max(24px, var(--safe-bottom));
  margin: 0;
  color: rgba(238, 233, 223, 0.24);
  font: 7px/1 monospace;
  letter-spacing: 0.18em;
}

.noscript-panel {
  position: absolute;
  z-index: 50;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 18px;
  padding: 32px;
  background: var(--obsidian);
  text-align: center;
}

.noscript-panel p,
.noscript-panel h1 {
  margin: 0;
}

.noscript-panel a {
  display: inline-grid;
  place-items: center;
  min-height: 52px;
  border: 1px solid var(--line);
}

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

@media (hover: hover) and (pointer: fine) {
  .enter-link:hover {
    background: rgba(184, 154, 99, 0.07);
  }

  .enter-link:hover > i {
    transform: scaleX(1.08);
  }
}

@media (max-width: 680px) {
  .landing {
    min-height: 560px;
  }

  .landing-header {
    left: 18px;
    right: 18px;
    font-size: 7px;
  }

  #scene-status {
    max-width: 44vw;
    overflow: hidden;
    text-align: right;
    white-space: nowrap;
  }

  .landing-ui {
    left: 0;
    top: 48.5%;
    width: calc(100% - 16px);
    padding: 34px 30px 32px 38px;
  }

  .landing-ui::before {
    inset: -10% 0 -10% -6%;
    background:
      linear-gradient(90deg, rgba(6, 9, 8, 0.38), rgba(6, 9, 8, 0.09) 68%, transparent),
      radial-gradient(circle at 18% 50%, rgba(31, 43, 37, 0.14), transparent 65%);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  .brand {
    margin-bottom: 12px;
    font-size: 9px;
  }

  .brand-cn {
    margin-bottom: 12px;
    font-size: 11px;
  }

  .landing-ui h1 {
    font-size: clamp(45px, 13vw, 58px);
    line-height: 1.06;
  }

  .landing-subtitle {
    margin-top: 20px;
    font-size: 11px;
    letter-spacing: 0.1em;
  }

  .enter-link {
    min-height: 58px;
    margin-top: 30px;
  }

  .prototype-note {
    display: none;
  }

  .depth-key {
    right: 18px;
    bottom: var(--safe-bottom);
    grid-template-columns: auto 44px auto;
  }

  .fallback-message {
    bottom: var(--safe-bottom);
  }

  .crystal-a {
    left: -15%;
    width: 68px;
  }

  .crystal-c {
    right: -8%;
    width: 58px;
  }

  .note-a {
    left: -18%;
  }

  .note-b {
    right: -22%;
  }
}

@media (max-height: 690px) {
  .landing-ui {
    top: 49%;
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .landing-ui h1 {
    font-size: clamp(39px, 9.5vh, 58px);
  }

  .landing-subtitle {
    margin-top: 14px;
  }

  .enter-link {
    min-height: 52px;
    margin-top: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .opening-veil,
  .handoff-occluder,
  .webgl-canvas,
  .landing-ui,
  .enter-link,
  .depth-key {
    transition-duration: 220ms !important;
  }

  .landing.webgl-failed .fallback-crystal,
  .landing.webgl-failed .fallback-note,
  .landing.webgl-failed .fallback-track {
    animation: none !important;
  }

  .film-grain {
    display: none;
  }
}
