:root {
  --gw-bg: #f6fbff;
  --gw-bg-2: #edf6ff;
  --gw-panel: rgba(255, 255, 255, 0.78);
  --gw-panel-strong: rgba(255, 255, 255, 0.94);
  --gw-line: rgba(48, 116, 220, 0.18);
  --gw-line-strong: rgba(42, 112, 222, 0.34);
  --gw-blue: #1f74ff;
  --gw-cyan: #24b8ff;
  --gw-text: #0a1b34;
  --gw-muted: #5d718c;
  --gw-soft: #2c5d9b;
  --gw-shadow: 0 24px 70px rgba(38, 114, 224, 0.15);
  --gw-radius: 8px;
  --gw-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body.gateway-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 38%, rgba(64, 147, 255, 0.14), transparent 34%),
    radial-gradient(circle at 18% 20%, rgba(95, 200, 255, 0.16), transparent 28%),
    radial-gradient(circle at 86% 72%, rgba(56, 118, 255, 0.12), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, var(--gw-bg) 52%, var(--gw-bg-2) 100%);
  color: var(--gw-text);
  font-family: var(--gw-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.gateway-bg,
.gateway-bg::before,
.gateway-bg::after,
.grid-plane,
.nebula {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.gateway-bg {
  z-index: 0;
  overflow: hidden;
}

.gateway-bg::before {
  content: "";
  opacity: 0.66;
  background-image:
    linear-gradient(rgba(58, 126, 232, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58, 126, 232, 0.07) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 72%, transparent);
}

.gateway-bg::after {
  content: "";
  background:
    radial-gradient(circle at 50% 48%, rgba(42, 126, 255, 0.16), transparent 26%),
    radial-gradient(circle at 28% 34%, rgba(59, 182, 255, 0.12), transparent 24%),
    radial-gradient(circle at 74% 58%, rgba(36, 108, 255, 0.1), transparent 26%);
  filter: blur(10px);
}

.nebula {
  width: 38vw;
  height: 38vw;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(43, 131, 255, 0.16), transparent 62%);
  filter: blur(24px);
}

.nebula-a {
  left: -16vw;
  top: -5vh;
}

.nebula-b {
  right: -14vw;
  bottom: -12vh;
}

.grid-plane {
  top: auto;
  height: 30vh;
  background:
    linear-gradient(rgba(45, 120, 230, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 120, 230, 0.08) 1px, transparent 1px);
  background-size: 64px 40px;
  transform: perspective(740px) rotateX(62deg) translateY(5vh);
  transform-origin: bottom center;
  opacity: 0.42;
}

.gateway-main {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(1180px, calc(100% - 40px));
  min-height: 100svh;
  margin: 0 auto;
  place-items: center;
}

.gateway-hero {
  display: grid;
  width: 100%;
  gap: clamp(24px, 4vw, 44px);
  padding: clamp(30px, 6vh, 72px) 0;
}

.hero-copy {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  transition:
    opacity 0.58s ease,
    transform 0.58s ease;
}

.hero-copy h1 {
  margin: 0;
  color: var(--gw-text);
  font-size: clamp(44px, 6.2vw, 86px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: 0;
}

.hero-subtitle {
  margin: 14px auto 0;
  color: var(--gw-muted);
  font-size: clamp(16px, 1.8vw, 22px);
  line-height: 1.6;
  font-weight: 650;
}

.gateway-stage {
  display: grid;
  grid-template-columns: minmax(210px, 0.72fr) minmax(320px, 1fr) minmax(210px, 0.72fr);
  gap: clamp(18px, 2.8vw, 34px);
  align-items: center;
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gateway-orbit {
  position: relative;
  width: min(540px, 44vw);
  min-width: 320px;
  aspect-ratio: 1;
  margin: 0 auto;
  cursor: grab;
  opacity: 1;
  transform: scale(1);
  transition:
    opacity 0.7s ease,
    transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gateway-orbit.is-dragging {
  cursor: grabbing;
}

.gateway-orbit canvas,
.core-ring,
.core-pulse {
  position: absolute;
  inset: 0;
}

.gateway-orbit canvas {
  width: 100%;
  height: 100%;
}

.core-ring {
  margin: 10%;
  border: 1px solid rgba(43, 125, 255, 0.2);
  border-radius: 999px;
  box-shadow:
    inset 0 0 42px rgba(59, 151, 255, 0.12),
    0 0 58px rgba(58, 138, 255, 0.18);
  animation: ringSpin 18s linear infinite;
}

.ring-two {
  margin: 22%;
  border-style: dashed;
  opacity: 0.78;
  animation-duration: 12s;
  animation-direction: reverse;
}

.core-pulse {
  inset: 40%;
  border-radius: 999px;
  background:
    radial-gradient(circle, #ffffff 0%, #7fe3ff 18%, #2679ff 48%, transparent 70%);
  box-shadow:
    0 0 34px rgba(62, 174, 255, 0.72),
    0 0 90px rgba(31, 116, 255, 0.34);
  animation: coreBreath 2.8s ease-in-out infinite;
}

.entry-card {
  position: relative;
  min-width: 0;
  min-height: 172px;
  padding: clamp(18px, 2.4vw, 24px);
  overflow: hidden;
  border: 1px solid var(--gw-line);
  border-radius: var(--gw-radius);
  background:
    linear-gradient(180deg, var(--gw-panel-strong), var(--gw-panel)),
    rgba(255, 255, 255, 0.84);
  box-shadow: var(--gw-shadow);
  backdrop-filter: blur(16px);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.entry-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  opacity: 0;
  background:
    radial-gradient(circle at 20% 18%, rgba(46, 151, 255, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(53, 126, 255, 0.12), transparent 45%);
  transition: opacity 0.18s ease;
}

.entry-card > * {
  position: relative;
  z-index: 1;
}

.entry-card:hover {
  transform: translateY(-3px);
  border-color: var(--gw-line-strong);
  box-shadow: 0 28px 80px rgba(38, 114, 224, 0.2);
}

.entry-card:hover::before {
  opacity: 1;
}

.entry-label {
  margin: 0 0 16px;
  color: var(--gw-blue);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
}

.entry-card h2 {
  margin: 0;
  color: var(--gw-text);
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.18;
  font-weight: 850;
  letter-spacing: 0;
}

.entry-desc {
  margin: 12px 0 20px;
  color: var(--gw-muted);
  font-size: 14px;
  line-height: 1.7;
}

.entry-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(42, 125, 255, 0.38);
  border-radius: 999px;
  background: linear-gradient(135deg, #2478ff, #35c3ff);
  color: #ffffff;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 14px 32px rgba(36, 119, 255, 0.24);
}

.entry-button.secondary {
  background: rgba(255, 255, 255, 0.86);
  color: var(--gw-blue);
  box-shadow: none;
}

.is-booting .hero-copy,
.is-booting .gateway-stage {
  opacity: 0;
  transform: translateY(14px);
}

.intro-stage-1 .hero-copy {
  opacity: 1;
  transform: translateY(0);
}

.intro-stage-1 .gateway-stage {
  opacity: 1;
}

.intro-stage-1 .gateway-orbit {
  transform: scale(0.82);
}

.intro-stage-2 .gateway-orbit,
.intro-complete .gateway-orbit {
  transform: scale(1);
}

.intro-stage-2 .gateway-stage,
.intro-complete .gateway-stage {
  opacity: 1;
  transform: translateY(0);
}

@keyframes ringSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes coreBreath {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.18);
    opacity: 1;
  }
}

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

@media (max-width: 900px) {
  .gateway-stage {
    grid-template-columns: 1fr;
    width: min(540px, 100%);
    margin: 0 auto;
  }

  .gateway-orbit {
    grid-row: 1;
    width: min(420px, 86vw);
    min-width: 0;
  }

  .entry-card {
    min-height: 150px;
  }
}

@media (max-width: 520px) {
  .gateway-main {
    width: min(100% - 28px, 1180px);
  }

  .gateway-hero {
    gap: 22px;
    padding: 28px 0;
  }

  .hero-copy h1 {
    font-size: clamp(42px, 14vw, 62px);
  }

  .hero-subtitle {
    margin-top: 12px;
    font-size: 15px;
  }

  .gateway-orbit {
    width: min(360px, 92vw);
  }

  .entry-card {
    min-height: 144px;
    padding: 18px;
  }

  .entry-card h2 {
    font-size: 23px;
  }
}
