/* ===================================
   Journey Landing — Cinematic Waitlist
   =================================== */

:root {
  --bg: #0a0a0a;
  --glow-1: rgba(229, 70, 40, 0.15);
  --glow-2: rgba(248, 140, 64, 0.08);
  --glow-warm: rgba(234, 88, 30, 0.18);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.5);
  --text-dim: rgba(255, 255, 255, 0.25);
  --accent: #f0854a;
  --accent-deep: #e54528;
  --transition-bloom: 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fade: 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: default;
  user-select: none;
}

/* ===================================
   Canvas — full viewport container
   =================================== */

#canvas {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===================================
   Cinematic video background
   =================================== */

#cinema {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 3s ease;
}

#cinema.visible {
  opacity: 1;
}

#bg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%) scale(1.05);
  object-fit: cover;
  transition: transform 4s ease, opacity 3s ease;
}

/* Video zoom shifts per state */
.cinema-state-1 #bg-video {
  transform: translate(-50%, -50%) scale(1.05);
  opacity: 1;
}
.cinema-state-2 #bg-video {
  transform: translate(-50%, -50%) scale(1.14);
  opacity: 0.9;
}
.cinema-state-3 #bg-video {
  transform: translate(-50%, -50%) scale(1.22);
  opacity: 0.6;
}
.cinema-state-4 #bg-video {
  transform: translate(-50%, -50%) scale(1.3);
  opacity: 0.3;
}

/* Dark overlay — keeps text readable, adds mood */
#cinema-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.6) 100%);
  transition: background 2s ease;
}

/* Overlay darkens as we approach the form */
.cinema-state-2 #cinema-overlay {
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.75) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.2) 40%, rgba(0,0,0,0.6) 100%);
}

.cinema-state-3 #cinema-overlay {
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.85) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 40%, rgba(0,0,0,0.7) 100%);
}

.cinema-state-4 #cinema-overlay {
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.95) 100%);
}

/* ===================================
   Glow layers
   =================================== */

#glow {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  transform: translate(-50%, -50%) scale(0.8);
  background: radial-gradient(circle, var(--glow-1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 2s ease,
    transform 2s cubic-bezier(0.22, 1, 0.36, 1),
    background 2s ease;
  will-change: transform, opacity;
  animation: breathe 6s ease-in-out infinite;
  z-index: 1;
}

#glow-secondary {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 900px;
  height: 900px;
  transform: translate(-50%, -50%) scale(0.5);
  background: radial-gradient(circle, var(--glow-2) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 2.5s ease,
    transform 2.5s cubic-bezier(0.22, 1, 0.36, 1),
    background 2.5s ease;
  will-change: transform, opacity;
  animation: breathe-slow 8s ease-in-out infinite;
  z-index: 1;
}

@keyframes breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(0.8); }
  50% { transform: translate(-50%, -50%) scale(0.85); }
}

@keyframes breathe-slow {
  0%, 100% { transform: translate(-50%, -50%) scale(0.5); }
  50% { transform: translate(-50%, -50%) scale(0.55); }
}

/* Glow state progressions */
.glow-state-1 #glow {
  opacity: 0.4;
  transform: translate(-50%, -50%) scale(0.8);
  background: radial-gradient(circle, var(--glow-1) 0%, transparent 70%);
}
.glow-state-1 #glow-secondary {
  opacity: 0.2;
  transform: translate(-50%, -50%) scale(0.5);
}

.glow-state-2 #glow {
  opacity: 0.7;
  transform: translate(-50%, -50%) scale(1.2);
  background: radial-gradient(circle, var(--glow-warm) 0%, var(--glow-1) 50%, transparent 70%);
  animation-name: breathe-expand;
}
.glow-state-2 #glow-secondary {
  opacity: 0.5;
  transform: translate(-50%, -50%) scale(0.9);
}

.glow-state-3 #glow {
  opacity: 0.9;
  transform: translate(-50%, -50%) scale(1.5);
  background: radial-gradient(circle, var(--glow-warm) 0%, var(--glow-1) 40%, transparent 70%);
  animation-name: breathe-full;
}
.glow-state-3 #glow-secondary {
  opacity: 0.7;
  transform: translate(-50%, -50%) scale(1.15);
}

.glow-state-4 #glow {
  opacity: 0.3;
  transform: translate(-50%, -50%) scale(1.7);
  background: radial-gradient(circle, rgba(248, 140, 64, 0.08) 0%, transparent 70%);
  animation-name: breathe-settle;
}
.glow-state-4 #glow-secondary {
  opacity: 0.15;
  transform: translate(-50%, -50%) scale(1.4);
}

@keyframes breathe-expand {
  0%, 100% { transform: translate(-50%, -50%) scale(1.1); }
  50% { transform: translate(-50%, -50%) scale(1.18); }
}

@keyframes breathe-full {
  0%, 100% { transform: translate(-50%, -50%) scale(1.4); }
  50% { transform: translate(-50%, -50%) scale(1.48); }
}

@keyframes breathe-settle {
  0%, 100% { transform: translate(-50%, -50%) scale(1.6); }
  50% { transform: translate(-50%, -50%) scale(1.65); }
}

/* ===================================
   States — each is full viewport, stacked
   =================================== */

.state {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--transition-bloom),
    visibility 0s linear 1.2s;
  z-index: 2;
}

.state.active {
  opacity: 1;
  visibility: visible;
  transition:
    opacity var(--transition-bloom),
    visibility 0s linear 0s;
}

