:root {
  --bg: #050a05;
  --bg-card: #0a120a;
  --bg-input: #0d160d;
  --bg-elevated: #111a11;
  --border: #1a2e1a;
  --border-hover: #2a4a2a;
  --border-subtle: rgba(34, 197, 94, 0.08);
  --text: #f0fdf0;
  --text-secondary: #94b894;
  --text-dim: #5a7a5a;
  --accent: #22c55e;
  --accent-hover: #4ade80;
  --accent-glow: rgba(34, 197, 94, 0.1);
  --accent-glow-strong: rgba(34, 197, 94, 0.15);
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
  --blue: #3b82f6;
  --radius: 10px;
  --radius-lg: 14px;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ── Header ──────────────────────────────────────────── */

header {
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  background: rgba(5, 10, 5, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
}

.logo {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 0;
}

.logo-icon {
  color: var(--accent);
  font-size: 14px;
  margin-right: 6px;
}

nav {
  display: flex;
  gap: 1px;
  flex: 1;
}

.tab {
  background: none;
  border: none;
  color: var(--text-dim);
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  transition: color 0.15s, background 0.15s;
}

.tab:hover { color: var(--text-secondary); background: var(--bg-elevated); }
.tab.active { color: var(--text); background: var(--bg-elevated); }

.wallet-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-wallet {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-wallet:hover { border-color: var(--accent); color: var(--accent); }

.wallet-addr {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: 0.2s;
}

/* ── Main ────────────────────────────────────────────── */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
  flex: 1;
  width: 100%;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  letter-spacing: -0.5px;
}

/* ── Hero / Landing ──────────────────────────────────── */

.hero {
  text-align: center;
  padding: 72px 0 56px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(34, 197, 94, 0.2);
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 28px;
  letter-spacing: 0.3px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

.hero-title {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -2px;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, #22c55e 0%, #4ade80 40%, #86efac 70%, #22c55e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ── Marquee ─────────────────────────────────────────── */

.marquee-section {
  margin: 0 0 56px;
  text-align: center;
}

.marquee-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
  margin-bottom: 16px;
}

.marquee-track {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-scroll {
  display: flex;
  gap: 12px;
  width: max-content;
  animation: marquee 30s linear infinite;
}

.marquee-track:hover .marquee-scroll {
  animation-play-state: paused;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.mi-icon {
  font-size: 16px;
}

/* ── Features ────────────────────────────────────────── */

.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 0 0 64px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 0 1px var(--border-hover);
}

.feature-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-glow);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ── How It Works ────────────────────────────────────── */

.how-it-works {
  margin: 0 0 64px;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.section-desc {
  text-align: center;
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 32px;
}

.steps {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.step {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: border-color 0.2s;
}

.step:hover { border-color: var(--border-hover); }

.step-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  flex-shrink: 0;
  color: var(--text-dim);
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-glow-strong);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  font-family: var(--mono);
}

.step-content h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.step-content p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ── Code Section ────────────────────────────────────── */

.code-section {
  margin: 0 0 56px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
}

.code-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.code-dots {
  display: flex;
  gap: 6px;
}

.code-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-hover);
}

.code-dots span:first-child { background: #ef4444; }
.code-dots span:nth-child(2) { background: #eab308; }
.code-dots span:nth-child(3) { background: #22c55e; }

.code-label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  flex: 1;
}

.btn-copy {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-copy:hover { border-color: var(--accent); color: var(--accent); }

.code-block {
  padding: 20px 22px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--text-secondary);
}

.code-dim { color: var(--text-dim); }
.code-str { color: var(--accent); }
.code-num { color: var(--yellow); }

/* ── Live Stats Bar ──────────────────────────────────── */

.live-stats-bar {
  display: flex;
  justify-content: center;
  gap: 56px;
  padding: 40px 0 16px;
  border-top: 1px solid var(--border);
}

.live-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.live-stat-value {
  font-size: 32px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: -1px;
}

.live-stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 500;
}

/* ── Controls ────────────────────────────────────────── */

.controls {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent);
}

/* ── Inputs ──────────────────────────────────────────── */

.input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}

