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

:root {
  --c-bg: #10120f;
  --c-bg-soft: #171a15;
  --c-surface: rgba(242, 238, 225, 0.075);
  --c-surface-strong: rgba(242, 238, 225, 0.12);
  --c-line: rgba(242, 238, 225, 0.16);
  --c-line-strong: rgba(242, 238, 225, 0.28);
  --c-text: #f4f0e4;
  --c-muted: rgba(244, 240, 228, 0.64);
  --c-faint: rgba(244, 240, 228, 0.42);
  --c-accent: #c7e36f;
  --c-accent-dark: #34411f;
  --c-warn: #ffb86b;
  --c-error: #ff8b7d;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
  --r-card: 18px;
  --r-inner: 10px;
  --font: "Outfit", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
  font-family: var(--font);
}

html { scroll-behavior: smooth; }

body {
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% -10%, rgba(199, 227, 111, 0.18), transparent 30rem),
    radial-gradient(circle at 90% 12%, rgba(255, 184, 107, 0.12), transparent 26rem),
    linear-gradient(180deg, var(--c-bg), #0b0d0b 70%);
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.root {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 22px clamp(18px, 5vw, 64px) 64px;
}

.bg-glow {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  filter: blur(90px);
  opacity: 0.75;
}

.bg-glow--blue {
  width: 30rem;
  height: 30rem;
  top: 16%;
  left: -10rem;
  background: rgba(199, 227, 111, 0.12);
}

.bg-glow--purple {
  width: 28rem;
  height: 28rem;
  right: -10rem;
  bottom: 5%;
  background: rgba(255, 184, 107, 0.10);
}

.bg-noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.site-header,
.main {
  position: relative;
  z-index: 1;
}

.site-header {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 0 54px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(244, 240, 228, 0.16), transparent 45%),
    conic-gradient(from 110deg, var(--c-accent), var(--c-warn), #f4f0e4, var(--c-accent));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28), 0 14px 36px rgba(199, 227, 111, 0.18);
  flex: 0 0 auto;
}

.logo-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.logo-tag {
  color: var(--c-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  background: rgba(16, 18, 15, 0.58);
  backdrop-filter: blur(18px);
}

.site-nav a {
  min-width: 82px;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--c-muted);
  text-align: center;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--c-surface-strong);
  color: var(--c-text);
}

.site-nav a:active,
.btn:active,
.text-link:active {
  transform: translateY(1px);
}

.main {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.hero {
  position: relative;
  width: min(100%, 760px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  overflow: hidden;
  padding: clamp(38px, 7vw, 78px) clamp(20px, 6vw, 70px) clamp(34px, 6vw, 60px);
  border: 1px solid var(--c-line);
  border-radius: 32px;
  background:
    linear-gradient(160deg, rgba(244, 240, 228, 0.14), rgba(244, 240, 228, 0.045)),
    rgba(16, 18, 15, 0.76);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
  backdrop-filter: blur(24px);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 18px 18px auto;
  height: 160px;
  border-radius: 24px;
  background:
    linear-gradient(90deg, transparent 0 9%, rgba(199, 227, 111, 0.32) 9% 10.5%, transparent 10.5% 24%, rgba(255, 184, 107, 0.22) 24% 25.5%, transparent 25.5% 100%),
    repeating-linear-gradient(0deg, rgba(244, 240, 228, 0.075) 0 1px, transparent 1px 22px);
  opacity: 0.58;
  mask-image: linear-gradient(to bottom, #000, transparent);
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--c-accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-accent);
  box-shadow: 0 0 0 6px rgba(199, 227, 111, 0.12);
}

.hero-heading,
.page-heading {
  max-width: 760px;
  font-size: clamp(1.416rem, 3.2vw, 2.703rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0;
  text-wrap: balance;
}

.page-heading {
  max-width: 860px;
  font-size: clamp(2.8rem, 6.8vw, 6.4rem);
}

.hero-sub,
.page-sub {
  max-width: 620px;
  color: var(--c-muted);
  font-size: clamp(1.04rem, 1.4vw, 1.22rem);
  line-height: 1.65;
  text-wrap: pretty;
}

.hero-cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 10px;
  justify-content: center;
}

.btn,
.text-link,
.back-link {
  outline: none;
}

.btn:focus-visible,
.text-link:focus-visible,
.back-link:focus-visible,
.site-nav a:focus-visible {
  box-shadow: 0 0 0 3px rgba(199, 227, 111, 0.34);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: 700 0.94rem/1 var(--font);
  padding: 14px 22px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

.btn--primary {
  background: var(--c-accent);
  color: #13170d;
  box-shadow: 0 16px 46px rgba(199, 227, 111, 0.22);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 56px rgba(199, 227, 111, 0.28);
}

.btn--primary:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--ghost {
  border: 1px solid var(--c-line);
  background: rgba(244, 240, 228, 0.07);
  color: var(--c-text);
}

.btn--ghost:hover {
  background: rgba(244, 240, 228, 0.12);
  transform: translateY(-2px);
}

.text-link,
.back-link {
  color: var(--c-muted);
  font-size: 0.96rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 180ms ease, transform 180ms ease;
}

.text-link:hover,
.back-link:hover {
  color: var(--c-text);
}

.hero-card,
.wallet-panel,
.status-bar {
  border: 1px solid var(--c-line);
  background:
    linear-gradient(150deg, rgba(244, 240, 228, 0.13), rgba(244, 240, 228, 0.045)),
    rgba(16, 18, 15, 0.76);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px);
}

.hero-card {
  justify-self: end;
  width: min(100%, 410px);
  border-radius: 28px;
  padding: 24px;
  transform: translateY(22px);
}

.hero-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--c-muted);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 34px;
}

