/* TsawerLink waitlist: a darkroom lit by light leaks, framed through a viewfinder.
   Brand tokens from docs/DESIGN-SYSTEM.md (brand #1a63e0 / logo blue #2276fe, Manrope). */
@font-face {
  font-family: 'Manrope';
  src: url('/waitlist/manrope.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

* { box-sizing: border-box; }
html { accent-color: var(--brand-strong); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.55 'Manrope', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: rgb(91 155 255 / 40%); color: var(--ink); }
a { color: var(--brand-strong); text-underline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Hero: the viewfinder frame ---------- */
.hero {
  position: relative;
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 16px;
  padding: 56px 20px;
  min-height: calc(100dvh - 120px);
  text-align: center;
  transition: opacity 0.6s var(--ease), transform 0.8s var(--ease), filter 0.6s var(--ease);
}
.corner { position: absolute; width: 26px; height: 26px; border: 0 solid var(--corner); animation: focus 1.4s 0.2s var(--ease) both; }
.corner-tl { top: 0; left: 0; border-width: 1.5px 0 0 1.5px; --fx: -14px; --fy: -14px; }
.corner-tr { top: 0; right: 0; border-width: 1.5px 1.5px 0 0; --fx: 14px; --fy: -14px; }
.corner-bl { bottom: 0; left: 0; border-width: 0 0 1.5px 1.5px; --fx: -14px; --fy: 14px; }
.corner-br { bottom: 0; right: 0; border-width: 0 1.5px 1.5px 0; --fx: 14px; --fy: 14px; }
@keyframes focus { from { opacity: 0; transform: translate(var(--fx), var(--fy)); } 60% { opacity: 1; } }
.hero-title {
  margin: 0;
  font-size: clamp(36px, 5.6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
  text-wrap: balance;
}
.hero-title .line { display: block; animation: develop 1.3s var(--ease) both; }
.hero-title .line + .line { color: var(--ink-2); animation-delay: 0.18s; }
@keyframes develop { from { opacity: 0; filter: blur(14px); transform: translateY(18px) scale(0.98); } }
.hero-lead {
  max-width: 36rem;
  margin: 20px 0 32px;
  font-size: clamp(16px, 1.6vw, 18.5px);
  color: var(--ink-2);
  text-wrap: pretty;
  animation: develop 1.2s 0.4s var(--ease) both;
}
.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--cta-bg);
  color: var(--cta-ink);
  font-weight: 800;
  font-size: 17px;
  text-decoration: none;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 40%), 0 10px 30px -6px rgb(34 118 254 / 65%), 0 0 60px 6px rgb(34 118 254 / 30%);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  animation: develop 1.2s 0.55s var(--ease) both;
}
.cta svg { transition: transform 0.4s var(--ease); }
.cta:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgb(255 255 255 / 55%), 0 16px 40px -6px rgb(34 118 254 / 75%), 0 0 80px 12px rgb(34 118 254 / 38%); }
.cta:hover svg { transform: translateX(3px); }
.cta:focus-visible { outline: none; box-shadow: var(--ring), 0 10px 30px -6px rgb(34 118 254 / 65%); }
.hero-roles {
  max-width: 100%;
  margin: 40px 0 0;
  padding: 10px 18px;
  border: 1px solid var(--glass-edge);
  border-radius: 22px;
  background: var(--glass);
  box-shadow: inset 0 1px 0 var(--glass-hi);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  animation: develop 1.2s 0.7s var(--ease) both;
}

/* Join: the hero recedes, the panel rises */
body.is-joining .hero { opacity: 0; transform: scale(0.94) translateY(-3vh); filter: blur(10px); pointer-events: none; }
.hero[hidden], .join[hidden] { display: none; }
.join {
  grid-area: 1 / 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 40px;
}
.join .panel { animation: surface 0.9s var(--ease) both; }
@keyframes surface { from { opacity: 0; transform: translateY(40px) scale(0.97); filter: blur(8px); } }

/* ---------- Panel ---------- */
.panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  padding: 24px 20px 20px;
  border: 1px solid var(--glass-edge);
  border-radius: 28px;
  background: var(--glass);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow);
}
.panel::before {
  content: '';
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(140deg, rgb(127 212 255 / 55%), transparent 35%, transparent 70%, rgb(34 118 254 / 45%));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.panel-head { margin-bottom: 20px; }
.progress-label { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress { height: 3px; overflow: hidden; border-radius: 3px; background: var(--field); }
.progress span {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--leak-b));
  box-shadow: 0 0 12px rgb(127 212 255 / 80%);
  transition: width 0.7s var(--ease);
}
.step { position: relative; z-index: 2; min-width: 0; margin: 0; padding: 0; border: 0; animation: slide 0.55s var(--ease) both; }
.step.back { animation-name: slide-back; }
@keyframes slide { from { opacity: 0; transform: translateX(28px); } }
@keyframes slide-back { from { opacity: 0; transform: translateX(-28px); } }
legend { margin-bottom: 18px; padding: 0; }
legend h3 { margin: 0; font-size: clamp(24px, 4vw, 30px); line-height: 1.15; letter-spacing: -0.025em; font-weight: 800; }
legend h3:focus { outline: none; }
.field { min-width: 0; margin: 0 0 18px; }
label, .label { display: block; margin: 0 0 8px; font-weight: 700; font-size: 14.5px; color: var(--ink); }
.optional { margin-left: 6px; font-weight: 600; font-size: 13px; color: var(--muted); }
.hint { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }
#roles-hint { margin: -10px 0 0; }
.group-label { margin: 16px 0 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); }

