@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  background: #05060b;
  color: #d5e3f2;
  font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: rgba(103, 232, 255, 0.25);
}

.aurora,
.aurora i,
#fluid {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.aurora {
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.aurora i {
  position: absolute;
  inset: auto;
  border-radius: 50%;
  will-change: transform;
}

.aurora i:nth-child(1) {
  width: 95vmax;
  height: 95vmax;
  left: -28vmax;
  top: -38vmax;
  background: radial-gradient(closest-side, rgba(34, 170, 255, 0.16), transparent 70%);
  animation: drift1 26s ease-in-out infinite alternate;
}

.aurora i:nth-child(2) {
  width: 85vmax;
  height: 85vmax;
  right: -32vmax;
  top: -12vmax;
  background: radial-gradient(closest-side, rgba(255, 61, 199, 0.11), transparent 70%);
  animation: drift2 31s ease-in-out infinite alternate;
}

.aurora i:nth-child(3) {
  width: 100vmax;
  height: 70vmax;
  left: 8vmax;
  bottom: -46vmax;
  background: radial-gradient(closest-side, rgba(139, 92, 246, 0.13), transparent 70%);
  animation: drift3 37s ease-in-out infinite alternate;
}

body.no-webgl .aurora i:nth-child(1) {
  background: radial-gradient(closest-side, rgba(34, 170, 255, 0.3), transparent 70%);
}

body.no-webgl .aurora i:nth-child(2) {
  background: radial-gradient(closest-side, rgba(255, 61, 199, 0.22), transparent 70%);
}

body.no-webgl .aurora i:nth-child(3) {
  background: radial-gradient(closest-side, rgba(139, 92, 246, 0.25), transparent 70%);
}

@keyframes drift1 {
  to {
    transform: translate(9vmax, 6vmax) scale(1.14);
  }
}

@keyframes drift2 {
  to {
    transform: translate(-7vmax, 9vmax) scale(1.1);
  }
}

@keyframes drift3 {
  to {
    transform: translate(-10vmax, -7vmax) scale(1.18);
  }
}

#fluid {
  z-index: 1;
  display: block;
  pointer-events: none;
}

#cursor-glow {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2;
  width: 320px;
  height: 320px;
  margin: -160px 0 0 -160px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  background: radial-gradient(closest-side, rgba(140, 210, 255, 0.07), transparent 70%);
  mix-blend-mode: screen;
}

#cursor-glow.on {
  opacity: 1;
}

#cursor-glow.big {
  background: radial-gradient(closest-side, rgba(190, 150, 255, 0.12), transparent 72%);
}

