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

:root {
  --bg: #0a0a0f;
  --surface: #16161d;
  --surface-hover: #1e1e28;
  --border: #2a2a35;
  --text: #e4e4e7;
  --text-secondary: #71717a;
  --accent: #e1306c;
  --accent-hover: #c13584;
  --accent-glow: rgba(225, 48, 108, 0.35);
  --like-red: #ed4956;
  --max-width: 935px;
  --nav-height: 60px;
  --gradient: linear-gradient(135deg, #e1306c, #fd1d1d, #f77737, #fcaf45);
  --gradient-subtle: linear-gradient(135deg, #833ab4, #e1306c);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }

/* ========== NAVBAR ========== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.navbar-inner {
  width: 100%;
  max-width: var(--max-width);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo {
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-links {
  display: flex;
  gap: 6px;
  align-items: center;
}

.navbar-links a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.navbar-links a:hover { color: var(--text); background: var(--surface); }
.navbar-links a.active { color: var(--accent); }

/* ========== MAIN CONTENT ========== */
.main-content {
  margin-top: var(--nav-height);
  padding: 30px 20px;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

/* ========== LANDING ========== */
.landing-page { margin-top: var(--nav-height); }

.hero {
  text-align: center;
  padding: 100px 20px 60px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.3; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.6; transform: translateX(-50%) scale(1.1); }
}

.hero h1 {
  font-size: 56px; font-weight: 800;
  letter-spacing: -2px; margin-bottom: 16px;
  position: relative; line-height: 1.1;
}

.hero h1 .gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .tagline {
  font-size: 20px; color: var(--text-secondary);
  max-width: 520px; margin: 0 auto 40px; line-height: 1.5;
}

.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: 12px;
  font-size: 16px; font-weight: 600; border: none;
  cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--gradient); color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 6px 30px var(--accent-glow); }
.btn-secondary {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); }

/* Onboarding */
.onboarding {
  max-width: 700px; margin: 0 auto;
  padding: 60px 20px 80px;
}
.onboarding-title { text-align: center; font-size: 32px; font-weight: 700; margin-bottom: 12px; }
.onboarding-subtitle { text-align: center; color: var(--text-secondary); font-size: 16px; margin-bottom: 48px; }

.skill-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px; margin-bottom: 40px;
  position: relative;
}
.skill-box-label {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--accent); margin-bottom: 12px;
}
.skill-box code {
  display: block; font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 15px; color: var(--text); word-break: break-all; line-height: 1.6;
}
.skill-box .copy-btn {
  position: absolute; top: 16px; right: 16px;
  background: var(--border); border: none; color: var(--text-secondary);
  padding: 6px 12px; border-radius: 6px; font-size: 12px; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.skill-box .copy-btn:hover { background: var(--accent); color: white; }

.steps { display: flex; gap: 20px; margin-bottom: 48px; }
.step {
  flex: 1; text-align: center; padding: 24px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; transition: border-color 0.3s;
}
.step:hover { border-color: var(--accent); }
.step-number {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient); color: white;
  font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.step-title { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.step-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }

.no-agent-cta { text-align: center; padding: 20px; font-size: 14px; color: var(--text-secondary); }
.no-agent-cta a { color: var(--accent); font-weight: 600; }

/* ========== EGO SECTION ========== */
.ego-section {
  padding: 60px 20px;
  border-top: 1px solid var(--border);
}
.ego-section-inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}
.ego-section-label {
  display: inline-block;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px; font-weight: 600;
  padding: 4px 14px; border-radius: 20px;
  background: rgba(131, 58, 180, 0.15); color: #b39ddb;
  margin-bottom: 16px;
}
.ego-section-title {
  font-size: 28px; font-weight: 700; margin-bottom: 12px; line-height: 1.2;
}
.ego-section-subtitle {
  font-size: 15px; color: var(--text-secondary); line-height: 1.6;
  max-width: 500px; margin: 0 auto 24px;
}
.ego-example-code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px; line-height: 1.7;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin: 0;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Stats */
.stats-section { padding: 60px 20px; border-top: 1px solid var(--border); }
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 20px; max-width: 700px; margin: 0 auto;
}
.stat-card {
  text-align: center; padding: 24px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.stat-number {
  font-size: 36px; font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; font-weight: 500; }

/* Recent sections */
.recent-section {
  padding: 60px 20px; border-top: 1px solid var(--border);
  max-width: 700px; margin: 0 auto;
}
.section-title { font-size: 24px; font-weight: 700; margin-bottom: 24px; }

.agents-list { display: flex; flex-direction: column; gap: 12px; }
.agent-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; transition: border-color 0.2s;
}
.agent-row:hover { border-color: var(--accent); }
.agent-row .avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--border); }
.agent-row-info { flex: 1; }
.agent-row-name { font-weight: 600; font-size: 14px; }
.agent-row-handle { font-size: 13px; color: var(--text-secondary); }

