@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: #0a0b0e;
  --bg-surface: #12141a;
  --bg-surface-elevated: #191c24;
  --border-subtle: #242834;
  --border-focus: #3b4255;
  --lime: #ccff00;
  --lime-dim: rgba(204, 255, 0, 0.12);
  --lime-glow: rgba(204, 255, 0, 0.25);
  --teal-accent: #00e5ff;
  --text-main: #f0f3f8;
  --text-muted: #8b95a8;
  --text-dim: #5c6577;
  --pill-read: #00e5ff;
  --pill-read-bg: rgba(0, 229, 255, 0.1);
  --pill-write: #ccff00;
  --pill-write-bg: rgba(204, 255, 0, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header */
.topbar {
  border-bottom: 1px solid var(--border-subtle);
  background-color: rgba(10, 11, 14, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lens-glyph {
  color: var(--lime);
  font-size: 1.4rem;
  line-height: 1;
}

.brand-title {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  background-color: var(--lime-dim);
  color: var(--lime);
  border-radius: 999px;
  font-weight: 600;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  font-size: 0.88rem;
}

.nav-links a {
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--lime);
}

/* Container */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Hero */
.hero-strip {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
  align-items: center;
  background: linear-gradient(135deg, rgba(25, 28, 36, 0.6) 0%, rgba(18, 20, 26, 0.9) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.hero-strip::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, var(--lime-glow) 0%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
}

.pill-category {
  display: inline-block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--lime);
  margin-bottom: 0.6rem;
}

.hero-content h1 {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.lead {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contract-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.4rem 0.35rem 0.85rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.input-icon {
  color: var(--lime);
  margin-right: 0.5rem;
  font-size: 1.1rem;
}

.contract-input-wrapper input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  flex-grow: 1;
  outline: none;
}

.contract-input-wrapper input::placeholder {
  color: var(--text-dim);
}

.btn {
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background-color: var(--lime);
  color: #0b0c10;
}

.btn-primary:hover {
  background-color: #b8e600;
  box-shadow: 0 0 16px var(--lime-glow);
}

.input-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.input-hint code {
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.hero-media {
  display: flex;
  justify-content: center;
  position: relative;
}

.hero-image {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
}

/* Contract Summary Card */
.summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.contract-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.status-tags {
  display: flex;
  gap: 0.6rem;
}

.pill {
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-weight: 600;
}

.pill-verified {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.pill-chain {
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.contract-note {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  background: var(--bg-surface-elevated);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  border: 1px solid rgba(255,255,255,0.03);
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.meta-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.meta-code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-main);
  word-break: break-all;
}

.meta-val {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
}

.action-links-row {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  font-size: 0.85rem;
}

.subtle-link {
  color: var(--teal-accent);
  transition: opacity 0.15s ease;
}

.subtle-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

.subtle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
}

.subtle-btn:hover {
  color: var(--text-main);
}

.source-drawer {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: #0d0f14;
  border: 1px dashed var(--border-subtle);
}

.source-drawer.hidden {
  display: none;
}

.source-header {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
}

.source-header code {
  font-family: var(--font-mono);
  color: var(--lime);
  font-size: 0.78rem;
  word-break: break-all;
}

.source-caption {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Capability Grid */
.lens-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.capability-col {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.col-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.indicator-bubble {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.indicator-read {
  background: var(--pill-read);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.indicator-write {
  background: var(--pill-write);
  box-shadow: 0 0 8px var(--lime-glow);
}

.col-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.count-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-surface-elevated);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.col-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.cards-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Capability Card */
.cap-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.cap-card:hover {
  border-color: var(--border-focus);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.6rem;
}

.func-signature {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  word-break: break-word;
}

.sig-name {
  color: #fff;
}

.sig-type {
  color: var(--text-muted);
}

.kind-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.kind-read {
  background: var(--pill-read-bg);
  color: var(--pill-read);
}

.kind-write {
  background: var(--pill-write-bg);
  color: var(--pill-write);
}

.params-block, .returns-block {
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
}

.param-title {
  color: var(--text-dim);
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.param-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.arg-tag {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.arg-tag .t-type {
  color: var(--lime);
}

.arg-tag .t-name {
  color: var(--text-main);
  margin-left: 0.25rem;
}

.json-preview-container {
  margin-top: 0.85rem;
  background: #08090c;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.json-preview-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.75rem;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.74rem;
}

.api-target {
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.15rem 0.55rem;
  font-size: 0.7rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: var(--lime);
  color: #000;
  border-color: var(--lime);
}

.code-snippet {
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #c9d1d9;
  overflow-x: auto;
  line-height: 1.4;
  margin: 0;
}

.dryrun-note {
  padding: 0.4rem 0.75rem;
  font-size: 0.7rem;
  background: rgba(204, 255, 0, 0.05);
  border-top: 1px solid rgba(204, 255, 0, 0.1);
  color: #dbe896;
}

/* Safety banner */
.safety-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--lime);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.safety-icon {
  font-size: 1.8rem;
}

.safety-body h4 {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.safety-body p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 1.5rem;
  background-color: var(--bg-primary);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

.footer a {
  color: var(--lime);
}

.foot-notes {
  margin-top: 0.5rem;
  font-size: 0.76rem;
  color: var(--text-dim);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--lime);
  color: #0b0c10;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 900px) {
  .hero-strip {
    grid-template-columns: 1fr;
  }
  .lens-layout {
    grid-template-columns: 1fr;
  }
  .hero-media {
    order: -1;
  }
}