:root {
  color-scheme: dark;
  --bg: #000000;
  --crystals-opacity: 1;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-brand: 'Share Tech Mono', ui-monospace, 'Courier New', monospace;
  --font-ui: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --violet: #8c64ff;
  --blue: #4096ff;
  --cyan: #5ac8ff;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-soft: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html,
body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  cursor: default;
  font-family: var(--font-ui);
}

/* Near-black base with a faint purple–blue atmosphere (behind matrix). */
.landing-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: #000000;
  background-size: 150% 150%, 150% 150%, 140% 140%, 100% 100%;
  background:
    radial-gradient(85% 65% at 14% 22%, rgba(72, 56, 128, 0.14), transparent 58%),
    radial-gradient(75% 55% at 86% 18%, rgba(36, 72, 140, 0.11), transparent 55%),
    radial-gradient(65% 50% at 52% 90%, rgba(80, 40, 120, 0.09), transparent 60%),
    linear-gradient(168deg, #000000 0%, #030308 45%, #000000 100%);
  animation: landing-aurora-drift 72s ease-in-out infinite alternate;
}

.landing-aurora::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 38%, rgba(0, 0, 0, 0.72) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, transparent 22%, transparent 78%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}

@keyframes landing-aurora-drift {
  from {
    background-position: 0% 18%, 100% 0%, 50% 100%, 40% 40%, 0 0;
  }
  to {
    background-position: 28% 62%, 68% 38%, 42% 78%, 60% 55%, 0 0;
  }
}

.hub-matrix-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  height: 100dvh;
  pointer-events: none;
  opacity: var(--crystals-opacity);
  background: transparent;
  display: block;
  mix-blend-mode: lighten;
}

@media (prefers-reduced-motion: reduce) {
  .landing-aurora {
    animation: none;
  }

  .hub-matrix-canvas {
    display: none;
  }
}

.landing-stage {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(20px + var(--safe-top)) 20px calc(28px + var(--safe-bottom));
  /* Must stay pointer-events:auto — Android often drops taps on
     pointer-events:auto children inside a none parent. Matrix uses window listeners. */
  pointer-events: auto;
}

/* Typography-only CTA — large VSTOUPIT, no chrome (passkey unchanged). */
.landing-enter {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 20px 28px;
  min-height: 48px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #f8fbff;
  font: inherit;
  text-align: center;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  will-change: transform, opacity;
  transform: translate3d(0, 0, 0);
  animation: landingCtaIn 0.9s var(--ease-out-expo) 0.15s both;
}

.landing-enter__label {
  display: block;
  font-family: var(--font-brand);
  font-weight: 400;
  font-size: clamp(1.2rem, 5.8vw, 2rem);
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  line-height: 1;
  text-transform: uppercase;
  color: rgba(186, 230, 253, 0.78);
  text-shadow:
    0 0 18px rgba(100, 120, 200, 0.22),
    0 0 36px rgba(80, 60, 140, 0.14);
  transition:
    color 280ms var(--ease-out-soft),
    letter-spacing 320ms var(--ease-out-soft),
    text-shadow 320ms var(--ease-out-soft),
    opacity 220ms var(--ease-out-soft);
}

.landing-enter:hover,
.landing-enter:focus-visible {
  outline: none;
}

.landing-enter:hover .landing-enter__label,
.landing-enter:focus-visible .landing-enter__label {
  color: rgba(236, 254, 255, 0.96);
  letter-spacing: 0.44em;
  text-indent: 0.44em;
  text-shadow:
    0 0 22px rgba(140, 160, 220, 0.32),
    0 0 44px rgba(100, 80, 160, 0.2);
}

.landing-enter--pulse .landing-enter__label {
  animation: landingLabelPulse 720ms var(--ease-out-soft);
}

.landing-enter:disabled {
  cursor: wait;
  opacity: 0.78;
}

@keyframes landingCtaIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes landingLabelPulse {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0.82;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-enter,
  .landing-enter__label {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }

  html,
  body {
    cursor: auto;
  }
}

.landing-form {
  width: min(92vw, 420px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: auto;
}

.landing-form input,
.landing-form button {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f5f5f7;
  font: inherit;
  padding: 0 14px;
}

.landing-msg {
  color: rgba(235, 235, 245, 0.72);
  font-size: 0.875rem;
  text-align: center;
  max-width: 28rem;
}

.landing-msg--error {
  color: #ff453a;
}

.landing-msg--ok {
  color: #30d158;
}
