/* SYNDICATE design system */
:root {
  --bg: #0b0b0d;
  --surface: #131316;
  --border: #1e1e22;
  --text: #ededed;
  --muted: #8a8a90;
  --dim: #5a5a60;
  --accent: #9171ff;
  --accent-dim: rgba(145, 113, 255, 0.12);
  --accent-border: rgba(145, 113, 255, 0.28);
  --down: #ff5c5c;
  --max: 1200px;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.muted {
  color: var(--muted);
}

.dim {
  color: var(--dim);
}

.accent {
  color: var(--accent);
}

.container {
  width: min(100% - 48px, var(--max));
  margin-inline: auto;
}

.narrow {
  max-width: 720px;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0.055;
  background-image: radial-gradient(rgba(255, 255, 255, 0.55) 0.35px, transparent 0.35px);
  background-size: 3px 3px;
  background-color: transparent;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(11, 11, 13, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  width: min(100% - 32px, var(--max));
  margin-inline: auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.logo-mark {
  color: var(--accent);
}

.logo-word {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s var(--ease);
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agent-pill {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--dim);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}

.agent-pill span {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-decoration: none;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s var(--ease);
}

.btn-lime {
  background: var(--accent);
  color: #0b0b0d;
}

.btn-lime:hover {
  opacity: 0.92;
}

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

.btn-ghost:hover {
  border-color: var(--muted);
}

.btn-block {
  width: 100%;
  margin-top: 16px;
}

/* Hero */
.hero {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  padding: 48px 0 80px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0 0 24px;
}

.hero-sub {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  text-transform: lowercase;
  margin: 0 0 24px;
  max-width: 480px;
}

.hairline {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 16px;
}

.hero-disclaimer {
  font-size: 11px;
  color: var(--dim);
  margin: 0 0 32px;
  max-width: 420px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-visual {
  position: relative;
  aspect-ratio: 1;
  max-height: min(70vh, 520px);
  margin-left: auto;
  width: 100%;
}

#hero-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 12px;
}

.hero-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.fallback-network {
  width: 70%;
  height: auto;
}

/* Sections */
.section {
  padding: 120px 0;
}

.section-tag {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 16px;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 0 0 48px;
  max-width: 640px;
}

.body-lg {
  font-size: 17px;
  max-width: 480px;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.surface-inner {
  background: var(--bg);
}

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.filter-btn {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

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

.filter-btn.active {
  color: var(--accent);
  border-color: var(--border);
  background: var(--accent-dim);
}

/* Marketplace grid */
.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.agent-card {
  position: relative;
  padding: 20px;
  transition: border-color 0.25s, transform 0.25s var(--ease);
}

.agent-card.hidden-filter {
  display: none;
}

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

.agent-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.agent-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.agent-name {
  font-size: 13px;
  font-weight: 500;
}

.spark-wrap {
  position: relative;
  height: 48px;
  margin-bottom: 16px;
}

.spark-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.agent-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 10px;
  color: var(--muted);
}

.agent-stats .val {
  color: var(--text);
}

.agent-stats .up {
  color: var(--accent);
}

.agent-stats .down {
  color: var(--down);
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 10px;
}

.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 10px;
}

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

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot {
    animation: none;
  }
}

.verified {
  color: var(--dim);
  font-size: 10px;
}

.card-rent {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 11, 13, 0.75);
  opacity: 0;
  transition: opacity 0.25s;
  border-radius: 10px;
}

.agent-card:hover .card-rent {
  opacity: 1;
}

.preview-tag {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--dim);
  opacity: 0.8;
}

/* Two column */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.rent-panel {
  padding: 24px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.preview-label {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--dim);
}

