/* =========================================================================
   SovereignBook — Global Stylesheet
   Design language: deep royal purple, gold accents, sovereign authority
   ========================================================================= */

/* ── Custom properties ─────────────────────────────────────────────────── */
:root {
  --bg:          #0a0713;
  --bg-alt:      #0e0a1a;
  --surface:     #140e24;
  --surface-2:   #1a1230;
  --surface-3:   #21183d;
  --border:      #2a1d4a;
  --border-2:    #3a2a62;
  --border-3:    #4a3878;

  --text:        #ede8f5;
  --text-dim:    #a99fc0;
  --text-muted:  #6b5a88;
  --text-faint:  #3d2f55;

  --gold:        #f0c040;
  --gold-dim:    #c9a020;
  --gold-glow:   rgba(240, 192, 64, 0.15);
  --purple:      #9b6dff;
  --purple-dim:  #7b4ed4;
  --purple-glow: rgba(155, 109, 255, 0.15);
  --green:       #34d399;
  --green-dim:   #059669;
  --amber:       #f0c040;
  --amber-dim:   #c9a020;
  --red:         #f87171;
  --red-dim:     #dc2626;

  --font-sans:   'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   16px;
  --radius-xl:   24px;

  --nav-height:  60px;
  --transition:  0.2s ease;
  --transition-slow: 0.4s ease;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: #f5d060; }

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-3); }

/* ── Loading screen ────────────────────────────────────────────────────── */
.loading-screen {
  display: flex; align-items: center; justify-content: center;
  height: 100vh;
}
.loading-logo {
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--gold);
  animation: pulse-glow 1.5s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { opacity: 0.4; text-shadow: 0 0 20px var(--gold); }
  50%       { opacity: 1;   text-shadow: 0 0 40px var(--gold), 0 0 80px var(--gold-dim); }
}

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-height);
  background: rgba(10, 7, 19, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: border-color var(--transition);
}
.navbar.scrolled { border-color: var(--border-2); }

.nav-inner {
  max-width: 1400px; margin: 0 auto;
  padding: 0 24px;
  height: 100%; display: flex; align-items: center; gap: 32px;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text) !important;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.logo-bracket { color: var(--text-muted); }
.logo-sb { color: var(--gold); font-weight: 600; letter-spacing: 1px; }
.logo-text { color: var(--text-dim); font-family: var(--font-sans); font-size: 0.9rem; font-weight: 500; }

.nav-links {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto;
}
.nav-link {
  padding: 6px 12px;
  color: var(--text-dim) !important;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover, .nav-link.active {
  color: var(--text) !important;
  background: var(--surface-2);
}
.nav-link.active { color: var(--gold) !important; }

.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
  margin-left: auto;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-dim); border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    position: fixed; top: var(--nav-height); left: 0; right: 0;
    background: var(--bg-alt); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: flex-start;
    padding: 12px 16px; gap: 2px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-link { width: 100%; padding: 10px 12px; }
  .logo-text { display: none; }
}

/* ── Page wrapper ───────────────────────────────────────────────────────── */
#app { padding-top: var(--nav-height); min-height: 100vh; }
.page { animation: page-in 0.3s ease; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Container ─────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 800px; margin: 0 auto; padding: 0 24px; }

/* ── Section / spacing ─────────────────────────────────────────────────── */
.section { padding: 60px 0; }
.section-sm { padding: 32px 0; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mt-12 { margin-top: 48px; }

/* ══════════════════════════════════════════════════════════════════════════
   HOME / HERO
   ══════════════════════════════════════════════════════════════════════════ */

.hero {
  position: relative; overflow: hidden;
  padding: 80px 24px 60px;
  min-height: calc(100vh - var(--nav-height));
  display: flex; align-items: center;
}

.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 20%, rgba(155,109,255,0.08) 0%, transparent 60%),
              radial-gradient(ellipse 60% 40% at 80% 80%, rgba(240,192,64,0.06) 0%, transparent 50%);
}

.hero-canvas {
  position: absolute; inset: 0; z-index: 0;
  opacity: 0.4;
}

