/* The coming-soon waitlist card (SITE-34; markup and states in waitlist.js). A hairline card in the v2 tokens:
   the industry, one line of promise, an email field and the orange button. Mobile first: the field and button stack
   full width, then sit on one row from 480px. Every target is ≥ 44px (field and button 48). */

.wl {
  position: relative; display: grid; gap: var(--s-5); max-width: 560px;
  padding: var(--card-pad); border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--canvas);
}
.wl__head { display: grid; gap: var(--s-3); }
.wl__top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.wl__title { font: 500 var(--t-h3)/1.15 var(--font-display); letter-spacing: -.02em; color: var(--ink); text-wrap: balance; }
.wl__line { font-size: var(--t-small); line-height: 1.5; color: var(--ink-64); text-wrap: pretty; }

.wl__form { display: grid; gap: var(--s-2); }
.wl__row { display: grid; gap: var(--s-2); }
@media (min-width: 480px) { .wl__row { grid-template-columns: minmax(0, 1fr) auto; } }

/* 16px text so iOS doesn't zoom on focus. The placeholder carries the field's visible label (the <label> is for
   screen readers), so it's --ink-58, the lightest ink that passes AA, not the decorative --ink-32. */
.wl__input {
  width: 100%; height: 48px; padding: 0 14px; margin: 0;
  border: 1px solid var(--hairline-strong); border-radius: var(--r-sm); background: var(--canvas); box-shadow: var(--shadow-xs);
  font: 400 16px/1 var(--font-body); letter-spacing: var(--track-body); color: var(--ink);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.wl__input::placeholder { color: var(--ink-58); opacity: 1; }
.wl__input:hover { border-color: rgb(21 19 15 / .24); }
.wl__input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgb(255 90 36 / .18); }
.wl__input[aria-invalid="true"] { border-color: var(--orange-ink); }
.wl__input:read-only { color: var(--ink-58); }

/* The two labels share one cell, so "Joining…" doesn't change the button's width. */
.wl__btn { display: inline-grid; place-items: center; height: 48px; }
.wl__btn > span { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 8px; }
.wl__busy, .wl[data-state="sending"] .wl__idle { visibility: hidden; }
.wl[data-state="sending"] .wl__busy { visibility: visible; }
.wl[data-state="sending"] .wl__btn { cursor: progress; transform: none; }
@media (max-width: 479.98px) { .wl__btn { width: 100%; } }

.wl__msg { font-size: var(--t-small); line-height: 1.45; color: var(--ink-64); }
/* Empty, the live region stays in the tree (so it's announced when it fills) but takes no room. */
.wl__msg:empty { margin-top: calc(-1 * var(--s-2)); }
.wl[data-state="error"] .wl__msg { color: var(--orange-ink); }
.wl__note { font-size: var(--t-micro); line-height: 1.45; color: var(--ink-58); }
.wl__note a { color: inherit; }

/* The honeypot: off-screen, out of the tab order, hidden from assistive tech. */
.wl__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* No-JS results: the Worker sends the post back to #<id>-joined or #<id>-<error>, and :target shows it. With JS the
   live region speaks instead. */
.wl__nojs { display: none; font-size: var(--t-small); line-height: 1.45; color: var(--orange-ink); }
.wl__nojs:target { display: block; }
.wl[data-js] .wl__nojs { display: none; }

/* Done: the form gives way to the thank-you. */
/* Done: the form and the promise line give way to the mark and the thank-you, side by side. */
.wl__done { display: none; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: var(--s-4); outline: none; }
.wl.is-done .wl__done, .wl__done:target { display: grid; }
.wl.is-done .wl__form, .wl:has(.wl__done:target) .wl__form,
.wl.is-done .wl__head .wl__line, .wl:has(.wl__done:target) .wl__head .wl__line { display: none; }
.wl__done-copy { display: grid; gap: var(--s-1); }
.wl__done-title { font: 500 20px/1.2 var(--font-display); letter-spacing: -.02em; color: var(--ink); }
/* A no-JS post lands on #<id>-joined or #<id>-<error>: keep the card's title in view under a sticky nav. */
.wl__done, .wl__nojs { scroll-margin-top: 160px; }
/* The mark (SITE-33's mascot when it lands in [data-mascot-slot]; a pixel tick until then). */
.wl__mark { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-md); background: var(--orange-soft); color: var(--orange-ink); }
.wl__mark > svg { width: 24px; height: 24px; }  /* 3 CSS px per mark pixel */
.wl__mark:has(> img, > picture, > canvas) { width: auto; height: auto; background: none; }

/* Pixel confetti: square dots in the five accents, thrown out from the mark and falling as they fade. */
.wl__confetti { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.wl__confetti i { position: absolute; left: calc(var(--s) / -2); top: calc(var(--s) / -2); width: var(--s); height: var(--s); background: var(--c);
  animation: wl-pixel var(--t) var(--ease-out) forwards; }
@keyframes wl-pixel {
  0% { transform: translate(0, 0) scale(.4); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--x), calc(var(--y) + 28px)) scale(1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .wl__input { transition: none; }
  .wl__confetti { display: none; }
}