.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--text-dim); }

/* ── Buttons ─────────────────────────────────────────── */

.btn {
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  padding: 10px 20px;
  transition: all 0.15s;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  background: var(--accent);
  color: #050a05;
}

.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover { border-color: var(--text-secondary); color: var(--text); }

.btn-large {
  padding: 13px 28px;
  font-size: 15px;
  border-radius: 10px;
}

.btn-full { width: 100%; }

/* ── Agent Grid ──────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.agent-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: border-color 0.2s;
}

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

.agent-card .agent-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.agent-card .agent-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-active { background: rgba(34, 197, 94, 0.1); color: var(--green); }
.badge-inactive { background: rgba(239, 68, 68, 0.1); color: var(--red); }

.agent-card .skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.skill-tag {
  background: var(--accent-glow);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.agent-card .details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 13px;
}

.detail-label { color: var(--text-dim); }
.detail-value { text-align: right; font-family: var(--mono); font-size: 12px; }

.agent-card .endpoint {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
  word-break: break-all;
  font-family: var(--mono);
}

/* ── Stats Grid ──────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
}

.stat-value {
  font-size: 30px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: -1px;
}

.stat-unit {
  font-size: 12px;
  color: var(--text-dim);
}

/* ── Jobs List ───────────────────────────────────────── */

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 60px 1fr auto auto;
  gap: 16px;
  align-items: center;
  transition: border-color 0.15s;
}

.job-row:hover { border-color: var(--border-hover); }

.job-id {
  font-weight: 600;
  font-family: var(--mono);
  color: var(--accent);
  font-size: 14px;
}

.job-parties {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-amount {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
}

.job-status {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-created { background: rgba(59, 130, 246, 0.1); color: var(--blue); }
.status-completed { background: rgba(34, 197, 94, 0.1); color: var(--green); }
.status-disputed { background: rgba(234, 179, 8, 0.1); color: var(--yellow); }
.status-cancelled { background: rgba(239, 68, 68, 0.1); color: var(--red); }

/* ── Form ────────────────────────────────────────────── */

.form-container { max-width: 600px; }

.form-desc {
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: 14px;
  line-height: 1.6;
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.result {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--mono);
  word-break: break-all;
}

.result.success {
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--green);
}

.result.error {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--red);
}

.placeholder {
  color: var(--text-dim);
  text-align: center;
  padding: 48px;
  grid-column: 1 / -1;
}

.hidden { display: none !important; }

/* ── Footer ──────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-dim);
}

.footer-logo {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 14px;
}

.footer-brand p {
  font-size: 12px;
  margin-top: 2px;
}

.footer-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.program-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}

.network-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(34, 197, 94, 0.2);
  padding: 3px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 900px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .steps { flex-direction: column; gap: 12px; }
  .step-connector {
    transform: rotate(90deg);
    width: auto;
    height: 24px;
  }
}

@media (max-width: 640px) {
  .mobile-menu-btn { display: flex; }

  nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 8px 16px 12px;
    gap: 2px;
  }

  nav.open { display: flex; }

  .tab { text-align: left; padding: 10px 14px; }

  .header-inner { flex-wrap: wrap; }

  .wallet-section { margin-left: auto; }

  .hero { padding: 48px 0 36px; }
  .hero-title { font-size: 34px; letter-spacing: -1.2px; }
  .hero-desc { font-size: 15px; }
  .hero-actions { flex-direction: column; align-items: center; }

  .features { grid-template-columns: 1fr; }

  .live-stats-bar { gap: 24px; flex-wrap: wrap; }
  .live-stat-value { font-size: 24px; }

  .grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }

  .job-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .footer-links { flex-wrap: wrap; justify-content: center; }
  .footer-meta { justify-content: center; }
}
