/* ── Reset & Base ─────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: hsl(230 20% 5%);
  --fg: hsl(210 30% 95%);
  --card: hsl(230 18% 8%);
  --border: hsl(230 15% 14%);
  --muted: hsl(220 10% 45%);
  --surface: hsl(230 18% 10%);
  --surface-hover: hsl(230 16% 13%);
  --primary: hsl(152 80% 45%);
  --primary-dark: hsl(152 70% 35%);
  --primary-fg: hsl(230 20% 5%);
  --destructive: hsl(0 72% 51%);
  --radius: 0.75rem;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }
input { font-family: inherit; border: none; outline: none; }

/* ── Utilities ────────────────────────────────── */
.dim { color: var(--muted); }
.bold { font-weight: 600; color: var(--fg); }
.hide-mobile { display: inline; }
@media (max-width: 640px) { .hide-mobile { display: none; } }

.gradient-text {
  background: linear-gradient(135deg, var(--primary), hsl(180 80% 55%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-glow { text-shadow: 0 0 20px hsl(152 80% 45% / 0.6); }

.grid-bg {
  background-image:
    linear-gradient(hsl(230 15% 14% / 0.3) 1px, transparent 1px),
    linear-gradient(90deg, hsl(230 15% 14% / 0.3) 1px, transparent 1px);
  background-size: 50px 50px;
}

.glass {
  background: hsl(230 18% 8% / 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid hsl(230 15% 14% / 0.8);
}

.page { min-height: 100vh; position: relative; }
#page-home { background: var(--bg); }
#page-home, #page-claim { background-image:
  linear-gradient(hsl(230 15% 14% / 0.3) 1px, transparent 1px),
  linear-gradient(90deg, hsl(230 15% 14% / 0.3) 1px, transparent 1px);
  background-size: 50px 50px;
}

.radial-glow {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, hsl(152 80% 45% / 0.08), transparent);
}

/* ── Nav ──────────────────────────────────────── */
.nav {
  border-bottom: 1px solid hsl(230 15% 14% / 0.5);
  backdrop-filter: blur(12px);
  background: hsl(230 20% 5% / 0.6);
  position: sticky; top: 0; z-index: 10;
}
.nav-inner {
  max-width: 640px; margin: 0 auto; padding: 0 1.5rem;
  height: 3.5rem; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
#page-home .nav-inner { max-width: 80rem; }
.nav-brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.875rem; }
.brand-icon { width: 1.5rem; height: 1.5rem; border-radius: 6px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }
.nav-links { display: flex; align-items: center; gap: 1rem; font-size: 0.875rem; color: var(--muted); }
.nav-links a:hover { color: var(--fg); transition: color 0.2s; }
.chain-badge {
  padding: 0.25rem 0.75rem; border-radius: 9999px;
  border: 1px solid hsl(152 80% 45% / 0.3); color: var(--primary);
  font-size: 0.75rem; font-weight: 500;
}

.back-link { display: flex; align-items: center; gap: 0.375rem; color: var(--muted); font-size: 0.875rem; transition: color 0.2s; }
.back-link:hover { color: var(--fg); }
.addr-short { font-size: 0.75rem; color: var(--muted); font-family: monospace; overflow: hidden; text-overflow: ellipsis; }
.chart-link { display: flex; align-items: center; gap: 0.25rem; color: var(--muted); font-size: 0.875rem; transition: color 0.2s; }
.chart-link:hover { color: var(--primary); }

/* ── Hero ─────────────────────────────────────── */
.hero {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 5rem 1.5rem;
}
.hero-content { max-width: 42rem; width: 100%; text-align: center; }
.hero-content > * + * { margin-top: 1.5rem; }

.badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.375rem 0.75rem; border-radius: 9999px;
  border: 1px solid hsl(152 80% 45% / 0.3); background: hsl(152 80% 45% / 0.05);
  color: var(--primary); font-size: 0.75rem; font-weight: 500;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); animation: pulse 2s infinite; }

h1 { font-size: clamp(2.5rem, 6vw, 3.75rem); font-weight: 700; line-height: 1.1; }
.hero-sub { color: var(--muted); font-size: 1.125rem; max-width: 32rem; margin-left: auto; margin-right: auto; }

