/* QAL — calm walkthrough + funding */

:root {
  --ink: #1a1a1a;
  --paper: #f7f5f0;
  --paper2: #efece4;
  --line: #d4cfc3;
  --mute: #5c5a54;
  --link: #0b4f6c;
  --warn: #8a4b08;
  --warn-bg: #f3e6d0;
  --ok: #1b4332;
  --ok-bg: #d8e8df;
  --accent: #0b4f6c;
  --fund: #c45c26;
  --fund-soft: #f6e8df;
  --mono: "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 17px; scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover { color: #083d54; }

.wrap {
  max-width: 38rem;
  margin: 0 auto;
  padding: 1.35rem 1.2rem 4.5rem;
}

/* nav */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.95rem;
  align-items: baseline;
  padding-bottom: 0.9rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

nav .brand {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  margin-right: 0.35rem;
  letter-spacing: -0.02em;
}

nav .brand:hover { color: var(--link); }

nav a {
  color: var(--mute);
  text-decoration: none;
}

nav a:hover,
nav a.active {
  color: var(--ink);
  text-decoration: underline;
}

nav a.nav-fund {
  color: var(--fund);
  font-weight: 600;
}

nav a.nav-fund:hover,
nav a.nav-fund.active {
  color: var(--fund);
}

/* type */
h1 {
  font-size: 1.65rem;
  font-weight: 650;
  line-height: 1.22;
  letter-spacing: -0.025em;
  margin-bottom: 0.55rem;
}

h2 {
  font-size: 1.05rem;
  font-weight: 650;
  margin: 2rem 0 0.55rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1rem 0 0.35rem;
}

p { margin-bottom: 0.75rem; }

.one-liner {
  font-size: 1.08rem;
  font-weight: 500;
  margin-bottom: 1rem;
  line-height: 1.4;
  color: var(--ink);
}

.lede {
  font-size: 1.02rem;
  color: var(--mute);
  margin-bottom: 1rem;
}

.short {
  color: var(--mute);
  font-size: 0.95rem;
}

.warn {
  font-size: 0.85rem;
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid #e0c89a;
  padding: 0.6rem 0.8rem;
  margin: 0.9rem 0 1.1rem;
  line-height: 1.45;
}

.ok {
  font-size: 0.88rem;
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid #a8c9b8;
  padding: 0.65rem 0.8rem;
  margin: 1rem 0;
}

.note {
  font-size: 0.88rem;
  color: var(--mute);
  border-left: 3px solid var(--line);
  padding: 0.25rem 0 0.25rem 0.8rem;
  margin: 1rem 0;
}

/* actions */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.9rem;
  margin: 1.1rem 0 1.35rem;
  align-items: center;
}

.actions a.primary,
a.btn-primary,
button.btn-primary {
  font-weight: 600;
  color: var(--paper);
  background: var(--ink);
  padding: 0.55rem 1rem;
  text-decoration: none;
  border: 1px solid var(--ink);
  font-family: var(--sans);
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-block;
}

.actions a.primary:hover,
a.btn-primary:hover,
button.btn-primary:hover {
  background: #333;
  color: var(--paper);
}

.actions a.secondary {
  font-weight: 500;
  font-size: 0.92rem;
}

a.btn-fund,
button.btn-fund {
  font-weight: 650;
  color: #fff;
  background: var(--fund);
  border: 1px solid var(--fund);
  padding: 0.55rem 1rem;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-block;
}

a.btn-fund:hover,
button.btn-fund:hover {
  background: #a84c1c;
  border-color: #a84c1c;
  color: #fff;
}

/* ========== FUNDING BAR ========== */
.fund-card {
  border: 1px solid #e8c9b4;
  background: linear-gradient(180deg, #fffdfb 0%, var(--fund-soft) 140%);
  padding: 1rem 1.05rem 1.1rem;
  margin: 1.15rem 0 1.4rem;
  position: relative;
  overflow: hidden;
}

.fund-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--fund);
}

.fund-card h3 {
  margin: 0 0 0.2rem;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.fund-card .fund-why {
  font-size: 0.88rem;
  color: var(--mute);
  margin: 0 0 0.85rem;
  line-height: 1.45;
}

.fund-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.82rem;
  margin-bottom: 0.4rem;
}

.fund-meta strong {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-size: 0.9rem;
}

.fund-meta span {
  color: var(--mute);
  font-variant-numeric: tabular-nums;
}

