:root {
  --bg: #000000;
  --chrome-light: #f4f4f5;
  --chrome-mid: #b9bcc2;
  --chrome-dark: #5f6369;
  --text-dim: rgba(235, 236, 240, 0.55);
  --text-faint: rgba(235, 236, 240, 0.32);
  --ease-fluid: cubic-bezier(0.65, 0, 0.15, 1);
}

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

html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  /* Fixed body fully locks the viewport on mobile (no rubber-band panning). */
  position: fixed;
  inset: 0;
  width: 100%;
  background: var(--bg);
  color: var(--chrome-light);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* subtle ambient glow so the black isn't flat */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(60% 45% at 50% 0%, rgba(190, 195, 205, 0.07), transparent 70%),
    radial-gradient(45% 35% at 50% 110%, rgba(190, 195, 205, 0.05), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- click-to-enter gate ---------- */

#gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  /* transparent so the paused first frame of the intro video shows through */
  background: transparent;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: clamp(3rem, 12vh, 6rem);
  cursor: pointer;
  transition: opacity 0.6s var(--ease-fluid), visibility 0.6s;
}

#gate.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 3vh, 1.75rem);
  animation: gate-breathe 3.2s ease-in-out infinite;
}

.gate-hint {
  font-size: clamp(0.72rem, 2.2vw, 0.85rem);
  font-weight: 400;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(240, 241, 244, 0.85);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8);
}

@keyframes gate-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ---------- intro video → logo ---------- */

#brand {
  position: fixed;
  z-index: 10;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(78vmin, 640px);
  /* the footage is chrome on black: screen-blending melts its box into the page */
  mix-blend-mode: screen;
  transition:
    width 0.7s var(--ease-fluid),
    top 0.7s var(--ease-fluid),
    transform 0.7s var(--ease-fluid);
}

#brand video,
#brand img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* docked: video's final frame becomes the logo at the top */
body.docked #brand {
  top: calc(env(safe-area-inset-top, 0px) + clamp(0.5rem, 2vh, 1.75rem));
  transform: translate(-50%, 0);
  width: clamp(150px, 26vmin, 220px);
}

/* ---------- waitlist ---------- */

#waitlist {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(6rem, 16vh, 9rem) 1.5rem 4.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s var(--ease-fluid) 0.2s, visibility 0.6s 0.2s;
}

body.docked #waitlist {
  opacity: 1;
  visibility: visible;
}

.wl-inner {
  width: 100%;
  max-width: 480px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.9rem, 2.2vh, 1.3rem);
  transform: translateY(26px);
  transition: transform 0.6s var(--ease-fluid) 0.2s;
}

body.docked .wl-inner {
  transform: translateY(0);
}

.wl-eyebrow {
  font-size: clamp(0.68rem, 2vw, 0.78rem);
  font-weight: 400;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(240, 241, 244, 0.8);
}

.wl-title {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(2.1rem, 7vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: 0.01em;
  background: linear-gradient(
    165deg,
    var(--chrome-light) 0%,
    var(--chrome-mid) 40%,
    var(--chrome-dark) 60%,
    var(--chrome-light) 85%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.wl-title em {
  font-style: italic;
}

/* ---------- form ---------- */

#wl-form {
  width: 100%;
  margin-top: clamp(0.4rem, 1.5vh, 0.9rem);
}

.field {
  display: flex;
  gap: 0.55rem;
  width: 100%;
}

#email {
  flex: 1 1 auto;
  min-width: 0;
  height: 3.25rem;
  padding: 0 1.15rem;
  font: inherit;
  /* 16px minimum keeps iOS from auto-zooming on focus (which unlocks panning) */
  font-size: 1rem;
  font-weight: 300;
  color: var(--chrome-light);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  outline: none;
  backdrop-filter: blur(8px);
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

#email::placeholder {
  color: rgba(235, 236, 240, 0.55);
}

#email:focus {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

#submit-btn {
  flex: 0 0 auto;
  height: 3.25rem;
  padding: 0 1.5rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: #0a0a0a;
  background: linear-gradient(165deg, #ffffff 0%, #cfd2d8 45%, #9a9ea6 70%, #e8eaee 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.25s var(--ease-fluid), box-shadow 0.25s, filter 0.25s;
  box-shadow: 0 4px 24px rgba(220, 224, 232, 0.18);
}

#submit-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 6px 32px rgba(220, 224, 232, 0.3);
}

#submit-btn:active {
  transform: translateY(0);
}

#submit-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

#form-msg {
  min-height: 1.3rem;
  margin-top: 0.8rem;
  font-size: 0.8rem;
  font-weight: 300;
  color: #e08a8a;
}

/* ---------- success state ---------- */

#success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  animation: success-in 0.7s var(--ease-fluid);
}

#success[hidden] {
  display: none;
}

.success-badge {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #0a0a0a;
  border-radius: 50%;
  background: linear-gradient(165deg, #ffffff 0%, #cfd2d8 45%, #9a9ea6 70%, #e8eaee 100%);
  box-shadow: 0 4px 28px rgba(220, 224, 232, 0.25);
}

#success h2 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(1.5rem, 5vw, 2rem);
}

#success p {
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--text-dim);
}

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

/* ---------- footer ---------- */

#foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 1.1rem);
  z-index: 5;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-faint);
  opacity: 0;
  transition: opacity 0.6s var(--ease-fluid) 0.45s;
}

body.docked #foot {
  opacity: 1;
}

/* ---------- legal link ---------- */

#legal-link {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.52rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(235, 236, 240, 0.35);
  text-decoration: none;
  transition: color 0.3s;
}

#legal-link:hover {
  color: rgba(235, 236, 240, 0.8);
}

/* ---------- responsive ---------- */

@media (max-width: 540px) {
  .field {
    flex-direction: column;
    gap: 0.7rem;
  }

  #submit-btn {
    width: 100%;
  }

  #brand {
    width: min(88vmin, 640px);
  }

  body.docked #brand {
    width: clamp(130px, 34vw, 170px);
  }
}

@media (max-height: 620px) {
  #waitlist {
    padding-top: clamp(4.5rem, 14vh, 6.5rem);
  }

  body.docked #brand {
    width: clamp(110px, 20vmin, 150px);
  }
}

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