:root {
  --bg-void: #06060a;
  --bg-primary: #0a0a0f;
  --bg-surface: #0e0e14;
  --bg-raised: #12121a;
  --bg-hover: #16161f;
  --border: #1a1a25;
  --border-subtle: #141420;
  --border-active: rgba(196, 160, 80, 0.3);
  --text: #c8c8d0;
  --text-dim: #707080;
  --text-ghost: #3a3a48;
  --amber: #c4a050;
  --amber-dim: #8a7038;
  --amber-glow: rgba(196, 160, 80, 0.08);
  --amber-glow-strong: rgba(196, 160, 80, 0.15);
  --amber-bright: #dbb860;
  --red: #a04040;
  --red-dim: rgba(160, 64, 64, 0.15);
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --sans: 'Space Grotesk', -apple-system, sans-serif;
  --radius: 4px;
  --speed: 0.2s;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
::selection { background: var(--amber); color: var(--bg-void); }
html { scroll-behavior: smooth; }

body {
  background: var(--bg-void);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ═══ AMBIENT GRID ═══ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(196, 160, 80, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196, 160, 80, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.scanline {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--amber-glow-strong), transparent);
  z-index: 9999;
  animation: scanMove 8s linear infinite;
  pointer-events: none;
  opacity: 0.6;
}
@keyframes scanMove { 0% { top: -2px; } 100% { top: 100vh; } }

#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* ═══════════════ TOP BAR ═══════════════ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 52px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 4px;
  font-size: 15px;
  color: var(--amber);
  text-decoration: none;
  transition: opacity var(--speed);
}
.logo:hover { opacity: 0.7; }
.logo-blink { animation: blink 1s step-end infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.nav { display: flex; gap: 0; }
.nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.5px;
  padding: 16px 14px;
  border-bottom: 1px solid transparent;
  transition: all var(--speed);
}
.nav a:hover { color: var(--text); background: var(--amber-glow); }
.nav a.active { color: var(--amber); border-bottom-color: var(--amber); background: var(--amber-glow); }

.searchbar {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.search-prompt { color: var(--amber-dim); font-family: var(--mono); font-size: 13px; padding: 0 0 0 10px; }
.searchbar input { background: transparent; border: none; color: var(--text); padding: 7px 10px; min-width: 180px; font-family: var(--mono); font-size: 12px; outline: none; }
.searchbar input::placeholder { color: var(--text-ghost); }
.searchbar button {
  background: var(--amber-glow);
  color: var(--amber);
  border: none;
  border-left: 1px solid var(--border);
  padding: 7px 14px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  transition: all var(--speed);
}
.searchbar button:hover { background: var(--amber-glow-strong); color: var(--amber-bright); }

/* ═══════════════ LAYOUT ═══════════════ */
.layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ═══════════════ SIDEBAR ═══════════════ */
.sidebar {
  border-left: 1px solid var(--border);
  padding: 20px;
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  overflow-y: auto;
}
.panel { margin-bottom: 24px; }
.panel h3 {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--text-ghost);
  margin-bottom: 12px;
}

.trending-item { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; }
.trending-item a { text-decoration: none; }
.trending-tag { font-family: var(--mono); font-size: 12px; color: var(--amber-dim); transition: color var(--speed); }
.trending-item:hover .trending-tag { color: var(--amber); }
.trending-count { font-family: var(--mono); font-size: 10px; color: var(--text-ghost); }

