:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #05080e;
  --blue: #0c57ba;
  --blue-bright: #3b9dff;
  --cyan: #85e6ff;
  --stage-bg: #060a11;
  --stage-line: rgba(93, 181, 255, 0.08);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", SimSun, serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

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

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

body {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--sans);
  background: var(--paper);
  transition: background-color 620ms ease;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

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

.experience {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  isolation: isolate;
}

.welcome {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--paper);
  transition:
    background-color 650ms ease,
    visibility 0s linear;
}

.welcome::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(10, 69, 151, 0.12), transparent);
  opacity: 0.7;
}

.welcome__inner {
  display: flex;
  width: min(90vw, 720px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}

.welcome__mark-wrap {
  position: relative;
  display: grid;
  width: clamp(280px, 48vmin, 500px);
  aspect-ratio: 1;
  place-items: center;
  margin-bottom: clamp(28px, 4.5vh, 50px);
}

.welcome__halo {
  position: absolute;
  width: 73%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(41, 129, 238, 0.07) 0%, rgba(41, 129, 238, 0) 70%);
  transform: scale(1.32);
  animation: haloBreathe 4.8s ease-in-out infinite;
}

.welcome__mark-picture {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.welcome__mark {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 20px rgba(7, 36, 83, 0.08));
  transform-origin: 50% 52%;
  will-change: transform, opacity, filter;
}

.enter-button {
  position: relative;
  min-width: min(100%, 330px);
  min-height: 54px;
  padding: 15px 26px;
  border: 2px solid #05080e;
  border-radius: 0;
  color: var(--blue);
  background: #ffffff;
  box-shadow: 5px 5px 0 #05080e;
  font-size: clamp(16px, 2.5vw, 18px);
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.enter-button::before,
.enter-button::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-color: var(--blue);
  border-style: solid;
  opacity: 0;
  transition: opacity 180ms ease;
}

.enter-button::before {
  top: 5px;
  left: 5px;
  border-width: 1px 0 0 1px;
}

.enter-button::after {
  right: 5px;
  bottom: 5px;
  border-width: 0 1px 1px 0;
}

.enter-button:hover {
  color: #ffffff;
  background: var(--blue);
  box-shadow: 2px 2px 0 #05080e;
  transform: translate(3px, 3px);
}

.enter-button:hover::before,
.enter-button:hover::after {
  border-color: #b9e8ff;
  opacity: 1;
}

.enter-button:active {
  box-shadow: 0 0 0 #05080e;
  transform: translate(5px, 5px);
}

.enter-button:focus-visible,
.countdown__link:focus-visible {
  outline: 3px solid #53b7ff;
  outline-offset: 4px;
}

.enter-button:disabled {
  pointer-events: none;
}

.welcome.is-departing {
  background: var(--stage-bg);
}

.welcome.is-departing .welcome__halo,
.welcome.is-departing .enter-button {
  animation: softVanish 420ms ease forwards;
}

.welcome.is-departing .welcome__mark {
  animation: markDepart 1050ms cubic-bezier(0.78, 0, 0.2, 1) forwards;
}

.welcome.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.reveal-stage {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--stage-bg);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 800ms ease,
    visibility 0s linear 800ms;
}

body[data-stage="transitioning"] .reveal-stage,
body[data-stage="revealed"] .reveal-stage {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 800ms ease,
    visibility 0s;
}

.reveal-stage__grid {
  position: absolute;
  inset: 0;
  opacity: 0.8;
  background-image:
    linear-gradient(var(--stage-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--stage-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 72%);
  transform: perspective(500px) rotateX(0deg);
}

.reveal-stage__grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 43%, transparent 0 18%, rgba(1, 6, 13, 0.55) 68%);
}

.reveal-stage__aura {
  position: absolute;
  top: 42%;
  left: 50%;
  width: min(74vmin, 720px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(45, 147, 255, 0.2) 0%, rgba(16, 87, 182, 0.07) 35%, transparent 70%);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.65);
  transition:
    opacity 1.2s ease,
    transform 1.8s cubic-bezier(0.18, 0.72, 0.18, 1);
}

body[data-stage="revealed"] .reveal-stage__aura {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.hud {
  position: absolute;
  right: clamp(20px, 4vw, 54px);
  left: clamp(20px, 4vw, 54px);
  display: flex;
  justify-content: space-between;
  color: rgba(160, 216, 255, 0.38);
  font-family: "Bahnschrift", "DIN Alternate", Consolas, sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 900ms ease 500ms;
}

.hud--top {
  top: max(24px, env(safe-area-inset-top));
}

body[data-stage="transitioning"] .hud,
body[data-stage="revealed"] .hud {
  opacity: 1;
}

.particle-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transition: opacity 1.2s ease;
}

