.landing-page {
  --mouse-x: 0.5;
  --mouse-y: 0.5;
  min-height: 100dvh;
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  background: linear-gradient(155deg, #050c1f, #0b1f3d 42%, #112f57);
}

.landing-page::before,
.landing-page::after {
  display: none;
}

.landing-background {
  position: fixed;
  inset: -8%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-layer,
.starfield,
.shooting-stars {
  position: absolute;
  inset: 0;
}

.bg-image {
  background-image: url("../pngs/background-first.png");
  background-size: cover;
  background-position: center;
  transform: translate3d(
      calc((var(--mouse-x) - 0.5) * -52px),
      calc((var(--mouse-y) - 0.5) * -34px),
      0
    )
    scale(1.14);
  filter: saturate(1.12) contrast(1.08) brightness(0.52);
  transition: transform 0.22s linear, filter 0.35s ease;
}

.bg-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 52% 28%, rgba(97, 210, 255, 0.22), transparent 50%),
    radial-gradient(circle at 18% 78%, rgba(255, 149, 83, 0.18), transparent 44%),
    linear-gradient(160deg, rgba(6, 15, 34, 0.32), rgba(3, 7, 18, 0.7));
}

.bg-vignette {
  opacity: 0.95;
  background:
    radial-gradient(circle at 20% 15%, rgba(115, 192, 255, 0.16), transparent 36%),
    radial-gradient(circle at 80% 82%, rgba(59, 130, 246, 0.14), transparent 40%),
    radial-gradient(circle at 50% 52%, transparent 44%, rgba(3, 7, 18, 0.68));
  animation: atmosphere-shift 16s ease-in-out infinite alternate;
}

.starfield {
  z-index: 2;
}

.star {
  --star-size: 2px;
  --star-opacity: 0.7;
  position: absolute;
  width: var(--star-size);
  height: var(--star-size);
  border-radius: 50%;
  background: rgba(236, 247, 255, var(--star-opacity));
  box-shadow: 0 0 10px rgba(130, 195, 255, 0.5);
  animation: star-twinkle var(--duration, 2.8s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.shooting-stars {
  z-index: 3;
  overflow: hidden;
}

.shooting-star {
  position: absolute;
  width: min(34vw, 220px);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0),
    rgba(229, 243, 255, 0.98) 35%,
    rgba(140, 208, 255, 0.82) 62%,
    rgba(255, 255, 255, 0)
  );
  filter: drop-shadow(0 0 10px rgba(157, 214, 255, 0.72));
  transform-origin: left center;
  animation: shooting-star-flight var(--duration, 1800ms) ease-out forwards;
}

.shooting-star::before {
  content: "";
  position: absolute;
  left: 38%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 255, 255, 1), rgba(165, 220, 255, 0.35));
}

.landing-main {
  position: relative;
  z-index: 4;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.landing-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 1.2rem;
  width: min(100%, 64rem);
  text-align: center;
}

.landing-stage::before {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(70vw, 40rem);
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -48%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.14), transparent 70%);
  pointer-events: none;
  filter: blur(6px);
}

.landing-wordmark {
  position: relative;
  z-index: 1;
  margin: 0;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: center;
  width: max-content;
  max-width: none;
  gap: 0;
  white-space: nowrap;
  font-size: min(10.5rem, 15vw, calc((100vw - 2.5rem) / 5.9));
  line-height: 0.9;
  letter-spacing: -0.05em;
  color: rgba(241, 248, 255, 0.96);
  text-shadow:
    0 0 26px rgba(160, 214, 255, 0.24),
    0 18px 42px rgba(2, 10, 26, 0.56);
  animation: name-breathe 6.2s ease-in-out infinite;
}

.landing-name-fragment {
  display: inline-block;
}

.landing-name-space {
  width: 0.28em;
  flex: 0 0 auto;
}

.landing-clue {
  position: relative;
  z-index: 1;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(4, 12, 30, 0.36);
  color: var(--ui-text-soft);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: 0 14px 30px rgba(2, 10, 26, 0.26);
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.landing-letter {
  appearance: none;
  -webkit-appearance: none;
  display: inline;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  line-height: inherit;
  color: inherit;
  border-radius: 0;
  box-shadow: none;
  filter: none;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    color 0.18s ease,
    text-shadow 0.18s ease,
    opacity 0.18s ease;
}

.landing-letter::before,
.landing-letter::after {
  content: none;
  display: none;
}

.landing-letter:hover {
  transform: translateY(-0.02em);
  color: #f8fcff;
}

.landing-letter:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.94);
  outline-offset: 0.08em;
}

.landing-page[data-unlock-state="armed"] .landing-letter[data-unlock-letter="m"] {
  transform: translateY(-0.03em) scale(1.03);
  color: #85ddff;
  text-shadow:
    0 0 26px rgba(96, 205, 255, 0.56),
    0 0 60px rgba(96, 205, 255, 0.22);
}

.landing-page[data-unlock-state="armed"] .landing-clue {
  color: #dff7ff;
  border-color: rgba(96, 205, 255, 0.32);
  box-shadow:
    0 18px 34px rgba(2, 10, 26, 0.28),
    0 0 0 1px rgba(96, 205, 255, 0.12);
}