.input-row {
  display: flex; gap: 0.75rem; max-width: 36rem; margin: 0 auto; width: 100%;
  flex-wrap: wrap;
}
.input-wrap {
  flex: 1; min-width: 0; display: flex; align-items: center; padding: 0 1rem;
  background: hsl(230 18% 8% / 0.6); backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color 0.2s;
}
.input-wrap:focus-within { border-color: hsl(152 80% 45% / 0.5); }
.input-label { color: var(--muted); font-size: 0.875rem; margin-right: 0.5rem; white-space: nowrap; }
.input-wrap input {
  flex: 1; background: transparent; padding: 0.875rem 0;
  color: var(--fg); font-size: 0.875rem; font-family: monospace;
}
.input-wrap input::placeholder { color: var(--muted); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--primary-fg); font-weight: 600; padding: 0.875rem 1.5rem;
  border-radius: var(--radius); display: flex; align-items: center; gap: 0.5rem;
  white-space: nowrap; transition: opacity 0.2s, transform 0.1s;
  box-shadow: 0 0 10px hsl(152 80% 45% / 0.4);
}
.btn-primary:hover { opacity: 0.9; transform: scale(1.02); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.try-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; }
.try-row span { color: var(--muted); font-size: 0.75rem; }
.try-row button {
  font-size: 0.75rem; padding: 0.25rem 0.75rem; border-radius: 9999px;
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  font-family: monospace; transition: all 0.2s;
}
.try-row button:hover { border-color: hsl(152 80% 45% / 0.5); color: var(--fg); }

/* URL card */
.url-card {
  margin-top: 4rem; max-width: 42rem; width: 100%;
  background: hsl(230 18% 8% / 0.6); backdrop-filter: blur(12px);
  border: 1px solid hsl(230 15% 14% / 0.8); border-radius: 1rem; padding: 1.5rem;
}
.url-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 500; }
.url-box {
  margin-top: 0.75rem; background: var(--surface); border-radius: 0.5rem;
  padding: 0.75rem 1rem; font-family: monospace; font-size: 0.875rem;
}
.url-box .hl { color: var(--primary); }
.url-desc { margin-top: 0.75rem; color: var(--muted); font-size: 0.875rem; }

/* Features */
.features {
  margin-top: 2.5rem; max-width: 42rem; width: 100%;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
@media (max-width: 640px) { .features { grid-template-columns: 1fr; } }
.feature-card {
  background: hsl(230 18% 8% / 0.6); backdrop-filter: blur(12px);
  border: 1px solid hsl(230 15% 14% / 0.8); border-radius: var(--radius); padding: 1.25rem;
}
.feature-card > * + * { margin-top: 0.5rem; }
.feat-title { font-size: 0.875rem; font-weight: 600; }
.feat-desc { font-size: 0.75rem; color: var(--muted); }

.footer {
  border-top: 1px solid hsl(230 15% 14% / 0.4); padding: 1.5rem;
  text-align: center; font-size: 0.75rem; color: var(--muted);
}

/* ── Claim Page ───────────────────────────────── */
.claim-wrap { max-width: 32rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
@media (min-width: 640px) { .claim-wrap { padding: 2.5rem 1.5rem 3rem; } }

.card {
  background: hsl(230 18% 8% / 0.6); backdrop-filter: blur(12px);
  border: 1px solid hsl(230 15% 14% / 0.8); border-radius: 1rem; padding: 1.25rem;
}
@media (min-width: 640px) { .card { padding: 1.5rem; } }
.card > * + * { margin-top: 1rem; }
@media (min-width: 640px) { .card > * + * { margin-top: 1.25rem; } }

/* Token header */
.token-head { display: flex; align-items: center; gap: 0.75rem; }
@media (min-width: 640px) { .token-head { gap: 1rem; } }
.token-head img, .token-head .logo-fallback {
  width: 3rem; height: 3rem; border-radius: 50%; border: 2px solid var(--border);
  object-fit: cover; flex-shrink: 0; animation: float 4s ease-in-out infinite;
}
@media (min-width: 640px) { .token-head img, .token-head .logo-fallback { width: 4rem; height: 4rem; } }
.logo-fallback {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  color: var(--primary-fg); font-weight: 700; font-size: 1.25rem;
}
.token-info { flex: 1; min-width: 0; }
.token-info h1 { font-size: 1.25rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 640px) { .token-info h1 { font-size: 1.5rem; } }
.token-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.25rem; }
.price { font-weight: 600; font-size: 0.875rem; }
.change-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.75rem; font-weight: 500; padding: 0.125rem 0.5rem;
  border-radius: 9999px;
}
.change-badge.up { background: hsl(152 80% 45% / 0.1); color: var(--primary); }
.change-badge.down { background: hsl(0 72% 51% / 0.1); color: var(--destructive); }