.particle-canvas.is-settled {
  opacity: 0.34;
}

.scan-beam {
  position: absolute;
  z-index: 3;
  top: -20%;
  left: 50%;
  width: 1px;
  height: 52%;
  background: linear-gradient(180deg, transparent, rgba(79, 192, 255, 0.55), transparent);
  box-shadow: 0 0 18px rgba(78, 189, 255, 0.6);
  opacity: 0;
  pointer-events: none;
}

body[data-stage="transitioning"] .scan-beam {
  animation: scanBeam 1.8s cubic-bezier(0.35, 0, 0.3, 1) 450ms;
}

.crest-lockup {
  position: relative;
  z-index: 4;
  display: flex;
  width: min(94vw, 980px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 7vh;
  opacity: 0;
  transform: translateY(6px);
}

.crest-core {
  position: relative;
  display: grid;
  width: clamp(200px, 30vmin, 304px);
  aspect-ratio: 1;
  place-items: center;
}

.crest-core__mark {
  position: relative;
  z-index: 2;
  display: block;
  width: 84%;
  height: 84%;
  object-fit: contain;
  filter:
    brightness(1.55)
    saturate(1.1)
    drop-shadow(0 0 8px rgba(66, 183, 255, 0.76))
    drop-shadow(0 0 28px rgba(25, 113, 255, 0.56));
  opacity: 0;
  transform: scale(0.88);
  transition:
    opacity 700ms ease,
    transform 1.2s cubic-bezier(0.16, 0.8, 0.22, 1);
}

body[data-stage="revealed"] .crest-lockup {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 450ms ease,
    transform 1s ease;
}

body[data-stage="revealed"] .crest-core__mark {
  opacity: 1;
  transform: scale(1);
  transition-delay: 100ms;
}

.crest-core__orbit {
  position: absolute;
  border: 1px solid rgba(111, 206, 255, 0.22);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.72);
  transition:
    opacity 900ms ease,
    transform 1.3s cubic-bezier(0.2, 0.75, 0.25, 1);
}

.crest-core__orbit::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #9aeeff;
  box-shadow: 0 0 10px #2e9fff;
}

.crest-core__orbit--outer {
  inset: -8%;
  border-style: dashed;
  animation: orbitSpin 18s linear infinite;
}

.crest-core__orbit--inner {
  inset: 3%;
  border-color: rgba(111, 206, 255, 0.14);
  animation: orbitSpinReverse 13s linear infinite;
}

body[data-stage="revealed"] .crest-core__orbit {
  opacity: 1;
  transform: scale(1);
}

.crest-core__bracket {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: rgba(111, 213, 255, 0.64);
  border-style: solid;
  opacity: 0;
  transition:
    inset 650ms ease 350ms,
    opacity 500ms ease 350ms;
}

.crest-core__bracket--tl {
  top: 29%;
  left: 29%;
  border-width: 1px 0 0 1px;
}

.crest-core__bracket--tr {
  top: 29%;
  right: 29%;
  border-width: 1px 1px 0 0;
}

.crest-core__bracket--br {
  right: 29%;
  bottom: 29%;
  border-width: 0 1px 1px 0;
}

.crest-core__bracket--bl {
  bottom: 29%;
  left: 29%;
  border-width: 0 0 1px 1px;
}

body[data-stage="revealed"] .crest-core__bracket {
  width: 24px;
  height: 24px;
  opacity: 1;
}

body[data-stage="revealed"] .crest-core__bracket--tl {
  top: 7%;
  left: 7%;
}

body[data-stage="revealed"] .crest-core__bracket--tr {
  top: 7%;
  right: 7%;
}

body[data-stage="revealed"] .crest-core__bracket--br {
  right: 7%;
  bottom: 7%;
}

body[data-stage="revealed"] .crest-core__bracket--bl {
  bottom: 7%;
  left: 7%;
}

.motto {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: clamp(27px, 4vh, 44px) 0 0;
  color: var(--cyan);
  font-family: var(--serif);
  font-size: clamp(17px, 2.2vmin, 24px);
  font-weight: 500;
  letter-spacing: 0.11em;
  line-height: 1.8;
  text-align: center;
  text-shadow:
    0 0 8px rgba(79, 190, 255, 0.45),
    0 0 26px rgba(32, 120, 255, 0.28);
  opacity: 0;
  transform: translateY(10px);
}

.motto span {
  display: inline-block;
  white-space: nowrap;
}