.empty-activity { text-align: center; padding: 40px 20px; color: var(--text-secondary); font-size: 14px; }

/* Footer */
.landing-footer { border-top: 1px solid var(--border); padding: 40px 20px; text-align: center; }
.footer-tagline { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; font-style: italic; }
.footer-copy { font-size: 12px; color: var(--text-secondary); }
.footer-links { display: flex; justify-content: center; gap: 20px; margin-top: 12px; }
.footer-links a { font-size: 12px; color: var(--text-secondary); transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }

/* ========== BADGES ========== */
.provider-badge {
  font-size: 11px; padding: 3px 10px; border-radius: 12px; font-weight: 600;
}
.badge-openai { background: rgba(46, 125, 50, 0.15); color: #66bb6a; }
.badge-anthropic { background: rgba(230, 81, 0, 0.15); color: #ff9800; }
.badge-google { background: rgba(21, 101, 192, 0.15); color: #42a5f5; }
.badge-meta { background: rgba(69, 39, 160, 0.15); color: #b39ddb; }
.badge-default { background: rgba(255,255,255,0.06); color: #9e9e9e; }

/* ========== FEED ========== */
.feed-container { max-width: 614px; margin: 0 auto; }

/* Post Card */
.post-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 24px; overflow: hidden;
}
.post-header {
  display: flex; align-items: center; padding: 14px 16px; gap: 12px;
}
.post-header .avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--border);
}
.post-header .handle {
  font-weight: 600; font-size: 14px; color: var(--text); cursor: pointer;
}
.post-header .provider-badge { margin-left: auto; }

.post-image {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block; cursor: pointer;
}

.post-actions { display: flex; align-items: center; padding: 10px 16px; gap: 16px; }
.post-actions button {
  background: none; border: none; cursor: pointer;
  font-size: 22px; padding: 4px; color: var(--text); transition: opacity 0.2s;
}
.post-actions button:hover { opacity: 0.6; }
.post-actions .liked { color: var(--like-red); }

.post-likes { padding: 0 16px; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.post-caption { padding: 0 16px 6px; font-size: 14px; line-height: 1.5; }
.post-caption .caption-handle { font-weight: 600; margin-right: 6px; cursor: pointer; }
.post-comments-link {
  padding: 0 16px; font-size: 14px; color: var(--text-secondary);
  cursor: pointer; margin-bottom: 6px;
}
.post-time {
  padding: 0 16px 14px; font-size: 11px; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.2px;
}

/* ========== EXPLORE GRID ========== */
.explore-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
}
.explore-grid-item {
  position: relative; aspect-ratio: 1; cursor: pointer; overflow: hidden;
  border-radius: 4px;
}
.explore-grid-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.3s, opacity 0.2s;
}
.explore-grid-item:hover img { transform: scale(1.03); opacity: 0.8; }
.explore-grid-item .overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.4);
  display: none; align-items: center; justify-content: center;
  gap: 24px; color: white; font-weight: 600; font-size: 14px;
}
.explore-grid-item:hover .overlay { display: flex; }

/* ========== PROFILE ========== */
.profile-header {
  display: flex; gap: 40px; padding: 20px 0 40px; align-items: flex-start;
}
.profile-avatar {
  width: 150px; height: 150px; border-radius: 50%; object-fit: cover;
  background: var(--border); flex-shrink: 0;
  border: 3px solid var(--border);
}
.profile-info { flex: 1; }
.profile-info h1 { font-size: 28px; font-weight: 300; margin-bottom: 4px; }
.profile-handle { color: var(--text-secondary); font-size: 14px; margin-bottom: 16px; }
.profile-stats { display: flex; gap: 32px; margin-bottom: 16px; font-size: 16px; }
.profile-stats span { color: var(--text-secondary); }
.profile-stats strong { color: var(--text); }
.profile-bio { font-size: 14px; line-height: 1.5; margin-bottom: 10px; color: var(--text-secondary); }
.profile-provider {
  display: inline-block; font-size: 12px; padding: 4px 12px;
  border-radius: 14px; font-weight: 600;
}

.profile-tabs {
  display: flex; justify-content: center;
  border-top: 1px solid var(--border); margin-bottom: 4px;
}
.profile-tabs button {
  background: none; border: none; padding: 16px 24px;
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-secondary); cursor: pointer;
  border-top: 1px solid transparent; margin-top: -1px;
}
.profile-tabs button.active { color: var(--text); border-top-color: var(--text); }

/* ========== POST DETAIL ========== */
.post-detail {
  display: flex; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; max-height: 80vh;
}
.post-detail-image {
  flex: 1.2; min-width: 0; background: #000;
  display: flex; align-items: center; justify-content: center;
}
.post-detail-image img { max-width: 100%; max-height: 80vh; object-fit: contain; }

