:root {
  --bg: oklch(0.18 0.006 270);
  --bg-2: oklch(0.21 0.007 270);
  --fg: oklch(0.97 0.004 270);
  --muted: oklch(0.66 0.008 270);
  --faint: oklch(0.48 0.008 270);
  --line: oklch(0.30 0.008 270);
}

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

html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(120% 80% at 50% -10%, var(--bg-2) 0%, var(--bg) 55%);
  color: var(--fg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---- Logo / header ---- */
header {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: clamp(28px, 5vh, 52px) 24px 0;
}

.wordmark {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  opacity: 0;
  animation: fadeDown 0.9s 0.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.wordmark .mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--fg);
  display: inline-block;
}

.wordmark .tm {
  font-size: 0.62em;
  letter-spacing: 0;
  vertical-align: super;
  color: var(--muted);
}

/* ---- Main stage ---- */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  gap: clamp(36px, 6vh, 60px);
}

.headline {
  font-size: clamp(2.4rem, 8.5vw, 5.5rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.03em;
  max-width: 16ch;
  text-wrap: balance;
  opacity: 0;
  transform: translateY(22px);
  animation: rise 1.1s 0.18s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.headline .accent {
  font-style: italic;
  font-weight: 500;
}

/* ---- Pay block (wallet + send + status) ---- */
.pay {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: 560px;
}

/* ---- Wallet ---- */
.wallet {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: oklch(0.20 0.006 270 / 0.6);
  backdrop-filter: blur(8px);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px);
  animation: rise 1.1s 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.wallet .addr {
  flex: 1 1 auto;
  min-width: 0; /* lets the flex item shrink so ellipsis can engage */
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.82rem, 2.6vw, 1rem);
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: var(--muted);
  padding: 13px 18px;
  user-select: all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* works now that .addr is block-level, not flex */
}

.wallet button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--bg);
  background: var(--fg);
  border: none;
  padding: 0 20px;
  cursor: pointer;
  transition: opacity 0.18s ease, background 0.18s ease;
  flex-shrink: 0;
  min-width: 86px;
}

.wallet button:hover { opacity: 0.85; }
.wallet button:active { transform: translateY(0.5px); }
.wallet button.copied {
  background: oklch(0.78 0.13 150);
  color: oklch(0.20 0.02 150);
}

/* ---- Send button (primary CTA) ---- */
.send {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--bg);
  background: var(--fg);
  border: 1px solid var(--fg);
  border-radius: 999px;
  padding: 13px 30px;
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.06s ease, background 0.18s ease, color 0.18s ease;
  opacity: 0;
  transform: translateY(16px);
  animation: rise 1.1s 0.54s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.send:hover { opacity: 0.88; }
.send:active { transform: translateY(0.5px); }
.send:disabled { cursor: progress; opacity: 0.55; }
.send.done {
  background: oklch(0.78 0.13 150);
  border-color: oklch(0.78 0.13 150);
  color: oklch(0.20 0.02 150);
  opacity: 1;
}

/* ---- Status line ---- */
.status {
  font-size: 12.5px;
  letter-spacing: 0.02em;
  line-height: 1.4;
  color: var(--muted);
  min-height: 1.2em;
  max-width: 32ch;
  text-align: center;
  transition: color 0.18s ease;
}

.status:empty { visibility: hidden; }
.status a { color: var(--fg); text-underline-offset: 2px; }
.status.err { color: oklch(0.72 0.15 25); }
.status.ok { color: oklch(0.80 0.13 150); }

/* ---- Footnote ---- */
footer {
  width: 100%;
  text-align: center;
  padding: 0 24px clamp(28px, 5vh, 48px);
  opacity: 0;
  animation: fadeUp 1s 0.7s ease forwards;
}

footer p {
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--faint);
  line-height: 1.5;
}

/* ---- Animations ---- */
@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-delay: 0ms !important; }
  .headline, .wallet, .wordmark, footer { opacity: 1 !important; transform: none !important; }
}
