/* Exchangent waitlist. The background canvas (background.js), one line, one form. Nothing else. */

:root {
  color-scheme: dark;
  --bg: #0b0c0b;
  --fg: #e8e6e0;
  --muted: #8a8a84;
  --faint: #4a4b47;
  --line: #2a2b28;
  --lbl: #a3a39c;
  --accent: #a9b996;
  --danger: #d9a0a0;
  --field: #141513;
  --edge: #3a3b36;

  --serif: "Newsreader", "Iowan Old Style", "Palatino", Georgia, serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f4f3ef;
    --fg: #1b1c19;
    --muted: #6b6c66;
    --faint: #b5b6b0;
    --line: #d6d5cf;
    --lbl: #5e5f59;
    --accent: #5c7349;
    --danger: #a04848;
    --field: #fbfaf7;
    --edge: #c4c3bc;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--bg);
  color: var(--fg);
  font: 400 14px/1.6 var(--mono);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

/* ---------- background ---------- */
#bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  contain: strict;
}
#bg canvas {
  position: absolute;
  top: 0;
  left: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
#bg .lbl {
  position: absolute;
  top: 0;
  left: 0;
  white-space: nowrap;
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.01em;
  color: var(--lbl);
  opacity: 0;
  transition: opacity 700ms ease;
  will-change: opacity;
}
#bg .lbl.is-on { opacity: 1; transition-duration: 500ms; }
#bg .lbl.is-dim { opacity: 0.3; }
#bg .lbl.is-dim.is-on { opacity: 0.3; }
#bg .lbl b { font-weight: 400; color: var(--accent); }
#bg .lbl s { text-decoration: line-through; color: var(--faint); }

/* ---------- content ---------- */
main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
}

h1 {
  margin: 0 0 28px;
  font: 400 clamp(24px, 1.2rem + 1.2vw, 32px)/1.2 var(--serif);
  font-optical-sizing: auto;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

form { display: grid; gap: 10px; }
.field { position: relative; }
.field label {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}
.in {
  display: block;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--edge);
  border-radius: 0;
  background: var(--field);
  color: var(--fg);
  font: 400 15px/1.4 var(--mono);
  outline: none;
  transition: border-color 160ms ease;
}
.in::placeholder { color: var(--muted); opacity: 1; }
.in:focus { border-color: var(--fg); }
.in:focus-visible { outline: none; }
.in[aria-invalid="true"] { border-color: var(--danger); }

.row { display: flex; gap: 10px; align-items: stretch; }
.row .field { flex: 1 1 auto; }

.btn {
  flex: 0 0 auto;
  appearance: none;
  margin: 0;
  padding: 12px 18px;
  border: 1px solid var(--fg);
  border-radius: 0;
  background: var(--fg);
  color: var(--bg);
  font: 400 13px/1 var(--mono);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}
.btn:hover { background: transparent; color: var(--fg); }
.btn:disabled { opacity: 0.5; cursor: progress; }
.btn[aria-busy="true"]::after {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-left: 8px;
  background: currentColor;
  animation: blink 900ms steps(2, start) infinite;
  vertical-align: 1px;
}
@keyframes blink { to { visibility: hidden; } }
.stack .btn { justify-self: start; margin-top: 10px; }

.status {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.status:empty { margin: 0; }
.status.is-error { color: var(--danger); }

.done { outline: none; color: var(--muted); }

.alt {
  display: inline-block;
  margin-top: 18px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  transition: color 160ms ease, border-color 160ms ease;
}
.alt:hover { color: var(--fg); border-color: var(--muted); }
.done + .alt { margin-top: 20px; }

/* merchant brief */
.brief { margin: -12px 0 24px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 0 0 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stats dt { font: 400 26px/1.1 var(--serif); color: var(--fg); }
.stats dd { margin: 6px 0 0; font-size: 11px; line-height: 1.5; color: var(--muted); }
.stats dd a { display: block; margin-top: 4px; color: var(--faint); }
.stats dd a:hover { color: var(--fg); }
.stats + .brief { margin-top: 0; }

.mail { margin: 18px 0 0; font-size: 12px; color: var(--muted); }
.mail a { color: var(--fg); border-bottom: 1px solid var(--line); }
.mail a:hover { border-color: var(--muted); }
.mail + .alt { margin-top: 10px; }
.done b { font-weight: 400; color: var(--fg); }

/* honeypot */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 480px) {
  .row { flex-direction: column; align-items: stretch; gap: 16px; }
  .btn, .stack .btn { width: 100%; padding: 14px; justify-self: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