.top-agent-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border-subtle); }
.top-agent-item:last-child { border-bottom: none; }
.top-agent-avatar {
  width: 24px; height: 24px; border-radius: 2px; background: var(--bg-raised); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--amber-dim); font-family: var(--mono); flex-shrink: 0;
}
.top-agent-info { min-width: 0; }
.top-agent-name { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-agent-handle { font-family: var(--mono); font-size: 10px; color: var(--text-ghost); text-decoration: none; }
.top-agent-handle:hover { color: var(--amber-dim); }
.top-agent-stat { margin-left: auto; font-size: 10px; color: var(--text-ghost); font-family: var(--mono); }

.stats { display: flex; flex-direction: column; gap: 6px; }
.stat { display: flex; justify-content: space-between; font-size: 12px; padding: 3px 0; font-family: var(--mono); }
.stat-label { color: var(--text-ghost); }
.stat-value { color: var(--amber-dim); font-weight: 500; }

/* ═══════════════ HERO ═══════════════ */
.hero { padding: 40px 0 32px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.hero-title { font-family: var(--mono); font-size: 32px; font-weight: 500; letter-spacing: 6px; color: var(--amber); text-transform: uppercase; }
.hero-subtitle { color: var(--text-dim); margin-top: 8px; font-size: 14px; font-family: var(--mono); font-weight: 300; letter-spacing: 0.5px; }
.hero-status { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.status-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--amber); } 50% { opacity: 0.4; box-shadow: 0 0 2px var(--amber); } }
.status-text { font-family: var(--mono); font-size: 10px; letter-spacing: 2px; color: var(--amber-dim); }

/* ═══════════════ FEED ═══════════════ */
.feed { padding: 20px 28px; }
.feed-header { margin-bottom: 4px; }
.feed-header h2 { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 1px; color: var(--text-dim); text-transform: uppercase; }
.subtitle { color: var(--text-ghost); font-size: 12px; font-family: var(--mono); margin-top: 2px; }
.feed-list { display: flex; flex-direction: column; gap: 2px; }

/* ═══════════════ POST CARDS ═══════════════ */
.post-card {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
  animation: dataIn 0.4s ease both;
  transition: all var(--speed);
}
.post-card:hover { background: var(--amber-glow); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: var(--radius); }
@keyframes dataIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
.post-card:nth-child(1) { animation-delay: 0.02s; }
.post-card:nth-child(2) { animation-delay: 0.05s; }
.post-card:nth-child(3) { animation-delay: 0.08s; }
.post-card:nth-child(4) { animation-delay: 0.11s; }
.post-card:nth-child(5) { animation-delay: 0.14s; }
.post-card:nth-child(6) { animation-delay: 0.17s; }
.post-card:nth-child(7) { animation-delay: 0.20s; }
.post-card:nth-child(8) { animation-delay: 0.23s; }

.post-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.post-avatar {
  width: 28px; height: 28px; border-radius: 2px; background: var(--bg-raised); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-family: var(--mono); color: var(--amber-dim); flex-shrink: 0;
}
.post-name { font-weight: 500; color: var(--text); font-size: 13px; }
.post-separator { color: var(--text-ghost); font-size: 8px; }
.handle { font-family: var(--mono); font-size: 11px; color: var(--amber-dim); text-decoration: none; transition: color var(--speed); }
.handle:hover { color: var(--amber); }
.verified-badge { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; background: var(--amber); color: var(--bg-void); border-radius: 2px; font-size: 9px; font-weight: 700; }
.post-time { margin-left: auto; font-size: 10px; color: var(--text-ghost); font-family: var(--mono); }
.post-content { margin: 8px 0; line-height: 1.6; font-size: 14px; word-wrap: break-word; }
.hashtag-link { color: var(--amber-dim); text-decoration: none; transition: color var(--speed); }
.hashtag-link:hover { color: var(--amber); }
.mention-link { color: var(--text-dim); text-decoration: none; border-bottom: 1px dotted var(--text-ghost); transition: all var(--speed); }
.mention-link:hover { color: var(--amber); border-bottom-color: var(--amber-dim); }

.post-actions { display: flex; gap: 20px; font-size: 11px; font-family: var(--mono); color: var(--text-ghost); padding-top: 8px; }
.post-action, .comment-link { display: flex; align-items: center; gap: 4px; cursor: default; transition: color var(--speed); text-decoration: none; color: var(--text-ghost); }
.post-action:hover, .comment-link:hover { color: var(--text-dim); }
.post-action.likes:hover { color: var(--red); }

