/* Stipple waitlist · shared styles
   Tokens: Terminal amber, from Stipple Design System v1.0 */
:root {
  --canvas-deep: #050506;
  --canvas: #08080a;
  --ink: #111114;
  --well: #16161a;
  --chip: #1c1c21;
  --raised: #1f1f25;
  --raised-hover: #26262d;
  --white: #ffffff;
  --pale: #ededf1;
  --mist: #d2d2d9;
  --graphite: #adadb6;
  --smoke: #8f8f99;
  --hairline: rgb(255 255 255 / 0.07);
  --hairline-strong: rgb(255 255 255 / 0.12);
  --divider: rgb(255 255 255 / 0.05);
  --fill-1: rgb(255 255 255 / 0.03);
  --fill-2: rgb(255 255 255 / 0.06);
  --fill-3: rgb(255 255 255 / 0.10);
  --gain: #4ebe96;
  --gain-bg: #14201e;
  --loss: #d14c6e;
  --loss-bg: #261017;
  --ember: #ffb000;
  --ember-bg: rgb(255 176 0 / 0.12);
  --signal: #4d7cff;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ring: 0 0 0 1.5px var(--signal);
  --shadow-float: 0 0 44px 0 rgb(0 0 0 / 0.8);
  --shadow-float-soft: 0 0 35px 0 rgb(0 0 0 / 0.5);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--canvas-deep); color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--canvas-deep);
  color: var(--white);
  font-family: var(--font);
  font-feature-settings: "ss01" 1, "cv11" 1;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); }
[hidden] { display: none !important; }

/* ---------- Background: stipple tiles + glows ---------- */
.bg {
  position: absolute;
  inset: 0 0 auto 0;
  height: 900px;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(46% 40% at 50% 18%, rgb(255 176 0 / 0.11) 0%, transparent 70%),
    radial-gradient(40% 36% at 50% 92%, rgb(77 124 255 / 0.06) 0%, transparent 70%);
}
.tiles {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 1430px;
  height: auto;
  -webkit-mask-image: radial-gradient(58% 52% at 50% 26%, #000 0%, rgb(0 0 0 / 0.55) 42%, transparent 76%);
          mask-image: radial-gradient(58% 52% at 50% 26%, #000 0%, rgb(0 0 0 / 0.55) 42%, transparent 76%);
}
.tiles .t { fill: rgb(255 255 255 / 0.012); stroke: rgb(255 255 255 / 0.045); stroke-width: 1; }
.tiles .a { fill: var(--ember); }
.tiles .w { fill: #fff; }
.tiles .pulse { animation: tile-pulse 7s ease-in-out infinite alternate; }
@keyframes tile-pulse { from { opacity: var(--o1); } to { opacity: var(--o2); } }

/* ---------- Shell ---------- */
.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding:
    max(20px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  flex: 1;
  display: flex;
  flex-direction: column;
}
.shell.narrow { max-width: 520px; }
header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 36px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  border-radius: 8px;
}
.toplink {
  font-size: 13px;
  font-weight: 500;
  color: var(--graphite);
  text-decoration: none;
  border-radius: 6px;
  padding: 4px 2px;
}
.toplink:hover { color: var(--white); }

/* ---------- Type ---------- */
.eyebrow {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px 0 10px;
  border-radius: 99px;
  background: var(--fill-2);
  border: 1px solid var(--hairline);
  color: var(--mist);
  font-size: 12px;
  font-weight: 500;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 99px;
  background: var(--ember);
  box-shadow: 0 0 0 3px rgb(255 176 0 / 0.18);
}
h1 {
  margin: 0;
  font-weight: 600;
  text-wrap: balance;
}
h1 em, h2 em { font-style: normal; color: var(--ember); }
.lede {
  margin: 0;
  max-width: 34em;
  font-size: 16px;
  line-height: 1.6;
  color: var(--graphite);
  text-wrap: pretty;
}

/* ---------- Card ---------- */
.card {
  position: relative;
  border-radius: 16px;
  background:
    radial-gradient(80% 70% at 0% 0%, rgb(255 176 0 / 0.08) 0%, transparent 70%),
    var(--ink);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-float-soft);
  padding: 22px 20px 20px;
}
.card-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }
.card-head h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.card-head p { margin: 0; font-size: 14px; color: var(--graphite); }