.hero-card__status {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c-accent);
}

.hero-card__metric {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--c-line);
}

.hero-card__metric span,
.stat-card__label,
.wallet-panel__label {
  color: var(--c-faint);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero-card__metric strong {
  font-size: 2.45rem;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.hero-card__line {
  height: 128px;
  margin: 26px 0;
  border-radius: 18px;
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(199, 227, 111, 0.35) 8% 10%, transparent 10% 22%, rgba(255, 184, 107, 0.28) 22% 24%, transparent 24% 100%),
    repeating-linear-gradient(0deg, rgba(244, 240, 228, 0.08) 0 1px, transparent 1px 24px);
}

.hero-card p {
  color: var(--c-muted);
  line-height: 1.55;
}

.support-strip {
  display: grid;
  gap: 24px;
  padding: 10px 0 34px;
}

.chain-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chain-pill {
  border: 1px solid var(--c-line);
  border-radius: 999px;
  background: rgba(244, 240, 228, 0.07);
  color: var(--c-text);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 8px 13px;
}

.chain-pill--more {
  color: var(--c-muted);
  background: transparent;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--c-line);
  border-radius: var(--r-card);
  background: var(--c-line);
}

.trust-grid article {
  min-height: 150px;
  padding: 22px;
  background: rgba(16, 18, 15, 0.84);
}

.trust-grid span {
  color: var(--c-accent);
  font-size: 0.78rem;
  font-weight: 800;
}

.trust-grid h2 {
  margin-top: 26px;
  font-size: 1.25rem;
}

.trust-grid p {
  margin-top: 8px;
  max-width: 23rem;
  color: var(--c-muted);
  line-height: 1.5;
}

.connect-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding: 12px 0 12px;
}

.status-bar {
  width: min(100%, 760px);
  align-self: flex-start;
  border-radius: 14px;
  color: var(--c-muted);
  font-size: 0.92rem;
  line-height: 1.45;
  padding: 14px 16px;
}

.status-bar[data-variant="success"] {
  border-color: rgba(199, 227, 111, 0.36);
  color: #e8fab0;
  background: rgba(199, 227, 111, 0.09);
}

.status-bar[data-variant="error"] {
  border-color: rgba(255, 139, 125, 0.34);
  color: #ffc2bb;
  background: rgba(255, 139, 125, 0.08);
}

.wallet-panel {
  width: min(100%, 760px);
  overflow: hidden;
  border-radius: 24px;
}

.wallet-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid var(--c-line);
}

.wallet-panel__value {
  display: block;
  margin-top: 8px;
  color: var(--c-text);
  font-size: 1.15rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.chain-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(199, 227, 111, 0.28);
  border-radius: 999px;
  background: rgba(199, 227, 111, 0.1);
  color: #e8fab0;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 8px 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--c-line);
}

.stat-card {
  min-height: 138px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  background: rgba(16, 18, 15, 0.82);
}

.stat-card--wide {
  grid-column: 1 / -1;
  min-height: 120px;
  flex-direction: row;
  align-items: flex-end;
}

