:root {
  color-scheme: dark;
  --background: #030712;
  --text: #f8fafc;
  --muted: #94a3b8;
  --dim: #64748b;
  --cyan: #67e8f9;
  --green: #34d399;
  --font-display: "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

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

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

body {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--background);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
}

.cosmos, .aurora-fallback, .vignette, .portal-bloom {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cosmos {
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.webgl-ready .cosmos { opacity: 1; }

.aurora-fallback {
  z-index: 0;
  background:
    radial-gradient(circle at 50% 52%, rgba(37, 99, 235, 0.22), transparent 28%),
    radial-gradient(ellipse at 28% 58%, rgba(76, 29, 149, 0.17), transparent 42%),
    radial-gradient(ellipse at 74% 42%, rgba(8, 145, 178, 0.11), transparent 40%),
    linear-gradient(180deg, #020617, #050816 58%, #030712);
}

.webgl-ready .aurora-fallback { opacity: 0; }

.vignette {
  z-index: 1;
  background: radial-gradient(circle at center, transparent 18%, rgba(2, 6, 23, 0.35) 58%, rgba(2, 6, 23, 0.88) 100%);
}

.portal-bloom {
  z-index: 1;
  inset: 50% auto auto 50%;
  width: min(52rem, 78vw);
  height: min(52rem, 78vw);
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.09), rgba(79, 70, 229, 0.025) 42%, transparent 68%);
  filter: blur(12px);
  animation: breathe 7s ease-in-out infinite;
}

.system-bar, .hero, footer { position: relative; z-index: 2; }

.system-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 6rem, 80rem);
  margin: 0 auto;
  padding-top: 2.5rem;
  color: var(--dim);
  font: 600 0.68rem/1 var(--font-mono);
  letter-spacing: 0.18em;
}

.status-pill, .identity {
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.9rem;
}

.status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0.9rem rgba(52, 211, 153, 0.75);
  animation: status-pulse 2.4s ease-in-out infinite;
}

.system-meta { display: flex; gap: 0.8rem; }
.system-node { color: rgba(96, 165, 250, 0.8); }

.hero {
  align-self: center;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100% - 3rem, 50rem);
  text-align: center;
}

.identity {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.7rem;
  padding: 0.52rem 1rem;
  color: #bae6fd;
  font: 700 0.72rem/1 var(--font-mono);
  letter-spacing: 0.3em;
}

.identity span {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0.75rem rgba(103, 232, 249, 0.65);
}

h1 {
  margin: 0;
  font-size: clamp(2.8rem, 5vw, 4.7rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.045em;
  text-shadow: 0 0 2.6rem rgba(96, 165, 250, 0.12);
}

h1 span, h1 strong { display: block; }

h1 strong {
  color: transparent;
  background: linear-gradient(100deg, #dbeafe 5%, #7dd3fc 48%, #c7d2fe 92%);
  background-clip: text;
  -webkit-background-clip: text;
}

.intro {
  max-width: 36rem;
  margin: 1.8rem 0 2.7rem;
  color: rgba(203, 213, 225, 0.78);
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
  line-height: 1.8;
  letter-spacing: 0.025em;
}

.portal-action {
  position: relative;
  border-radius: 999px;
  transition: transform 180ms ease-out;
  will-change: transform;
}

.button-aura {
  position: absolute;
  inset: -0.3rem;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #22d3ee, #8b5cf6);
  opacity: 0.38;
  filter: blur(1.15rem);
  transition: opacity 350ms ease, filter 350ms ease;
}

.portal-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-width: 15.2rem;
  padding: 0.9rem 1.25rem 0.9rem 1.8rem;
  border: 1px solid rgba(96, 165, 250, 0.42);
  border-radius: inherit;
  color: var(--text);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(3, 7, 18, 0.95));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.1), 0 0.75rem 2.6rem rgba(37, 99, 235, 0.12);
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: border-color 250ms ease, box-shadow 250ms ease, background 250ms ease;
}

.portal-link:hover {
  border-color: rgba(103, 232, 249, 0.8);
  background: linear-gradient(180deg, rgba(17, 31, 59, 0.96), rgba(3, 7, 18, 0.98));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16), 0 0 2.3rem rgba(37, 99, 235, 0.3);
}

.portal-action:hover .button-aura { opacity: 0.86; filter: blur(1.5rem); }
.portal-link:focus-visible { outline: 2px solid var(--cyan); outline-offset: 0.35rem; }

.arrow {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(96, 165, 250, 0.4);
  border-radius: 50%;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.16);
  transition: color 250ms ease, background 250ms ease, transform 250ms ease;
}

.arrow svg {
  width: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-link:hover .arrow { color: white; background: #2563eb; transform: translateX(0.16rem) rotate(8deg); }

.target {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 1.35rem 0 0;
  color: var(--dim);
  font: 500 0.7rem/1.4 var(--font-mono);
  letter-spacing: 0.12em;
}

.target-url { color: rgba(203, 213, 225, 0.82); letter-spacing: 0.03em; }
.separator { width: 0.25rem; height: 0.25rem; border-radius: 50%; background: #475569; }
.encrypted { color: rgba(52, 211, 153, 0.82); }

footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  padding: 0 1.5rem 2.4rem;
  color: rgba(148, 163, 184, 0.58);
  font: 500 0.66rem/1.5 var(--font-mono);
  letter-spacing: 0.25em;
  text-align: center;
}

footer p { margin: 0; }

.signal-line {
  width: 1px;
  height: 2rem;
  background: linear-gradient(transparent, rgba(71, 85, 105, 0.7), rgba(34, 211, 238, 0.7));
}

@keyframes breathe {
  0%, 100% { opacity: 0.65; scale: 0.96; }
  50% { opacity: 1; scale: 1.04; }
}

@keyframes status-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@media (max-width: 720px) {
  .system-bar { justify-content: center; width: 100%; padding-top: 2rem; }
  .system-meta { display: none; }
  .status-pill { padding: 0.48rem 0.78rem; font-size: 0.62rem; }
  .hero { width: min(100% - 2.5rem, 28rem); }
  .identity { margin-bottom: 1.35rem; padding: 0.48rem 0.78rem; font-size: 0.66rem; letter-spacing: 0.22em; }
  h1 { font-size: clamp(2.15rem, 10vw, 3.1rem); line-height: 1.25; letter-spacing: -0.035em; }
  .intro { max-width: 19rem; margin: 1.25rem 0 2.1rem; font-size: 0.9rem; line-height: 1.75; }
  .portal-link { min-width: 13.5rem; padding: 0.76rem 1rem 0.76rem 1.4rem; font-size: 0.98rem; }
  .arrow { width: 1.8rem; height: 1.8rem; }
  .target { gap: 0.5rem; margin-top: 1.1rem; font-size: 0.62rem; }
  .target > :first-child { display: none; }
  footer { padding-bottom: 1.8rem; font-size: 0.58rem; letter-spacing: 0.18em; }
  .portal-bloom { width: 28rem; height: 28rem; }
}

@media (max-height: 620px) {
  .system-bar { padding-top: 1rem; }
  .identity { margin-bottom: 0.8rem; }
  .intro { margin: 0.8rem 0 1.2rem; }
  footer { padding-bottom: 0.8rem; }
  .signal-line { display: none; }
}

@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;
  }
}
