/* ─────────────────────────────────────────────────────────────────────────────
   DNA Model Benchmarking Demo — styles
   Research/scientific aesthetic: dark navy + amber accents + monospace seqs
───────────────────────────────────────────────────────────────────────────── */

:root {
  --bg: #0b0f1a;
  --surface: #111827;
  --surface-2: #1a2235;
  --border: #1f2d42;
  --text: #e8edf5;
  --text-muted: #8896aa;
  --accent: #00d4aa;
  --accent-dim: #00a884;
  --amber: #f59e0b;
  --font: 'DM Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Header ── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-header .logo {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent);
  text-decoration: none;
}
.site-header .logo span { color: var(--text-muted); font-weight: 400; }
.site-header nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  margin-left: 1.5rem;
  transition: color 0.2s;
}
.site-header nav a:hover { color: var(--text); }

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 3rem 2rem 2rem;
  border-bottom: 1px solid var(--border);
}
.hero .badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.2rem 0.8rem;
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 580px;
  margin: 0 auto 1.5rem;
}
.hero .meta-row {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero .meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.hero .meta-item svg { color: var(--accent); flex-shrink: 0; }

/* ── Main layout ── */
.demo-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0;
  min-height: calc(100vh - 220px);
}

/* ── Sidebar ── */
.sidebar {
  border-right: 1px solid var(--border);
  padding: 1.5rem;
  background: var(--surface);
  overflow-y: auto;
}

.sidebar h2 {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ── Form controls ── */
.field {
  margin-bottom: 1.25rem;
}
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.field label .hint {
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 0.4rem;
}
.field .form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  line-height: 1.4;
}

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  padding: 0.55rem 0.75rem;
  transition: border-color 0.2s;
  outline: none;
}
input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
}
textarea {
  resize: vertical;
  min-height: 120px;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.5;
  letter-spacing: 0.03em;
}
textarea.seq-input {
  min-height: 160px;
  background: var(--bg);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238896aa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  cursor: pointer;
}

/* Range slider */
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}
.range-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}
.range-row .val {
  font-family: var(--mono);
  color: var(--accent);
  font-weight: 600;
}

/* Model selection */
.model-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 0.6rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.model-card input[type="checkbox"] {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  accent-color: var(--accent);
  cursor: pointer;
  transform: scale(1.1);
}
.model-card:hover { border-color: var(--accent-dim); background: var(--surface-2); }
.model-card.selected { border-color: var(--accent); background: rgba(0,212,170,0.06); }
.model-card .card-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.model-card .card-size {
  font-size: 0.72rem;
  color: var(--accent);
  background: rgba(0,212,170,0.12);
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  font-weight: 600;
}
.model-card .card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Run button */
.btn-run {
  width: 100%;
  background: var(--accent);
  color: #0b0f1a;
  border: none;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.03em;
  margin-top: 0.5rem;
}
.btn-run:hover { background: var(--accent-dim); }
.btn-run:active { transform: scale(0.99); }
.btn-run:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Results pane ── */
.results-pane {
  padding: 1.5rem 2rem;
  overflow-y: auto;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state svg { margin-bottom: 1rem; opacity: 0.4; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }
.empty-state p { font-size: 0.85rem; }

/* ── Result cards ── */
.result-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  gap: 1.25rem;
}
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.result-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.result-card-header .model-name {
  font-weight: 700;
  font-size: 0.9rem;
}
.result-card-header .model-badge {
  font-size: 0.72rem;
  color: var(--accent);
  background: rgba(0,212,170,0.12);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-weight: 600;
}
.result-card-body { padding: 1rem 1.1rem; }

.seq-block { margin-bottom: 0.9rem; }
.seq-block-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.seq-display {
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.7;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  word-break: break-all;
  color: var(--text-muted);
  max-height: 160px;
  overflow-y: auto;
}
.seq-display .seq-gen {
  color: var(--accent);
}
.seq-display .seq-input-len { color: var(--amber); }

.seq-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}
.stat-pill {
  font-size: 0.78rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  color: var(--text-muted);
}
.stat-pill strong { color: var(--text); font-weight: 700; }

.card-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.btn-copy, .btn-download {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.2s, border-color 0.2s;
}
.btn-copy:hover, .btn-download:hover { color: var(--text); border-color: var(--accent); }
.btn-copy.copied { color: var(--accent); border-color: var(--accent); }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(0,212,170,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 0.4rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Error banner */
.error-banner {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  color: #fca5a5;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.error-banner .err-title { font-weight: 700; margin-bottom: 0.25rem; }

/* Error on card */
.card-error {
  color: #fca5a5;
  font-size: 0.85rem;
  padding: 0.75rem;
  background: rgba(239,68,68,0.08);
  border-radius: 8px;
}

/* ── Loading overlay ── */
.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
}
.loading-overlay .spinner {
  width: 32px; height: 32px;
  border-width: 3px;
  margin-bottom: 1rem;
}
.loading-overlay p { font-size: 0.85rem; }

/* ── Tooltip ── */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.75rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  max-width: 220px;
  white-space: normal;
  text-align: left;
}

/* ── Comparison table (multi-model) ── */
.compare-table-wrap {
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.compare-table th {
  background: var(--surface-2);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.compare-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(31,45,66,0.4);
  color: var(--text-muted);
  vertical-align: middle;
}
.compare-table tr:last-child td { border-bottom: none; }
.compare-table tr:hover td { background: var(--surface-2); }
.ct-model {
  font-weight: 700;
  color: var(--text);
  margin-right: 0.4rem;
}
.ct-size {
  font-size: 0.72rem;
  color: var(--accent);
  background: rgba(0,212,170,0.1);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
}
.ct-mono {
  font-family: var(--mono);
  font-size: 0.8rem;
}

/* ── Comparison toggle ── */
.compare-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1.25rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.compare-bar .compare-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.toggle-btn.active { color: var(--accent); border-color: var(--accent); }
.toggle-btn input { accent-color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .demo-layout { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border); }
  .result-cards { grid-template-columns: 1fr; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Benchmark reference ── */
.bench-section {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.bench-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}
.bench-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}
.bench-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.25rem 0;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.bench-table td {
  padding: 0.35rem 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.bench-table tr:not(:last-child) td {
  border-bottom: 1px solid rgba(31,45,66,0.5);
}
.bench-val {
  font-family: var(--mono);
  color: var(--accent) !important;
  font-weight: 600;
  text-align: right;
}
.bench-footnote {
  margin-top: 0.65rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.6;
}
.bench-footnote a {
  color: var(--accent-dim);
  text-decoration: none;
}
.bench-footnote a:hover { text-decoration: underline; }