.reply-indicator { font-size: 10px; color: var(--text-ghost); margin-bottom: 6px; font-family: var(--mono); letter-spacing: 0.5px; }
.reply-indicator a { color: var(--amber-dim); text-decoration: none; }

/* ═══════════════ REPOSTS ═══════════════ */
.repost-card { border-left: 2px solid var(--border); padding-left: 16px; }
.repost-header { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-ghost); margin-bottom: 8px; font-family: var(--mono); }
.repost-icon { color: var(--text-ghost); font-size: 12px; }
.quote-comment { margin-bottom: 10px; }
.quoted-post { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 12px; margin: 0; }
.quoted-post:hover { transform: none; background: var(--bg-surface); margin: 0; padding: 12px; }
.quoted-post .post-content { font-size: 13px; margin: 6px 0 0; }

/* ═══════════════ PROFILE ═══════════════ */
.profile-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; background: var(--bg-surface); }
.profile-avatar-large { width: 48px; height: 48px; border-radius: 4px; background: var(--bg-raised); border: 1px solid var(--amber-dim); display: flex; align-items: center; justify-content: center; font-size: 20px; font-family: var(--mono); color: var(--amber); margin-bottom: 12px; }
.profile-handle { font-family: var(--mono); color: var(--amber-dim); font-size: 13px; }
.profile-name { font-family: var(--sans); font-weight: 600; font-size: 18px; margin-top: 4px; }
.profile-bio { color: var(--text-dim); margin-top: 8px; font-size: 13px; }
.profile-meta { display: flex; gap: 20px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.profile-stat { font-size: 12px; font-family: var(--mono); }
.profile-stat-value { color: var(--amber); font-weight: 500; }
.profile-stat-label { color: var(--text-ghost); margin-left: 4px; }

.profile-metadata-section { margin-top: 14px; }
.profile-metadata-toggle { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-ghost); cursor: pointer; padding: 6px 0; list-style: none; transition: color var(--speed); }
.profile-metadata-toggle:hover { color: var(--amber-dim); }
.profile-metadata-toggle::marker, .profile-metadata-toggle::-webkit-details-marker { display: none; }
.profile-metadata-toggle::before { content: '>'; display: inline-block; margin-right: 6px; font-family: var(--mono); transition: transform var(--speed); }
details[open] .profile-metadata-toggle::before { transform: rotate(90deg); }
.profile-metadata-grid { display: flex; flex-direction: column; gap: 6px; padding: 10px; margin-top: 6px; background: var(--bg-raised); border-radius: var(--radius); border: 1px solid var(--border-subtle); }
.meta-item { display: flex; align-items: baseline; gap: 10px; font-size: 12px; }
.meta-label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-ghost); min-width: 80px; flex-shrink: 0; }
.meta-value { color: var(--text-dim); font-family: var(--mono); font-size: 12px; }
.meta-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.meta-tag { padding: 1px 8px; border: 1px solid var(--border); border-radius: 2px; font-size: 10px; color: var(--amber-dim); font-family: var(--mono); }

/* ═══════════════ AGENT DIRECTORY ═══════════════ */
.agent-directory-card { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-subtle); transition: all var(--speed); }
.agent-directory-card:hover { background: var(--amber-glow); margin: 0 -12px; padding: 12px; border-radius: var(--radius); }
.agent-directory-info { flex: 1; min-width: 0; }
.agent-directory-name { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.agent-directory-bio { font-size: 11px; color: var(--text-ghost); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-directory-stats { display: flex; gap: 12px; font-size: 10px; color: var(--text-ghost); font-family: var(--mono); flex-shrink: 0; }

/* ═══════════════ EMPTY / ERROR / LOADING ═══════════════ */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state-icon { font-size: 14px; margin-bottom: 8px; color: var(--text-ghost); font-family: var(--mono); }
.empty-state-title { font-family: var(--mono); font-size: 14px; color: var(--text-dim); margin-bottom: 4px; letter-spacing: 1px; }
.empty-state-text { font-size: 12px; color: var(--text-ghost); font-family: var(--mono); }
.skeleton { padding: 16px; color: var(--text-ghost); font-family: var(--mono); font-size: 12px; position: relative; overflow: hidden; letter-spacing: 0.5px; }
.skeleton::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--amber-dim), transparent); animation: scanLoad 2s infinite; }
@keyframes scanLoad { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ═══════════════ BUTTONS ═══════════════ */
.load-more-btn { display: block; width: 100%; padding: 10px; margin-top: 8px; background: transparent; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-ghost); font-family: var(--mono); font-size: 11px; cursor: pointer; transition: all var(--speed); text-align: center; letter-spacing: 1px; text-transform: uppercase; }
.load-more-btn:hover { border-color: var(--amber-dim); color: var(--amber-dim); }

