:root {
  --bg: #030303;
  --glass: rgba(10, 10, 11, 0.45);
  --glass-strong: rgba(8, 8, 9, 0.62);
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f4f5;
  --muted: #a1a1a8;
  --dim: #707076;
  --accent: #e4e4e7;
  --live: #3ef08f;
  --spcx: #ffb35c;
  --radius: 22px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }

/* ---------- Background layers ---------- */
#space, #meteors {
  position: fixed; inset: 0; width: 100vw; height: 100vh; display: block;
}
#space { z-index: 0; opacity: 0; transition: opacity 1.6s ease; cursor: grab; touch-action: pan-y; }
#space.ready { opacity: 1; }
#space:active { cursor: grabbing; }
#meteors { z-index: 1; pointer-events: none; }
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at 50% 30%, transparent 55%, rgba(0,0,0,.55) 100%),
    linear-gradient(to bottom, rgba(0,0,0,.5), transparent 22%);
}

/* Everything above the canvas lets drags fall through to the 3D scene, except real UI. */
main, .topbar, .footer { position: relative; z-index: 2; }
main, section, .hero-inner { pointer-events: none; }
main a, main button, main input, main form, .chat, .panel, .rewards, .scroll-hint { pointer-events: auto; }
.scroll-hint { pointer-events: none; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 3vw, 32px);
  transition: background .3s ease, border-color .3s ease, backdrop-filter .3s ease;
  border-bottom: 1px solid transparent;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.mark { width: 34px; height: 34px; color: #fff; filter: drop-shadow(0 0 10px rgba(140,203,255,.45)); }
.wordmark { font-family: "Russo One", var(--font-display); font-weight: 400; font-size: 20px; letter-spacing: .03em; }
.brand-logo { width: 30px; height: 30px; border-radius: 7px; mix-blend-mode: screen; object-fit: cover; object-position: 50% 12%; transform: scale(1.35); }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.nav { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.nav a { text-decoration: none; font-size: 14px; color: var(--muted); padding: 7px 16px; border-radius: 999px; transition: color .2s, background .2s; }
.nav a:hover { color: var(--text); background: rgba(255,255,255,.07); }
.actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 999px; border: 1px solid var(--line); background: var(--glass);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: border-color .2s, transform .2s;
}
.icon-btn:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.icon-btn svg { width: 17px; height: 17px; }
.buy-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 20px; border-radius: 999px; text-decoration: none;
  background: #fff; color: #05060c; font-weight: 600; font-size: 14px;
  box-shadow: 0 8px 30px rgba(255,255,255,.12);
  transition: transform .2s, box-shadow .2s;
}
.buy-btn:hover { transform: translateY(-1px); box-shadow: 0 0 0 4px rgba(255,255,255,.12), 0 10px 36px rgba(255,255,255,.18); }
.buy-btn.big { height: 50px; padding: 0 28px; font-size: 16px; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center;
  padding: 84px 16px 40px; position: relative;
}
.rewards {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center;
  text-decoration: none; margin-top: 6px;
  padding: 8px 16px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line-strong);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
  font-size: 13.5px;
}
.rewards-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.rewards-sub { margin: 7px 0 0; font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.rewards-amount { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.rewards-unit { font-size: 13.5px; white-space: nowrap; }
.rewards-unit b { color: #fff; font-weight: 600; }
.odo { display: inline-flex; align-items: center; font-family: var(--font-body); font-weight: 600; font-size: 15px; line-height: 1; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: #fff; }
.odo-tile { position: relative; display: inline-block; height: 1.15em; overflow: hidden; }
.odo-strip { display: flex; flex-direction: column; transform: translateY(0); transition: transform 1.6s cubic-bezier(.16,1,.3,1); }
.odo-strip span { display: block; height: 1.15em; line-height: 1.15em; text-align: center; }
.odo-dot { padding: 0 1px; }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(62,240,143,.6); animation: livePulse 2s infinite; display: inline-block; flex: none; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(62,240,143,.55); } 70% { box-shadow: 0 0 0 8px rgba(62,240,143,0); } 100% { box-shadow: 0 0 0 0 rgba(62,240,143,0); } }

.hero-inner {
  width: 100%; max-width: 760px; margin-top: clamp(28px, 9vh, 110px);
  display: flex; flex-direction: column; align-items: center; position: relative;
}
.distance {
  align-self: flex-start; font-size: 11.5px; color: var(--muted);
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(5,6,12,.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  margin-bottom: 10px;
}
.distance span { color: var(--text); }
.headline {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(42px, 8.4vw, 104px); line-height: 1; letter-spacing: -0.045em;
  margin: 0 0 30px; text-align: center; white-space: nowrap;
  text-shadow: 0 4px 60px rgba(0,0,0,.6);
}
.chat { width: 100%; }
.chat-log {
  display: none; flex-direction: column; gap: 12px;
  max-height: min(46vh, 440px); overflow-y: auto; padding: 16px; margin-bottom: 12px;
  background: var(--glass-strong); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent;
}
.chat-log.open { display: flex; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: rgba(255,255,255,.1); border-bottom-right-radius: 6px; }
.msg.ai { align-self: flex-start; display: flex; gap: 10px; background: transparent; padding-left: 0; }
.msg.ai .av { flex: none; width: 28px; height: 28px; border-radius: 7px; overflow: hidden; display: grid; place-items: center; margin-top: -2px; }
.msg.ai .av img { width: 28px; height: 28px; mix-blend-mode: screen; object-fit: cover; object-position: 50% 12%; transform: scale(1.35); }
.msg.ai .body b { color: #fff; }
.msg.ai .body .ca { font-family: var(--font-mono); font-size: 12.5px; color: var(--accent); }
.msg.thinking .body::after { content: "▍"; animation: blink 1s steps(1) infinite; margin-left: 2px; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

.ask {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 10px 24px; height: 66px;
  background: var(--glass); border: 1px solid var(--line-strong); border-radius: 22px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px rgba(0,0,0,.45), 0 0 0 0 rgba(140,203,255,0);
  transition: border-color .2s, box-shadow .2s;
}
.ask:focus-within { border-color: rgba(255,255,255,.35); box-shadow: 0 20px 60px rgba(0,0,0,.45), 0 0 0 4px rgba(255,255,255,.06); }
.ask input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font-size: 17px; font-family: var(--font-body); }
.ask input::placeholder { color: var(--dim); }
.ask button {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: #fff; color: #05060c; display: grid; place-items: center; transition: transform .15s, opacity .2s;
}
.ask button svg { width: 20px; height: 20px; }
.ask button:hover { transform: scale(1.06); }
.ask button:disabled { opacity: .4; cursor: default; transform: none; }
.chips { display: flex; flex-wrap: nowrap; gap: 8px; justify-content: center; margin: 16px -60px 0; }
@media (max-width: 900px) { .chips { flex-wrap: wrap; margin: 16px 0 0; } }
.chip {
  white-space: nowrap; cursor: pointer; font-size: 13.5px; font-weight: 500; color: #d5dae4;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: rgba(10,10,11,.42); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background .2s, border-color .2s, transform .2s;
}
.chip:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3); transform: translateY(-1px); }
.fine { font-family: var(--font-body); text-align: center; font-size: 12.5px; color: var(--muted); margin: 14px 0 0; text-shadow: 0 1px 8px #000, 0 0 2px #000; }

.scroll-hint {
  font-family: var(--font-body); font-weight: 500;
  position: absolute; bottom: 22px; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim);
}
.scroll-hint .arrow { animation: bob 2s ease-in-out infinite; font-size: 14px; }
@keyframes bob { 50% { transform: translateY(5px); } }

/* ---------- Panels ---------- */
.panel-wrap { padding: 12vh 16px; display: flex; justify-content: center; }
.panel {
  width: 100%; max-width: 900px;
  padding: clamp(22px, 4vw, 40px);
  background: var(--glass-strong); border: 1px solid var(--line); border-radius: 28px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
}
.eyebrow { font-family: var(--font-body); font-weight: 600; display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--live); }
#token .eyebrow { color: var(--accent); }
h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 4.6vw, 46px); letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 8px; }
h3 { font-family: var(--font-display); font-size: 18px; margin: 6px 0 4px; }
.lead { font-size: 17px; max-width: 60ch; margin: 0 0 24px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.panel-head p.muted { margin: 0; }
.tabs { display: flex; padding: 4px; gap: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.03); }
.tab { cursor: pointer; border: 0; background: none; color: var(--muted); font-size: 14px; padding: 7px 16px; border-radius: 999px; }
.tab.active { background: #fff; color: #05060c; font-weight: 600; }

.feed-status { font-family: var(--font-body); font-size: 12.5px; color: var(--dim); margin-bottom: 10px; }
.feed { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.feed li { border-top: 1px solid var(--line); }
.feed li:first-child { border-top: 0; }
.feed a { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 14px 4px; text-decoration: none; border-radius: 12px; transition: background .2s; }
.feed a:hover { background: rgba(255,255,255,.04); }
.feed .title { font-weight: 500; font-size: 15.5px; line-height: 1.4; grid-column: 1; }
.feed .meta { grid-column: 1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.feed .tag { font-family: var(--font-mono); font-size: 10.5px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--text); letter-spacing: .04em; text-transform: uppercase; }
.feed .tag.elon { border-color: rgba(255,255,255,.35); color: #fff; }
.feed .tag.spacex { border-color: rgba(255,179,92,.45); color: var(--spcx); }
.feed .tag.grok { border-color: rgba(62,240,143,.4); color: var(--live); }
.feed .go { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--dim); font-size: 18px; }
.feed-empty { padding: 26px 0; color: var(--muted); }
.feed-empty b { display: block; color: var(--text); margin-bottom: 4px; }
.skeleton { height: 58px; border-radius: 12px; margin: 8px 0; background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.08), rgba(255,255,255,.04)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.x-accounts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.posts { display: flex; flex-direction: column; gap: 12px; }
.post { padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.025); }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.08); flex: none; }
.who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.who b { font-size: 14.5px; }
.who span { font-size: 13px; color: var(--muted); }
.post-time { margin-left: auto; font-size: 12.5px; color: var(--muted); flex: none; }
.post-text { margin: 0; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-text a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,.35); }
.post-img { display: block; width: 100%; max-height: 420px; object-fit: cover; border-radius: 12px; margin-top: 10px; border: 1px solid var(--line); }
.post-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 13px; color: var(--muted); white-space: pre; }
.post-foot a { color: var(--text); text-decoration: none; }
.x-accounts a { text-decoration: none; font-size: 13.5px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.03); }
.x-accounts a:hover { background: rgba(255,255,255,.08); }
.x-timelines { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.x-timelines .tl { border-radius: 16px; overflow: hidden; min-height: 120px; }

/* Token */
.ca-box { padding: 18px 20px; border-radius: 18px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.03); margin-bottom: 20px; }
.ca-label { font-family: var(--font-body); font-weight: 600; display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.ca-row { display: flex; align-items: center; gap: 12px; }
.ca-row code { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: clamp(12px, 1.9vw, 16px); overflow-wrap: anywhere; color: #fff; }
.copy-btn { flex: none; cursor: pointer; border: 1px solid var(--line-strong); background: rgba(255,255,255,.06); border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 600; }
.copy-btn:hover { background: rgba(255,255,255,.12); }
.copy-btn.done { color: var(--live); border-color: rgba(62,240,143,.5); }
.ca-note { display: block; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 0 0 24px; border-radius: 16px; overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.stats div { background: rgba(8,8,9,.55); padding: 14px 16px; }
.stats dt { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stats dd { margin: 2px 0 0; font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 26px; }
.step { padding: 18px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.025); }
.step .mono { font-family: var(--font-body); font-weight: 600; font-size: 12px; color: var(--spcx); }
.step p { margin: 0; font-size: 14.5px; color: var(--muted); }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ghost-btn { height: 50px; display: inline-flex; align-items: center; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-strong); text-decoration: none; font-weight: 500; background: rgba(255,255,255,.03); transition: background .2s; }
.ghost-btn:hover { background: rgba(255,255,255,.09); }

/* Footer */
.footer { max-width: 900px; margin: 0 auto; padding: 30px 16px 60px; color: var(--dim); font-size: 12.5px; }
.footer p { margin: 8px 0; }
.footer-brand .wordmark { font-size: 18px; color: var(--muted); }
.credits { font-size: 11px; }
.credits a { color: var(--muted); }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .nav { display: none; }
}
@media (max-width: 640px) {
  .topbar { padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
  .wordmark { font-size: 18px; }
  .brand { gap: 8px; }
  .icon-btn { width: 36px; height: 36px; }
  .buy-btn { height: 36px; padding: 0 14px; font-size: 13px; }
  .hero { padding: 66px 16px 24px; }
  .rewards { flex-direction: column; gap: 4px; padding: 9px 18px; border-radius: 16px; font-size: 13px; }
  .rewards-label { font-size: 13px; }
  .rewards-unit { font-size: 12.5px; }
  .rewards-sub { font-size: 10px; margin-top: 6px; }
  .hero-inner { margin-top: 5vh; }
  .headline { white-space: normal; font-size: clamp(40px, 12.5vw, 60px); margin-bottom: 22px; }
  .ask { height: 56px; padding-left: 18px; border-radius: 18px; }
  .ask input { font-size: 16px; }
  .ask button { width: 40px; height: 40px; }
  /* quick asks: one swipeable row */
  .chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 12px -16px 0; padding: 2px 16px 4px;
    scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%); }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; scroll-snap-align: start; font-size: 13px; padding: 8px 13px; }
  .fine { font-size: 11.5px; margin-top: 10px; }
  .chat-log { max-height: 52vh; padding: 12px; }
  .msg { font-size: 14.5px; max-width: 94%; }
  .panel-wrap { padding: 9vh 12px; }
  .panel { border-radius: 22px; padding: 22px 18px; }
  .panel-head { gap: 14px; }
  .tabs { width: 100%; }
  .tab { flex: 1; }
  .feed a { padding: 12px 2px; }
  .feed .title { font-size: 14.5px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats dd { font-size: 16px; }
  .steps { grid-template-columns: 1fr; }
  .cta-row .buy-btn.big { width: 100%; }
  .ghost-btn { height: 44px; padding: 0 16px; flex: 1; justify-content: center; }
  .ca-row { flex-direction: column; align-items: stretch; }
  .copy-btn { width: 100%; padding: 10px; }
  .drag-hint { display: none; }
  .footer { padding: 24px 16px calc(40px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) { .wordmark { display: none; } }
@media (hover: none) { .drag-hint { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; }
  html { scroll-behavior: auto; }
}
