:root {
  --bg-1: #32044a;
  --bg-2: #521e62;
  --bg-3: #723879;
  --accent-1: #935291;
  --accent-2: #b36ca8;
  --accent-3: #d386c0;
  --accent-4: #f3a0d7;
  --text: #fff5ff;
  --text-soft: #f9d8f5;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-family: "Space Grotesk", "Poppins", "Trebuchet MS", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at center, var(--bg-1) 0%, var(--bg-2) 52%, var(--bg-3) 100%);
  padding: 16px;
}

.bg-layer {
  position: fixed;
  inset: -10vmax;
  pointer-events: none;
  background:
    radial-gradient(circle at 25% 20%, rgb(243 160 215 / 0.22), transparent 42%),
    radial-gradient(circle at 80% 72%, rgb(211 134 192 / 0.2), transparent 45%);
  filter: blur(2px);
}

.hero {
  position: relative;
  z-index: 2;
  width: min(440px, 100%);
  text-align: center;
  padding: 28px 20px;
  border-radius: 22px;
  border: 1px solid rgb(243 160 215 / 0.3);
  background: rgb(32 5 44 / 0.34);
  backdrop-filter: blur(12px);
  box-shadow:
    0 16px 40px rgb(16 2 24 / 0.45),
    inset 0 1px 0 rgb(255 255 255 / 0.12);
}

.hero > * {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: reveal 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero > :nth-child(1) {
  animation-delay: 0.1s;
}

.hero > :nth-child(2) {
  animation-delay: 0.2s;
}

.hero > :nth-child(3) {
  animation-delay: 0.3s;
}

.hero > :nth-child(4) {
  animation-delay: 0.45s;
}

.hero > :nth-child(5) {
  animation-delay: 0.6s;
}

.eyebrow {
  margin: 0;
  font-size: clamp(0.68rem, 2vw, 0.78rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-4);
}

h1 {
  margin: 10px 0 8px;
  font-size: clamp(1.55rem, 5.2vw, 2.2rem);
  line-height: 1.08;
}

.lead {
  margin: 0 auto 22px;
  max-width: 29ch;
  color: var(--text-soft);
  font-size: clamp(0.95rem, 3.1vw, 1.02rem);
}

.join-btn {
  appearance: none;
  border: 2px solid #fff5ff;
  width: min(260px, 100%);
  min-height: 54px;
  border-radius: 999px;
  cursor: pointer;
  font-size: clamp(1rem, 4.2vw, 1.15rem);
  font-weight: 700;
  color: #23052e;
  text-shadow: 0 1px 0 rgb(255 255 255 / 0.45);
  background: linear-gradient(120deg, var(--accent-4), var(--accent-3), var(--accent-2));
  background-size: 180% 180%;
  box-shadow:
    0 14px 34px rgb(28 3 38 / 0.5),
    0 0 0 3px rgb(255 245 255 / 0.16),
    inset 0 1px 0 rgb(255 255 255 / 0.62);
  transition: transform 180ms ease, box-shadow 180ms ease;
  animation:
    gradientRun 6s ease infinite,
    pulse 2.4s ease-in-out infinite 1s;
}

.join-btn:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 18px 40px rgb(22 2 32 / 0.56),
    0 0 0 5px rgb(255 245 255 / 0.22);
}

.join-btn:active {
  transform: translateY(0) scale(0.98);
}

.join-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.join-btn:disabled {
  cursor: not-allowed;
  opacity: 0.88;
  filter: brightness(0.9);
  box-shadow:
    0 8px 20px rgb(18 2 26 / 0.35),
    0 0 0 2px rgb(255 245 255 / 0.12);
}

.status {
  min-height: 1.4em;
  margin: 12px 0 0;
  font-size: 0.89rem;
  color: var(--accent-4);
}

.icon-rain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.falling-icon {
  position: absolute;
  top: -15vh;
  left: var(--x, 50%);
  width: var(--size, 28px);
  opacity: var(--alpha, 0.8);
  filter: drop-shadow(0 6px 8px rgb(8 0 12 / 0.35));
  animation:
    fall var(--fall-time, 12s) linear infinite,
    sway var(--sway-time, 2.8s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s), var(--delay, 0s);
  will-change: transform;
}

@media (max-width: 420px) {
  .hero {
    padding: 24px 16px;
    border-radius: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero > *,
  .join-btn,
  .falling-icon {
    animation: none;
  }

  .join-btn {
    transition: none;
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes gradientRun {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow:
      0 14px 34px rgb(28 3 38 / 0.5),
      0 0 0 3px rgb(255 245 255 / 0.16),
      inset 0 1px 0 rgb(255 255 255 / 0.62);
  }

  50% {
    box-shadow:
      0 20px 46px rgb(28 3 38 / 0.62),
      0 0 0 8px rgb(255 245 255 / 0.24),
      inset 0 1px 0 rgb(255 255 255 / 0.68);
  }
}

@keyframes fall {
  from {
    transform: translateY(-16vh);
  }

  to {
    transform: translateY(126vh);
  }
}

@keyframes sway {
  from {
    margin-left: 0;
  }

  to {
    margin-left: var(--drift, 38px);
  }
}