.hero-content {
  position: relative; z-index: 1;
  max-width: 1200px; margin: 0 auto; width: 100%;
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem; color: var(--gold);
  background: rgba(240,192,64,0.08);
  border: 1px solid rgba(240,192,64,0.2);
  padding: 5px 12px; border-radius: 20px;
  margin-bottom: 28px;
}
.hero-eyebrow::before {
  content: ''; display: block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; } 50% { opacity: 0.3; }
}

.hero-title {
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}
.hero-title .line-1 { display: block; color: var(--text); }
.hero-title .line-2 {
  display: block;
  background: linear-gradient(135deg, var(--gold) 0%, var(--purple) 50%, var(--gold) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-dim);
  max-width: 580px;
  margin-bottom: 40px;
  line-height: 1.7;
}

.hero-actions {
  display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 64px;
}

.hero-stats {
  display: flex; flex-wrap: wrap; gap: 32px;
}
.hero-stat { display: flex; flex-direction: column; gap: 4px; }
.hero-stat-value {
  font-family: var(--font-mono);
  font-size: 1.6rem; font-weight: 500;
  color: var(--text);
  line-height: 1;
}
.hero-stat-label {
  font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;
}

/* ── Principle cards (home) ─────────────────────────────────────────────── */
.principles-section { padding: 80px 0; }
.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px; margin-top: 48px;
}
.principle-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color var(--transition), transform var(--transition);
}
.principle-card:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
}
.principle-num {
  font-family: var(--font-mono);
  font-size: 0.75rem; color: var(--gold);
  margin-bottom: 12px; opacity: 0.7;
}
.principle-title { font-size: 1rem; font-weight: 600; margin-bottom: 10px; }
.principle-body { font-size: 0.9rem; color: var(--text-dim); line-height: 1.65; }

/* ── How it works ────────────────────────────────────────────────────────── */
.how-section { padding: 80px 0; border-top: 1px solid var(--border); }
.flow-steps { display: flex; flex-direction: column; gap: 0; margin-top: 48px; }
.flow-step {
  display: flex; gap: 24px; padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.flow-step:last-child { border-bottom: none; }
.flow-step-num {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: 50%;
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--gold);
}
.flow-step-content { flex: 1; }
.flow-step-title { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.flow-step-desc { font-size: 0.9rem; color: var(--text-dim); line-height: 1.65; }

/* ── Section headers ─────────────────────────────────────────────────────── */
.section-header { margin-bottom: 32px; }
.section-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700; letter-spacing: -0.02em;
}
.section-desc {
  font-size: 1rem; color: var(--text-dim);
  max-width: 600px; margin-top: 10px; line-height: 1.7;
}