.home {
  position: fixed;
  top: calc(1.1rem + env(safe-area-inset-top));
  left: calc(1.1rem + env(safe-area-inset-left));
  z-index: 5;
  display: inline-block;
  padding: 0.55em 1.3em;
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  color: #7f93b8;
  background: rgba(12, 18, 32, 0.35);
  border: 1px solid rgba(120, 200, 255, 0.12);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  transition: color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.home:hover,
.home:focus-visible {
  color: #ecf7ff;
  border-color: rgba(120, 200, 255, 0.45);
  box-shadow: 0 0 22px rgba(90, 180, 255, 0.16);
}

.stage {
  position: relative;
  z-index: 4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4.5rem 1.25rem 3.5rem;
  gap: 0;
}

@supports (height: 100dvh) {
  .stage {
    min-height: 100dvh;
  }
}

.title {
  display: flex;
  font-size: clamp(4rem, 17vw, 11.5rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-indent: 0.08em;
  line-height: 1;
  animation: hue-drift 14s ease-in-out infinite alternate;
}

.title .lt {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.title .lt span {
  display: inline-block;
  background: linear-gradient(
    115deg,
    #67e8ff 0%,
    #8b5cf6 42%,
    #ff5fd0 78%,
    #67e8ff 100%
  );
  background-size: 420% 100%;
  background-position: calc(var(--i) * 30%) 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transform: translateY(135%) rotate(5deg);
}

.has-js body.ready .title .lt span,
body.ready .title .lt span {
  transform: none;
  transition: transform 1.15s cubic-bezier(0.19, 1, 0.22, 1);
  transition-delay: calc(var(--i) * 85ms + 250ms);
}

html:not(.has-js) .title .lt span {
  transform: none;
}

.doors a:nth-child(1) {
  --d: 0;
}

.doors a:nth-child(2) {
  --d: 1;
}

.doors a:nth-child(3) {
  --d: 2;
}

.doors a:nth-child(4) {
  --d: 3;
}

.doors a:nth-child(5) {
  --d: 4;
}

.doors a:nth-child(6) {
  --d: 5;
}

@keyframes hue-drift {
  from {
    filter: hue-rotate(-18deg);
  }
  to {
    filter: hue-rotate(22deg);
  }
}

.tag {
  margin-top: 1.15rem;
  font-size: clamp(0.82rem, 2.6vw, 1rem);
  font-weight: 300;
  letter-spacing: 0.14em;
  color: #8494ba;
  max-width: 36ch;
  line-height: 1.65;
}

.doors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin-top: clamp(2.2rem, 7vh, 4rem);
  max-width: 30rem;
}

.doors a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6em 1.45em;
  border-radius: 999px;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: #9fb4d8;
  background: rgba(10, 16, 30, 0.38);
  border: 1px solid rgba(130, 200, 255, 0.13);
  backdrop-filter: blur(14px) saturate(1.35);
  -webkit-backdrop-filter: blur(14px) saturate(1.35);
  box-shadow: inset 0 0 22px rgba(80, 160, 255, 0.05);
  will-change: transform;
  transition: color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease,
    background 0.3s ease, opacity 0.9s ease, translate 0.9s cubic-bezier(0.19, 1, 0.22, 1);
}

.doors a:hover,
.doors a:focus-visible {
  color: #ecf7ff;
  border-color: rgba(130, 200, 255, 0.48);
  box-shadow: 0 0 26px rgba(90, 180, 255, 0.18), inset 0 0 22px rgba(80, 160, 255, 0.09);
}

.doors a:focus-visible,
.home:focus-visible {
  outline: 1px solid rgba(140, 220, 255, 0.75);
  outline-offset: 3px;
}

.has-js .tag,
.has-js .doors a,
.has-js .home,
.has-js .edge span {
  opacity: 0;
  translate: 0 14px;
}

.has-js body.ready .tag,
body.ready .tag {
  opacity: 1;
  translate: 0 0;
  transition: opacity 1s ease 0.62s, translate 1s cubic-bezier(0.19, 1, 0.22, 1) 0.62s;
}

.has-js body.ready .doors a,
body.ready .doors a {
  opacity: 1;
  translate: 0 0;
  transition-delay: calc(var(--d, 0) * 70ms + 0.78s);
}

body.ready .doors a:hover,
body.ready .doors a:focus-visible {
  transition-property: color, border-color, box-shadow, background;
  transition-duration: 0.3s;
  transition-delay: 0s;
}

.has-js body.ready .home,
body.ready .home {
  opacity: 1;
  translate: 0 0;
  transition: opacity 1s ease 0.3s, translate 1s ease 0.3s, color 0.3s ease,
    border-color 0.3s ease, box-shadow 0.3s ease;
}

body.ready .home:hover {
  transition-property: color, border-color, box-shadow;
  transition-delay: 0s;
}

.has-js body.ready .edge span,
body.ready .edge span {
  opacity: 1;
  translate: 0 0;
  transition: opacity 1.2s ease 1.25s, translate 1.2s ease 1.25s;
}

.edge {
  position: fixed;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  left: calc(1.2rem + env(safe-area-inset-left));
  right: calc(1.2rem + env(safe-area-inset-right));
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #46527a;
  pointer-events: none;
}

@media (hover: none) {
  .doors a:active {
    color: #ecf7ff;
    border-color: rgba(130, 200, 255, 0.5);
    background: rgba(20, 32, 54, 0.55);
    box-shadow: 0 0 26px rgba(90, 180, 255, 0.2);
  }
}

@media (max-width: 640px) {
  .stage {
    padding: 4rem 1rem 3.25rem;
  }

  .title {
    font-size: clamp(3.4rem, 21vw, 6rem);
    letter-spacing: 0.06em;
  }

  .tag {
    max-width: 30ch;
  }

  .doors {
    gap: 0.45rem;
    max-width: 21rem;
  }

  .doors a {
    font-size: 0.66rem;
    padding: 0.55em 1.15em;
  }

  .edge {
    font-size: 0.52rem;
    letter-spacing: 0.16em;
  }

  .home {
    font-size: 0.6rem;
    padding: 0.5em 1.05em;
  }

  #cursor-glow {
    display: none;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .stage {
    padding: 3.4rem 1.25rem 2.9rem;
  }

  .title {
    font-size: min(15vh, 5.2rem);
  }

  .tag {
    margin-top: 0.6rem;
    line-height: 1.45;
  }

  .doors {
    margin-top: 1.4rem;
    gap: 0.4rem;
  }

  .doors a {
    min-height: 38px;
    padding: 0.4em 1.1em;
  }
}

@media (min-width: 2000px) {
  .tag {
    font-size: 1.15rem;
  }

  .doors {
    max-width: 44rem;
    gap: 0.8rem;
  }

  .doors a {
    font-size: 0.88rem;
    min-height: 56px;
  }

  .home {
    font-size: 0.8rem;
  }

  .edge {
    font-size: 0.72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aurora i,
  .title,
  .title .lt span,
  #cursor-glow {
    animation: none !important;
    transition: none !important;
  }

  .has-js .tag,
  .has-js .doors a,
  .has-js .home,
  .has-js .edge span,
  .has-js .title .lt span {
    opacity: 1 !important;
    translate: none !important;
    transform: none !important;
  }

  .doors a,
  .home {
    transition: color 0.2s ease, border-color 0.2s ease;
  }
}
