:root {
  --bg: #090909;
  --card: #121212;
  --field: #0a0a0a;
  --green: #20c968;
  --green-2: #18c766;
  --text: #ededed;
  --muted: #9a9a9a;
  --line: #222;
  --danger: #ff8f86;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* 1u == 1px of the 1920x1080 design; shrinks to fit width AND height so desktop never scrolls */
  --u: min(calc(100vw / 1920), calc(100vh / 1080), 1.25px);
  color-scheme: dark;
}
@supports (height: 100dvh) {
  :root { --u: min(calc(100vw / 1920), calc(100dvh / 1080), 1.25px); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }
button, input { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- background (fixed layer, can never cause scroll) ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 55% at 92% 100%, rgba(0, 96, 60, .26), transparent 72%),
    radial-gradient(ellipse 40% 40% at 64% 88%, rgba(0, 50, 32, .16), transparent 85%),
    var(--bg);
}
.pixels {
  position: absolute;
  right: 0;
  width: 100%;
  --px: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Crect x='2' y='2' width='27' height='27' fill='%23262626'/%3E%3C/svg%3E");
  background-size: var(--px) var(--px);
  background-position: right top;
}
.pixels--top {
  top: 0;
  height: 42%;
  opacity: .45;
  -webkit-mask-image: radial-gradient(ellipse 80% 75% at 85% 0%, #000 10%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 75% at 85% 0%, #000 10%, transparent 100%);
}
.pixels--bottom {
  bottom: 0;
  height: 36%;
  opacity: .5;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 90%), linear-gradient(to right, transparent, #000 70%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent, #000 90%), linear-gradient(to right, transparent, #000 70%);
  mask-composite: intersect;
}

/* ---------- page: mobile first ---------- */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding:
    max(20px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
}
.header { flex: none; }
.logo { display: block; width: 116px; height: auto; }

.main {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(22px, 4vh, 44px);
  padding: clamp(18px, 4vh, 44px) 0;
}
.hero { min-width: 0; }
.eyebrow {
  margin: 0 0 clamp(10px, 1.6vh, 18px);
  font: 400 11px/1.2 var(--mono);
  letter-spacing: .02em;
  color: #8f8f8f;
}
h1 {
  margin: 0;
  font-size: clamp(32px, 9.6vw, 60px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -.045em;
}
h1 .line { display: block; white-space: nowrap; }
h1 .accent { color: var(--green-2); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: clamp(14px, 2.6vh, 28px);
  padding: 9px 15px;
  border: 1px solid #13c974;
  border-radius: 999px;
  color: #b0b0b0;
  background: rgba(9, 9, 9, .75);
  box-shadow: inset 0 0 0 3px rgba(14, 162, 94, .08), 0 0 13px rgba(15, 229, 134, .18);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}
.pill-dot {
  width: 8px; height: 8px; flex: none; border-radius: 50%;
  background: #38e994; box-shadow: 0 0 10px 2px rgba(47, 243, 151, .6);
}

/* ---------- form card ---------- */
.waitlist {
  width: 100%;
  padding: 20px 16px 14px;
  background: var(--card);
  border: 1.5px solid #1acc69;
  border-radius: 22px;
  box-shadow: 0 12px 45px rgba(0, 0, 0, .2);
}
.step-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  color: #a5a5a5;
}
.number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 23px; flex: none;
  border: 1px solid #5c5c5c; border-radius: 6px;
  font: 400 13px/1 var(--mono); color: #aaa;
}
.field-row {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 14px 4px 4px;
  border: 1px solid #202020;
  border-radius: 14px;
  background: var(--field);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field-row:focus-within { border-color: rgba(32, 201, 104, .7); box-shadow: 0 0 0 3px rgba(32, 201, 104, .1); }
.field-row.is-invalid { border-color: rgba(255, 120, 110, .7); box-shadow: 0 0 0 3px rgba(255, 120, 110, .08); }
.icon-tile {
  flex: none;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  overflow: hidden;
  border: 1px solid #363636; border-radius: 10px;
  background: #161616;
}
.icon-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.email-icon { width: 30px; height: 26px; display: block; }
.email-field {
  min-width: 0; flex: 1;
  background: transparent; border: 0; outline: none;
  font-size: 16px; /* >=16px stops iOS zoom */
  color: var(--text);
}
.email-field:focus-visible { outline: none; }
.email-field::placeholder { color: #666; opacity: 1; }
.step + .step { margin-top: clamp(16px, 2.6vh, 26px); }

.x-row { text-decoration: none; color: var(--text); cursor: pointer; }
a.x-row:hover { border-color: #3d3d3d; background: #0d0d0d; }
.x-icon { color: var(--green); font-size: 26px; line-height: 1; }
.x-text { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.x-name { font-size: 18px; font-weight: 500; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x-sub { font-size: 12px; color: var(--muted); }
.x-end { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.outbound { display: block; width: 20px; height: 20px; color: #aaa; }
.x-row.is-verified { border-color: rgba(32, 201, 104, .5); cursor: default; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px; border-radius: 999px;
  background: rgba(32, 201, 104, .12); color: #5bec9a;
  font: 500 12px/1 var(--mono);
}
.badge svg { width: 12px; height: 12px; }
.change-btn {
  border: 0; background: none; padding: 4px 2px; cursor: pointer;
  color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 3px;
}
.change-btn:hover { color: var(--text); }

.join {
  width: 100%;
  height: 56px;
  margin-top: clamp(18px, 2.8vh, 28px);
  border: 1px solid #242424;
  border-radius: 14px;
  background: #171717;
  color: var(--green);
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: border-color .2s, background .2s, transform .15s, color .2s;
}
.join:hover { border-color: rgba(32, 201, 104, .55); background: #1b231e; }
.join:active { transform: scale(.995); }
.join.is-ready { border-color: rgba(32, 201, 104, .55); background: #16241c; }
.join.is-busy { pointer-events: none; opacity: .8; }
.join .spinner { width: 18px; height: 18px; border-width: 2px; margin: 0; }

.help { min-height: 1.3em; margin: 12px 0 0; text-align: center; color: #a3a3a3; font-size: 13px; line-height: 1.3; }
.help.is-error { color: var(--danger); }
.help.is-success { color: #5bec9a; }
.help button { border: 0; background: none; padding: 0; color: var(--green); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }

.footer { flex: none; color: #8c8c8c; font-size: 12px; line-height: 1.3; }

/* short phones: drop the pill so the whole thing fits one screen */
@media (max-width: 1023px) and (max-height: 700px) {
  .pill { display: none; }
}

/* ---------- tablet / large phone ---------- */
@media (min-width: 600px) and (max-width: 1023px), (min-width: 1024px) and (max-aspect-ratio: 1/1) {
  .page { padding: 32px 36px 28px; }
  .logo { width: 150px; }
  .main { max-width: 640px; }
  .eyebrow { font-size: 14px; }
  h1 { font-size: clamp(48px, 9vw, 78px); }
  .pill { font-size: 16px; padding: 11px 20px; gap: 12px; }
  .waitlist { padding: 28px 26px 20px; border-radius: 26px; }
  .step-label { font-size: 20px; gap: 12px; }
  .number { width: 36px; height: 27px; font-size: 16px; }
  .field-row { min-height: 66px; padding: 5px 16px 5px 5px; border-radius: 17px; gap: 16px; }
  .icon-tile { width: 54px; height: 54px; border-radius: 12px; }
  .email-icon { width: 36px; height: 31px; }
  .email-field { font-size: 18px; }
  .x-icon { font-size: 31px; }
  .x-name { font-size: 22px; }
  .outbound { width: 24px; height: 24px; }
  .join { height: 66px; font-size: 22px; border-radius: 17px; }
  .help { font-size: 15px; margin-top: 16px; }
  .footer { font-size: 14px; }
}

/* ---------- desktop: scaled replica of the 1920x1080 design ---------- */
@media (min-width: 1024px) and (min-aspect-ratio: 1/1) {
  .pixels { --px: calc(48 * var(--u)); width: 54%; }
  .pixels--top { height: calc(475 * var(--u)); }
  .pixels--bottom { height: calc(400 * var(--u)); }

  .page {
    padding: calc(80 * var(--u)) max(calc(80 * var(--u)), calc((100vw - 2200px) / 2));
  }
  .logo { width: calc(188 * var(--u)); min-width: 120px; }
  .main {
    max-width: none;
    margin: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) calc(770 * var(--u));
    column-gap: calc(62 * var(--u));
    align-items: center;
    gap: 0 calc(62 * var(--u));
    padding: calc(20 * var(--u)) 0;
    min-height: 0;
  }
  .eyebrow { margin: 0 0 calc(104 * var(--u)) calc(7 * var(--u)); font-size: max(12px, calc(20 * var(--u))); letter-spacing: 0; }
  h1 { font-size: calc(120 * var(--u)); letter-spacing: -.04em; }
  .pill {
    margin-top: calc(84 * var(--u));
    min-height: calc(61 * var(--u));
    padding: calc(12 * var(--u)) calc(25 * var(--u));
    gap: calc(23 * var(--u));
    font-size: max(13px, calc(23 * var(--u)));
  }
  .pill-dot { width: calc(11 * var(--u)); height: calc(11 * var(--u)); min-width: 7px; min-height: 7px; }

  .waitlist {
    padding: calc(43 * var(--u)) calc(40 * var(--u)) calc(27 * var(--u));
    border-radius: calc(32 * var(--u));
  }
  .step-label { font-size: max(15px, calc(28 * var(--u))); gap: calc(15 * var(--u)); margin-bottom: calc(14 * var(--u)); }
  .number {
    width: calc(42 * var(--u)); height: calc(32 * var(--u));
    min-width: 28px; min-height: 21px;
    font-size: max(12px, calc(20 * var(--u))); border-radius: calc(7 * var(--u));
  }
  .field-row {
    min-height: calc(76 * var(--u));
    padding: calc(6 * var(--u)) calc(18 * var(--u)) calc(6 * var(--u)) calc(6 * var(--u));
    gap: calc(20 * var(--u));
    border-radius: calc(20 * var(--u));
  }
  .icon-tile { width: calc(64 * var(--u)); height: calc(64 * var(--u)); min-width: 40px; min-height: 40px; border-radius: calc(14 * var(--u)); }
  .email-icon { width: calc(45 * var(--u)); height: calc(39 * var(--u)); min-width: 28px; min-height: 24px; }
  .email-field { font-size: max(15px, calc(21 * var(--u))); }
  .step + .step { margin-top: calc(60 * var(--u)); }
  .x-icon { font-size: max(24px, calc(39 * var(--u))); }
  .x-name { font-size: max(16px, calc(27 * var(--u))); }
  .x-sub { font-size: max(11px, calc(16 * var(--u))); }
  .outbound { width: calc(28 * var(--u)); height: calc(28 * var(--u)); min-width: 18px; min-height: 18px; }
  .badge { font-size: max(11px, calc(16 * var(--u))); padding: calc(7 * var(--u)) calc(12 * var(--u)); }
  .change-btn { font-size: max(11px, calc(16 * var(--u))); }
  .join {
    height: calc(85 * var(--u)); min-height: 48px;
    margin-top: calc(35 * var(--u));
    border-radius: calc(20 * var(--u));
    font-size: max(16px, calc(28 * var(--u)));
  }
  .help { margin-top: calc(22 * var(--u)); font-size: max(12px, calc(22 * var(--u))); }
  .footer { font-size: max(12px, calc(20 * var(--u))); }
}

/* ---------- overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(4, 4, 4, .72);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  overflow-y: auto;
  animation: fade .2s ease;
}
.sheet {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: auto;
  padding: 28px 22px 22px;
  background: var(--card);
  border: 1.5px solid #1acc69;
  border-radius: 24px;
  box-shadow: 0 0 40px rgba(32, 201, 104, .12), 0 20px 60px rgba(0, 0, 0, .5);
  text-align: center;
  animation: pop .25s cubic-bezier(.2, .9, .3, 1.2);
}
.sheet h2 { margin: 14px 0 6px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.sheet-sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.sheet-sub b { color: var(--text); font-weight: 500; }
.sheet-icon {
  width: 56px; height: 56px; margin: 0 auto;
  display: grid; place-items: center;
  border: 1px solid #363636; border-radius: 14px; background: #161616;
}
.handle-row { padding: 4px 14px; }
.at { color: var(--green); font-size: 18px; font-weight: 600; padding-left: 4px; }
.v-msg { min-height: 1.35em; margin: 10px 0 2px; font-size: 13px; color: var(--danger); line-height: 1.35; text-align: left; }
.v-msg:empty { min-height: 0; margin: 6px 0 0; }
.sheet-link { display: inline-block; margin-top: 16px; color: var(--muted); font-size: 13px; text-decoration: none; }
.sheet-link:hover { color: var(--green); }

.btn {
  width: 100%;
  height: 52px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 12px;
  border-radius: 14px;
  font-size: 16px; font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
}
.btn:active { transform: scale(.99); }
.btn svg { width: 19px; height: 19px; }
.btn-primary { border: 1px solid var(--green); background: var(--green); color: #04130a; }
.btn-primary:hover { background: #2bd877; }
.btn-ghost { border: 1px solid #2c2c2c; background: #171717; color: var(--text); }
.btn-ghost:hover { border-color: rgba(32, 201, 104, .55); }
.btn[disabled] { opacity: .6; pointer-events: none; }

.spinner {
  width: 46px; height: 46px; margin: 4px auto 0;
  border: 3px solid #262626; border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.progress { height: 4px; border-radius: 4px; background: #1d1d1d; overflow: hidden; margin: 4px 0 6px; }
.progress span { display: block; height: 100%; width: 0; background: var(--green); border-radius: inherit; }
.check {
  width: 58px; height: 58px; margin: 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(32, 201, 104, .14); color: var(--green);
  box-shadow: 0 0 0 6px rgba(32, 201, 104, .06);
}
.check svg { width: 30px; height: 30px; }
.user-chip {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 0 8px; padding: 10px 12px;
  border: 1px solid #242424; border-radius: 14px; background: var(--field);
  text-align: left;
}
.user-chip .av {
  width: 44px; height: 44px; flex: none; border-radius: 10px; overflow: hidden;
  background: #1c1c1c; display: grid; place-items: center; color: var(--green); font-weight: 700;
}
.user-chip .av img { width: 100%; height: 100%; object-fit: cover; }
.user-chip .nm { min-width: 0; }
.user-chip .nm b, .user-chip .nm span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .nm b { font-weight: 600; font-size: 15px; }
.user-chip .nm span { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* card modal */
.sheet--card { max-width: 760px; padding: 26px 18px 18px; }
.card-eyebrow { margin: 0; font: 500 11px/1 var(--mono); color: var(--green); letter-spacing: .06em; }
.sheet--card h2 { margin: 8px 0 16px; }
.card-frame {
  /* shows just the card; the saved PNG keeps the full 1280x720 canvas */
  position: relative;
  aspect-ratio: 1044 / 540;
  overflow: hidden;
  border-radius: 6.5% / 12.6%;
  margin: 0 -4px;
}
.card-frame img {
  position: absolute;
  left: -10.536%;
  top: -16.667%;
  width: 122.605%;
  height: auto;
  max-width: none;
  display: block;
  -webkit-touch-callout: default;
}
.card-loading { position: absolute; inset: 0; display: grid; place-items: center; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.card-note { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid #2a2a2a; border-radius: 10px; background: #171717; color: #bbb; cursor: pointer;
}
.close svg { width: 18px; height: 18px; }
.close:hover { color: var(--text); border-color: #3a3a3a; }

@media (min-width: 600px) {
  .sheet { padding: 34px 32px 28px; }
  .sheet--card { padding: 30px 28px 24px; }
  .sheet h2 { font-size: 25px; }
  .card-actions { gap: 12px; }
}
@media (max-width: 440px) {
  .badge { padding: 6px; }
  .badge .badge-text { display: none; }
  .x-sub { font-size: 11px; }
}
@media (max-width: 380px) {
  .card-actions { grid-template-columns: 1fr; gap: 0; }
}

.toast {
  position: fixed;
  left: 50%; bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 80;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border: 1px solid rgba(32, 201, 104, .45);
  border-radius: 12px;
  background: #101a14;
  color: #d8f7e4;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  animation: rise .25s ease;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .spinner { animation-duration: 1.6s !important; }
}