.rent-agent-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.chart-wrap {
  position: relative;
  margin-bottom: 20px;
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.chart-wrap canvas {
  width: 100%;
  height: 140px;
  display: block;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  font-size: 10px;
}

.stat-grid div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-grid .label {
  color: var(--dim);
}

.stat-preview-cell {
  position: relative;
}

.stat-preview-cell .preview-tag {
  position: static;
  display: block;
  margin-top: 2px;
}

.term-selector {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.term-btn {
  flex: 1;
  font-family: inherit;
  font-size: 11px;
  padding: 10px;
  background: transparent;
  border: none;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
}

.term-btn.active {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--border);
}

.rent-summary {
  font-size: 11px;
  color: var(--muted);
  margin: 16px 0 0;
}

/* List section */
.step-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
}

.step-list li {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.step-num {
  color: var(--accent);
  font-size: 11px;
}

.builder-panel {
  padding: 24px;
}

.builder-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--dim);
  margin: 0 0 20px;
}

.builder-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.builder-fields label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 10px;
  color: var(--muted);
}

.builder-fields input,
.builder-fields select {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

.caption {
  margin-top: 32px;
  font-size: 12px;
}

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  padding: 28px;
}

.feature-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 13px;
  margin: 0 0 8px;
}

.feature-card p {
  margin: 0;
  font-size: 14px;
}

/* Fees */
.fees-model {
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 12px;
}

/* Token */
.token-desc {
  max-width: 560px;
  margin-bottom: 32px;
}

.ca-pill {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.ca-pill:hover {
  border-color: var(--accent);
}

.copy-hint {
  color: var(--accent);
  font-size: 10px;
}

.distribution {
  margin-top: 48px;
}

.dist-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--dim);
  margin-bottom: 16px;
}

.dist-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  gap: 2px;
  margin-bottom: 16px;
}

.dist-seg {
  flex: 0 0 var(--w);
  background: var(--border);
  font-size: 0;
}

.dist-seg:first-child {
  background: rgba(145, 113, 255, 0.45);
}

.dist-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
}

.btn-wallet {
  padding: 10px 16px;
  font-size: 10px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* Wallet modal */
.wallet-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.wallet-modal[hidden] {
  display: none;
}

.wallet-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.wallet-modal-panel {
  position: relative;
  width: min(100%, 400px);
  padding: 28px;
  z-index: 1;
}

.wallet-modal-tag {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--dim);
  margin: 0 0 8px;
}

.wallet-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}

.wallet-modal-sub {
  font-size: 13px;
  margin: 0 0 24px;
}

.wallet-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.wallet-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s;
}

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

.wallet-option img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: contain;
}

.wallet-option-name {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 500;
}

.wallet-cancel {
  margin-top: 8px;
}

.wallet-install {
  font-size: 11px;
  margin: 0 0 16px;
  line-height: 1.6;
}

.wallet-install a {
  color: var(--accent);
}

.wallet-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  padding: 12px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  max-width: min(90vw, 420px);
  text-align: center;
}

.wallet-toast[hidden] {
  display: none;
}

.wallet-toast.is-error {
  border-color: rgba(255, 92, 92, 0.4);
  color: #ffb4b4;
}

/* Footer */
.site-footer {
  padding: 80px 0 48px;
  border-top: 1px solid var(--border);
}

.footer-wordmark {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(3rem, 12vw, 7rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--border);
  margin: 0 0 32px;
  line-height: 1;
}

.footer-nav {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
}

.footer-nav a:hover {
  color: var(--text);
}

.footer-fine {
  font-size: 10px;
  margin: 8px 0 0;
  max-width: 560px;
}

/* Mobile nav */
@media (max-width: 900px) {
  .nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  .site-header.menu-open .nav {
    display: flex;
  }

  .agent-pill {
    display: none;
  }

  .btn-wallet {
    padding: 8px 12px;
    font-size: 9px;
    max-width: 140px;
  }

  .nav-toggle {
    display: flex;
  }

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

  .hero-visual {
    order: -1;
    max-height: 320px;
    margin-left: 0;
  }

  .marketplace-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-col-grid,
  .feature-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 540px) {
  .marketplace-grid {
    grid-template-columns: 1fr;
  }

  .header-actions .btn-lime {
    padding: 10px 14px;
    font-size: 10px;
  }
}