.landing-page[data-unlock-state="armed"] .landing-name-fragment:first-of-type {
  color: rgba(242, 249, 255, 0.98);
}

.landing-page[data-unlock-state="unlocked"] .landing-wordmark {
  color: rgba(230, 243, 255, 0.84);
}

.landing-page[data-unlock-state="unlocked"] .landing-letter[data-unlock-letter="m"],
.landing-page[data-unlock-state="unlocked"] .landing-letter[data-unlock-letter="j"] {
  color: #99e4ff;
  text-shadow:
    0 0 32px rgba(107, 216, 255, 0.62),
    0 0 78px rgba(107, 216, 255, 0.24);
}

.landing-page[data-unlock-state="unlocked"] .landing-clue {
  color: #effbff;
  border-color: rgba(121, 220, 255, 0.48);
  transform: translateY(-2px);
  box-shadow:
    0 20px 36px rgba(2, 10, 26, 0.3),
    0 0 0 1px rgba(121, 220, 255, 0.18);
}

.landing-page[data-unlock-feedback="armed"] .landing-clue,
.landing-page[data-unlock-feedback="success"] .landing-clue {
  animation: clue-pulse 0.42s ease;
}

.landing-page[data-unlock-feedback="reset"] .landing-wordmark {
  animation: unlock-reset 0.42s ease;
}

.landing-unlock-shell {
  position: relative;
  z-index: 1;
  min-height: 0;
  display: grid;
  place-items: center;
}

.landing-unlock-shell[hidden],
.landing-page:not([data-unlock-state="unlocked"]) .landing-unlock-shell {
  display: none !important;
}

.landing-unlock-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.35rem;
  padding: 0.86rem 1.5rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.68);
  background:
    linear-gradient(135deg, rgba(234, 247, 255, 0.98), rgba(121, 220, 255, 0.95)),
    rgba(255, 255, 255, 0.08);
  color: #05111e;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 22px 42px rgba(7, 18, 35, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.18);
  opacity: 0;
  transform: translateY(24px) scale(0.86);
  filter: blur(8px);
  animation: unlock-emerge 680ms cubic-bezier(0.19, 1, 0.22, 1) forwards;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.landing-unlock-cta::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0));
  transform: translateX(-120%);
  animation: unlock-sheen 0.92s ease 0.12s forwards;
  pointer-events: none;
}

.landing-unlock-cta:hover,
.landing-unlock-cta:focus-visible {
  transform: translateY(-2px) scale(1.01);
  border-color: rgba(var(--accent-rgb), 0.9);
  box-shadow:
    0 26px 46px rgba(7, 18, 35, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.24);
}

.landing-unlock-cta:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.96);
  outline-offset: 4px;
}

@keyframes atmosphere-shift {
  from {
    transform: translate3d(-1.5%, -1%, 0) scale(1);
  }

  to {
    transform: translate3d(1.5%, 1.2%, 0) scale(1.04);
  }
}

@keyframes star-twinkle {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.9);
  }

  50% {
    opacity: 0.95;
    transform: scale(1.15);
  }
}

@keyframes shooting-star-flight {
  from {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(var(--angle, -20deg)) scaleX(0.2);
  }

  8% {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: translate3d(var(--travel-x, -45vw), var(--travel-y, 28vh), 0)
      rotate(var(--angle, -20deg)) scaleX(1);
  }
}

@keyframes name-breathe {
  0%,
  100% {
    text-shadow:
      0 0 18px rgba(160, 214, 255, 0.24),
      0 16px 36px rgba(2, 10, 26, 0.48);
  }

  50% {
    text-shadow:
      0 0 30px rgba(160, 214, 255, 0.38),
      0 20px 44px rgba(2, 10, 26, 0.6);
  }
}

@keyframes unlock-emerge {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.86);
    filter: blur(8px);
    letter-spacing: 0.46em;
  }

  58% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
    letter-spacing: 0.32em;
  }
}

@keyframes unlock-sheen {
  from {
    transform: translateX(-120%);
  }

  to {
    transform: translateX(135%);
  }
}

@keyframes unlock-reset {
  0%,
  100% {
    transform: translateX(0);
  }

  24% {
    transform: translateX(-10px);
  }

  58% {
    transform: translateX(8px);
  }

  82% {
    transform: translateX(-4px);
  }
}

@keyframes clue-pulse {
  0% {
    transform: scale(0.98);
    opacity: 0.86;
  }

  60% {
    transform: scale(1.03);
    opacity: 1;
  }

  100% {
    transform: scale(1);
  }
}

@media (max-width: 720px) {
  .landing-unlock-cta {
    font-size: 0.76rem;
    letter-spacing: 0.26em;
    padding-inline: 1.2rem;
  }

  .landing-clue {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
  }
}

@media (max-width: 480px) {
  .landing-main {
    padding: 1rem;
  }

  .landing-name-space {
    width: 0.22em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-vignette,
  .landing-wordmark,
  .star,
  .shooting-star,
  .landing-unlock-cta,
  .landing-unlock-cta::before {
    animation: none !important;
  }

  .bg-image,
  .landing-letter,
  .landing-clue,
  .landing-unlock-cta,
  .landing-page {
    transform: none !important;
    transition: none !important;
  }

  .landing-unlock-cta {
    opacity: 1;
    filter: none;
    letter-spacing: 0.32em;
  }
}
