*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  background: #000;
  color: #fff;
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: Outfit, system-ui, sans-serif;
  cursor: pointer;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.72) 100%);
  z-index: 2;
}

.grain {
  position: fixed;
  inset: -40%;
  pointer-events: none;
  z-index: 3;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.45s steps(2) infinite;
}

@keyframes grain {
  0% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-2%, 1%);
  }
  50% {
    transform: translate(1%, -2%);
  }
  100% {
    transform: translate(-1%, 2%);
  }
}

#gate {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

#gate.gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hint {
  position: relative;
  display: grid;
  place-items: center;
  width: 9.5rem;
  height: 9.5rem;
}

.hint p {
  position: relative;
  z-index: 1;
  font-weight: 300;
  font-size: 0.92rem;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  text-transform: lowercase;
  color: rgba(255, 255, 255, 0.82);
  animation: breathe 2.6s ease-in-out infinite;
}

.ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  animation: ripple 2.6s ease-out infinite;
}

.ring.delay {
  animation-delay: 1.3s;
}

@keyframes ripple {
  0% {
    transform: scale(0.72);
    opacity: 0.55;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

#flash {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: #fff;
  opacity: 0;
}

#flash.go {
  animation: flash 0.5s ease-out;
}

@keyframes flash {
  0% {
    opacity: 0.5;
    background: #fff;
  }
  40% {
    opacity: 0.16;
    background: #ff4d7a;
  }
  100% {
    opacity: 0;
  }
}

#words {
  position: fixed;
  left: 50%;
  top: 66%;
  transform: translate(-50%, 0);
  z-index: 4;
  text-align: center;
  pointer-events: none;
  width: min(92vw, 40rem);
}

#name {
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  font-size: clamp(4.4rem, 22vw, 8.6rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow:
    0 0 24px rgba(255, 80, 130, 0.55),
    0 0 64px rgba(255, 40, 90, 0.35);
}

#name span {
  display: inline-block;
  opacity: 0;
  transform: translateY(28px) scale(0.86);
  filter: blur(10px);
}

#words.show #name span {
  animation: letterIn 1.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#name span:nth-child(1) {
  animation-delay: 0s;
}
#name span:nth-child(2) {
  animation-delay: 0.08s;
}
#name span:nth-child(3) {
  animation-delay: 0.16s;
}
#name span:nth-child(4) {
  animation-delay: 0.24s;
}
#name span:nth-child(5) {
  animation-delay: 0.32s;
}

#line {
  margin-top: 0.35rem;
  font-weight: 200;
  font-size: clamp(0.72rem, 3.2vw, 0.95rem);
  letter-spacing: 0.62em;
  text-indent: 0.62em;
  text-transform: lowercase;
  color: rgba(255, 214, 224, 0.78);
  opacity: 0;
  transform: translateY(10px);
}

#words.show #line {
  animation: lineIn 1.4s 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes letterIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes lineIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.lit {
  cursor: default;
}

@media (max-height: 700px) {
  #name {
    font-size: clamp(3.4rem, 16vw, 6.2rem);
  }
}
