* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background: #02030a;
  font-family: "Inter", Arial, Helvetica, sans-serif;
  color: white;
  overscroll-behavior: none;
}

body {
  cursor: default;
}

body.experience-ready {
  cursor: grab;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(circle at 18% 18%, rgba(73, 175, 255, 0.13), transparent 28%),
    radial-gradient(circle at 84% 72%, rgba(176, 93, 255, 0.12), transparent 30%),
    radial-gradient(circle at center, transparent 36%, rgba(0, 0, 0, 0.52) 100%);
  mix-blend-mode: screen;
  opacity: 0.72;
  animation: spaceDrift 13s ease-in-out infinite alternate;
}

body::after {
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(circle at center, transparent 18%, black 100%);
  mask-image: radial-gradient(circle at center, transparent 18%, black 100%);
  opacity: 0.16;
}

#space {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}


.password-gate {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 45%, rgba(86, 190, 255, 0.11), transparent 28%),
    radial-gradient(circle at 22% 18%, rgba(178, 90, 255, 0.12), transparent 30%),
    radial-gradient(circle at 78% 76%, rgba(255, 214, 120, 0.07), transparent 28%),
    rgba(0, 0, 0, 0.16);
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.58s ease,
    visibility 0.58s ease;
}

.password-gate.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.password-card {
  width: min(92vw, 380px);
  padding: 30px 26px 26px;
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(8, 18, 39, 0.88), rgba(2, 5, 16, 0.9));
  border: 1px solid rgba(120, 225, 255, 0.28);
  box-shadow:
    0 0 42px rgba(0, 195, 255, 0.18),
    0 0 90px rgba(176, 93, 255, 0.12),
    inset 0 0 34px rgba(255, 255, 255, 0.035);
  text-align: center;
  backdrop-filter: blur(12px);
}

.password-kicker {
  margin: 0 0 10px;
  color: rgba(126, 231, 255, 0.86);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.password-card h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 8vw, 46px);
  line-height: 1;
  letter-spacing: -0.04em;
  text-shadow: 0 0 24px rgba(127, 226, 255, 0.22);
}

.password-copy {
  margin: 0 0 22px;
  color: rgba(232, 247, 255, 0.76);
  font-size: 14px;
  line-height: 1.55;
}

.password-form {
  display: grid;
  gap: 12px;
}

.password-form label {
  color: rgba(255, 244, 212, 0.92);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.password-form input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(120, 225, 255, 0.28);
  border-radius: 14px;
  outline: none;
  background: rgba(2, 7, 20, 0.72);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.025);
  color: white;
  font-size: 18px;
  text-align: center;
  letter-spacing: 0.18em;
}

.password-form input:focus {
  border-color: rgba(255, 213, 111, 0.62);
  box-shadow:
    0 0 24px rgba(255, 213, 111, 0.14),
    inset 0 0 18px rgba(255, 255, 255, 0.03);
}

.password-form button {
  padding: 13px 16px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(116, 230, 255, 0.92), rgba(255, 211, 107, 0.92));
  box-shadow: 0 0 28px rgba(116, 230, 255, 0.2);
  color: #06101c;
  font-weight: 700;
  cursor: pointer;
}

.password-form button:disabled {
  opacity: 0.58;
  cursor: wait;
}

.password-error {
  min-height: 20px;
  margin: 14px 0 0;
  color: rgba(255, 154, 154, 0.9);
  font-size: 13px;
}

.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hint {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(3, 8, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 0 26px rgba(89, 213, 255, 0.16);
  color: rgba(255, 255, 255, 0.84);
  font-size: 14px;
  text-align: center;
  backdrop-filter: blur(10px);
  transition:
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    color 0.35s ease,
    transform 0.35s ease;
}

.hint.ready {
  border-color: rgba(255, 213, 111, 0.55);
  box-shadow:
    0 0 28px rgba(255, 195, 81, 0.24),
    0 0 52px rgba(89, 213, 255, 0.15);
  color: rgba(255, 244, 212, 0.95);
  transform: translateX(-50%) translateY(-4px);
  animation: readyHintPulse 1.8s ease-in-out infinite;
}

.message-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at center, rgba(0, 190, 255, 0.15), transparent 38%),
    radial-gradient(circle at 50% 58%, rgba(255, 210, 102, 0.1), transparent 24%),
    rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(7px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.42s ease,
    visibility 0.42s ease;
}

.message-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.message-card {
  position: relative;
  overflow: hidden;
  width: min(92vw, 560px);
  padding: 36px 32px;
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(11, 24, 46, 0.93), rgba(4, 8, 20, 0.94));
  border: 1px solid rgba(120, 225, 255, 0.32);
  box-shadow:
    0 0 40px rgba(0, 195, 255, 0.24),
    0 0 96px rgba(255, 211, 107, 0.08),
    inset 0 0 34px rgba(255, 255, 255, 0.03);
  text-align: center;
  transform: translateY(18px) scale(0.96);
  opacity: 0;
  transition:
    transform 0.48s cubic-bezier(0.2, 0.85, 0.2, 1.2),
    opacity 0.36s ease;
}

.message-overlay.show .message-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.message-shine {
  position: absolute;
  inset: -45% -18%;
  background: linear-gradient(
    115deg,
    transparent 32%,
    rgba(255, 255, 255, 0.13) 48%,
    transparent 64%
  );
  transform: translateX(-55%);
  opacity: 0;
  pointer-events: none;
}

.message-overlay.show .message-shine {
  animation: cardShine 1.7s ease 0.25s forwards;
}

.small-title {
  position: relative;
  margin: 0 0 10px;
  color: rgba(120, 230, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
}

.message-card h1 {
  margin: 0 0 18px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(38px, 7vw, 66px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.message-text {
  position: relative;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: rgba(235, 247, 255, 0.87);
  font-size: 17px;
  line-height: 1.2;
  white-space: normal;
}

.message-text span {
  display: block;
}

.message-text span + span {
  margin-top: 6px;
}

.message-text .signature {
  margin-top: 20px;
}

.signature {
  display: block;
  color: rgba(180, 235, 255, 0.82);
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0.16em;
}

.close-button {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 24px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.close-button:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: rotate(90deg);
}

@keyframes spaceDrift {
  from {
    transform: translate3d(-1.4%, -0.8%, 0) scale(1.02);
  }

  to {
    transform: translate3d(1.4%, 0.8%, 0) scale(1.05);
  }
}

@keyframes readyHintPulse {
  0%,
  100% {
    box-shadow:
      0 0 28px rgba(255, 195, 81, 0.2),
      0 0 52px rgba(89, 213, 255, 0.13);
  }

  50% {
    box-shadow:
      0 0 36px rgba(255, 195, 81, 0.34),
      0 0 68px rgba(89, 213, 255, 0.2);
  }
}

@keyframes cardShine {
  0% {
    opacity: 0;
    transform: translateX(-55%);
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateX(55%);
  }
}

@media (max-width: 600px) {

  .hint {
    width: min(90%, 420px);
    bottom: 22px;
    font-size: 13px;
  }

  .message-card {
    padding: 34px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