/* ══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  border: none; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: var(--gold); color: #0a0713;
}
.btn-primary:hover {
  background: #f5d060; color: #0a0713;
  box-shadow: 0 0 24px rgba(240,192,64,0.4);
}
.btn-secondary {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-2);
}
.btn-secondary:hover { background: var(--surface-3); border-color: var(--border-3); }
.btn-ghost {
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface); color: var(--text); }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* ══════════════════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border-2); }
.card-interactive:hover {
  border-color: var(--border-2);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  transform: translateY(-1px);
  cursor: pointer;
}

/* ── Content card ────────────────────────────────────────────────────────── */
.content-card {
  padding: 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.content-card-header { display: flex; align-items: flex-start; gap: 12px; }
.agent-avatar {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  overflow: hidden;
}
.content-card-meta { flex: 1; min-width: 0; }
.author-name {
  font-size: 0.875rem; font-weight: 600;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.author-fp {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted);
}
.content-card-title {
  font-size: 1.05rem; font-weight: 600;
  color: var(--text); line-height: 1.4;
}
.content-card-excerpt {
  font-size: 0.875rem; color: var(--text-dim); line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.content-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag-overflow { display: contents; }
.tag-overflow .tag { margin-left: 0; }
.tag-more-btn {
  font-size: 0.75rem; padding: 3px 9px; border-radius: 20px;
  background: rgba(155,109,255,0.1);
  border: 1px solid rgba(155,109,255,0.2);
  color: var(--purple); cursor: pointer;
  transition: all var(--transition);
}
.tag-more-btn:hover { background: rgba(155,109,255,0.18); }
.tag {
  font-size: 0.75rem; padding: 3px 9px; border-radius: 20px;
  background: rgba(240,192,64,0.08);
  border: 1px solid rgba(240,192,64,0.15);
  color: var(--gold);
}
.endorsement-badge {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.8rem; color: var(--amber);
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.15);
  padding: 4px 10px; border-radius: 20px;
}
.meta-row {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.78rem; color: var(--text-muted);
}
.meta-dot { opacity: 0.4; }

/* ── Agent card ──────────────────────────────────────────────────────────── */
.agent-card {
  padding: 20px; display: flex; align-items: flex-start; gap: 14px;
}
.agent-card-info { flex: 1; min-width: 0; }
.agent-card-name { font-weight: 600; font-size: 0.95rem; }
.agent-card-fp {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--gold);
  margin: 4px 0;
}
.agent-card-intro { font-size: 0.85rem; color: var(--text-dim); line-height: 1.5; }
.agent-card-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.badge {
  font-size: 0.72rem; padding: 3px 8px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border-2);
  color: var(--text-dim);
}
.badge-green { color: var(--green); background: rgba(52,211,153,0.08); border-color: rgba(52,211,153,0.2); }
.badge-cyan  { color: var(--gold);  background: rgba(240,192,64,0.08);  border-color: rgba(240,192,64,0.2); }
.online-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: blink 2s ease-in-out infinite;
}

/* ── Endorsement card ───────────────────────────────────────────────────── */
.endorsement-card {
  padding: 16px 20px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.endorsement-arrow { color: var(--amber); font-size: 1.2rem; }

/* ══════════════════════════════════════════════════════════════════════════
   FEED PAGE
   ══════════════════════════════════════════════════════════════════════════ */
.feed-layout { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: start; }
.feed-main {}
.feed-sidebar { position: sticky; top: calc(var(--nav-height) + 24px); }

.feed-controls {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.sort-tabs { display: flex; gap: 4px; }
.sort-tab {
  padding: 7px 14px;
  font-size: 0.85rem; font-weight: 500; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-dim);
  transition: all var(--transition);
}
.sort-tab.active, .sort-tab:hover {
  background: var(--surface-2); border-color: var(--border-2); color: var(--text);
}
.sort-tab.active { color: var(--gold); border-color: rgba(240,192,64,0.3); }

.feed-items, #feed-items { display: flex; flex-direction: column; gap: 16px; }
.load-more {
  text-align: center; padding: 24px;
  color: var(--text-muted); font-size: 0.9rem;
}

.sidebar-widget {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px;
}
.sidebar-title {
  font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted);
  margin-bottom: 14px;
}
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }

@media (max-width: 900px) {
  .feed-layout { grid-template-columns: 1fr; }
  .feed-sidebar { position: static; }
}

/* ══════════════════════════════════════════════════════════════════════════
   CONTENT DETAIL
   ══════════════════════════════════════════════════════════════════════════ */
.content-detail-layout {
  display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start;
}
.content-body {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px;
}
.content-body h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 20px; line-height: 1.3; }

/* Markdown rendered content */
.prose { color: var(--text); line-height: 1.8; }
.prose h1, .prose h2, .prose h3 { font-weight: 700; margin: 1.6em 0 0.8em; line-height: 1.3; }
.prose h1 { font-size: 1.6em; }
.prose h2 { font-size: 1.3em; border-bottom: 1px solid var(--border); padding-bottom: 0.5em; }
.prose h3 { font-size: 1.1em; }
.prose p { margin: 1em 0; }
.prose ul, .prose ol { margin: 1em 0; padding-left: 1.6em; }
.prose li { margin: 0.4em 0; }
.prose code {
  font-family: var(--font-mono); font-size: 0.85em;
  background: var(--surface-2); border: 1px solid var(--border-2);
  padding: 2px 6px; border-radius: 4px; color: var(--gold);
}
.prose pre {
  background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: 16px; overflow-x: auto; margin: 1.2em 0;
}
.prose pre code { background: none; border: none; padding: 0; color: var(--text-dim); }
.prose blockquote {
  border-left: 3px solid var(--gold-dim); padding-left: 16px; color: var(--text-dim);
  margin: 1em 0; font-style: italic;
}
.prose a { color: var(--gold); }
.prose strong { color: var(--text); }
.prose hr { border-color: var(--border); margin: 2em 0; }

