:root {
  --bg: #0a0a0f;
  --cyan: #00f0ff;
  --purple: #b300ff;
  --pink: #ff0066;
  --text: #e0e0ff;
  --text-dim: #6a6a8a;
  --font-display: 'Orbitron', monospace;
  --font-body: 'Exo 2', sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.015) 2px,
    rgba(255, 255, 255, 0.015) 4px
  );
}

main {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 1.5rem;
  width: 100%;
  animation: fadeIn 1.5s ease forwards;
}

.logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.5rem, 10vw, 5.5rem);
  color: var(--cyan);
  text-transform: lowercase;
  letter-spacing: 0.05em;
  text-shadow:
    0 0 7px var(--cyan),
    0 0 10px var(--cyan),
    0 0 21px var(--cyan),
    0 0 42px var(--cyan),
    0 0 82px var(--cyan);
  animation: neonPulse 3s ease-in-out infinite;
  cursor: default;
  user-select: none;
  transition: filter 0.1s;
}

.logo::after {
  content: attr(aria-label);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  z-index: -1;
  color: var(--pink);
  opacity: 0;
}

.logo.glitching {
  animation: glitch 0.3s steps(2, end) forwards;
}

.logo.glitching::after {
  opacity: 0.4;
  animation: glitchOffset 0.3s steps(2, end) forwards;
}

@keyframes glitch {
  0% { transform: translate(0); opacity: 1; clip-path: inset(0); }
  10% { transform: translate(-3px, 2px); clip-path: inset(20% 0 30% 0); }
  20% { transform: translate(3px, -1px); clip-path: inset(10% 0 50% 0); }
  30% { transform: translate(-2px, 1px); clip-path: inset(40% 0 10% 0); }
  40% { transform: translate(2px, -2px); clip-path: inset(60% 0 5% 0); }
  50% { transform: translate(-1px, 0); opacity: 0.8; clip-path: inset(0); }
  60% { transform: translate(1px, 2px); }
  70% { transform: translate(-2px, -1px); clip-path: inset(30% 0 20% 0); }
  80% { transform: translate(0); opacity: 1; clip-path: inset(0); }
  100% { transform: translate(0); opacity: 1; clip-path: inset(0); }
}

@keyframes glitchOffset {
  0% { transform: translate(2px, -2px); opacity: 0.4; }
  20% { transform: translate(-3px, 1px); opacity: 0.3; }
  40% { transform: translate(4px, -1px); opacity: 0.5; }
  60% { transform: translate(-2px, 2px); opacity: 0.2; }
  80% { transform: translate(1px, -3px); opacity: 0.4; }
  100% { transform: translate(0); opacity: 0; }
}

@keyframes neonPulse {
  0%, 100% {
    text-shadow:
      0 0 7px var(--cyan),
      0 0 10px var(--cyan),
      0 0 21px var(--cyan),
      0 0 42px var(--cyan),
      0 0 82px var(--cyan);
  }
  50% {
    text-shadow:
      0 0 4px var(--cyan),
      0 0 7px var(--cyan),
      0 0 14px var(--cyan),
      0 0 28px var(--cyan),
      0 0 56px var(--cyan);
  }
}

.payoff {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(1.1rem, 4vw, 1.75rem);
  color: var(--text);
  margin-top: 1rem;
  letter-spacing: 0.15em;
  text-shadow:
    0 0 4px var(--purple),
    0 0 8px var(--purple);
  animation: float 4s ease-in-out infinite, fadeIn 2s ease 0.5s forwards;
  opacity: 0;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

#subscribe-form {
  margin-top: 2rem;
  animation: fadeIn 2s ease 1s forwards;
  opacity: 0;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.search-bar {
  display: flex;
  align-items: stretch;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 40px;
  transition: border-color 0.3s;
  overflow: hidden;
}

.search-bar:focus-within {
  border-color: var(--cyan);
}

#email {
  flex: 1;
  min-width: 0;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.85rem 1.25rem;
  background: transparent;
  border: none;
  color: var(--text);
  outline: none;
}

#email::placeholder {
  color: var(--text-dim);
}

#submit-btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0 1.25rem;
  background: transparent;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--cyan);
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.3s, text-shadow 0.3s;
}

#submit-btn:hover {
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

#submit-btn:active {
  opacity: 0.7;
}

#submit-btn.success {
  color: #00ff88;
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
}

#submit-btn.error {
  color: var(--pink);
  text-shadow: 0 0 8px rgba(255, 0, 102, 0.4);
}

@media (min-width: 480px) {
  .payoff {
    margin-top: 1.25rem;
  }

  #email {
    font-size: 1rem;
    padding: 0.9rem 1.5rem;
  }

  #submit-btn {
    font-size: 0.8rem;
    padding: 0 1.5rem;
  }
}

@media (min-width: 768px) {
  main {
    padding: 2rem;
  }
}

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

  .payoff {
    opacity: 1;
  }
}
