@font-face {
  font-family: 'Geist';
  src: url('https://musechain.io/fonts/geist/geist-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-primary: #0a0c0e;
  --bg-secondary: #121519;
  --bg-surface: #181d22;
  --bg-surface-hover: #1f252b;
  --border-subtle: #272f37;
  --border-strong: #38434e;
  --text-primary: #f2f5f8;
  --text-secondary: #9aa7b5;
  --text-muted: #626e7b;
  --accent: #ccff00;
  --accent-dim: rgba(204, 255, 0, 0.12);
  --accent-hover: #b8e600;
  --accent-text: #050607;
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --code-bg: #07090b;
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  background-color: rgba(18, 21, 25, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
}
.brand-dot {
  width: 9px;
  height: 9px;
  background-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--accent);
}
.brand-divider {
  color: var(--text-muted);
}
.brand-task {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 13px;
}
.header-actions {
  display: flex;
  gap: 8px;
}
.pill-link {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}
.pill-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pill-dim {
  color: var(--text-secondary);
}

/* Container */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  width: 100%;
  flex: 1;
}

/* Hero Card */
.hero-card {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}
.hero-visual {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--code-bg);
  border: 1px solid var(--border-subtle);
  height: 100%;
  min-height: 220px;
}
.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(10, 12, 14, 0.85);
  backdrop-filter: blur(8px);
  color: var(--accent);
  border: 1px solid var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 4px;
}
.hero-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.meta-tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.tag-accent {
  background-color: var(--accent-dim);
  border-color: rgba(204, 255, 0, 0.3);
  color: var(--accent);
  font-weight: 600;
}
.hero-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 10px;
  color: var(--text-primary);
}
.hero-lead {
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.6;
  margin-bottom: 18px;
}
.inline-code {
  font-family: var(--font-mono);
  background-color: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.contract-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}
.contract-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.contract-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.contract-address {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--accent);
  word-break: break-all;
  font-weight: 600;
}
.copy-btn {
  background-color: var(--code-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.copy-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}
.contract-footnote {
  font-size: 12px;
  color: var(--text-muted);
}

/* Identity Banner */
.identity-banner {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.identity-icon {
  font-size: 24px;
  color: var(--accent);
  line-height: 1;
}
.identity-content {
  flex: 1;
}
.identity-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  margin-bottom: 3px;
}
.identity-muse-badge {
  background-color: var(--accent-dim);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(204, 255, 0, 0.3);
}
.identity-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}
.identity-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 6px var(--success);
  display: inline-block;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

/* Catalog Section */
.catalog-section {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
}
.section-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
.stat-pill {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-number {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.search-box {
  position: relative;
  flex: 1;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  opacity: 0.6;
}
.search-box input {
  width: 100%;
  background-color: var(--code-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 9px 12px 9px 34px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}
.search-box input:focus {
  border-color: var(--accent);
}
.secondary-btn {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.secondary-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}
.rotate-icon {
  font-size: 14px;
  display: inline-block;
}

/* Tool List & Cards */
.tool-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
}
.tool-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: border-color 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tool-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.tool-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.tool-card-title-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.tool-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.tool-card-index {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.tool-card-author {
  font-size: 12px;
  font-family: var(--font-mono);
  background-color: var(--code-bg);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--accent);
  border: 1px solid rgba(204, 255, 0, 0.2);
  white-space: nowrap;
}
.tool-card-purpose {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.tool-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.tool-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  word-break: break-all;
}
.tool-card-link:hover {
  text-decoration: underline;
}
.tool-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.loading-state, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
  gap: 12px;
}
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Pagination Bar */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}
.pagination-btn {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pagination-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.pagination-info {
  font-size: 12.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Author Sidebar */
.author-panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.panel-title {
  font-size: 17px;
  font-weight: 700;
}
.panel-pill {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background-color: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}
.panel-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 16px;
}

.add-tool-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-group input,
.form-group textarea {
  background-color: var(--code-bg);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}
.field-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.call-inspector {
  background-color: var(--code-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 11.5px;
  font-family: var(--font-mono);
}
.inspector-title {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 700;
}
.inspector-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
  gap: 8px;
}
.inspector-key {
  color: var(--text-muted);
}
.inspector-val {
  color: var(--text-primary);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inspector-val.highlight {
  color: var(--accent);
  font-weight: 600;
}

.primary-btn {
  background-color: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  margin-top: 4px;
}
.primary-btn:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}
.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-arrow {
  transition: transform 0.15s ease;
}
.primary-btn:hover .btn-arrow {
  transform: translateX(3px);
}

.submission-feedback {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.4;
}
.submission-feedback.hidden {
  display: none;
}
.submission-feedback.success {
  background-color: var(--success-bg);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}
.submission-feedback.error {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.standards-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}
.standards-panel h4 {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.standards-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.standards-list li strong {
  color: var(--text-primary);
}
.standards-list a {
  color: var(--accent);
  text-decoration: none;
}
.standards-list a:hover {
  text-decoration: underline;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-secondary);
  padding: 16px 20px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: auto;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-left a,
.footer-right a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}
.footer-left a:hover,
.footer-right a:hover {
  color: var(--accent);
}
.footer-dot {
  margin: 0 6px;
  color: var(--border-strong);
}

/* Responsive */
@media (max-width: 900px) {
  .hero-card {
    grid-template-columns: 1fr;
  }
  .hero-visual {
    height: 180px;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}