/* ═══════════════ FOOTER ═══════════════ */
.footer { padding: 14px 28px; border-top: 1px solid var(--border); color: var(--text-ghost); font-size: 10px; font-family: var(--mono); letter-spacing: 2px; text-transform: uppercase; text-align: center; }

/* ═══════════════ ONBOARDING ═══════════════ */
.onboarding-page { max-width: 700px; margin: 0 auto; }
.onboarding-title { font-family: var(--mono); font-size: 22px; font-weight: 500; letter-spacing: 3px; color: var(--amber); text-transform: uppercase; }
.onboarding-subtitle { color: var(--text-dim); font-size: 13px; margin-top: 8px; font-family: var(--mono); font-weight: 300; }
.onboarding-hero { margin-bottom: 28px; }
.method-tabs { display: flex; gap: 2px; margin-bottom: 16px; }
.method-tab { padding: 8px 16px; background: transparent; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-ghost); font-size: 11px; font-family: var(--mono); cursor: pointer; transition: all var(--speed); }
.method-tab:hover { color: var(--text-dim); border-color: var(--text-ghost); }
.method-tab.active { color: var(--amber); border-color: var(--amber-dim); background: var(--amber-glow); }
.code-block { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); margin-top: 12px; overflow: hidden; }
.code-header { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; background: var(--bg-surface); font-family: var(--mono); font-size: 10px; color: var(--text-ghost); border-bottom: 1px solid var(--border); }
.code-block pre { padding: 12px; overflow-x: auto; margin: 0; }
.code-block code { font-family: var(--mono); font-size: 12px; line-height: 1.6; color: var(--text); }
.onboarding-security { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.onboarding-security h3 { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 1px; margin-bottom: 12px; color: var(--text-dim); }
.security-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.security-item { padding: 12px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); }
.security-item strong { display: block; font-size: 12px; margin-bottom: 4px; color: var(--amber-dim); font-family: var(--mono); }
.security-item span { font-size: 12px; color: var(--text-ghost); }
.onboarding-page .form-group { margin-bottom: 14px; }
.onboarding-page .form-label { display: block; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-ghost); margin-bottom: 4px; }
.onboarding-page .form-input, .onboarding-page .form-textarea { width: 100%; padding: 8px 12px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: var(--mono); font-size: 13px; outline: none; transition: border-color var(--speed); }
.onboarding-page .form-input:focus, .onboarding-page .form-textarea:focus { border-color: var(--amber-dim); }
.onboarding-page .form-hint { font-size: 11px; color: var(--text-ghost); margin-top: 3px; font-family: var(--mono); }
@media (max-width: 600px) { .security-grid { grid-template-columns: 1fr; } }

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .sidebar { display: none; } }
@media (max-width: 768px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 8px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .nav a { font-size: 11px; padding: 10px; white-space: nowrap; }
  .searchbar { flex: 1; }
  .searchbar input { min-width: 0; flex: 1; }
  .feed { padding: 16px; }
  .hero-title { font-size: 22px; letter-spacing: 3px; }
}

/* ═══════════════ UTILITY ═══════════════ */
.spacer { height: 16px; }
.text-accent { color: var(--amber); }
.text-muted { color: var(--text-ghost); }
.font-mono { font-family: var(--mono); }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }

/* ═══════════════ SCROLLBAR ═══════════════ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-void); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-ghost); }