input:not([type='checkbox']):not([type='radio']), select {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid var(--field-edge);
  border-radius: 14px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  caret-color: var(--brand-strong);
  transition: border-color 0.25s, box-shadow 0.25s;
}
input::placeholder { color: var(--muted); opacity: 0.85; }
input:hover, select:hover { border-color: rgb(127 212 255 / 45%); }
input:focus-visible, select:focus-visible { outline: none; border-color: var(--brand-strong); box-shadow: var(--ring), 0 0 24px -4px rgb(34 118 254 / 55%); }
input[aria-invalid='true'], select[aria-invalid='true'] { border-color: var(--danger); }
.select { position: relative; }
.select select { appearance: none; padding-right: 44px; cursor: pointer; }
.select::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 18px;
  width: 8px;
  height: 8px;
  border: solid var(--ink-2);
  border-width: 0 1.6px 1.6px 0;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
select option { background: var(--ground); color: var(--ink); }

/* Chips */
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--field-edge);
  border-radius: 999px;
  background: var(--field);
  font-weight: 700;
  font-size: 14.5px;
  text-align: center;
  cursor: pointer;
  transition: background 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s, color 0.3s;
}
.chip input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.chip:hover { border-color: rgb(127 212 255 / 50%); }
.chip:has(input:checked) {
  border-color: rgb(127 212 255 / 70%);
  background: linear-gradient(160deg, #2276fe, #1a55c4);
  color: #fff;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 35%), 0 8px 24px -8px rgb(34 118 254 / 80%), 0 0 22px -2px rgb(34 118 254 / 45%);
}
.chip:has(input:focus-visible) { box-shadow: var(--ring); }
.other { margin-top: 14px; }

/* Checks */
.check { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 4px; padding: 12px 0; font-weight: 600; cursor: pointer; }
.check input { flex: none; width: 22px; height: 22px; margin: 0; cursor: pointer; }
.check input:focus-visible { outline: none; border-radius: 4px; box-shadow: var(--ring); }
.turnstile { min-height: 65px; margin: 14px 0 6px; }

.error { margin: 8px 0 0; color: var(--danger); font-size: 13.5px; font-weight: 700; }
.error:empty { display: none; }
.summary { margin: 0 0 18px; padding: 12px 14px; border: 1px solid var(--danger); border-radius: 14px; background: rgb(255 120 100 / 8%); color: var(--danger); font-weight: 700; }
.summary:focus { outline: none; }
.note { margin: 14px 0 0; font-size: 13.5px; color: var(--muted); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Nav buttons */
.nav { display: flex; gap: 10px; margin-top: 24px; }
.nav button { min-height: 52px; border-radius: 999px; font: inherit; font-weight: 800; font-size: 16px; cursor: pointer; transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), opacity 0.3s; }
.primary {
  flex: 1;
  border: 0;
  background: var(--cta-bg);
  color: var(--cta-ink);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 40%), 0 10px 26px -8px rgb(34 118 254 / 70%), 0 0 40px 0 rgb(34 118 254 / 25%);
}
.primary:hover { transform: translateY(-1px); }
.ghost { padding: 0 22px; border: 1px solid var(--glass-edge); background: var(--field); color: var(--ink); }
.ghost[hidden] { display: none; }
.nav button:focus-visible { outline: none; box-shadow: var(--ring); }
.nav button:disabled { opacity: 0.6; cursor: progress; }

/* Thank-you */
.thanks { overflow: hidden; padding: 48px 24px; text-align: center; }
.thanks h2 { margin: 0 0 12px; font-size: clamp(28px, 5vw, 40px); letter-spacing: -0.03em; font-weight: 800; }
.thanks h2:focus { outline: none; }
.thanks p { margin: 0; color: var(--ink-2); }
.thanks .note { margin-top: 16px; }
.flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgb(255 255 255 / 70%), transparent 60%);
  pointer-events: none;
  animation: flash 1.2s var(--ease) both;
}
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

.foot { position: relative; z-index: 1; padding: 0 16px 20px; font-size: 12px; text-align: center; color: var(--muted); }
.foot a { color: inherit; }

@media (min-width: 640px) {
  .bar { margin: 20px 28px 0; }
  .hero { margin: 24px 28px; padding: 72px 40px; min-height: calc(100dvh - 150px); }
  .corner { width: 34px; height: 34px; }
  .panel { padding: 32px 32px 28px; }
  .join { align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