/* ===================================
   State 1 — Arrival
   =================================== */

.headline {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-transform: lowercase;
  opacity: 0;
  transform: translateY(20px);
  animation: headline-bloom 2.2s cubic-bezier(0.22, 1, 0.36, 1) 0.6s forwards;
}

@keyframes headline-bloom {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll cue — text + line */
.scroll-cue {
  position: absolute;
  bottom: 10vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: cue-appear 1s ease 3s forwards;
}

.scroll-cue-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.scroll-cue-line {
  width: 1px;
  height: 48px;
  position: relative;
  overflow: hidden;
}

.scroll-cue-line::after {
  content: '';
  display: block;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: cue-slide 2s ease-in-out infinite;
}

@keyframes cue-appear {
  to { opacity: 0.6; }
}

@keyframes cue-slide {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* ===================================
   State 2 — The Science
   =================================== */

.science-facts {
  max-width: 560px;
  text-align: center;
}

.fact {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  line-height: 1.75;
  color: var(--text-secondary);
  letter-spacing: 0.005em;
  transform: translateY(15px);
  opacity: 0;
  transition:
    opacity var(--transition-bloom),
    transform var(--transition-bloom);
}

#state-2.active .fact {
  opacity: 1;
  transform: translateY(0);
}

.fact-source {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: clamp(0.7rem, 1.2vw, 0.8rem);
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 1.8rem;
  transform: translateY(10px);
  opacity: 0;
  transition:
    opacity var(--transition-bloom) 0.4s,
    transform var(--transition-bloom) 0.4s;
}

#state-2.active .fact-source {
  opacity: 0.6;
  transform: translateY(0);
}

.fact-bridge {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  line-height: 1.75;
  color: var(--text-primary);
  letter-spacing: 0.005em;
  margin-top: 2.5rem;
  transform: translateY(10px);
  opacity: 0;
  transition:
    opacity 1.6s cubic-bezier(0.22, 1, 0.36, 1) 2.4s,
    transform 1.6s cubic-bezier(0.22, 1, 0.36, 1) 2.4s;
}

#state-2.active .fact-bridge {
  opacity: 1;
  transform: translateY(0);
}

/* ===================================
   State 3 — The Threshold
   =================================== */

.threshold-line {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--text-secondary);
  margin-bottom: 3rem;
  letter-spacing: 0.02em;
  transform: translateY(10px);
  opacity: 0;
  transition:
    opacity var(--transition-bloom) 0.1s,
    transform var(--transition-bloom) 0.1s;
}

#state-3.active .threshold-line {
  opacity: 1;
  transform: translateY(0);
}

.waitlist-form {
  transform: translateY(15px);
  opacity: 0;
  transition:
    opacity var(--transition-bloom) 0.3s,
    transform var(--transition-bloom) 0.3s;
}

#state-3.active .waitlist-form {
  opacity: 1;
  transform: translateY(0);
}

.form-container {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 60px;
  padding: 6px 6px 6px 24px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition:
    border-color 0.4s ease,
    background 0.4s ease,
    box-shadow 0.4s ease;
}

.form-container:focus-within {
  border-color: rgba(240, 133, 74, 0.3);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 40px rgba(229, 70, 40, 0.1);
}

.email-input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  width: 260px;
  padding: 12px 0;
}

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

.submit-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-deep);
  border: none;
  border-radius: 50px;
  padding: 12px 28px;
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition:
    background 0.4s ease,
    transform 0.3s ease,
    box-shadow 0.4s ease;
  white-space: nowrap;
}

.submit-btn:hover {
  background: var(--accent);
  transform: scale(1.02);
  box-shadow: 0 0 30px rgba(229, 70, 40, 0.3);
}

.submit-btn:active {
  transform: scale(0.98);
}

.btn-arrow {
  transition: transform 0.3s ease;
  font-size: 1.1rem;
}

.submit-btn:hover .btn-arrow {
  transform: translateX(3px);
}

.form-error {
  color: rgba(248, 113, 113, 0.8);
  font-size: 0.8rem;
  font-weight: 300;
  margin-top: 1rem;
  height: 1.2rem;
  letter-spacing: 0.02em;
}

/* ===================================
   State 4 — Confirmation
   =================================== */

.confirmation {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: -0.01em;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 1.5s cubic-bezier(0.22, 1, 0.36, 1) 0.2s,
    transform 1.5s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}

#state-4.active .confirmation {
  opacity: 1;
  transform: translateY(0);
}

.confirmation-sub {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 2rem;
  opacity: 0;
  transition: opacity 1.5s ease 0.8s;
}

#state-4.active .confirmation-sub {
  opacity: 1;
}

/* ===================================
   Responsive
   =================================== */

@media (max-width: 768px) {
  #glow {
    width: 400px;
    height: 400px;
  }

  #glow-secondary {
    width: 600px;
    height: 600px;
  }

  .form-container {
    flex-direction: column;
    border-radius: 20px;
    padding: 6px;
    gap: 0;
    width: min(90vw, 340px);
  }

  .email-input {
    width: 100%;
    text-align: center;
    padding: 16px 20px;
  }

  .submit-btn {
    width: 100%;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 16px;
  }

  .science-facts {
    max-width: 90vw;
  }

  .scroll-cue {
    bottom: 6vh;
  }
}

@media (max-width: 380px) {
  .headline {
    font-size: 2.2rem;
  }
}

/* ===================================
   Reduced motion
   =================================== */

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

  .headline {
    opacity: 1;
    transform: none;
  }
}
