/* ============================================================
   VECTOR DB SHOWDOWN — STYLES
   Palette: Brutalist Concrete  (#D9D4CE / #A39E93 / #3C3C3C / #FF4500)
   Fonts: Syne (display) + Space Mono (body/code)
   ============================================================ */

:root {
  --bg:        #1a1a1a;
  --surface:   #242424;
  --surface2:  #2e2e2e;
  --border:    #3c3c3c;
  --muted:     #a39e93;
  --text:      #d9d4ce;
  --text-dim:  #7a7570;
  --accent:    #ff4500;
  --accent2:   #ff6a33;
  --white:     #f0ece6;

  /* DB brand colours */
  --chroma:    #e8a838;
  --qdrant:    #dc3545;
  --weaviate:  #3ecf8e;
  --milvus:    #00b4d8;
  --pgvector:  #8b5cf6;

  --font-display: 'Syne', sans-serif;
  --font-mono:    'Space Mono', monospace;

  --radius: 2px;
  --transition: 0.18s ease;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── NOISE OVERLAY ── */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ── HEADER ── */
header {
  position: relative;
  padding: 80px 40px 60px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.header-inner {
  position: relative;
  z-index: 2;
  max-width: 900px;
}

.header-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 20px;
  display: inline-block;
  border: 1px solid var(--accent);
  padding: 4px 10px;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(52px, 8vw, 96px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--white);
  margin-bottom: 24px;
}

h1 .accent {
  color: var(--accent);
  display: block;
}

.header-sub {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 32px;
}

.db-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border: 1px solid;
  text-transform: uppercase;
}

.pill-chroma   { color: var(--chroma);   border-color: var(--chroma); }
.pill-qdrant   { color: var(--qdrant);   border-color: var(--qdrant); }
.pill-weaviate { color: var(--weaviate); border-color: var(--weaviate); }
.pill-milvus   { color: var(--milvus);   border-color: var(--milvus); }
.pill-pgvector { color: var(--pgvector); border-color: var(--pgvector); }

/* Grid lines decoration */
.header-grid-lines {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.25;
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.6) 40%, transparent 100%);
}

/* ── MAIN ── */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px 80px;
}

/* ── STATS STRIP ── */
.stats-strip {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 60px;
  flex-wrap: wrap;
  gap: 0;
}

.stat-item {
  display: flex;
  flex-direction: column;
  padding: 0 40px 0 0;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 4px;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  margin-right: 40px;
}

/* ── SECTION HEADERS ── */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
}

.section-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

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

/* ── TABLE SECTION ── */
.table-section {
  margin-bottom: 72px;
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
}

thead tr {
  background: var(--surface2);
  border-bottom: 2px solid var(--accent);
}

th {
  padding: 14px 16px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  user-select: none;
}

th.sortable {
  cursor: pointer;
  transition: color var(--transition);
}

th.sortable:hover {
  color: var(--accent);
}

th.sort-asc .sort-icon::after  { content: ' ↑'; color: var(--accent); }
th.sort-desc .sort-icon::after { content: ' ↓'; color: var(--accent); }

.sort-icon {
  color: var(--text-dim);
  font-size: 10px;
  margin-left: 4px;
}

th.sort-asc .sort-icon,
th.sort-desc .sort-icon {
  color: var(--accent);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover {
  background: var(--surface);
}

td {
  padding: 14px 16px;
  vertical-align: top;
  color: var(--text);
  line-height: 1.5;
}

/* DB name cell */
.td-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.td-name a {
  text-decoration: none;
  transition: color var(--transition);
}

.td-name a:hover { opacity: 0.8; }

.name-chroma   .td-name a { color: var(--chroma); }
.name-qdrant   .td-name a { color: var(--qdrant); }
.name-weaviate .td-name a { color: var(--weaviate); }
.name-milvus   .td-name a { color: var(--milvus); }
.name-pgvector .td-name a { color: var(--pgvector); }

/* Licence badge */
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-apache { border-color: #3ecf8e33; color: #3ecf8e; }
.badge-pg     { border-color: #8b5cf633; color: #8b5cf6; }
.badge-bsd    { border-color: #00b4d833; color: #00b4d8; }

/* Tag chips for index types */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

/* Stars cell */
.td-stars {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

.stars-bar-wrap {
  margin-top: 5px;
  height: 3px;
  background: var(--border);
  width: 100%;
  max-width: 100px;
}

.stars-bar {
  height: 3px;
  background: var(--accent);
  transition: width 0.6s ease;
}

/* Filtering cell */
.filter-level {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.filter-dots {
  display: flex;
  gap: 3px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
}

.dot.on { background: var(--accent); }

.filter-label {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

/* ── CHART SECTION ── */
.chart-section {
  margin-bottom: 72px;
}

.chart-container {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 32px;
  position: relative;
  height: 320px;
}

/* ── VERDICT SECTION ── */
.verdict-section {
  margin-bottom: 40px;
}

.verdict-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.verdict-card {
  background: var(--surface);
  padding: 24px 20px;
  transition: background var(--transition);
}

.verdict-card:hover {
  background: var(--surface2);
}

.verdict-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.verdict-db {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.verdict-chroma   { color: var(--chroma); }
.verdict-qdrant   { color: var(--qdrant); }
.verdict-weaviate { color: var(--weaviate); }
.verdict-milvus   { color: var(--milvus); }
.verdict-pgvector { color: var(--pgvector); }

.verdict-card p {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 40px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.footer-sep {
  color: var(--border);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  header { padding: 48px 20px 40px; }
  main   { padding: 0 20px 60px; }
  footer { padding: 20px; }

  h1 { font-size: 48px; }

  .stats-strip {
    gap: 24px;
  }

  .stat-divider { display: none; }
  .stat-item { padding: 0; }

  .chart-container { height: 240px; padding: 16px; }

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

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

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

header        { animation: fadeUp 0.5s ease both; }
.stats-strip  { animation: fadeUp 0.5s 0.1s ease both; }
.table-section{ animation: fadeUp 0.5s 0.2s ease both; }
.chart-section{ animation: fadeUp 0.5s 0.3s ease both; }
.verdict-section { animation: fadeUp 0.5s 0.4s ease both; }