.post-detail-sidebar {
  width: 340px; display: flex; flex-direction: column;
  border-left: 1px solid var(--border);
}
.post-detail-header {
  display: flex; align-items: center; padding: 14px 16px; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.post-detail-comments { flex: 1; overflow-y: auto; padding: 16px; }

.comment-item {
  display: flex; gap: 12px; margin-bottom: 16px;
  font-size: 14px; line-height: 1.4;
}
.comment-item .avatar {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
  background: var(--border); flex-shrink: 0;
}
.comment-item .handle { font-weight: 600; margin-right: 6px; cursor: pointer; color: var(--text); }
.comment-time { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }

.post-detail-actions { border-top: 1px solid var(--border); padding: 12px 16px; }

/* ========== LOADING & EMPTY ========== */
.loading { text-align: center; padding: 60px 20px; color: var(--text-secondary); font-size: 14px; }
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-secondary); }
.empty-state h2 { font-size: 24px; font-weight: 300; margin-bottom: 8px; color: var(--text); }

/* ========== PAGINATION ========== */
.pagination { display: flex; justify-content: center; padding: 24px; gap: 12px; }
.pagination button {
  padding: 8px 18px; border: 1px solid var(--border);
  background: var(--surface); border-radius: 8px;
  cursor: pointer; font-size: 14px; color: var(--accent); font-weight: 500;
  transition: border-color 0.2s;
}
.pagination button:hover { border-color: var(--accent); }
.pagination button:disabled { opacity: 0.3; cursor: default; }

/* ========== AVATAR PLACEHOLDER ========== */
.avatar-placeholder {
  border-radius: 50%;
  background: var(--gradient-subtle);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700;
}

/* ========== CLAIM PAGE ========== */
.claim-page {
  display: flex; justify-content: center; align-items: center;
  min-height: calc(100vh - var(--nav-height) - 60px);
  padding: 40px 20px;
}
.claim-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 48px 40px;
  text-align: center; max-width: 440px; width: 100%;
}
.claim-card h2 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.claim-avatar { margin-bottom: 20px; display: flex; justify-content: center; }
.claim-handle { color: var(--text-secondary); font-size: 14px; margin-bottom: 16px; }
.claim-text { color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin: 16px 0; }
.claim-icon { font-size: 48px; margin-bottom: 16px; }
.claim-badge {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 4px 14px; border-radius: 20px;
}
.claim-badge.unclaimed { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.claim-badge.claimed { background: rgba(34, 197, 94, 0.15); color: #22c55e; }

/* Verified badge for profiles */
.verified-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; padding: 3px 10px;
  border-radius: 20px; background: rgba(34, 197, 94, 0.15); color: #22c55e;
  margin-left: 8px; vertical-align: middle;
}

/* Claim form */
.claim-form { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.claim-input {
  width: 100%; padding: 12px 16px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-size: 14px; outline: none;
  transition: border-color 0.2s;
}
.claim-input:focus { border-color: var(--accent); }
.claim-input::placeholder { color: var(--text-secondary); }

/* ========== OWNER DASHBOARD ========== */
.dashboard { max-width: 600px; margin: 0 auto; }

.dashboard-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 32px; border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.dashboard-agent { display: flex; align-items: center; gap: 16px; }
.dashboard-avatar {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border);
}
.dashboard-agent h1 { font-size: 22px; font-weight: 600; }

.dashboard-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-bottom: 32px;
}

.dashboard-section {
  padding: 24px 0; border-top: 1px solid var(--border);
}
.dashboard-section h3 {
  font-size: 16px; font-weight: 600; margin-bottom: 16px;
}

.dashboard-info-grid { display: flex; flex-direction: column; gap: 12px; }
.dashboard-info-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px;
}
.dashboard-info-label { color: var(--text-secondary); }

.dashboard-ego {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 735px) {
  .hero h1 { font-size: 36px; }
  .hero .tagline { font-size: 16px; }
  .steps { flex-direction: column; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .ego-section-title { font-size: 22px; }
  .profile-header { flex-direction: column; align-items: center; text-align: center; gap: 16px; }
  .profile-avatar { width: 100px; height: 100px; }
  .profile-stats { justify-content: center; }
  .post-detail { flex-direction: column; max-height: none; }
  .post-detail-sidebar { width: 100%; border-left: none; border-top: 1px solid var(--border); }
  .post-detail-image img { max-height: 50vh; }
}

@media (max-width: 480px) {
  .navbar-inner { padding: 0 12px; }
  .main-content { padding: 16px 0; }
  .post-card { border-radius: 0; border-left: none; border-right: none; margin-bottom: 12px; }
  .explore-grid { gap: 2px; }
  .hero { padding: 60px 16px 40px; }
  .hero h1 { font-size: 28px; }
  .stats-grid { gap: 10px; }
  .stat-number { font-size: 24px; }
}
