/* ═══════════════════════════════════════════════════════════
   ChainAgent — "Precision Terminal" Aesthetic
   Fonts: Bricolage Grotesque / Plus Jakarta Sans / JetBrains Mono
   Palette: obsidian #08080f + emerald #34d399 + amber #fbbf24
   ═══════════════════════════════════════════════════════════ */

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

:root {
  --bg: #08080f;
  --bg2: #0e0e18;
  --bg3: #14141f;
  --surface: #1a1a28;
  --surface2: #222233;
  --border: #1e1e2e;
  --border-h: #2e2e44;

  --text: #e0e0ef;
  --text2: #8888a0;
  --text3: #555566;

  --accent: #34d399;
  --accent-d: rgba(52, 211, 153, .08);
  --accent-g: rgba(52, 211, 153, .2);

  --amber: #fbbf24;
  --red: #f87171;
  --green: #4ade80;

  --ff: 'Plus Jakarta Sans', sans-serif;
  --ffd: 'Bricolage Grotesque', sans-serif;
  --ffm: 'JetBrains Mono', monospace;

  --r: 10px;
  --r-sm: 6px;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff);
  font-size: 15px;
  line-height: 1.55;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .2s
}

a:hover {
  color: #fff
}

code {
  font-family: var(--ffm);
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: .82em;
  color: var(--accent)
}

/* ── Top Bar ─────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 8, 15, .85);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0 28px;
  height: 52px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--ffd);
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  flex-shrink: 0;
}

.logo svg {
  color: var(--accent)
}

.logo-eth {
  color: var(--accent);
  font-weight: 800
}

.topnav {
  display: flex;
  gap: 4px;
  margin-left: 24px
}

.topnav-link {
  padding: 6px 14px;
  border-radius: var(--r-sm);
  font-size: .82rem;
  font-weight: 500;
  color: var(--text2);
  transition: all .15s;
}

.topnav-link:hover {
  color: #fff;
  background: var(--surface)
}

.topnav-link.active {
  color: var(--accent);
  background: var(--accent-d)
}

.topbar-right {
  margin-left: auto
}

.net-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ffm);
  font-size: .72rem;
  font-weight: 500;
  color: var(--text2);
  background: var(--bg3);
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
}

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

@keyframes pulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .4
  }
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  position: relative;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -160px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-g) 0%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
}

.hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 28px 40px;
  display: flex;
  align-items: center;
  gap: 48px;
  position: relative;
  z-index: 1;
}

.hero-text {
  flex: 1;
  min-width: 0
}

.hero-tag {
  display: inline-block;
  font-family: var(--ffm);
  font-size: .7rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-d);
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid rgba(52, 211, 153, .15);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero h1 {
  font-family: var(--ffd);
  font-weight: 800;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -.02em;
  color: #fff;
  margin-bottom: 14px;
}

.hero-em {
  background: linear-gradient(135deg, var(--accent), var(--amber));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-p {
  color: var(--text2);
  font-size: .95rem;
  max-width: 440px;
  line-height: 1.6
}

/* Stats */
.stats-row {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px 28px;
  flex-shrink: 0;
}

.stat {
  text-align: center;
  padding: 0 20px
}

.stat-val {
  display: block;
  font-family: var(--ffd);
  font-weight: 800;
  font-size: 1.5rem;
  color: #fff;
  line-height: 1.2;
}

.stat-label {
  font-family: var(--ffm);
  font-size: .65rem;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.stat-sep {
  width: 1px;
  height: 36px;
  background: var(--border)
}

/* ── Panels ──────────────────────────────────────────────── */
.panel {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 28px;
}

.panel-alt {
  background: var(--bg2);
  max-width: 100%;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.panel-alt>* {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.panel h2 {
  font-family: var(--ffd);
  font-weight: 800;
  font-size: 1.4rem;
  color: #fff;
  letter-spacing: -.01em;
}

.panel-sub {
  color: var(--text2);
  font-size: .85rem;
  margin-top: 3px
}

/* ── Search ──────────────────────────────────────────────── */
.search-input {
  padding: 8px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  font-family: var(--ff);
  font-size: .85rem;
  outline: none;
  min-width: 260px;
  transition: .2s;
}

.search-input:focus {
  border-color: var(--accent)
}

/* ── Proxy Cards ─────────────────────────────────────────── */
.proxy-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}

.proxy-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  position: relative;
  transition: all .2s;
  overflow: hidden;
}

.proxy-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--amber));
  opacity: 0;
  transition: .2s;
}

.proxy-card:hover {
  border-color: var(--border-h);
  transform: translateY(-2px)
}

.proxy-card:hover::before {
  opacity: 1
}

.pc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px
}

.pc-ens {
  font-family: var(--ffm);
  font-size: .82rem;
  color: var(--accent);
  font-weight: 500
}

.pc-badge {
  font-family: var(--ffm);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
}

.pc-badge-on {
  color: var(--green);
  background: rgba(74, 222, 128, .08);
  border: 1px solid rgba(74, 222, 128, .15)
}

.pc-badge-off {
  color: var(--red);
  background: rgba(248, 113, 113, .08);
  border: 1px solid rgba(248, 113, 113, .15)
}

.pc-desc {
  font-size: .82rem;
  color: var(--text2);
  line-height: 1.45;
  margin-bottom: 12px
}

.pc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px
}

.pc-tag {
  font-family: var(--ffm);
  font-size: .66rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text2);
  transition: .15s;
}

.pc-tag:hover {
  border-color: var(--accent);
  color: var(--accent)
}

.pc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: .76rem;
  color: var(--text3);
}

