:root {
  --ink: #030405;
  --paper: #e9e5da;
  --muted: rgba(233, 229, 218, 0.48);
  --faint: rgba(233, 229, 218, 0.16);
  --accent: #e8a849;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100svh;
  color: var(--paper);
  font-family: Bahnschrift, "Microsoft YaHei UI", sans-serif;
  letter-spacing: 0.01em;
}

button,
a {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 5px;
}

#starfield,
.space-glow,
.grain,
.frame {
  position: fixed;
  inset: 0;
}

#starfield {
  z-index: 0;
  width: 100%;
  height: 100%;
}

.space-glow {
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 48%, transparent 0, rgba(4, 7, 10, 0.08) 17%, rgba(3, 4, 5, 0.66) 75%),
    linear-gradient(100deg, rgba(19, 29, 38, 0.12), transparent 45%, rgba(232, 168, 73, 0.025));
  box-shadow: inset 0 0 22vw 8vw #010203;
  transition: opacity 1.8s ease;
}

.grain {
  z-index: 7;
  pointer-events: none;
  opacity: 0.09;
  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='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.62'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.frame {
  z-index: 8;
  pointer-events: none;
  margin: 20px;
}

.frame i {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: rgba(233, 229, 218, 0.34);
  border-style: solid;
}

.frame i:nth-child(1) { top: 0; left: 0; border-width: 1px 0 0 1px; }
.frame i:nth-child(2) { top: 0; right: 0; border-width: 1px 1px 0 0; }
.frame i:nth-child(3) { right: 0; bottom: 0; border-width: 0 1px 1px 0; }
.frame i:nth-child(4) { bottom: 0; left: 0; border-width: 0 0 1px 1px; }

.masthead,
.footer {
  position: fixed;
  right: 42px;
  left: 42px;
  z-index: 5;
  display: grid;
  align-items: center;
  transition: opacity 0.9s ease, transform 0.9s var(--ease);
}

.masthead {
  top: 34px;
  grid-template-columns: 1fr auto 1fr;
}

.mark {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.mark-number {
  font-family: Impact, Haettenschweiler, sans-serif;
  font-size: 2.15rem;
  line-height: 0.8;
  letter-spacing: -0.04em;
}

.mark-unit,
.coordinates,
.signal,
.footer,
.eyebrow,
.fine-print {
  font-size: 0.61rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.mark-unit {
  color: var(--muted);
  letter-spacing: 0.14em;
}

.coordinates {
  margin: 0;
  color: var(--muted);
}

.signal {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--muted);
}

.signal span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: signal 2.2s ease-in-out infinite;
}

main {
  position: relative;
  z-index: 4;
  min-height: 100svh;
}

.panel {
  position: absolute;
  top: 50%;
  left: clamp(42px, 10vw, 160px);
  width: min(680px, calc(100vw - 84px));
  transform: translateY(-47%);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 28px;
  color: var(--muted);
}

.eyebrow::after {
  width: 84px;
  height: 1px;
  margin-left: 6px;
  background: var(--faint);
  content: "";
}

.eyebrow span {
  color: var(--accent);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 32px;
  font-weight: 400;
  line-height: 0.86;
  letter-spacing: -0.065em;
}

.title-large {
  display: block;
  font-family: Impact, Haettenschweiler, "Microsoft YaHei UI", sans-serif;
  font-size: clamp(4.2rem, 9.5vw, 9rem);
  letter-spacing: -0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.promise {
  margin-bottom: 38px;
  color: rgba(233, 229, 218, 0.58);
  font-family: "STSong", "SimSun", serif;
  font-size: clamp(0.95rem, 1.25vw, 1.1rem);
  line-height: 1.9;
  letter-spacing: 0.08em;
}

.launch {
  position: relative;
  display: flex;
  width: min(292px, 100%);
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px 0 24px;
  overflow: hidden;
  border: 1px solid rgba(233, 229, 218, 0.42);
  border-radius: 0;
  background: rgba(3, 4, 5, 0.35);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  cursor: pointer;
  backdrop-filter: blur(7px);
  transition: border-color 0.35s ease, color 0.35s ease;
}

.launch::before {
  position: absolute;
  inset: 0;
  background: var(--paper);
  content: "";
  transform: translateX(-102%);
  transition: transform 0.55s var(--ease);
}

.launch:hover {
  color: var(--ink);
  border-color: var(--paper);
}

.launch:hover::before {
  transform: translateX(0);
}

.launch-label,
.launch-icon {
  position: relative;
  z-index: 1;
}

.launch-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(233, 229, 218, 0.25);
  font-size: 1rem;
  transition: border-color 0.35s ease, transform 0.35s ease;
}

.launch:hover .launch-icon {
  border-color: rgba(3, 4, 5, 0.3);
  transform: translateX(2px);
}

.fine-print {
  margin: 14px 0 0 2px;
  color: rgba(233, 229, 218, 0.3);
  letter-spacing: 0.13em;
}

.intro > * {
  opacity: 0;
  animation: reveal 0.9s var(--ease) forwards;
}

.intro {
  transition: opacity 0.6s ease, transform 0.7s var(--ease), visibility 0s;
}

.intro .eyebrow { animation-delay: 0.2s; }
.intro h1 { animation-delay: 0.34s; }
.intro .promise { animation-delay: 0.48s; }
.intro .launch { animation-delay: 0.62s; }
.intro .fine-print { animation-delay: 0.7s; }

.transit {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 1.2s ease;
}

.reticle {
  position: relative;
  width: min(33vw, 400px);
  aspect-ratio: 1;
  border: 1px solid rgba(232, 168, 73, 0.1);
  border-radius: 50%;
  animation: rotate 18s linear infinite;
}

.reticle::before {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.reticle::before {
  inset: 12%;
  border: 1px dashed rgba(233, 229, 218, 0.08);
}

.reticle span {
  position: absolute;
  background: rgba(232, 168, 73, 0.45);
}

.reticle span:nth-child(1),
.reticle span:nth-child(2) { top: -4px; left: 50%; width: 1px; height: 8px; }
.reticle span:nth-child(2) { top: auto; bottom: -4px; }
.reticle span:nth-child(3),
.reticle span:nth-child(4) { top: 50%; left: -4px; width: 8px; height: 1px; }
.reticle span:nth-child(4) { right: -4px; left: auto; }

.result {
  visibility: hidden;
  opacity: 0;
  transform: translateY(-43%);
  transition: opacity 1.2s ease 0.2s, transform 1.2s var(--ease) 0.2s, visibility 0s linear 1.4s;
}

.result h2 {
  margin: 0 0 28px;
  font-family: "STSong", "SimSun", serif;
  font-size: clamp(1.85rem, 3.7vw, 4rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.06em;
}

.result h2 span,
.result h2 strong {
  display: block;
}

.result h2 strong {
  margin-top: 8px;
  font-family: Impact, Haettenschweiler, "Microsoft YaHei UI", sans-serif;
  font-size: clamp(5.8rem, 14vw, 12.5rem);
  font-weight: 400;
  letter-spacing: -0.06em;
}

.again {
  padding: 0 0 9px;
  border: 0;
  border-bottom: 1px solid rgba(233, 229, 218, 0.35);
  background: transparent;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.again span {
  display: inline-block;
  margin-left: 24px;
  color: var(--accent);
  transition: transform 0.3s ease;
}

.again:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.again:hover span {
  transform: translate(3px, -3px);
}

.footer {
  bottom: 35px;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  color: rgba(233, 229, 218, 0.28);
}

.footer p {
  margin: 0;
}

.footer p:last-child {
  justify-self: end;
  color: rgba(233, 229, 218, 0.52);
}

body[data-state="traveling"] .intro,
body[data-state="traveling"] .masthead,
body[data-state="traveling"] .footer > p {
  pointer-events: none;
  opacity: 0;
}

body[data-state="traveling"] .intro {
  transform: translate(-20px, -47%);
  transition: opacity 0.7s ease, transform 0.8s var(--ease);
}

body[data-state="traveling"] .result {
  visibility: hidden;
  opacity: 0;
  transition: none;
}

body[data-state="traveling"] .masthead {
  transform: translateY(-12px);
}

body[data-state="traveling"] .transit {
  opacity: 0.66;
}

body[data-state="traveling"] .space-glow {
  opacity: 0.25;
}

body[data-state="complete"] .intro,
body[data-state="complete"] .transit {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

body[data-state="complete"] .result {
  visibility: visible;
  opacity: 1;
  transform: translateY(-47%);
  transition: opacity 1.2s ease 0.2s, transform 1.2s var(--ease) 0.2s, visibility 0s;
}

body[data-state="resetting"] .intro,
body[data-state="resetting"] .transit {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

body[data-state="resetting"] .result {
  visibility: visible;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-51%);
  transition: opacity 0.4s ease, transform 0.5s var(--ease), visibility 0s linear 0.5s;
}

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

@keyframes signal {
  50% { opacity: 0.35; box-shadow: 0 0 3px var(--accent); }
}

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

@media (max-width: 680px) {
  .frame { margin: 12px; }
  .masthead, .footer { right: 28px; left: 28px; }
  .masthead { top: 28px; grid-template-columns: 1fr auto; }
  .coordinates { display: none; }
  .panel { left: 28px; width: calc(100vw - 56px); }
  .title-large { font-size: clamp(4.2rem, 18vw, 5.2rem); }
  .promise { margin-bottom: 30px; }
  .footer { bottom: 27px; grid-template-columns: 1fr auto; }
  .footer > p:first-child { display: none; }
  .reticle { width: 64vw; }
}

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