/* ============================================================================
   Just WFP — waitlist landing page.
   Deep-teal "ink" hero, brand teal accent, Fraunces + Hanken Grotesk.
   Pure static, no build. Matches the product's editorial-finance aesthetic.
   ========================================================================== */

:root {
  --deep: #06211e;
  --deep-2: #0c322c;
  --cream: #e9f1ef;
  --cream-soft: rgba(233, 241, 239, 0.66);
  --cream-faint: rgba(233, 241, 239, 0.16);
  --accent: #2dd4bf;
  --accent-deep: #0d9488;
  --accent-glow: rgba(45, 212, 191, 0.22);
  --danger: #fca5a5;

  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--body);
  color: var(--cream);
  background:
    radial-gradient(120% 90% at 75% 0%, var(--deep-2) 0%, var(--deep) 58%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Atmosphere */
.glow {
  position: fixed;
  top: -20%;
  right: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.38;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

/* Layout */
.page {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  min-height: 100vh;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  display: flex;
  flex-direction: column;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}
.brand em {
  font-style: italic;
  font-family: var(--display);
  font-weight: 500;
  color: var(--cream);
}

/* Hero */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 6vw, 4rem) 0;
}
.eyebrow {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.headline {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5.6vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  max-width: 26ch;
}
/* "Finally." on its own line (no <br>, which would disable balancing below). */
.hl-line {
  display: block;
}
/* The rest balances its own lines so a word never orphans across breakpoints. */
.hl-rest {
  display: block;
  text-wrap: balance;
}
.headline .accent {
  font-style: italic;
  color: var(--accent);
  text-shadow: 0 0 34px var(--accent-glow);
}
.sub {
  margin-top: 1.5rem;
  max-width: 56ch;
  color: var(--cream);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  line-height: 1.55;
}

/* Form */
.form {
  margin-top: clamp(2rem, 4vw, 2.75rem);
}
.roles {
  border: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}
.roles legend {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 0.7rem;
  width: 100%;
}
.role {
  position: relative;
  cursor: pointer;
}
.role input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.role span {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--cream-faint);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--cream);
  transition: all 0.18s ease;
}
.role:hover span {
  border-color: var(--cream-soft);
  color: var(--cream);
}
.role input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--deep);
  font-weight: 600;
}
.role input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.signup {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
  max-width: 30rem;
}
@media (max-width: 520px) {
  .signup {
    flex-direction: column;
  }
}
.email {
  flex: 1;
  background: rgba(233, 241, 239, 0.06);
  border: 1px solid var(--cream);
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  font-family: var(--body);
  font-size: 1rem;
  color: var(--cream);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.email::placeholder {
  color: rgba(233, 241, 239, 0.4);
}
.email:focus {
  border-color: var(--accent);
  background: rgba(233, 241, 239, 0.09);
}
.submit {
  background: var(--accent);
  color: var(--deep);
  border: none;
  border-radius: 12px;
  padding: 0.95rem 1.6rem;
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.submit:hover {
  background: #45e0cc;
  box-shadow: 0 8px 28px var(--accent-glow);
  transform: translateY(-1px);
}
.submit:active {
  transform: translateY(0);
}
.submit:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}
.submit:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 3px;
}
.email:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.turnstile {
  /* interaction-only → invisible until a challenge is needed, so reserve no space. */
  min-height: 0;
  margin-top: 1rem;
}
/* Collapse fully once it has verified silently. */
.turnstile.passed {
  display: none;
}

.message {
  margin-top: 1rem;
  font-size: 0.92rem;
  min-height: 1.2rem;
  color: var(--cream-soft);
}
.message.is-success {
  color: var(--accent);
  font-weight: 600;
}
.message.is-error {
  color: var(--danger);
}

/* ── Two-step transform ───────────────────────────────────────────────── */
.step-block[hidden] {
  display: none;
}
/* Step 1 lifts away when the email is captured. */
#email-form.leaving {
  opacity: 0;
  transform: translateY(-14px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}

/* The captured email, now a confirmation header. */
.confirm {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  font-weight: 600;
  color: var(--cream);
}
.confirm-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--deep);
  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
}
.confirm-email {
  color: var(--accent);
  font-family: var(--display);
  font-style: italic;
  word-break: break-all;
}
.details-prompt {
  margin-top: 0.9rem;
  color: var(--cream);
  font-size: clamp(0.98rem, 1.6vw, 1.1rem);
}

/* Name field */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.5rem;
  max-width: 30rem;
}
.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cream);
}
.text-input {
  width: 100%;
  background: rgba(233, 241, 239, 0.06);
  border: 1px solid var(--cream);
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  font-family: var(--body);
  font-size: 1rem;
  color: var(--cream);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.text-input::placeholder {
  color: rgba(233, 241, 239, 0.4);
}
.text-input:focus {
  border-color: var(--accent);
  background: rgba(233, 241, 239, 0.09);
}
.text-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.details .roles {
  margin-top: 1.5rem;
}
.details .submit {
  margin-top: 1.6rem;
}

/* Staggered reveal of the step-2 pieces. */
.details .confirm,
.details .anim {
  opacity: 0;
}
.details.revealed .confirm,
.details.revealed .anim {
  animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.details.revealed .confirm { animation-delay: 0.02s; }
.details.revealed .a1 { animation-delay: 0.14s; }
.details.revealed .a2 { animation-delay: 0.24s; }
.details.revealed .a3 { animation-delay: 0.34s; }
.details.revealed .a4 { animation-delay: 0.46s; }

/* Final state — collapse the inputs, keep the confirmation + message. */
.details.done .details-prompt,
.details.done .field,
.details.done #roles,
.details.done .submit {
  display: none;
}

/* Celebration confetti canvas. */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

/* Footer */
.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--cream-soft);
  padding-top: 2rem;
}
.foot a {
  color: var(--cream-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--cream-faint);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.foot a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Entrance motion */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.rise {
  animation: rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.d1 { animation-delay: 0.05s; }
.d2 { animation-delay: 0.16s; }
.d3 { animation-delay: 0.28s; }
.d4 { animation-delay: 0.4s; }
.d5 { animation-delay: 0.54s; }

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