/* ── Reset & tokens ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0b0f;
  --text:      #f0f1f5;
  --sub:       #7c8093;
  --border:    rgba(240,241,245,0.07);
  --border-md: rgba(240,241,245,0.13);
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow: hidden;
}

/* ── Background layers ──────────────────────────────────────── */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.dot-grid {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(240,241,245,0.14) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, rgba(0,0,0,0.35) 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, rgba(0,0,0,0.35) 0%, transparent 75%);
}

.horizon {
  position: fixed;
  left: 0;
  right: 0;
  top: 42%;
  height: 1px;
  background: transparent;
  box-shadow: 0 0 120px 48px rgba(240,241,245,0.028);
  pointer-events: none;
  z-index: 2;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(ellipse 75% 75% at 50% 50%, transparent 30%, rgba(10,11,15,0.82) 100%);
}

.bottom-fade {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30%;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
}

/* ── Page wrapper ───────────────────────────────────────────── */
.page {
  position: relative;
  z-index: 10;
  height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 0 32px;
  max-width: 1280px;
  margin: 0 auto;
}

/* ── Main ───────────────────────────────────────────────────── */
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 0 20px;
}

.platform-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sub);
  margin-bottom: 32px;
  opacity: 0;
  animation: rise 800ms var(--ease) 150ms forwards;
}

.wordmark {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(14px, 1.8vw, 18px);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 28px;
  opacity: 0;
  animation: rise 800ms var(--ease) 80ms forwards;
}

.headline {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(44px, 7.5vw, 88px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--text);
  max-width: 820px;
  margin-bottom: 24px;
  opacity: 0;
  animation: rise 1000ms var(--ease) 300ms forwards;
}

.headline span {
  color: var(--sub);
}

.subline {
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.72;
  color: var(--sub);
  max-width: 460px;
  margin-bottom: 52px;
  opacity: 0;
  animation: rise 1000ms var(--ease) 420ms forwards;
}

/* ── Email form ─────────────────────────────────────────────── */
.form-wrapper {
  width: 100%;
  max-width: 460px;
  opacity: 0;
  animation: rise 1000ms var(--ease) 540ms forwards;
}

.form {
  display: flex;
  gap: 6px;
  width: 100%;
}

.input-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
}

.input-wrap::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 10px;
  background: transparent;
  box-shadow: 0 0 0 0 rgba(240,241,245,0);
  transition: box-shadow 350ms ease;
  pointer-events: none;
}

.input-wrap:focus-within::after {
  box-shadow: 0 0 0 3px rgba(240,241,245,0.07);
}

.form-input {
  width: 100%;
  height: 50px;
  padding: 0 18px;
  background: rgba(240,241,245,0.04);
  border: 1px solid var(--border-md);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 300ms ease, background 300ms ease;
  -webkit-appearance: none;
}

.form-input::placeholder {
  color: var(--sub);
  opacity: 0.5;
}

.form-input:focus {
  border-color: rgba(240,241,245,0.26);
  background: rgba(240,241,245,0.055);
}

.form-input[aria-invalid="true"] {
  border-color: rgba(240,241,245,0.3);
}

.form-btn {
  height: 50px;
  padding: 0 24px;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 200ms ease, transform 150ms var(--ease);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.form-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10,11,15,0);
  transition: background 200ms ease;
}

.form-btn:hover::before { background: rgba(10,11,15,0.08); }
.form-btn:active { transform: scale(0.975); }
.form-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-spinner {
  display: none;
  width: 13px;
  height: 13px;
  border: 1.5px solid rgba(10,11,15,0.3);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 500ms linear infinite;
  flex-shrink: 0;
}

.form-btn.loading .btn-text { display: none; }
.form-btn.loading .btn-spinner { display: block; }

.form-msg {
  margin-top: 11px;
  font-size: 12.5px;
  color: var(--sub);
  opacity: 0;
  transition: opacity 300ms ease;
  text-align: left;
  padding-left: 2px;
}

.form-msg.show { opacity: 1; }

.success-state {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 0;
}

.success-state.visible { display: flex; }

.success-icon {
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-md);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(240,241,245,0.05);
  flex-shrink: 0;
}

.success-text {
  font-size: 14px;
  color: var(--sub);
}

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 32px;
  opacity: 0;
  animation: rise 800ms var(--ease) 700ms forwards;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-copy {
  font-size: 12px;
  color: var(--sub);
  opacity: 0.45;
}

.footer-email {
  font-size: 12px;
  color: var(--sub);
  opacity: 0.45;
  text-decoration: none;
  transition: opacity 200ms ease;
}

.footer-email:hover { opacity: 0.8; }

.footer-sep {
  width: 1px;
  height: 12px;
  background: var(--border);
  flex-shrink: 0;
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: 6px;
}

.social-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(240,241,245,0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease, color 200ms ease;
  text-decoration: none;
  color: var(--sub);
}

.social-btn:hover {
  border-color: var(--border-md);
  background: rgba(240,241,245,0.06);
  color: var(--text);
}

.social-btn:focus-visible {
  outline: 1px solid rgba(240,241,245,0.35);
  outline-offset: 2px;
}

/* ── Keyframes ──────────────────────────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #bg-canvas, .dot-grid, .horizon { display: none; }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  body { overflow: auto; }
  .page { height: auto; min-height: 100dvh; padding: 0 20px; }
  main { padding: 48px 0 32px; }
  .headline { margin-bottom: 20px; }
  .subline { margin-bottom: 44px; }
  footer { padding-top: 18px; padding-bottom: 28px; }
}

@media (max-width: 480px) {
  .form { flex-direction: column; }
  .form-btn { width: 100%; height: 52px; }
  footer { flex-direction: column; align-items: flex-start; }
}

.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;
}
