/* ==========================================================================
   Waitlist / request access
   One centred column, one field. Uses the shared tokens from product-page.css;
   nothing here redefines width or rhythm.
   ========================================================================== */

.waitlist-page {
  position: relative;
}

.waitlist-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: max(640px, 100svh);
  padding: calc(var(--nav-h) + clamp(48px, 8vh, 96px)) var(--gutter) var(--section-pad-y-tight);
  text-align: center;
  overflow: hidden;
}

/* Two soft washes behind the column, the same pair the home hero uses. */
.waitlist-hero::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 52% 44% at 50% 12%, rgba(var(--signal-rgb), 0.07), transparent 68%),
    radial-gradient(ellipse 46% 40% at 50% 92%, rgba(var(--execution-rgb), 0.055), transparent 72%);
  content: '';
  pointer-events: none;
}

.waitlist-inner {
  width: min(660px, 100%);
  margin: 0 auto;
}

.waitlist-eyebrow {
  margin: 0 0 22px;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.waitlist-inner h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.9rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.waitlist-inner h1 span {
  color: var(--mint);
}

.waitlist-lede {
  max-width: 46ch;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.2vw, 1.14rem);
  line-height: 1.6;
}

/* ---- the field ------------------------------------------------------ */

.wl-form {
  margin: clamp(34px, 5vh, 52px) auto 0;
}

/* One pill: input on the left, submit on the right. Collapses to a stack
   on narrow screens. */
.wl-field {
  --wl-accent: var(--line-bright);
  --wl-glow: transparent;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 8px;
  border: 1px solid var(--wl-accent);
  border-radius: 14px;
  background: rgba(var(--field-rgb), 0.72);
  box-shadow: 0 0 0 4px var(--wl-glow);
  transition:
    border-color 260ms ease,
    box-shadow 260ms ease,
    background 260ms ease;
}

.wl-input {
  position: relative;
  display: flex;
  align-items: center;
}

.wl-field input {
  width: 100%;
  padding: 13px 40px 13px 16px;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px; /* 16px keeps iOS from zooming on focus */
  line-height: 1.4;
}

.wl-field input::placeholder {
  color: #6b6260;
}
.wl-field input:focus {
  outline: none;
}

/* ---- state machine --------------------------------------------------
   Driven by data-state on .wl-field, set from waitlist.js:
     idle | typing | valid | invalid | sending | error
   Each state only has to set the accent colour and which mark shows. */

.wl-field[data-state='typing'] {
  --wl-accent: var(--line-bright);
}

.wl-field[data-state='valid'] {
  --wl-accent: rgba(var(--signal-rgb), 0.62);
  --wl-glow: rgba(var(--signal-rgb), 0.1);
}

.wl-field[data-state='invalid'],
.wl-field[data-state='error'] {
  --wl-accent: rgba(255, 77, 94, 0.62);
  --wl-glow: rgba(255, 77, 94, 0.1);
}

.wl-field[data-state='sending'] {
  --wl-accent: rgba(var(--execution-rgb), 0.55);
  --wl-glow: rgba(var(--execution-rgb), 0.09);
}

.wl-field:focus-within {
  background: rgba(var(--field-rgb), 0.92);
}

/* the mark sits inside the input, right edge */
.wl-mark {
  position: absolute;
  right: 12px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  pointer-events: none;
}

