:root {
  --bg: #05070c;
  --bg-soft: #090d16;
  --surface: rgba(12, 18, 30, 0.78);
  --surface-strong: rgba(16, 23, 38, 0.94);
  --surface-muted: rgba(255, 255, 255, 0.03);
  --line: rgba(130, 150, 184, 0.16);
  --line-strong: rgba(0, 255, 136, 0.28);
  --text: #f7fafc;
  --muted: #9ba9c1;
  --muted-strong: #c4d0e3;
  --green: #00ff88;
  --cyan: #00d4ff;
  --amber: #ffb800;
  --danger: #ff6b7a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-sans: "Space Grotesk", "Avenir Next", "Trebuchet MS", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.agent-market-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(0, 255, 136, 0.12), transparent 24%),
    radial-gradient(circle at top right, rgba(0, 212, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #05070c 0%, #080b12 50%, #05070c 100%);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

.grid-overlay,
.ambient-glow,
.hero-scanline {
  pointer-events: none;
  position: fixed;
  inset: 0;
}

.grid-overlay {
  background-image:
    linear-gradient(rgba(0, 255, 136, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 136, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.35;
  mask-image: linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent 80%);
}

.ambient-glow {
  filter: blur(90px);
  opacity: 0.38;
}

.ambient-left {
  background: radial-gradient(circle at 20% 20%, rgba(0, 255, 136, 0.24), transparent 34%);
}

.ambient-right {
  background: radial-gradient(circle at 80% 10%, rgba(0, 212, 255, 0.24), transparent 34%);
}

.container {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
}

.market-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(5, 7, 12, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
}

.brand-link,
.nav-links a,
.ghost-action,
.primary-action,
.secondary-action,
.card-link,
.detail-link,
.footer-links a,
.tag-pill,
.filter-button,
.vendor-button,
.tag-button {
  text-decoration: none;
  transition:
    transform 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.28);
  color: var(--green);
  font-family: var(--font-mono);
  font-weight: 700;
}

.brand-copy strong,
.brand-copy small,
.filter-kicker,
.section-subtitle,
.filter-label,
.nav-links a,
.ghost-action,
.primary-action,
.secondary-action,
.compare-table,
.footer-bottom,
.vendor-label,
.terminal-prefix,
.tag-pill,
.filter-button,
.vendor-button,
.tag-button,
.card-status,
.card-footnote,
.metric-label {
  font-family: var(--font-mono);
}

.brand-copy strong {
  display: block;
  font-size: 16px;
}

.brand-copy small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a,
.ghost-action {
  color: var(--muted);
  font-size: 13px;
}

.nav-links a:hover,
.ghost-action:hover,
.footer-links a:hover {
  color: var(--green);
}

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

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.lang-button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition:
    color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.lang-button.active {
  background: rgba(0, 255, 136, 0.12);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 136, 0.28);
}

.lang-button:hover {
  color: var(--text);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.mobile-nav a {
  color: var(--muted-strong);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 13px;
}

.mobile-nav.open {
  display: flex;
}

.hero-section,
.stats-bar,
.agents-section,
.detail-section,
.compare-section,
.market-footer {
  position: relative;
}

.hero-section {
  overflow: hidden;
  padding: 96px 0 68px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.06), transparent 24%),
    linear-gradient(180deg, rgba(5, 7, 12, 0.18), rgba(5, 7, 12, 0.8)),
    linear-gradient(145deg, rgba(0, 255, 136, 0.12), transparent 45%, rgba(0, 212, 255, 0.1));
}

.hero-scanline {
  position: absolute;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 136, 0.015) 2px,
    rgba(0, 255, 136, 0.015) 4px
  );
}

.hero-content {
  position: relative;
  z-index: 1;
}

.terminal-prefix,
.filter-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cursor-dot {
  width: 10px;
  height: 18px;
  background: var(--green);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

.hero-content h1,
.section-header h2,
.detail-header h2,
.empty-state h3,
.selected-head h2 {
  margin: 0;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.hero-content h1 {
  max-width: 760px;
  margin-top: 24px;
  font-size: clamp(46px, 9vw, 88px);
}

.text-neon {
  color: var(--green);
  text-shadow: 0 0 18px rgba(0, 255, 136, 0.32);
}

.hero-copy {
  max-width: 660px;
  margin: 20px 0 0;
  color: var(--muted-strong);
  font-size: 18px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-action,
.secondary-action,
.ghost-action,
.card-link,
.detail-link,
.filter-toggle,
.clear-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid transparent;
  min-height: 44px;
  padding: 0 18px;
  font-size: 13px;
}

.primary-action {
  background: var(--green);
  color: #06110d;
  box-shadow: 0 0 24px rgba(0, 255, 136, 0.2);
}

.secondary-action,
.ghost-action,
.card-link,
.detail-link,
.filter-toggle,
.clear-action {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
  color: var(--text);
}

.primary-action:hover,
.secondary-action:hover,
.ghost-action:hover,
.card-link:hover,
.detail-link:hover,
.brand-link:hover,
.filter-button:hover,
.vendor-button:hover,
.tag-button:hover,
.agent-card:hover {
  transform: translateY(-2px);
}

.vendor-strip {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 48px;
}

.vendor-label {
  color: rgba(155, 169, 193, 0.58);
  font-size: 11px;
  text-transform: uppercase;
}

.vendor-list {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.vendor-item {
  color: rgba(255, 255, 255, 0.3);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.stats-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(12, 18, 30, 0.36);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  padding: 34px 0;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.metric-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 20px;
}

.metric-value {
  display: block;
  font-size: 30px;
  font-weight: 700;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
}

.agents-section,
.detail-section,
.compare-section {
  padding: 72px 0;
}

.section-header,
.detail-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-header h2,
.detail-header h2 {
  font-size: clamp(28px, 5vw, 46px);
}

.section-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.terminal-mark {
  color: var(--green);
}

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

.search-shell {
  display: grid;
  gap: 8px;
}

.search-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.search-shell input {
  min-width: 280px;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
}

.search-shell input::placeholder {
  color: rgba(155, 169, 193, 0.6);
}

.filter-toggle {
  display: none;
}

.agents-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
}

.filter-panel,
.selected-agent,
.compare-shell,
.agent-card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.filter-panel {
  align-self: start;
  position: sticky;
  top: 88px;
  padding: 22px;
}

.filter-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
}

.filter-head h3 {
  margin: 8px 0 0;
  font-size: 20px;
}

.clear-action {
  padding: 0 14px;
}

.filter-group + .filter-group {
  margin-top: 24px;
}

.filter-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}

