/* ---------------------------------------------------------------
   1by1 — design tokens
   bg near-black w/ a faint violet undertone, two accents only:
   coral-pink = live/current, electric violet = reserved/next.
   Archivo Black for the big chain numbers, Space Grotesk for
   labels/wordmark, Inter for body, JetBrains Mono for codes.
------------------------------------------------------------------ */
:root {
  --bg: #0c0b10;
  --surface: #17151c;
  --surface-raised: #201d28;
  --line: #2b2733;
  --text: #f3f1f7;
  --text-dim: #8d889b;
  --coral: #ff4d6d;
  --coral-dim: #ff4d6d33;
  --violet: #7c5cff;
  --violet-dim: #7c5cff33;

  --f-display: "Archivo Black", "Space Grotesk", sans-serif;
  --f-label: "Space Grotesk", sans-serif;
  --f-body: "Inter", sans-serif;
  --f-mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  overflow-x: hidden;
  min-height: 100vh;
}
button, input, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

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

/* ---------------- signature element: the vertical thread ---------------- */
.thread {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, transparent, var(--line) 8%, var(--line) 92%, transparent);
  z-index: 0;
  pointer-events: none;
}

/* ---------------- topbar ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, var(--bg) 60%, transparent);
}
.wordmark {
  font-family: var(--f-display);
  font-size: 20px;
  letter-spacing: 0.5px;
}
.wordmark .x {
  font-family: var(--f-label);
  font-weight: 400;
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 2px;
  text-transform: lowercase;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-family: var(--f-label);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.btn-ghost:hover { border-color: var(--violet); background: var(--violet-dim); }

/* ---------------- chain ---------------- */
.chain {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px calc(80px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 120px 0;
  color: var(--text-dim);
  font-family: var(--f-label);
}
.pulse-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 0 var(--coral-dim);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--coral-dim); }
  70% { box-shadow: 0 0 0 16px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------------- card ---------------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 24px;
  animation: rise 0.5s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.card .num {
  font-family: var(--f-display);
  font-size: 15px;
  color: var(--text-dim);
  letter-spacing: 1px;
}
.card .name {
  font-family: var(--f-display);
  font-size: 26px;
  line-height: 1.15;
  margin: 10px 0 2px;
}
.card .handle {
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--coral);
}
.card .copy {
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.card .tapped-by {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--f-label);
}

/* current: the glowing live card */
.card.current {
  border-color: var(--coral);
  box-shadow: 0 0 0 1px var(--coral-dim), 0 0 40px -12px var(--coral-dim);
}
.card.current::before {
  content: "current";
  position: absolute;
  top: -10px;
  left: 22px;
  background: var(--coral);
  color: #1a0508;
  font-family: var(--f-label);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 100px;
  text-transform: lowercase;
}

/* reserved / next slot */
.card.reserved {
  border-style: dashed;
  border-color: var(--violet);
  background: linear-gradient(180deg, var(--surface), var(--surface-raised));
}
.card.reserved .label {
  font-family: var(--f-label);
  font-size: 12px;
  color: var(--violet);
  text-transform: lowercase;
  letter-spacing: 0.4px;
}
.card.reserved .code-form {
  margin-top: 18px;
  display: flex;
  gap: 8px;
}
.card.reserved input {
  flex: 1;
  min-width: 0;
}
.card.reserved .btn-primary {
  white-space: nowrap;
}

/* retired / removed */
.card.retired, .card.removed {
  border-style: dotted;
  opacity: 0.55;
}
.card.retired .copy, .card.removed .copy {
  color: var(--text-dim);
  font-style: italic;
}

/* ---------------- form elements ---------------- */
label {
  display: block;
  margin-bottom: 14px;
}
label span {
  display: block;
  font-family: var(--f-label);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: lowercase;
}
input, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 14px 14px;
  font-size: 16px; /* prevents iOS zoom on focus */
  resize: vertical;
}
input:focus, textarea:focus { border-color: var(--violet); }
.divider { border: none; border-top: 1px solid var(--line); margin: 18px 0; }

.btn-primary {
  width: 100%;
  background: var(--coral);
  color: #1a0508;
  border: none;
  padding: 15px 18px;
  border-radius: 12px;
  font-family: var(--f-label);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.form-error {
  color: var(--coral);
  font-size: 13px;
  min-height: 18px;
  margin: 4px 0 10px;
}

/* ---------------- modals ---------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 5, 8, 0.75);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; }
}
.modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  padding: 32px 24px 28px;
}
@media (min-width: 640px) {
  .modal { border-radius: 20px; }
}
.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.eyebrow {
  font-family: var(--f-label);
  font-size: 12px;
  color: var(--coral);
  text-transform: lowercase;
  letter-spacing: 0.5px;
  margin: 0 0 6px;
}
.modal h2 {
  font-family: var(--f-display);
  font-size: 24px;
  margin: 0 0 6px;
}
.modal-sub {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 20px;
}
.modal form { margin-top: 18px; }

/* ---------------- footer / toast ---------------- */
.foot {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 30px 0 50px;
  color: var(--text-dim);
  font-family: var(--f-label);
  font-size: 12px;
  text-transform: lowercase;
}
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 100px;
  font-size: 13px;
  z-index: 100;
  animation: rise 0.3s ease both;
}

/* ---------------- founder dashboard ---------------- */
.dash-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 60;
  overflow-y: auto;
}
.dash {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 18px calc(80px + env(safe-area-inset-bottom));
}
.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash h2 {
  font-family: var(--f-display);
  font-size: 26px;
  margin: 4px 0 24px;
}
.dash-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 18px;
}
.dash-section h3 {
  font-family: var(--f-label);
  font-size: 15px;
  margin: 0 0 6px;
  text-transform: lowercase;
}
.dash-info { font-size: 14px; color: var(--text-dim); margin: 10px 0 14px; line-height: 1.6; }
.current-detail p { margin: 0 0 8px; font-size: 14px; line-height: 1.55; word-break: break-word; }
.current-detail .meta { color: var(--text-dim); font-size: 13px; }
.current-detail .mono { font-family: var(--f-mono); color: var(--coral); }
.dm-box {
  margin-top: 14px;
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.dm-label {
  font-family: var(--f-label);
  font-size: 11px;
  color: var(--violet);
  text-transform: lowercase;
  margin: 0 0 8px;
}
.dm-text {
  white-space: pre-wrap;
  font-family: var(--f-body);
  font-size: 13px;
  color: var(--text);
  margin: 0 0 10px;
}
.dash-list { display: flex; flex-direction: column; gap: 10px; }
.dash-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  flex-wrap: wrap;
}
.dash-row .meta { color: var(--text-dim); word-break: break-word; }
.dash-row .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.dash-row button {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

@media (max-width: 420px) {
  .dash-row { flex-direction: column; align-items: stretch; }
  .dash-row .actions { justify-content: flex-start; }
}

/* ---------------- responsive scale-up ---------------- */
@media (min-width: 768px) {
  .chain { max-width: 620px; padding-top: 40px; }
  .card { padding: 36px 32px; }
  .card .name { font-size: 32px; }
  .card .copy { font-size: 17px; }
}
