:root {
  --accent: #ccff00;
  --accent-dim: rgba(204, 255, 0, 0.14);
  --accent-border: rgba(204, 255, 0, 0.35);
  --bg: #0a0d08;
  --bg-card: #10150d;
  --bg-card-2: #131a0f;
  --border: #232b1c;
  --text: #eef3e4;
  --text-dim: #9aa88c;
  --buy: #6ee76e;
  --sell: #ff5c5c;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(204, 255, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(204, 255, 0, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, black 30%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

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

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 56px);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
  z-index: 30; /* keep the lore dropdown above page content */
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 30px; height: 30px; }
.brand-name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }

.header-right { display: flex; align-items: center; gap: 12px; }

.token-badge {
  font-family: var(--mono);
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  background: var(--bg-card);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent-border);
  background: var(--accent-dim);
  color: var(--accent);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(204, 255, 0, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(204, 255, 0, 0); }
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(36px, 6vw, 80px) clamp(20px, 5vw, 56px) clamp(24px, 4vw, 48px);
  max-width: 1280px;
  margin: 0 auto;
}

.coin-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent-border);
  background: var(--accent-dim);
}

.coin-ticker {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.coin-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  border-left: 1px solid var(--accent-border);
  padding-left: 10px;
}

h1 {
  font-size: clamp(34px, 4.4vw, 58px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.accent { color: var(--accent); }

.lede {
  margin-top: 18px;
  max-width: 54ch;
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1.6;
}

.stat-row {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stat {
  flex: 1 1 130px;
  min-width: 130px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stat:first-child .stat-value { color: var(--accent); }

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.stat-value.bump { animation: bump 0.4s ease; }
@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); color: var(--accent); }
  100% { transform: scale(1); }
}

/* Tree card */
.tree-card {
  background:
    radial-gradient(ellipse 90% 60% at 50% 100%, rgba(204, 255, 0, 0.05), transparent),
    var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px 22px 26px;
  position: relative;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
}

.tree-stage {
  position: absolute;
  top: 18px;
  left: 20px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  border: 1px solid var(--accent-border);
  background: var(--accent-dim);
  padding: 5px 11px;
  border-radius: 999px;
  z-index: 2;
}

.tree-svg {
  width: 100%;
  height: auto;
  aspect-ratio: 400 / 460;
  display: block;
}

.progress-block { margin-top: 6px; }

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 14px;
  margin-bottom: 8px;
}

#progressPct { color: var(--accent); font-weight: 500; }

.progress-track {
  height: 12px;
  border-radius: 999px;
  background: #1a2213;
  border: 1px solid var(--border);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #5cb338, var(--accent));
  box-shadow: 0 0 14px rgba(204, 255, 0, 0.45);
  transition: width 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.progress-hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

.progress-hint span { color: var(--text); font-weight: 600; }

/* Panels */
.panels {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  padding: 12px clamp(20px, 5vw, 56px) 8px;
  max-width: 1280px;
  margin: 0 auto;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 22px;
  min-height: 320px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.panel h2 { font-size: 19px; letter-spacing: -0.01em; }

.panel-sub {
  font-size: 12.5px;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* Trade feed */
.trade-feed {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.trade {
  display: grid;
  grid-template-columns: 58px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  animation: slideIn 0.35s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.trade-kind {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 3px 0;
  text-align: center;
  border-radius: 7px;
}

.trade-kind.buy { color: var(--buy); background: rgba(110, 231, 110, 0.1); border: 1px solid rgba(110, 231, 110, 0.3); }
.trade-kind.sell { color: var(--sell); background: rgba(255, 92, 92, 0.08); border: 1px solid rgba(255, 92, 92, 0.28); }

.trade-amount { font-weight: 600; font-variant-numeric: tabular-nums; }

.trade-hash {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-dim);
}

.trade-time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  text-align: right;
}

/* Receipts */
.receipts {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.receipt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  animation: slideIn 0.35s ease;
}

.receipt-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  display: grid;
  place-items: center;
}

.receipt-icon svg { width: 18px; height: 18px; }

.receipt-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.receipt-title { font-size: 14px; font-weight: 600; }

.receipt-uuid {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.receipt-date {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

.receipt-empty {
  color: var(--text-dim);
  font-size: 14px;
  padding: 24px 8px;
  text-align: center;
}

/* Lore dropdown */
.lore-dd { position: relative; }

.lore-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.lore-btn:hover { border-color: var(--accent-border); color: var(--accent); }

.lore-btn svg {
  width: 10px;
  height: 7px;
  transition: transform 0.2s ease;
}

.lore-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.lore-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(92vw, 520px);
  max-height: min(70vh, 560px);
  overflow-y: auto;
  background:
    radial-gradient(ellipse 80% 40% at 30% 0%, rgba(204, 255, 0, 0.06), transparent),
    var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.75);
  z-index: 40;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.lore-panel blockquote p {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--accent);
  font-style: italic;
}

.lore-panel cite {
  display: block;
  margin-top: 10px;
  font-family: var(--mono);
  font-style: normal;
  font-size: 12px;
  color: var(--text-dim);
}

.lore-note {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.55;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  margin: 16px 0;
}

.lore-panel h3 {
  font-size: 17px;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.lore-panel p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.lore-tagline {
  color: var(--accent) !important;
  font-weight: 600;
  font-size: 15px !important;
  margin-bottom: 0 !important;
}

/* X link */
.x-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.x-link:hover { border-color: var(--accent-border); color: var(--accent); }

.x-link svg { width: 14px; height: 14px; }

/* Verify notice */
.verify-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 13px 16px;
  border: 1px solid var(--accent-border);
  background: var(--accent-dim);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.45;
  max-width: 560px;
  transition: background 0.2s ease;
}

.verify-note:hover { background: rgba(204, 255, 0, 0.2); }

.verify-note svg { width: 20px; height: 20px; flex: 0 0 20px; color: var(--accent); }

.verify-note strong { color: var(--accent); }

/* How it works */
.how {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(32px, 5vw, 64px) clamp(20px, 5vw, 56px);
}

.how h2 { font-size: 26px; margin-bottom: 24px; letter-spacing: -0.02em; }

.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.how-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
}

.how-num {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.1em;
}

.how-step h3 { margin: 10px 0 8px; font-size: 16.5px; }

.how-step p { color: var(--text-dim); font-size: 14px; line-height: 1.55; }

/* Toast */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--accent-border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(204, 255, 0, 0.15);
  padding: 14px 22px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 50;
  max-width: min(92vw, 480px);
  text-align: center;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.toast .accent { color: var(--accent); }

/* Footer */
.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 22px clamp(20px, 5vw, 56px) 30px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
  max-width: 1280px;
  margin: 24px auto 0;
}

.site-footer code { font-family: var(--mono); font-size: 12px; color: var(--text); }

.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .panels { grid-template-columns: 1fr; }
  .tree-card { max-width: 480px; margin: 0 auto; width: 100%; }
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .header-right { flex-wrap: wrap; row-gap: 8px; }
  .token-badge {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .lore-panel { position: fixed; left: 4vw; right: 4vw; top: 120px; width: auto; }
  .x-link span { display: none; }
  .x-link { padding: 7px 10px; }
}