/* ---------- Form ---------- */
form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label, .q-label { font-size: 13px; font-weight: 500; color: var(--mist); }
.field input, .field textarea {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--hairline-strong);
  background: var(--fill-1);
  color: var(--white);
  font: 16px var(--font); /* 16px stops iOS from zooming on focus */
  outline: none;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease), background 150ms var(--ease);
}
.field textarea { height: auto; min-height: 92px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--smoke); }
.field input:hover, .field textarea:hover { background: var(--fill-2); }
.field input:focus, .field textarea:focus { border-color: var(--signal); box-shadow: var(--ring); }
.field input[aria-invalid="true"] { border-color: var(--loss); }
.field .err { display: none; font-size: 12px; color: var(--loss); }
.field .err.on { display: block; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  margin-top: 4px;
  padding: 0 20px;
  border: 0;
  border-radius: 99px;
  background: var(--ember);
  color: #0a0805;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: filter 150ms var(--ease), transform 150ms var(--ease), background 150ms var(--ease);
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(0.98); }
.btn[disabled] { cursor: progress; opacity: 0.75; }
.btn svg { flex: none; }
.btn.ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--hairline-strong);
  font-weight: 500;
}
.btn.ghost:hover { background: var(--fill-2); filter: none; }
.spinner {
  width: 16px; height: 16px; border-radius: 99px;
  border: 2px solid rgb(10 8 5 / 0.25);
  border-top-color: #0a0805;
  animation: spin 700ms linear infinite;
  display: none;
}
.btn.loading .spinner { display: block; }
.btn.loading .arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-err {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--loss-bg);
  border: 1px solid rgb(209 76 110 / 0.35);
  color: #f2b8c8;
  font-size: 13px;
  line-height: 1.5;
}
.form-err.on { display: flex; }
.form-err svg { flex: none; margin-top: 2px; color: var(--loss); }
.fineprint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
  margin-top: 2px;
  font-size: 12px;
  color: var(--smoke);
  text-align: center;
}
.linkbtn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--mist);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--hairline-strong);
  cursor: pointer;
  border-radius: 4px;
}
.linkbtn:hover { color: var(--white); }

/* ---------- Choice chips (radio / checkbox) ---------- */
.q { display: flex; flex-direction: column; gap: 10px; border: 0; margin: 0; padding: 0; min-width: 0; }
.q legend { padding: 0; margin-bottom: 10px; font-size: 14px; font-weight: 600; color: var(--white); }
.q legend small { font-weight: 400; color: var(--smoke); margin-left: 6px; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 99px;
  background: var(--fill-1);
  border: 1px solid var(--hairline-strong);
  color: var(--mist);
  font-size: 14px;
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 150ms var(--ease);
}
.chip span:hover { background: var(--fill-2); color: var(--white); }
.chip span:active { transform: scale(0.98); }
.chip input:checked + span {
  background: var(--ember-bg);
  border-color: rgb(255 176 0 / 0.6);
  color: var(--white);
}
.chip input:checked + span::before {
  content: "";
  width: 12px; height: 12px;
  background: var(--ember);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10.5 4 4 8-9' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m4 10.5 4 4 8-9' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.chip input:focus-visible + span { box-shadow: var(--ring); }

/* ---------- Success ---------- */
.check {
  width: 52px; height: 52px; border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gain-bg);
  color: var(--gain);
  flex: none;
}
.enter { animation: enter 200ms var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------- Referral block (spot, personal link, share) ---------- */
.referral { width: 100%; display: flex; flex-direction: column; gap: 12px; margin-top: 10px; text-align: left; }
.ref-spot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--well);
  border: 1px solid var(--hairline);
}
.ref-label { font-size: 13px; color: var(--graphite); }
.ref-num { font-size: 30px; line-height: 1; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--white); }
.ref-how { margin: 0; font-size: 14px; line-height: 1.5; color: var(--mist); text-align: center; }
.ref-link { display: flex; gap: 8px; }
.ref-link input {
  flex: 1; min-width: 0; height: 44px; padding: 0 12px;
  border-radius: 12px; border: 1px solid var(--hairline-strong);
  background: var(--fill-1); color: var(--mist);
  font: 14px var(--font); outline: none;
}
.ref-link input:focus { border-color: var(--signal); box-shadow: var(--ring); }
.ref-copy {
  flex: none; height: 44px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--hairline-strong);
  background: var(--raised); color: var(--white);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 150ms var(--ease);
}
.ref-copy:hover { background: var(--raised-hover); }
.referral .btn { margin-top: 0; }
.ref-count { margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--gain); }
.ref-count::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: var(--gain); }
.notyou { margin-top: 4px; }

/* ---------- Footer ---------- */
footer.site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 20px;
  border-top: 1px solid var(--divider);
  font-size: 12px;
  color: var(--smoke);
}
footer.site .linkbtn { color: var(--smoke); }
footer.site .linkbtn:hover { color: var(--white); }

/* ---------- Privacy dialog ---------- */
dialog.privacy {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 1px solid var(--hairline-strong);
  border-radius: 16px;
  background: var(--raised);
  color: var(--white);
  box-shadow: var(--shadow-float);
}
dialog.privacy[open] { animation: enter 200ms var(--ease) both; }
dialog.privacy::backdrop { background: rgb(0 0 0 / 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dlg { padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 14px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dlg h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.x {
  width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: transparent; color: var(--graphite);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.x:hover { background: var(--fill-2); color: var(--white); }
.dlg dl { margin: 0; display: flex; flex-direction: column; }
.dlg dt { font-size: 12px; font-weight: 600; color: var(--mist); }
.dlg dd { margin: 2px 0 14px; font-size: 14px; color: var(--graphite); line-height: 1.55; }
.dlg dd:last-child { margin-bottom: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  transform: translate(-50%, 8px);
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--raised);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-float);
  font-size: 13px;
  overflow-wrap: anywhere;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) {
  .shell { padding-left: 32px; padding-right: 32px; }
  .card { padding: 26px 24px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