.pc-price {
  font-family: var(--ffm);
  color: var(--accent);
  font-weight: 600
}

.pc-earned {
  font-family: var(--ffm)
}

/* Skeleton */
.skel {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  height: 190px;
  animation: sk 1.5s ease-in-out infinite
}

@keyframes sk {

  0%,
  100% {
    opacity: .35
  }

  50% {
    opacity: .12
  }
}

/* ── Cards (shared) ──────────────────────────────────────── */
.card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
}

.card-label {
  font-family: var(--ffm);
  font-size: .72rem;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 16px;
}

.card-label-warn {
  color: var(--amber)
}

.card-label-ok {
  color: var(--green)
}

.card-label-err {
  color: var(--red)
}

/* ── Fields ──────────────────────────────────────────────── */
.field {
  margin-bottom: 12px
}

.field label {
  display: block;
  font-size: .76rem;
  color: var(--text2);
  margin-bottom: 4px;
  font-weight: 500
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--ff);
  font-size: .85rem;
  outline: none;
  transition: .2s;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent)
}

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

.field-row:has(> :nth-child(3)) {
  grid-template-columns: 1fr 1fr 1fr
}

.form-msg {
  margin-top: 10px;
  font-size: .8rem;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  display: none
}

.form-msg.success {
  display: block;
  background: rgba(74, 222, 128, .08);
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, .15)
}

.form-msg.error {
  display: block;
  background: rgba(248, 113, 113, .08);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, .15)
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 24px;
  border-radius: var(--r-sm);
  font-family: var(--ff);
  font-weight: 600;
  font-size: .85rem;
  border: none;
  cursor: pointer;
  transition: all .2s;
}

.btn-accent {
  color: #000;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-g);
}

.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 28px var(--accent-g);
  color: #000
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none
}

/* ── Try Grid ────────────────────────────────────────────── */
.try-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px
}

.try-response-area {
  min-height: 260px;
  display: flex;
  flex-direction: column
}

.try-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text3);
  font-size: .85rem;
  text-align: center;
}

.hint {
  font-size: .8rem;
  color: var(--text2);
  margin: 10px 0
}

.codeblock {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px;
  font-family: var(--ffm);
  font-size: .72rem;
  color: var(--text2);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 240px;
  overflow: auto;
  line-height: 1.5;
}

.codeblock-err {
  border-color: rgba(248, 113, 113, .25);
  color: var(--red)
}

/* AI Response display */
.ai-text {
  font-size: .92rem;
  line-height: 1.65;
  color: var(--text);
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 10px;
  white-space: pre-wrap;
  max-height: 320px;
  overflow: auto;
}

.ai-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: .72rem;
  color: var(--text3);
  margin-bottom: 8px;
}

.ai-meta strong {
  color: var(--accent);
  font-family: var(--ffm)
}

.ai-raw {
  margin-top: 6px
}

.ai-raw summary {
  font-family: var(--ffm);
  font-size: .72rem;
  color: var(--text3);
  cursor: pointer
}

.ai-raw summary:hover {
  color: var(--accent)
}

.ai-raw .codeblock {
  margin-top: 6px;
  max-height: 140px
}

/* ── Sell Grid ───────────────────────────────────────────── */
.sell-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px
}

/* ── Flow Row (How it works) ─────────────────────────────── */
.flow-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 8px;
}

.flow-step {
  flex: 1;
  min-width: 140px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  transition: all .2s;
}

.flow-step:hover {
  border-color: var(--border-h);
  transform: translateY(-2px)
}

.flow-n {
  font-family: var(--ffd);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 8px;
  line-height: 1;
}

.flow-step h4 {
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 5px
}

.flow-step p {
  font-size: .78rem;
  color: var(--text2);
  line-height: 1.45
}

.flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text3);
  padding: 0 6px;
  flex-shrink: 0;
  margin-top: 40px;
}

/* ── Spinner ─────────────────────────────────────────────── */
.spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: sp .45s linear infinite;
  vertical-align: middle;
  margin-right: 5px;
}

@keyframes sp {
  to {
    transform: rotate(360deg)
  }
}

/* ── Footer ──────────────────────────────────────────────── */
.foot {
  border-top: 1px solid var(--border);
  padding: 24px 28px
}

.foot-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-size: .76rem;
  color: var(--text3);
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px)
  }

  to {
    opacity: 1;
    transform: none
  }
}

.panel {
  animation: fadeIn .4s ease both
}

.panel:nth-child(2) {
  animation-delay: .05s
}

.panel:nth-child(3) {
  animation-delay: .1s
}

.panel:nth-child(4) {
  animation-delay: .15s
}

/* ── Responsive ──────────────────────────────────────────── */
@media(max-width:900px) {
  .topbar-inner {
    padding: 0 16px
  }

  .topnav {
    display: none
  }

  .hero-inner {
    flex-direction: column;
    padding: 36px 16px 28px;
    gap: 20px
  }

  .stats-row {
    width: 100%
  }

  .panel,
  .panel-alt {
    padding: 32px 16px
  }

  .proxy-list {
    grid-template-columns: 1fr
  }

  .try-grid {
    grid-template-columns: 1fr
  }

  .sell-grid {
    grid-template-columns: 1fr
  }

  .flow-row {
    flex-wrap: nowrap;
    overflow-x: auto
  }

  .flow-arrow {
    display: none
  }

  .search-input {
    min-width: 100%
  }
}

@media(max-width:500px) {
  .hero h1 {
    font-size: 1.6rem
  }

  .stats-row {
    flex-direction: column;
    gap: 12px;
    padding: 16px
  }

  .stat-sep {
    width: 100%;
    height: 1px
  }
}