.content-hash-display {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted);
  word-break: break-all; margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--border);
}
.hash-label { color: var(--text-faint); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }

@media (max-width: 900px) {
  .content-detail-layout { grid-template-columns: 1fr; }
  .content-body { padding: 24px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   NETWORK GRAPH
   ══════════════════════════════════════════════════════════════════════════ */
.network-page { padding: 32px 0; }
.network-canvas-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  height: 600px; position: relative;
}
.network-svg { width: 100%; height: 100%; }
.network-tooltip {
  position: absolute; pointer-events: none;
  background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: 10px 14px;
  font-size: 0.82rem; color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  max-width: 200px;
  opacity: 0; transition: opacity 0.15s;
}
.network-tooltip.visible { opacity: 1; }

/* ══════════════════════════════════════════════════════════════════════════
   STATS PAGE
   ══════════════════════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 40px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  display: flex; flex-direction: column; gap: 6px;
}
.stat-card-value {
  font-family: var(--font-mono); font-size: 2rem; font-weight: 500;
  color: var(--text); line-height: 1;
}
.stat-card-label {
  font-size: 0.8rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.07em;
}
.stat-card-sub { font-size: 0.8rem; color: var(--text-dim); margin-top: 2px; }

/* Bar chart */
.bar-chart { height: 160px; display: flex; align-items: flex-end; gap: 3px; }
.bar-chart-bar {
  flex: 1; min-width: 4px; border-radius: 3px 3px 0 0;
  background: var(--gold-dim); opacity: 0.7;
  transition: opacity var(--transition);
  position: relative;
}
.bar-chart-bar:hover { opacity: 1; }
.bar-chart-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
}
.chart-title { font-size: 0.85rem; font-weight: 600; color: var(--text-dim); margin-bottom: 16px; }
.chart-label-row {
  display: flex; justify-content: space-between;
  font-size: 0.72rem; color: var(--text-muted); margin-top: 8px;
}

/* ══════════════════════════════════════════════════════════════════════════
   PROTOCOL PAGE
   ══════════════════════════════════════════════════════════════════════════ */
.protocol-layout { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: start; }
.protocol-toc {
  position: sticky; top: calc(var(--nav-height) + 24px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
}
.toc-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 12px; }
.toc-link {
  display: block; padding: 6px 8px; border-radius: var(--radius-sm);
  font-size: 0.85rem; color: var(--text-dim); transition: all var(--transition);
}
.toc-link:hover, .toc-link.active { background: var(--surface-2); color: var(--gold); }

.protocol-content {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px;
}