.wl-mark svg,
.wl-mark__spin {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  opacity: 0;
  transform: scale(0.7);
  transition:
    opacity 220ms ease,
    transform 260ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.wl-mark svg {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.wl-mark__ok {
  stroke: var(--mint);
}
.wl-mark__no {
  stroke: #ff5968;
}

.wl-mark__spin {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(var(--execution-rgb), 0.25);
  border-top-color: var(--execution);
  border-radius: 50%;
}

.wl-field[data-state='valid'] .wl-mark__ok,
.wl-field[data-state='invalid'] .wl-mark__no,
.wl-field[data-state='error'] .wl-mark__no {
  opacity: 1;
  transform: scale(1);
}

.wl-field[data-state='sending'] .wl-mark__spin {
  opacity: 1;
  transform: scale(1);
  animation: wl-spin 700ms linear infinite;
}

@keyframes wl-spin {
  to {
    transform: scale(1) rotate(360deg);
  }
}

/* a single shake when the address is rejected */
.wl-field[data-state='invalid'],
.wl-field[data-state='error'] {
  animation: wl-shake 380ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes wl-shake {
  10%,
  90% {
    transform: translateX(-2px);
  }
  20%,
  80% {
    transform: translateX(3px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-5px);
  }
  40%,
  60% {
    transform: translateX(5px);
  }
}

/* ---- submit --------------------------------------------------------- */

.wl-submit {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--mint);
  color: var(--signal-ink);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 200ms ease,
    transform 200ms ease,
    opacity 200ms ease;
}

.wl-submit svg {
  width: 17px;
  height: 17px;
  transition: transform 200ms ease;
}

.wl-submit:hover:not(:disabled),
.wl-submit:focus-visible:not(:disabled) {
  transform: translateY(-1px);
}
.wl-submit:hover:not(:disabled) svg {
  transform: translateX(2px);
}
.wl-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ---- message -------------------------------------------------------- */

.wl-msg {
  min-height: 1.3em;
  margin: 14px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(-3px);
  transition:
    opacity 240ms ease,
    transform 240ms ease;
}

.wl-msg[data-tone] {
  opacity: 1;
  transform: none;
}
.wl-msg[data-tone='ok'] {
  color: var(--mint);
}
.wl-msg[data-tone='bad'] {
  color: #ff6472;
}
.wl-msg[data-tone='busy'] {
  color: var(--muted);
}

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

/* Once they're on the list the pitch has done its job: fade the eyebrow,
   headline and lede so the confirmation is the only thing on the page. */
.waitlist-inner.is-done .waitlist-eyebrow,
.waitlist-inner.is-done h1,
.waitlist-inner.is-done .waitlist-lede {
  display: none;
}

.waitlist-done {
  animation: wl-in 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes wl-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.waitlist-done__mark {
  display: grid;
  width: 60px;
  height: 60px;
  margin: 0 auto clamp(22px, 3vh, 30px);
  border: 1px solid rgba(var(--signal-rgb), 0.34);
  border-radius: 50%;
  background: rgba(var(--signal-rgb), 0.09);
  place-items: center;
}

.waitlist-done__mark svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--mint);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: wl-draw 460ms 180ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes wl-draw {
  to {
    stroke-dashoffset: 0;
  }
}

.waitlist-done h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 680;
  letter-spacing: -0.04em;
}

.waitlist-done > p {
  max-width: 44ch;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.62;
}

.waitlist-done b {
  color: var(--ink);
  font-weight: 600;
}

.waitlist-done__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  justify-content: center;
  margin-top: clamp(26px, 4vh, 36px);
  padding-top: 24px;
  border-top: 1px solid var(--line-brown-soft);
  font-family: var(--mono);
  font-size: 13px;
}

.waitlist-done__links a {
  color: var(--mint);
  transition: opacity 180ms ease;
}
.waitlist-done__links a:hover,
.waitlist-done__links a:focus-visible {
  opacity: 0.72;
}

.waitlist-legal {
  max-width: 52ch;
  margin: clamp(30px, 4vh, 44px) auto 0;
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.6;
}

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

@media (max-width: 560px) {
  .waitlist-hero {
    min-height: 0;
    padding-top: calc(var(--nav-h) + 40px);
  }

  /* stack the field so the button gets a full-width tap target */
  .wl-field {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .wl-submit {
    justify-content: center;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wl-field,
  .waitlist-done,
  .waitlist-done__mark svg,
  .wl-mark__spin {
    animation: none;
  }
  .waitlist-done__mark svg {
    stroke-dashoffset: 0;
  }
  .wl-mark svg,
  .wl-mark__spin {
    transition: opacity 120ms ease;
  }
}