/* Airdrop badge */
.airdrop-badge {
  border: 1px solid hsl(152 80% 45% / 0.2); background: hsl(152 80% 45% / 0.05);
  border-radius: var(--radius); padding: 0.75rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
@media (min-width: 640px) { .airdrop-badge { padding: 1rem 1.25rem; } }
.ab-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 500; }
.ab-amount { font-size: 1.25rem; font-weight: 700; margin-top: 0.25rem; }
@media (min-width: 640px) { .ab-amount { font-size: 1.5rem; } }
.ab-right { text-align: right; flex-shrink: 0; }
.ab-usd { font-weight: 700; font-size: 1.125rem; }
@media (min-width: 640px) { .ab-usd { font-size: 1.25rem; } }

/* Stats */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
@media (min-width: 640px) { .stats-grid { gap: 0.75rem; } }
.stat {
  background: hsl(230 18% 8% / 0.6); backdrop-filter: blur(12px);
  border: 1px solid hsl(230 15% 14% / 0.8); border-radius: var(--radius);
  padding: 0.75rem; display: flex; flex-direction: column; gap: 0.25rem;
}
@media (min-width: 640px) { .stat { padding: 1rem; } }
.stat-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.stat-val { font-weight: 600; font-size: 0.875rem; }

/* Claim section */
.claim-section > * + * { margin-top: 0.75rem; }
.total-row {
  background: hsl(230 18% 8% / 0.6); backdrop-filter: blur(12px);
  border: 1px solid hsl(230 15% 14% / 0.8); border-radius: var(--radius);
  padding: 0.75rem 1rem; display: flex; align-items: center; justify-content: space-between;
  font-size: 0.875rem;
}
.btn-connect {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--primary-fg); font-weight: 600; font-size: 1.125rem;
  padding: 1rem 1.5rem; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  box-shadow: 0 0 20px hsl(152 80% 45% / 0.3), 0 0 60px hsl(152 80% 45% / 0.1);
  transition: opacity 0.2s, transform 0.1s;
}
.btn-connect:hover { opacity: 0.9; transform: scale(1.02); }
.btn-connect:active { transform: scale(0.98); }
.claim-note { text-align: center; font-size: 0.75rem; color: var(--muted); }
.powered { text-align: center; font-size: 0.75rem; color: var(--muted); }

/* Error card */
.error-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 2.5rem; gap: 1rem; }
.error-card h2 { font-size: 1.25rem; font-weight: 600; }
.error-card p { font-size: 0.875rem; color: var(--muted); }
.error-addr { font-family: monospace; font-size: 0.75rem; background: var(--surface); border-radius: 0.5rem; padding: 0.5rem 0.75rem; word-break: break-all; }
.back-text { color: var(--primary); font-size: 0.875rem; font-weight: 500; }

/* Skeleton */
.skeleton-card > * + * { margin-top: 1.25rem; }
.skel-row { display: flex; align-items: center; gap: 1rem; }
.skel-circle { width: 4rem; height: 4rem; border-radius: 50%; flex-shrink: 0; }
.skel-lines { flex: 1; display: flex; flex-direction: column; gap: 0.5rem; }
.skel-bar { height: 1.25rem; border-radius: 0.375rem; }
.skel-bar.w60 { width: 60%; }
.skel-bar.w40 { width: 40%; }
.skel-bar.full { width: 100%; }
.skel-bar.h16 { height: 4rem; }
.skel-bar.h14 { height: 3.5rem; }
.skel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.skeleton-card .skel-circle,
.skeleton-card .skel-bar {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ── Animations ───────────────────────────────── */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