.stat-card__value {
  color: var(--c-text);
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-card--wide .stat-card__value {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
}

.stat-card__sub {
  max-width: 240px;
  color: var(--c-muted);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: right;
}

.wallet-panel__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.wallet-panel__actions .btn {
  width: 100%;
}

.connecting-panel {
  width: min(100%, 520px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: clamp(38px, 7vw, 62px) 24px;
  border: 1px solid var(--c-line);
  border-radius: 28px;
  background:
    linear-gradient(160deg, rgba(244, 240, 228, 0.13), rgba(244, 240, 228, 0.045)),
    rgba(16, 18, 15, 0.76);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
  backdrop-filter: blur(24px);
}

.connecting-panel[hidden] {
  display: none;
}

.connecting-spinner {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid rgba(244, 240, 228, 0.14);
  border-top-color: var(--c-accent);
  border-right-color: rgba(199, 227, 111, 0.52);
  animation: spin 850ms linear infinite;
  box-shadow: 0 0 28px rgba(199, 227, 111, 0.16);
}

.connecting-label {
  color: var(--c-text);
  font-size: 1.28rem;
  font-weight: 800;
}

.connecting-sub {
  max-width: 330px;
  color: var(--c-muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 760px) {
  .root { padding: 16px 16px 44px; }

  .site-header {
    align-items: flex-start;
    padding-bottom: 28px;
  }

  .site-nav a {
    min-width: auto;
    padding-inline: 12px;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 28px;
  }

  .hero-card {
    justify-self: stretch;
    width: 100%;
    transform: none;
  }

  .trust-grid,
  .stats-grid,
  .wallet-panel__actions {
    grid-template-columns: 1fr;
  }

  .stat-card--wide {
    flex-direction: column;
    align-items: flex-start;
  }

  .stat-card__sub {
    max-width: none;
    text-align: left;
  }

  .wallet-panel__header {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .site-header {
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
  }

  .site-nav a {
    flex: 1;
  }

  .hero-heading,
  .page-heading {
    font-size: clamp(1.892rem, 11.44vw, 2.86rem);
  }

  .hero-card,
  .wallet-panel {
    border-radius: 18px;
  }

  .hero-card__metric strong {
    font-size: 2rem;
  }
}

/* ── Wallet Selection Modal ─────────────────────────────────────────────── */

.wallet-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.wallet-modal[hidden] { display: none; }

.wallet-modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.wallet-modal__sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: rgba(15, 18, 13, 0.97);
  border: 1px solid var(--c-line);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 20px);
  box-shadow: 0 -24px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  animation: wm-slide-up 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  overflow: hidden;
}

@media (min-width: 560px) {
  .wallet-modal { align-items: center; }
  .wallet-modal__sheet {
    border-bottom: 1px solid var(--c-line);
    border-radius: 24px;
    animation: wm-fade-in 0.22s ease;
  }
}

@keyframes wm-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@keyframes wm-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wallet-modal__hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--c-line);
  flex-shrink: 0;
}

.wallet-modal__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text);
}

.wallet-modal__ico-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  color: var(--c-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms ease;
}

.wallet-modal__ico-btn:hover { background: var(--c-surface-strong); }
.wallet-modal__ico-btn:focus-visible { box-shadow: 0 0 0 3px rgba(199,227,111,0.32); outline: none; }

/* Wallet list */
.wallet-list {
  list-style: none;
  padding: 8px 10px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.wallet-list__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 130ms ease, transform 130ms ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.wallet-list__item:hover  { background: var(--c-surface); }
.wallet-list__item:active { background: var(--c-surface-strong); transform: scale(0.985); }
.wallet-list__item:focus-visible { outline: none; background: var(--c-surface); }

.wallet-list__item::after {
  content: '›';
  color: var(--c-faint);
  font-size: 1.35rem;
  line-height: 1;
}

.wallet-list__name {
  flex: 1;
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--c-text);
}

.wallet-list__badge {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--c-muted);
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 999px;
  padding: 2px 9px;
}

/* Wallet Expansion States */
.wallet-list__item--expanded {
  display: none;
}

.wallet-list.wallet-list--expanded .wallet-list__item--expanded {
  display: flex;
}

.wallet-list__item--expander {
  border-top: 1px solid var(--c-line);
  margin-top: 4px;
  padding-top: 12px;
}

/* Wallet Icons */
.wallet-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  font-weight: 800;
  font-size: 15px;
  overflow: hidden;
  position: relative;
}

/* Real logo image — positioned absolutely so it covers the fallback letter */
.wallet-icon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 13px;
  z-index: 1;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.wallet-icon--image-error img {
  display: none;
}

/* MetaMask — use img tag for logo */
.wallet-icon--mm {
  background: #E8761B;
}

/* Trust Wallet */
.wallet-icon--trust { background: linear-gradient(145deg, #3B82F6, #1D4ED8); color: #fff; }

/* Coinbase Wallet */
.wallet-icon--coinbase { background: #1652F0; color: #fff; }

/* Binance Web3 Wallet */
.wallet-icon--binance { background: linear-gradient(145deg, #F0B90B, #D4A010); color: #13170d; }

/* SafePal */
.wallet-icon--safepal { background: linear-gradient(145deg, #00C087, #009E72); color: #fff; }

/* Phantom */
.wallet-icon--phantom { background: linear-gradient(145deg, #9945FF, #6126B3); color: #fff; }

/* OKX Wallet */
.wallet-icon--okx { background: linear-gradient(145deg, #000000, #1a1a1a); color: #fff; }

/* Rainbow */
.wallet-icon--rainbow { background: linear-gradient(145deg, #FF00FF, #00FFFF); color: #fff; }

/* Uniswap Wallet */
.wallet-icon--uniswap { background: linear-gradient(145deg, #FF007A, #FF00BB); color: #fff; }

/* Zerion */
.wallet-icon--zerion { background: linear-gradient(145deg, #6D46FF, #4C3AFF); color: #fff; }

/* Bybit Wallet */
.wallet-icon--bybit { background: linear-gradient(145deg, #FDD031, #F7B00E); color: #13170d; }

/* All Wallets — subtle surface */
.wallet-icon--all {
  background: var(--c-surface-strong);
  border: 1px solid var(--c-line);
}