body[data-stage="revealed"] .motto {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 900ms ease 500ms,
    transform 1.1s cubic-bezier(0.16, 0.75, 0.2, 1) 420ms;
}

.countdown {
  position: fixed;
  z-index: 30;
  right: clamp(16px, 4vw, 54px);
  bottom: max(18px, env(safe-area-inset-bottom));
  left: clamp(16px, 4vw, 54px);
  padding-top: 14px;
  color: rgba(191, 231, 255, 0.7);
  font-family: "Bahnschrift", "DIN Alternate", var(--sans);
  border-top: 1px solid rgba(105, 198, 255, 0.17);
  opacity: 0;
  transform: translateY(12px);
}

.countdown.is-visible {
  animation: countdownIn 700ms ease forwards;
}

.countdown__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.countdown__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.13em;
}

.countdown__status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #63d8ff;
  box-shadow: 0 0 9px #2b9fff;
  animation: statusPulse 1.4s ease-in-out infinite;
}

.countdown__link {
  color: #9bdcff;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-decoration: none;
  border-bottom: 1px solid rgba(126, 212, 255, 0.24);
  transition:
    color 180ms ease,
    border-color 180ms ease;
}

.countdown__link:hover {
  color: #ffffff;
  border-color: #ffffff;
}

.countdown__readout {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.countdown__readout strong {
  color: #e9fbff;
  font-size: clamp(25px, 3.5vw, 39px);
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow: 0 0 16px rgba(73, 193, 255, 0.56);
}

.countdown__readout span {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.countdown__rail {
  height: 1px;
  margin-top: 9px;
  overflow: hidden;
  background: rgba(100, 187, 255, 0.12);
}

.countdown__rail span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #2480ff, #8deaff);
  box-shadow: 0 0 8px rgba(86, 202, 255, 0.6);
  transform-origin: left center;
}

.noscript-message {
  position: fixed;
  z-index: 50;
  right: 20px;
  bottom: 20px;
  left: 20px;
  padding: 16px;
  color: #15345e;
  background: #ffffff;
  border: 1px solid #15345e;
  text-align: center;
}

@keyframes haloBreathe {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1.22);
  }
  50% {
    opacity: 1;
    transform: scale(1.42);
  }
}

@keyframes softVanish {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.94);
  }
}

@keyframes markDepart {
  0% {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    filter: drop-shadow(0 18px 20px rgba(7, 36, 83, 0.08));
  }
  24% {
    opacity: 1;
    transform: rotate(-7deg) scale(0.87);
    filter: drop-shadow(0 0 18px rgba(63, 177, 255, 0.22));
  }
  100% {
    opacity: 0;
    transform: rotate(190deg) scale(0.035);
    filter: blur(3px) drop-shadow(0 0 40px rgba(63, 177, 255, 0.9));
  }
}

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

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

@keyframes scanBeam {
  0% {
    opacity: 0;
    transform: translate3d(-50%, 0, 0);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(-50%, 240vh, 0);
  }
}

@keyframes countdownIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes statusPulse {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@media (max-width: 640px) {
  .welcome__inner {
    width: 100%;
  }

  .welcome__mark-wrap {
    width: min(76vw, 350px);
    margin-bottom: 32px;
  }

  .enter-button {
    width: min(82vw, 330px);
    min-width: 0;
    padding-inline: 16px;
    font-size: 16px;
  }

  .reveal-stage {
    place-items: start center;
    padding-top: 18vh;
  }

  .reveal-stage__grid {
    background-size: 42px 42px;
  }

  .hud {
    right: 18px;
    left: 18px;
    font-size: 8px;
    letter-spacing: 0.11em;
  }

  .hud span:last-child {
    display: none;
  }

  .crest-core {
    width: min(61vw, 280px);
  }

  .motto {
    max-width: 90vw;
    margin-top: 24px;
    font-size: 17px;
    letter-spacing: 0.075em;
    line-height: 1.85;
  }

  .motto span {
    white-space: normal;
  }

  .countdown {
    right: 18px;
    bottom: max(14px, env(safe-area-inset-bottom));
    left: 18px;
  }

  .countdown__topline {
    gap: 12px;
  }

  .countdown__status {
    font-size: 9px;
    letter-spacing: 0.08em;
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  .welcome__mark-wrap {
    width: min(42vh, 280px);
    margin-bottom: 16px;
  }

  .reveal-stage {
    place-items: center;
  }

  .crest-core {
    width: min(44vh, 260px);
  }

  .motto {
    margin-top: 14px;
    font-size: 16px;
  }

  .crest-lockup {
    padding-bottom: 9vh;
  }
}

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

  .particle-canvas {
    display: none;
  }
}
