:root {
  --black: #020306;
  --surface: rgba(8, 12, 19, 0.76);
  --surface-strong: rgba(9, 14, 22, 0.94);
  --white: #f7f9fc;
  --muted: #9ca8b8;
  --border: rgba(255, 255, 255, 0.2);
  --border-strong: rgba(255, 255, 255, 0.42);
  --cyan: #67e8f9;
  --amber: #f4c67a;
  --focus: #fbbf24;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
}

html {
  background: var(--black);
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--white);
  background: var(--black);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

img {
  display: block;
}

button {
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--black);
  background: var(--white);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.scene,
.scene canvas,
.scene-fallback {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene {
  z-index: 0;
  overflow: hidden;
  background: var(--black);
}

.scene canvas {
  display: block;
  opacity: 0;
  transition: opacity 400ms ease;
}

.scene.ready canvas {
  opacity: 1;
}

.scene-fallback {
  background-color: var(--black);
  opacity: 1;
}

.scene.ready .scene-fallback {
  opacity: 0;
}

.page {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  overflow: hidden;
}

.topbar {
  position: fixed;
  z-index: 10;
  inset: 0 0 auto;
  display: flex;
  min-height: 80px;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: max(18px, env(safe-area-inset-top)) clamp(24px, 4vw, 64px) 14px;
}

.brand {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 11px;
  font-size: 15px;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0c1018;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-name strong {
  color: var(--muted);
  font-weight: 500;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topnav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  color: #cbd3de;
  font-size: 13px;
  font-weight: 600;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.topnav a:hover {
  color: #fff;
}

.menu-button,
.menu-close {
  display: none;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 650;
}

.menu-button svg,
.menu-close svg,
.mobile-nav svg,
.button svg,
.copy-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 1.8;
}

.mobile-nav-backdrop,
.mobile-nav {
  display: none;
}

.hero {
  display: grid;
  min-height: 100dvh;
  align-items: center;
  padding: 112px clamp(24px, 8vw, 128px) 128px;
}

.hero-copy {
  position: relative;
  width: min(650px, 52vw);
  margin-left: clamp(0px, 5vw, 80px);
  animation: heroEnter 520ms ease-out both;
}

.signal {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 28px;
  color: #b6c0ce;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.signal span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 16px rgba(103, 232, 249, 0.7);
}

.intro {
  margin: 0 0 8px;
  color: #aab4c2;
  font-size: 16px;
}

.hero h1 {
  margin: 0;
  color: #ffffff;
  font-size: 76px;
  line-height: 1.06;
  font-weight: 650;
  text-shadow: 0 10px 42px rgba(0, 0, 0, 0.46);
}

.tagline {
  max-width: 520px;
  margin: 22px 0 0;
  color: #d0d6df;
  font-size: 18px;
  line-height: 1.7;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

.button {
  display: inline-flex;
  min-width: 132px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.button-primary {
  color: #071016;
  background: #f4f7fa;
}

.button-primary:hover {
  background: var(--cyan);
}

.button-secondary {
  color: #e5eaf0;
  border-color: var(--border);
  background: rgba(5, 8, 13, 0.56);
}

.button-secondary:hover {
  border-color: var(--border-strong);
  background: rgba(16, 22, 32, 0.78);
}

.hero-tools {
  display: block;
  width: min(100%, 470px);
  margin-top: 20px;
}

.endpoint-shell {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 4px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(5, 9, 15, 0.68);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.endpoint-label {
  color: #8d9aaa;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
}

.endpoint-shell code {
  min-width: 0;
  overflow: hidden;
  color: #e7edf4;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-button {
  display: inline-flex;
  min-width: 82px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  border: 0;
  border-radius: 5px;
  color: #dce5ee;
  background: rgba(255, 255, 255, 0.09);
  font-size: 12px;
  font-weight: 700;
  transition: color 180ms ease, background-color 180ms ease;
}

.copy-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.copy-button.copied {
  color: #071016;
  background: var(--cyan);
}

.planet-switcher {
  display: grid;
  min-width: 178px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(5, 9, 15, 0.68);
}

.top-planet-switcher {
  min-width: 178px;
}

.planet-option {
  display: inline-flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 9px;
  border: 0;
  border-radius: 4px;
  color: #9facbc;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  transition: color 180ms ease, background-color 180ms ease;
}

.planet-option svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke-width: 1.8;
}

.planet-option:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.planet-option.is-active {
  color: #071016;
  background: #f4f7fa;
}

.model-rail {
  position: fixed;
  z-index: 4;
  left: 50%;
  bottom: max(52px, calc(env(safe-area-inset-bottom) + 36px));
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(219, 226, 235, 0.7);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  transform: translateX(-50%);
  animation: railEnter 520ms 120ms ease-out both;
}

.footer {
  position: fixed;
  z-index: 4;
  right: clamp(24px, 4vw, 64px);
  bottom: max(18px, env(safe-area-inset-bottom));
  left: clamp(24px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: rgba(219, 226, 235, 0.68);
  font-size: 12px;
}

.footer a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.footer a:hover {
  color: var(--white);
}

body.custom-home-mode {
  overflow: auto;
}

.custom-home-frame {
  position: fixed;
  z-index: 20;
  inset: 0;
  width: 100%;
  height: 100dvh;
  border: 0;
  background: var(--black);
}

.custom-home-content {
  position: relative;
  z-index: 20;
  min-height: 100dvh;
  padding: clamp(28px, 6vw, 80px) clamp(20px, 8vw, 128px);
  color: var(--white);
  background: var(--black);
}

.custom-home-content > :first-child {
  margin-top: 0;
}

.custom-home-content img,
.custom-home-content video,
.custom-home-content iframe {
  max-width: 100%;
}

.custom-home-content a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.custom-home-content pre,
.custom-home-content code {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.custom-home-content pre {
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.custom-home-content blockquote {
  margin-left: 0;
  padding-left: 16px;
  border-left: 3px solid var(--cyan);
  color: #cbd3de;
}

.loading-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #aab4c2;
  background: var(--black);
  font-size: 12px;
  transition: opacity 240ms ease, visibility 240ms ease;
}

.loading-screen.done {
  visibility: hidden;
  opacity: 0;
}

.loading-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(103, 232, 249, 0.8);
  animation: loadingPulse 900ms ease-in-out infinite alternate;
}

.noscript {
  position: fixed;
  z-index: 200;
  right: 16px;
  bottom: 16px;
  left: 16px;
  margin: 0;
  padding: 14px;
  color: #fff;
  border: 1px solid var(--border);
  background: #111827;
  text-align: center;
}

@keyframes loadingPulse {
  from { opacity: 0.35; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.15); }
}

@keyframes heroEnter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes railEnter {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (min-width: 821px) and (max-width: 1100px) {
  .topbar {
    gap: 12px;
    padding-right: 20px;
    padding-left: 20px;
  }

  .topnav {
    gap: 0;
  }

  .topnav a {
    padding-right: 8px;
    padding-left: 8px;
    font-size: 12px;
  }

  .top-planet-switcher {
    min-width: 150px;
  }
}

@media (max-width: 820px) {
  .topbar {
    min-height: 72px;
    padding-inline: 20px;
  }

  .topnav {
    display: none;
  }

  .menu-button,
  .menu-close {
    display: inline-flex;
  }

  .mobile-nav-backdrop {
    position: fixed;
    z-index: 18;
    inset: 0;
    display: block;
    opacity: 0;
    background: rgba(0, 0, 0, 0.58);
    transition: opacity 180ms ease;
  }

  .mobile-nav {
    position: fixed;
    z-index: 20;
    top: max(76px, calc(env(safe-area-inset-top) + 64px));
    right: 20px;
    left: 20px;
    display: grid;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-strong);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.52);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 220ms ease, transform 220ms ease;
  }

  .mobile-nav-backdrop.is-open,
  .mobile-nav.is-open {
    opacity: 1;
  }

  .mobile-nav.is-open {
    transform: translateY(0);
  }

  .mobile-nav[hidden],
  .mobile-nav-backdrop[hidden] {
    display: none;
  }

  .mobile-nav-head {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    padding-left: 14px;
    color: #9ba8b8;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 12px;
  }

  .mobile-planet-control {
    display: grid;
    gap: 8px;
    padding: 8px 14px 12px;
    color: #9ba8b8;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 12px;
  }

  .mobile-planet-control .planet-switcher {
    width: 100%;
  }

  .menu-close {
    border-color: transparent;
    background: transparent;
  }

  .mobile-nav > a {
    display: flex;
    min-height: 48px;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    color: #dbe3ec;
    font-size: 14px;
    font-weight: 600;
  }

  .mobile-nav > a:hover,
  .mobile-nav > a:active {
    background: rgba(255, 255, 255, 0.08);
  }

  .mobile-nav .mobile-register {
    margin-top: 4px;
    color: #071016;
    background: #f4f7fa;
  }

  .hero {
    align-items: start;
    padding: 128px 24px 168px;
  }

  .hero-copy {
    width: 100%;
    margin-left: 0;
    text-align: center;
  }

  .signal,
  .actions {
    justify-content: center;
  }

  .hero h1 {
    font-size: 48px;
  }

  .tagline {
    margin-inline: auto;
    font-size: 17px;
  }

  .endpoint-shell {
    width: min(100%, 470px);
    margin-right: auto;
    margin-left: auto;
    text-align: left;
  }

  .hero-tools {
    width: 100%;
  }

  .model-rail {
    bottom: max(58px, calc(env(safe-area-inset-bottom) + 42px));
    width: calc(100% - 32px);
    justify-content: center;
    gap: 9px;
    font-size: 12px;
  }

  .footer {
    right: 20px;
    left: 20px;
  }
}

@media (max-width: 420px) {
  .brand-name {
    font-size: 14px;
  }

  .menu-button {
    min-width: 74px;
  }

  .hero {
    padding-inline: 16px;
  }

  .signal {
    margin-bottom: 20px;
    font-size: 12px;
  }

  .intro {
    font-size: 15px;
  }

  .hero h1 {
    font-size: 42px;
  }

  .tagline {
    font-size: 16px;
  }

  .actions {
    gap: 10px;
    margin-top: 28px;
  }

  .button {
    min-width: 124px;
  }

  .endpoint-shell {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 8px;
    padding-left: 12px;
  }

  .endpoint-label {
    grid-column: 1;
    align-self: end;
  }

  .endpoint-shell code {
    grid-column: 1;
    align-self: start;
  }

  .copy-button {
    grid-row: 1 / 3;
    grid-column: 2;
  }

  .footer a {
    display: none;
  }
}

@media (max-height: 640px) and (orientation: landscape) {
  .topbar {
    min-height: 64px;
    padding-top: 10px;
    padding-bottom: 8px;
  }

  .hero {
    padding-top: 68px;
    padding-bottom: 28px;
  }

  .hero-copy {
    width: min(520px, 62vw);
    margin-left: clamp(0px, 4vw, 40px);
  }

  .signal {
    margin-bottom: 6px;
  }

  .intro {
    display: none;
  }

  .hero h1 {
    font-size: 42px;
  }

  .tagline {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.45;
  }

  .actions {
    margin-top: 12px;
  }

  .endpoint-shell {
    min-height: 44px;
  }

  .hero-tools {
    width: min(100%, 520px);
    margin-top: 8px;
  }

  .endpoint-shell {
    width: auto;
    margin-inline: 0;
  }

  .top-planet-switcher {
    width: 166px;
    min-width: 166px;
  }

  .planet-option {
    padding-inline: 6px;
  }

  .model-rail {
    display: none;
  }

  .footer {
    display: none;
  }
}

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