:root {
  --space: #030712;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --display: "Syne", system-ui, sans-serif;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: var(--display);
  color: #f8fafc;
  background: var(--space);
  -webkit-font-smoothing: antialiased;
}

.cosmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 50% 120%, rgba(14, 116, 144, 0.35), transparent 55%),
    radial-gradient(70% 50% at 80% 10%, rgba(88, 28, 135, 0.25), transparent 50%),
    radial-gradient(60% 45% at 10% 20%, rgba(30, 58, 138, 0.3), transparent 48%),
    linear-gradient(180deg, #020617 0%, #030712 40%, #0f172a 100%);
}

.stars {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: url("/stars.svg") center / cover no-repeat;
  opacity: 0.92;
  animation: stars-twinkle 8s ease-in-out infinite;
}

.stars::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/stars.svg") center / 110% auto no-repeat;
  opacity: 0.35;
  transform: scale(1.05);
  animation: stars-drift 100s linear infinite;
}

.nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  pointer-events: none;
}

.nebula-a {
  width: 55vmin;
  height: 55vmin;
  top: -10vmin;
  right: -8vmin;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.5), transparent 70%);
}

.nebula-b {
  width: 48vmin;
  height: 48vmin;
  bottom: -12vmin;
  left: -6vmin;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.45), transparent 72%);
}

.planet-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
  perspective: 1100px;
}

.planet-orbit {
  position: absolute;
  width: min(100vmin, 880px);
  height: min(32vmin, 240px);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 50%;
  transform: rotateX(72deg) rotateZ(-12deg);
  opacity: 0.5;
  animation: orbit-tilt 48s linear infinite;
}

.planet {
  position: relative;
  width: min(78vmin, 620px);
  height: min(78vmin, 620px);
  border-radius: 50%;
  overflow: hidden;
  background: #0c1929;
  opacity: 0.72;
  box-shadow:
    inset -36px -24px 60px rgba(0, 0, 0, 0.55),
    inset 8px 8px 40px rgba(125, 211, 252, 0.08),
    0 0 80px rgba(56, 189, 248, 0.2),
    0 0 160px rgba(37, 99, 235, 0.12);
}

.planet-map {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  background: url("/earth-atmos.jpg") left center / 50% 100% repeat-x;
  filter: saturate(1.08) contrast(1.05);
  animation: planet-spin 60s linear infinite;
}

.planet-clouds {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  background: url("/earth-atmos.jpg") left center / 50% 100% repeat-x;
  opacity: 0.22;
  mix-blend-mode: screen;
  filter: blur(1px) brightness(1.4);
  animation: planet-spin 90s linear infinite;
}

.planet-shade {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 78% 22%, rgba(255, 255, 255, 0.18) 0%, transparent 38%),
    radial-gradient(circle at 28% 38%, transparent 0 32%, rgba(0, 0, 0, 0.15) 50%, rgba(2, 6, 23, 0.82) 100%);
}

.planet-atmosphere {
  position: absolute;
  inset: -4%;
  border-radius: 50%;
  pointer-events: none;
  box-shadow:
    inset 0 0 40px rgba(125, 211, 252, 0.25),
    0 0 30px rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(186, 230, 253, 0.12);
}

.planet-highlight {
  position: absolute;
  inset: 10% auto auto 12%;
  width: 34%;
  height: 20%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.35), transparent 70%);
  filter: blur(8px);
  transform: rotate(-18deg);
}

.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px;
  text-align: center;
}

.brand {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3.2rem, 14vw, 7.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  text-shadow:
    0 0 40px rgba(56, 189, 248, 0.35),
    0 4px 24px rgba(0, 0, 0, 0.5);
}

.brand-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(24px);
  animation: letter-rise 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.brand-letter:nth-child(-n + 3) {
  color: #7dd3fc;
}

.brand-letter:nth-child(n + 4) {
  color: #f8fafc;
}

.brand-letter:nth-child(1) { animation-delay: 0.05s; }
.brand-letter:nth-child(2) { animation-delay: 0.1s; }
.brand-letter:nth-child(3) { animation-delay: 0.15s; }
.brand-letter:nth-child(4) { animation-delay: 0.2s; }
.brand-letter:nth-child(5) { animation-delay: 0.25s; }
.brand-letter:nth-child(6) { animation-delay: 0.3s; }