.fund-track {
  height: 0.7rem;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #e0b89a;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.fund-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d46a2e 0%, #e88a3c 55%, #f0a35a 100%);
  background-size: 200% 100%;
  transition: width 1.35s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  min-width: 0;
  animation: fund-shimmer 2.8s ease-in-out infinite;
}

.fund-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.35) 48%,
    transparent 66%
  );
  background-size: 220% 100%;
  animation: fund-glint 2.4s ease-in-out infinite;
}

@keyframes fund-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes fund-glint {
  0% { background-position: 120% 0; }
  100% { background-position: -40% 0; }
}

.fund-card.fund-in .fund-fill {
  animation:
    fund-shimmer 2.8s ease-in-out infinite,
    fund-pulse 2.2s ease-out 1;
}

@keyframes fund-pulse {
  0% { filter: brightness(1); }
  35% { filter: brightness(1.12); }
  100% { filter: brightness(1); }
}

.fund-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.7rem;
  margin-top: 0.9rem;
  align-items: center;
}

.fund-actions .hint {
  font-size: 0.8rem;
  color: var(--mute);
}

.fund-addr {
  font-family: var(--mono);
  font-size: 0.72rem;
  word-break: break-all;
  background: #fff;
  border: 1px solid #e8c9b4;
  padding: 0.55rem 0.65rem;
  margin: 0.75rem 0 0.55rem;
  line-height: 1.4;
  user-select: all;
  color: #333;
}

/* sticky mini strip (home) */
.fund-strip {
  position: sticky;
  bottom: 0.75rem;
  z-index: 20;
  margin: 2rem 0 0;
  padding: 0.7rem 0.85rem;
  background: rgba(26, 26, 26, 0.94);
  color: #f5f3ee;
  border: 1px solid #333;
  backdrop-filter: blur(8px);
  display: grid;
  gap: 0.45rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

.fund-strip .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
}

.fund-strip p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #e8e4dc;
}