.filter-stack,
.tag-grid,
.active-filter-bar,
.card-tags,
.selected-tags,
.detail-links,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-button,
.vendor-button,
.tag-button,
.tag-pill {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted-strong);
  font-size: 11px;
}

.filter-button.active,
.vendor-button.active,
.tag-button.active,
.tag-pill {
  border-color: rgba(0, 255, 136, 0.34);
  background: rgba(0, 255, 136, 0.08);
  color: var(--green);
}

.active-filter-bar {
  min-height: 24px;
  margin-bottom: 18px;
}

.agents-main {
  display: grid;
  gap: 22px;
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.agent-card {
  display: grid;
  gap: 18px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.agent-card::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.42), transparent);
  opacity: 0;
  transition: opacity 180ms ease;
}

.agent-card:hover::before,
.agent-card.selected::before {
  opacity: 1;
}

.agent-card.selected {
  border-color: rgba(0, 255, 136, 0.26);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.card-avatar {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  flex-shrink: 0;
}

.card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-title {
  min-width: 0;
}

.card-title h3 {
  margin: 0;
  font-size: 20px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.card-status {
  margin-left: auto;
  color: var(--green);
  font-size: 10px;
  text-transform: uppercase;
}

.card-copy {
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.65;
  min-height: 72px;
}

.card-tags {
  min-height: 34px;
}

.eval-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.eval-pill strong {
  margin-left: auto;
  color: var(--green);
  font-family: var(--font-mono);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.card-pricing strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 18px;
}

.card-footnote {
  color: var(--muted);
  font-size: 11px;
}

.card-link {
  min-height: 40px;
}

.selected-agent,
.compare-shell {
  padding: 24px;
}

.selected-empty,
.empty-state {
  text-align: center;
  padding: 42px 24px;
}

.selected-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 24px;
}

.selected-hero {
  display: grid;
  gap: 20px;
}

.selected-top {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.selected-avatar {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.selected-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.selected-head h2 {
  font-size: clamp(34px, 6vw, 52px);
}

.selected-subhead {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.selected-description {
  color: var(--muted-strong);
  line-height: 1.7;
}

.selected-tags,
.detail-links {
  gap: 10px;
}

.detail-link {
  min-height: 42px;
}

.selected-panels {
  display: grid;
  gap: 16px;
}

.detail-panel {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  padding: 18px;
}

.detail-panel h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.detail-grid {
  display: grid;
  gap: 12px;
}

.detail-grid.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-item {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
}

.detail-item strong,
.compare-table strong {
  display: block;
}

.detail-item strong {
  font-size: 14px;
}

.detail-item span,
.detail-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.compare-table table {
  width: 100%;
  border-collapse: collapse;
}

.compare-table th,
.compare-table td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  font-size: 12px;
}

.compare-table th:first-child,
.compare-table td:first-child {
  text-align: left;
  width: 170px;
  color: var(--muted);
}

.compare-table th {
  color: var(--text);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.compare-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  margin: 0 auto 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.compare-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compare-name {
  display: block;
  color: var(--text);
  font-size: 12px;
}

.compare-vendor {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.bool-yes,
.bool-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 13px;
}

.bool-yes {
  background: rgba(0, 255, 136, 0.1);
  color: var(--green);
}

.bool-no {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(155, 169, 193, 0.54);
}

.market-footer {
  padding: 54px 0 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(6, 9, 14, 0.88);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: 28px;
}

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

.footer-copy {
  max-width: 320px;
  color: var(--muted);
  line-height: 1.7;
}

.market-footer h4 {
  margin: 0 0 14px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-links {
  flex-direction: column;
  align-items: flex-start;
}

.footer-links a {
  color: var(--muted-strong);
  font-size: 14px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(155, 169, 193, 0.76);
  font-size: 11px;
}

.footer-bottom strong {
  color: var(--green);
}

.empty-state {
  border-radius: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 1180px) {
  .agent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selected-shell {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 920px) {
  .nav-links,
  .ghost-action {
    display: none;
  }

  .lang-button {
    padding: 8px 10px;
  }

  .nav-toggle,
  .filter-toggle {
    display: inline-flex;
  }

  .agents-layout {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    display: none;
    position: static;
  }

  .filter-panel.open {
    display: block;
  }

  .stats-grid,
  .agent-grid,
  .detail-grid.two-up {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .container {
    width: min(100% - 24px, 1400px);
  }

  .hero-section,
  .agents-section,
  .detail-section,
  .compare-section {
    padding: 54px 0;
  }

  .section-header,
  .detail-header,
  .section-actions,
  .footer-bottom {
    flex-direction: column;
    align-items: stretch;
  }

  .search-shell input {
    min-width: 0;
    width: 100%;
  }

  .selected-top {
    flex-direction: column;
  }

  .compare-shell,
  .selected-agent,
  .filter-panel {
    padding: 18px;
  }

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