.download-hero {
  position: relative;
  appearance: none;
  border: 1px solid rgba(125, 211, 252, 0.45);
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: min(92vw, 280px);
  min-height: 168px;
  padding: 28px 36px 24px;
  border-radius: 22px;
  color: #f0f9ff;
  background: linear-gradient(165deg, rgba(14, 165, 233, 0.35) 0%, rgba(29, 78, 216, 0.55) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 0 0 6px rgba(56, 189, 248, 0.12),
    0 20px 50px rgba(14, 165, 233, 0.35),
    0 0 80px rgba(59, 130, 246, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  animation: download-pulse 3s ease-in-out infinite;
}

.download-hero-glow {
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.25), transparent 55%);
  pointer-events: none;
  animation: drift 5s ease-in-out infinite;
}

.download-hero-icon {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
}

.download-hero-label {
  position: relative;
  z-index: 1;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.download-hero:hover {
  transform: translateY(-4px) scale(1.02);
  filter: brightness(1.08);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 0 0 8px rgba(56, 189, 248, 0.18),
    0 28px 60px rgba(14, 165, 233, 0.45),
    0 0 100px rgba(59, 130, 246, 0.35);
}

.download-hero:active {
  transform: translateY(-1px) scale(1);
}

.password-block {
  width: min(92vw, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.password-hint {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.85);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.password-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.password {
  position: relative;
  overflow: hidden;
  flex: 1 1 auto;
  min-width: min(100%, 240px);
  margin: 0;
  padding: 18px 20px;
  border-radius: 16px;
  font-family: var(--mono);
  font-size: clamp(1.45rem, 5vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: center;
  border: 2px solid #fbbf24;
  background: linear-gradient(180deg, #fff9e6 0%, #ffe08a 100%);
  color: #0f172a;
  box-shadow:
    0 0 0 5px rgba(251, 191, 36, 0.35),
    0 0 40px rgba(251, 191, 36, 0.35),
    0 12px 28px rgba(0, 0, 0, 0.35);
  user-select: all;
  cursor: text;
}

.password.shimmer::after {
  content: "";
  position: absolute;
  inset: -20% 0;
  width: 45%;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 35%,
    rgba(255, 255, 255, 0.75) 50%,
    rgba(255, 255, 255, 0.15) 65%,
    transparent 100%
  );
  transform: translateX(140%);
  animation: sheen-sweep 3.2s ease-in-out infinite alternate;
}

.copy {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.35);
  cursor: pointer;
  min-height: 56px;
  min-width: 96px;
  padding: 0 20px;
  border-radius: 12px;
  font-family: var(--display);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.copy:hover {
  border-color: rgba(125, 211, 252, 0.6);
  background: rgba(30, 58, 138, 0.55);
}

.copy.is-done {
  background: rgba(34, 197, 94, 0.85);
  border-color: #4ade80;
  color: #052e16;
}

@keyframes letter-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes planet-spin {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes orbit-tilt {
  from { transform: rotateX(72deg) rotateZ(-18deg); }
  to { transform: rotateX(72deg) rotateZ(342deg); }
}

@keyframes stars-drift {
  from { transform: scale(1.05) translateY(0); }
  to { transform: scale(1.05) translateY(-12px); }
}

@keyframes stars-twinkle {
  0%, 100% { opacity: 0.88; }
  50% { opacity: 1; }
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(3%, 2%); }
}

@keyframes download-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset, 0 0 0 6px rgba(56, 189, 248, 0.12), 0 20px 50px rgba(14, 165, 233, 0.35), 0 0 80px rgba(59, 130, 246, 0.25); }
  50% { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset, 0 0 0 10px rgba(56, 189, 248, 0.2), 0 24px 56px rgba(14, 165, 233, 0.45), 0 0 100px rgba(59, 130, 246, 0.35); }
}

@keyframes sheen-sweep {
  0% { transform: translateX(140%); }
  100% { transform: translateX(-140%); }
}

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