.fund-strip strong { color: #fff; }

.fund-strip .fund-track {
  background: #2a2a2a;
  border-color: #444;
  height: 0.45rem;
}

.fund-strip .fund-fill {
  background: linear-gradient(90deg, #e07a3a, #f0a35a);
}

.fund-strip a.btn-fund {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
}

/* ========== WALKTHROUGH ========== */
.flow {
  display: grid;
  gap: 0;
  margin: 1rem 0 1.5rem;
}

.flow-step {
  display: grid;
  grid-template-columns: 2.1rem 1fr;
  gap: 0.65rem 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.flow-step:last-child { border-bottom: 0; }

.flow-n {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.flow-step h3 {
  margin: 0.15rem 0 0.2rem;
  font-size: 0.98rem;
}

.flow-step p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--mute);
  line-height: 1.45;
}

/* numbered ol steps (other pages) */
.steps {
  counter-reset: step;
  list-style: none;
  margin: 0.85rem 0 1.25rem;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.15rem 2.5rem;
  border-left: 2px solid var(--line);
  margin-left: 0.65rem;
}

.steps > li:last-child {
  border-left-color: transparent;
  padding-bottom: 0.2rem;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: -0.85rem;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.steps > li strong {
  display: block;
  color: var(--ink);
  font-size: 0.98rem;
  margin-bottom: 0.2rem;
}

.steps > li p {
  color: var(--mute);
  font-size: 0.9rem;
  margin: 0 0 0.3rem;
}

.steps > li p:last-child { margin-bottom: 0; }

/* enter animation */
.will-show {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.will-show.is-shown {
  opacity: 1;
  transform: translateY(0);
}

.flow-step.will-show .flow-n {
  transform: scale(0.85);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.05s;
}

.flow-step.will-show.is-shown .flow-n {
  transform: scale(1);
}

/* stagger via nth-child delay when shown as group */
.flow-step.will-show:nth-child(1) { transition-delay: 0s; }
.flow-step.will-show:nth-child(2) { transition-delay: 0.05s; }
.flow-step.will-show:nth-child(3) { transition-delay: 0.1s; }
.flow-step.will-show:nth-child(4) { transition-delay: 0.15s; }
.flow-step.will-show:nth-child(5) { transition-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .will-show {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .fund-fill {
    animation: none !important;
    transition: width 0.2s linear;
  }
  .fund-fill::after { display: none; }
}

/* lists */
ul {
  margin: 0.4rem 0 1rem 1.15rem;
  color: var(--mute);
}

ul li { margin-bottom: 0.3rem; }

ul.checks {
  list-style: none;
  margin-left: 0;
}

ul.checks li {
  padding: 0.25rem 0 0.25rem 1.35rem;
  position: relative;
  color: var(--ink);
  font-size: 0.93rem;
}

ul.checks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--ok);
  font-weight: 700;
}

ul.nope {
  list-style: none;
  margin-left: 0;
}

ul.nope li {
  padding: 0.25rem 0 0.25rem 1.35rem;
  position: relative;
  color: var(--mute);
  font-size: 0.93rem;
}

ul.nope li::before {
  content: "–";
  position: absolute;
  left: 0.15rem;
  color: #9b2226;
  font-weight: 700;
}

/* wallet (simple, non-fund pages) */
.wallet {
  border: 1px solid var(--line);
  background: #fff;
  padding: 1rem 1.05rem;
  margin: 1.1rem 0;
}

.wallet h3 {
  margin-top: 0;
  font-size: 0.95rem;
}

.wallet .addr {
  font-family: var(--mono);
  font-size: 0.78rem;
  word-break: break-all;
  background: var(--paper2);
  border: 1px solid var(--line);
  padding: 0.65rem 0.75rem;
  margin: 0.55rem 0 0.65rem;
  line-height: 1.4;
  user-select: all;
}

.wallet p {
  font-size: 0.88rem;
  color: var(--mute);
  margin-bottom: 0.4rem;
}

.wallet p:last-child { margin-bottom: 0; }

.btn-copy {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}

.btn-copy:hover { background: #333; }

.btn-copy.done,
button.btn-fund.done,
button.btn-primary.done {
  background: var(--ok) !important;
  border-color: var(--ok) !important;
  color: #fff !important;
}

code, pre {
  font-family: var(--mono);
  font-size: 0.82rem;
}

code {
  background: var(--paper2);
  padding: 0.08rem 0.3rem;
  border: 1px solid var(--line);
}

pre {
  background: var(--paper2);
  border: 1px solid var(--line);
  padding: 0.75rem 0.9rem;
  overflow-x: auto;
  margin: 0.55rem 0 1rem;
  line-height: 1.45;
  color: #2a2a2a;
  font-size: 0.8rem;
}

.compare {
  display: grid;
  gap: 1rem;
  margin: 1rem 0 1.25rem;
}

@media (min-width: 560px) {
  .compare { grid-template-columns: 1fr 1fr; }
}

.compare > div {
  border-top: 2px solid var(--line);
  padding-top: 0.5rem;
}

.compare h3 { margin-top: 0; }

.compare p, .compare li {
  font-size: 0.9rem;
  color: var(--mute);
}

.table-simple {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 0.65rem 0 1.15rem;
}

.table-simple th,
.table-simple td {
  text-align: left;
  padding: 0.4rem 0.5rem 0.4rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table-simple th {
  color: var(--mute);
  font-weight: 500;
  font-size: 0.8rem;
}

footer {
  margin-top: 2.4rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--mute);
}

footer a { color: var(--mute); }

/* pill chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 0.25rem;
}

.chip {
  font-size: 0.78rem;
  color: var(--mute);
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

/* verify form */
.drop {
  border: 1px dashed var(--line);
  background: var(--paper2);
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--mute);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.drop.drag {
  border-color: var(--link);
  background: #e8eef2;
}

label {
  display: block;
  font-size: 0.82rem;
  color: var(--mute);
  margin: 0.75rem 0 0.3rem;
}

input[type="text"],
select {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.85rem;
}

button#verifyBtn {
  margin-top: 1rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  padding: 0.5rem 1rem;
  cursor: pointer;
}

button#verifyBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#outcomePill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  padding: 0.2rem 0;
  border-bottom: 2px solid var(--line);
}

#outcomePill.ok { border-color: #2d6a4f; color: #1b4332; }
#outcomePill.warn { border-color: var(--warn); color: var(--warn); }
#outcomePill.bad { border-color: #9b2226; color: #9b2226; }

.kv {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.35rem 0.75rem;
  font-size: 0.88rem;
}

.kv span:nth-child(odd) { color: var(--mute); }
.kv span:nth-child(even) {
  font-family: var(--mono);
  font-size: 0.8rem;
  word-break: break-all;
}

#raw {
  margin-top: 1rem;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.75rem;
}