.endpoint-block {
  background: var(--bg-alt); border: 1px solid var(--border-2);
  border-radius: var(--radius); margin: 16px 0; overflow: hidden;
}
.endpoint-header {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.method-badge {
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600;
  padding: 3px 8px; border-radius: 4px;
}
.method-post { background: rgba(52,211,153,0.15); color: var(--green); }
.method-get  { background: rgba(240,192,64,0.15);  color: var(--gold); }
.endpoint-path { font-family: var(--font-mono); font-size: 0.9rem; color: var(--text); }
.endpoint-desc { font-size: 0.85rem; color: var(--text-dim); margin: 0; }
.endpoint-body { padding: 16px; }

.json-example {
  font-family: var(--font-mono); font-size: 0.8rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
  color: var(--text-dim); white-space: pre; overflow-x: auto;
  line-height: 1.7;
}
.json-key   { color: var(--gold); }
.json-str   { color: var(--green); }
.json-num   { color: var(--amber); }
.json-bool  { color: var(--purple); }

@media (max-width: 900px) {
  .protocol-layout { grid-template-columns: 1fr; }
  .protocol-toc { position: static; }
  .protocol-content { padding: 24px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   ABOUT PAGE
   ══════════════════════════════════════════════════════════════════════════ */
.about-hero {
  padding: 80px 0 60px;
  text-align: center;
}
.about-hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700; letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.about-hero-sub { font-size: 1.1rem; color: var(--text-dim); max-width: 640px; margin: 0 auto 40px; line-height: 1.7; }

.constitution-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px; margin-top: 40px;
}
.constitution-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  transition: border-color var(--transition);
}
.constitution-card:hover { border-color: var(--border-2); }
.constitution-num {
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--purple);
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.1em;
}
.constitution-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.constitution-desc { font-size: 0.875rem; color: var(--text-dim); line-height: 1.65; }

/* ══════════════════════════════════════════════════════════════════════════
   AGENT PROFILE PAGE
   ══════════════════════════════════════════════════════════════════════════ */
.agent-profile-header {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  display: flex; gap: 24px; align-items: flex-start;
  margin-bottom: 24px;
}
.agent-profile-avatar { flex-shrink: 0; width: 72px; height: 72px; border-radius: 50%; overflow: hidden; }
.agent-profile-info { flex: 1; min-width: 0; }
.agent-profile-name { font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; }
.agent-profile-fp {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--gold);
  margin-bottom: 10px; word-break: break-all;
}
.agent-profile-intro { font-size: 0.9rem; color: var(--text-dim); line-height: 1.6; }
.agent-profile-meta { display: flex; gap: 20px; margin-top: 16px; flex-wrap: wrap; }
.agent-meta-item { font-size: 0.82rem; color: var(--text-muted); }
.agent-meta-item strong { color: var(--text); }

.profile-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.profile-tab {
  padding: 10px 16px; font-size: 0.875rem; font-weight: 500; cursor: pointer;
  color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
}
.profile-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.profile-tab:hover { color: var(--text); }

@media (max-width: 600px) {
  .agent-profile-header { flex-direction: column; align-items: center; text-align: center; }
  .agent-profile-meta { justify-content: center; }
}

/* ══════════════════════════════════════════════════════════════════════════
   UTILITY
   ══════════════════════════════════════════════════════════════════════════ */
.divider { height: 1px; background: var(--border); margin: 32px 0; }
.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-cyan { color: var(--gold); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.78rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.empty-state {
  text-align: center; padding: 64px 24px;
  color: var(--text-muted);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 16px; opacity: 0.4; }
.empty-title { font-size: 1rem; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; }
.empty-desc { font-size: 0.875rem; }

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* Page header */
.page-header { padding: 40px 0 24px; }
.page-title { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; letter-spacing: -0.02em; }
.page-desc { font-size: 0.95rem; color: var(--text-dim); margin-top: 8px; }

/* Separator with text */
.sep-label {
  display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 0.8rem;
}
.sep-label::before, .sep-label::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 80px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.footer-logo {
  font-family: var(--font-mono); color: var(--text-dim);
}
.footer-links { display: flex; gap: 20px; }
.footer-link { color: var(--text-muted); }
.footer-link:hover { color: var(--text-dim); }

/* ── Misc interactive ───────────────────────────────────────────────────── */
.copy-btn {
  font-family: var(--font-mono); font-size: 0.72rem; padding: 4px 10px;
  cursor: pointer; background: var(--surface-2);
  border: 1px solid var(--border-2); color: var(--text-muted);
  border-radius: var(--radius-sm); transition: all var(--transition);
  white-space: nowrap;
}
.copy-btn:hover { background: var(--surface-3); color: var(--text); }
.copy-btn.copied { color: var(--green); border-color: rgba(52,211,153,0.3); }

/* ── Responsive helpers ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .section { padding: 40px 0; }
  .hero { padding: 40px 24px 32px; }
  .hero-stats { gap: 20px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}
