:root {
  --bg: #050505;
  --text: #f2f2f0;
  --muted: rgba(242, 242, 240, 0.72);
  --line: rgba(242, 242, 240, 0.28);
  --accent: #8f1e24;
  --accent-hover: #a8252c;
  --focus: #e8e4dc;
  --font-display: "Bebas Neue", "Arial Narrow", sans-serif;
  --font-body: "Barlow", "Helvetica Neue", sans-serif;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  background: var(--bg);
  overflow-x: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Night field scene —— */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.scene__bg {
  position: absolute;
  inset: -2%;
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.35) 0%, rgba(5, 5, 5, 0.15) 35%, rgba(5, 5, 5, 0.55) 100%),
    url("assets/field-night.jpg") center / cover no-repeat;
  transform: scale(1.04);
  animation: slow-drift 28s ease-in-out infinite alternate;
}

.scene__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 42%, transparent 0%, rgba(0, 0, 0, 0.35) 55%, rgba(0, 0, 0, 0.82) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, transparent 28%, transparent 58%, rgba(0, 0, 0, 0.7) 100%);
}

.scene__fog {
  position: absolute;
  inset: -10% -20%;
  background: radial-gradient(ellipse at center, rgba(180, 190, 200, 0.08), transparent 60%);
  filter: blur(40px);
  opacity: 0.55;
  mix-blend-mode: soft-light;
}

.scene__fog--a {
  animation: fog-a 22s ease-in-out infinite alternate;
}

.scene__fog--b {
  opacity: 0.35;
  animation: fog-b 30s ease-in-out infinite alternate;
}

.scene__dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene__grain {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* —— Content —— */
.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem) 1.25rem 5rem;
  text-align: center;
}

.brand {
  margin: 0;
  animation: rise-in 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand__logo {
  display: block;
  width: min(58vw, 360px);
  height: auto;
  filter:
    drop-shadow(0 0 28px rgba(255, 255, 255, 0.14))
    drop-shadow(0 12px 40px rgba(0, 0, 0, 0.65));
  animation: breath 5.5s ease-in-out infinite;
}

.tagline {
  margin: 1.35rem 0 0;
  max-width: 28rem;
  font-family: var(--font-body);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.45;
  color: var(--muted);
  animation: rise-in 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

.signup button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.signup {
  margin-top: 2rem;
  width: min(100%, 440px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  animation: rise-in 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.32s both;
}

.signup input {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(8, 8, 8, 0.55);
  color: var(--text);
  font: 500 0.95rem/1.2 var(--font-body);
  backdrop-filter: blur(8px);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.signup input::placeholder {
  color: rgba(242, 242, 240, 0.45);
}

.signup input:focus {
  border-color: var(--focus);
  background: rgba(8, 8, 8, 0.72);
}

.signup button {
  min-height: 3rem;
  padding: 0.75rem 1.15rem;
  border: 0;
  border-radius: 2px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.15s ease;
}

.signup button:hover {
  background: var(--accent-hover);
}

.signup button:active {
  transform: translateY(1px);
}

.signup button:focus-visible,
.signup input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.signup__msg {
  grid-column: 1 / -1;
  min-height: 1.25rem;
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.signup__msg.is-error {
  color: #f0a8a8;
}

.signup__msg.is-ok {
  color: #c8e0c4;
}

.foot {
  position: fixed;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem;
  text-align: center;
  pointer-events: none;
}

.foot p {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(242, 242, 240, 0.38);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes breath {
  0%,
  100% {
    filter:
      drop-shadow(0 0 22px rgba(255, 255, 255, 0.08))
      drop-shadow(0 12px 40px rgba(0, 0, 0, 0.65));
    transform: scale(1);
  }
  50% {
    filter:
      drop-shadow(0 0 36px rgba(255, 255, 255, 0.18))
      drop-shadow(0 12px 40px rgba(0, 0, 0, 0.65));
    transform: scale(1.015);
  }
}

@keyframes slow-drift {
  from {
    transform: scale(1.04) translate3d(-0.8%, 0, 0);
  }
  to {
    transform: scale(1.08) translate3d(0.8%, -0.6%, 0);
  }
}

@keyframes fog-a {
  from {
    transform: translate3d(-4%, 2%, 0) scale(1);
  }
  to {
    transform: translate3d(5%, -3%, 0) scale(1.1);
  }
}

@keyframes fog-b {
  from {
    transform: translate3d(6%, -2%, 0) scale(1.05);
  }
  to {
    transform: translate3d(-5%, 4%, 0) scale(1.15);
  }
}

@media (max-width: 560px) {
  .brand__logo {
    width: min(78vw, 280px);
  }

  .signup {
    grid-template-columns: 1fr;
  }

  .signup button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene__bg,
  .scene__fog,
  .brand__logo,
  .brand,
  .tagline,
  .signup {
    animation: none !important;
  }
}
