/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: 'SF Mono', 'Cascadia Code', 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  background: #0f172a; color: #e2e8f0; line-height: 1.6;
  padding: 0; margin: 0;
}
a { color: #60a5fa; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.site-nav {
  position: sticky; top: 0; z-index: 1000;
  background: #0f172a; border-bottom: 1px solid #334155;
  display: flex; align-items: center; padding: 0 1.5rem;
  height: 52px; user-select: none;
}
.site-nav .logo {
  font-size: 1.1rem; font-weight: 700; color: #f1f5f9;
  text-decoration: none; letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 0.5rem;
}
.site-nav .logo:hover { text-decoration: none; color: #60a5fa; }
.site-nav .logo .logo-dot { color: #60a5fa; }
.site-nav .nav-items {
  display: flex; gap: 0; margin-left: 2rem; height: 100%;
}
.site-nav .nav-item {
  position: relative; height: 100%; display: flex; align-items: center;
}
.site-nav .nav-item > a {
  display: flex; align-items: center; height: 100%;
  padding: 0 0.85rem; color: #94a3b8;
  text-decoration: none; font-size: 0.82rem; font-weight: 600;
  border-bottom: 2px solid transparent; transition: color 0.15s;
}
.site-nav .nav-item > a:hover { color: #e2e8f0; text-decoration: none; }
.site-nav .nav-item > a.active {
  color: #60a5fa; border-bottom-color: #60a5fa;
}
.site-nav .dropdown {
  display: none; position: absolute; top: 100%; left: 0;
  background: #1e293b; border: 1px solid #334155; border-radius: 0 0 0.5rem 0.5rem;
  min-width: 220px; padding: 0.4rem 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.site-nav .nav-item:hover .dropdown { display: block; }
.site-nav .dropdown a {
  display: block; padding: 0.45rem 1rem; color: #94a3b8;
  font-size: 0.8rem; text-decoration: none;
}
.site-nav .dropdown a:hover { background: #334155; color: #e2e8f0; }
.site-nav .dropdown .sep {
  height: 1px; background: #334155; margin: 0.3rem 0;
}

/* ── Page shell ───────────────────────────────────────────────────────────── */
.page-body {
  max-width: 1400px; margin: 0 auto; padding: 0.75rem 1.5rem;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: #1e293b; border: 1px solid #334155; border-radius: 0.75rem;
  padding: 1.5rem; margin-bottom: 1.5rem;
}
.card-header {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid #334155;
}
.card-header h2 {
  font-size: 1.15rem; color: #f1f5f9; margin: 0; padding: 0; border: none; flex: 1;
}
.card h2 {
  font-size: 1.15rem; color: #f1f5f9; margin-bottom: 1rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid #334155;
}

/* ── Tables ────────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid #1e293b; }
th {
  background: #0f172a; color: #94a3b8; font-weight: 600; text-transform: uppercase;
  font-size: 0.75rem; letter-spacing: 0.05em; position: sticky; top: 0; cursor: pointer;
  user-select: none;
}
th:hover { color: #e2e8f0; }
th .sort-arrow { margin-left: 0.3em; font-size: 0.65rem; }
tr:hover td { background: #1e293b; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Status badges ─────────────────────────────────────────────────────────── */
.pass { color: #34d399; font-weight: 600; }
.fail { color: #f87171; font-weight: 600; }
.mixed { color: #fbbf24; font-weight: 600; }
.pct-high { color: #34d399; }
.pct-mid  { color: #fbbf24; }
.pct-low  { color: #f87171; }

/* ── Loading / error ───────────────────────────────────────────────────────── */
.loading-msg {
  text-align: center; padding: 4rem; color: #94a3b8; font-size: 1.1rem;
}
.spinner {
  display: inline-block; width: 24px; height: 24px;
  border: 3px solid #334155; border-top-color: #60a5fa;
  border-radius: 50%; animation: spin 0.8s linear infinite;
  vertical-align: middle; margin-right: 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.hero {
  text-align: center; padding: 3rem 1rem 2rem;
}
.hero h1 { font-size: 2.4rem; color: #f1f5f9; font-weight: 700; margin-bottom: 0.5rem; }
.hero h1 .accent { color: #60a5fa; }
.hero .tagline { color: #94a3b8; font-size: 1rem; max-width: 600px; margin: 0 auto; }

/* ── Feature grid ─────────────────────────────────────────────────────────── */
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem; margin: 2rem 0;
}
.feature-card {
  background: #1e293b; border: 1px solid #334155; border-radius: 0.75rem;
  padding: 1.5rem; text-decoration: none; color: inherit;
  transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover {
  border-color: #60a5fa; transform: translateY(-2px); text-decoration: none;
}
.feature-card h3 { color: #f1f5f9; font-size: 1.05rem; margin-bottom: 0.5rem; }
.feature-card p { color: #94a3b8; font-size: 0.85rem; }
.feature-card .stat {
  margin-top: 1rem; font-size: 1.8rem; font-weight: 700; color: #60a5fa;
}

/* ── Section headers ──────────────────────────────────────────────────────── */
.section-header {
  margin: 0.25rem 0 1rem; padding-bottom: 0.5rem;
  border-bottom: 1px solid #334155;
}
.section-header h2 { font-size: 1.3rem; color: #f1f5f9; }
.section-header p { color: #94a3b8; font-size: 0.85rem; margin-top: 0.3rem; }

/* ── Content prose ────────────────────────────────────────────────────────── */
.prose { max-width: 800px; }
.prose p { color: #cbd5e1; margin-bottom: 1rem; font-size: 0.9rem; }
.prose h3 { color: #f1f5f9; margin: 1.5rem 0 0.5rem; font-size: 1.05rem; }
.prose ul { margin: 0.5rem 0 1rem 1.5rem; color: #cbd5e1; font-size: 0.9rem; }
.prose li { margin-bottom: 0.3rem; }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 0; border-bottom: 1px solid #334155; margin-bottom: 1.5rem;
}
.tab {
  padding: 0.6rem 1.2rem; color: #94a3b8; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; border-bottom: 2px solid transparent;
  background: none; border-top: none; border-left: none; border-right: none;
  font-family: inherit;
}
.tab:hover { color: #e2e8f0; }
.tab.active { color: #60a5fa; border-bottom-color: #60a5fa; }

/* ── Preview grid (prompt tests) ──────────────────────────────────────────── */
.preview-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.preview-card {
  background: #1e293b; border: 1px solid #334155; border-radius: 0.75rem;
  overflow: hidden; transition: border-color 0.2s;
}
.preview-card:hover { border-color: #60a5fa; }
.preview-card .preview-frame {
  width: 100%; height: 200px; position: relative; overflow: hidden;
  background: #fff; border-bottom: 1px solid #334155;
}
.preview-card .preview-frame iframe {
  width: 400%; height: 400%; border: none;
  transform: scale(0.25); transform-origin: top left;
  pointer-events: none;
}
.preview-card .preview-frame img {
  width: 100%; height: 100%; object-fit: cover; object-position: top left;
  pointer-events: none;
}
.preview-card .preview-info {
  padding: 0.75rem 1rem; display: flex; align-items: center; justify-content: space-between;
}
.preview-card .preview-name {
  color: #e2e8f0; font-size: 0.82rem; font-weight: 600;
}
.preview-card .preview-link {
  color: #60a5fa; font-size: 0.75rem; font-weight: 600;
}

/* ── Preview lightbox ─────────────────────────────────────────────────────── */
.lightbox-backdrop {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0); transition: background 0.35s ease;
}
.lightbox-backdrop.open { background: rgba(0,0,0,0.85); }

.lightbox-container {
  position: fixed; z-index: 2001;
  border-radius: 0.75rem; overflow: hidden;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column;
}
.lightbox-container.open {
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}

.lightbox-bar {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 0.75rem; background: #1e293b; border-bottom: 1px solid #334155;
  flex-shrink: 0; opacity: 0; transition: opacity 0.25s ease 0.2s;
}
.lightbox-container.open .lightbox-bar { opacity: 1; }
.lightbox-bar .lb-title { color: #e2e8f0; font-size: 0.8rem; font-weight: 600; flex: 1; }
.lightbox-bar .lb-model { color: #64748b; font-size: 0.72rem; }
.lightbox-bar a {
  color: #60a5fa; font-size: 0.75rem; font-weight: 600; text-decoration: none;
  padding: 0.2rem 0.5rem; border-radius: 0.25rem;
}
.lightbox-bar a:hover { background: #334155; text-decoration: none; }
.lightbox-bar .lb-close {
  color: #94a3b8; font-size: 1.1rem; cursor: pointer; background: none;
  border: none; padding: 0.1rem 0.4rem; border-radius: 0.25rem; line-height: 1;
  font-family: inherit;
}
.lightbox-bar .lb-close:hover { color: #f1f5f9; background: #334155; }

.lightbox-frame {
  flex: 1; background: #fff; overflow: hidden;
}
.lightbox-frame iframe {
  width: 100%; height: 100%; border: none;
  transform-origin: top left;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── News items ───────────────────────────────────────────────────────────── */
.news-item {
  background: #1e293b; border: 1px solid #334155; border-radius: 0.75rem;
  padding: 1.25rem 1.5rem; margin-bottom: 1rem;
}
.news-item time { color: #64748b; font-size: 0.78rem; }
.news-item h3 { color: #f1f5f9; font-size: 1rem; margin: 0.3rem 0 0.5rem; }
.news-item p { color: #94a3b8; font-size: 0.85rem; }

/* ── Model detail page ────────────────────────────────────────────────────── */
.model-page-header {
  padding: 1rem 0 0.75rem; margin-bottom: 1.25rem;
}
.model-page-breadcrumb {
  font-size: 0.8rem; color: #64748b; margin-bottom: 0.4rem;
}
.model-page-breadcrumb a { color: #64748b; }
.model-page-breadcrumb a:hover { color: #94a3b8; }
.model-page-breadcrumb span { color: #94a3b8; }
.model-page-title-row {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.5rem 1rem;
}
.model-page-title-row h1 {
  font-size: 1.5rem; color: #f1f5f9; font-weight: 700; margin: 0;
  word-break: break-word;
}
.model-page-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }
.model-tag {
  background: #334155; color: #94a3b8; font-size: 0.75rem; font-weight: 600;
  padding: 0.2rem 0.6rem; border-radius: 0.3rem;
}
.model-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem; margin-bottom: 1.5rem;
}
.model-stat-card {
  background: #1e293b; border: 1px solid #334155; border-radius: 0.75rem;
  padding: 1rem 1.25rem; display: flex; flex-direction: column; align-items: center;
  text-align: center; min-height: 0;
}
.model-stat-card.score-card {
  grid-row: span 1; padding: 1rem;
}
.model-stat-label {
  color: #64748b; font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 0.25rem;
}
.model-stat-value {
  font-size: 1.4rem; font-weight: 700; color: #f1f5f9; line-height: 1.2;
}
.model-stat-sub { color: #64748b; font-size: 0.7rem; margin-top: 0.2rem; }
/* Score ring */
.score-ring { margin-bottom: 0.35rem; }
.score-ring .ring-bg { fill: none; stroke: #334155; }
.score-ring .ring-fg { fill: none; stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
.score-ring .ring-text { font-weight: 700; fill: #f1f5f9; }
.score-ring .ring-pct { font-weight: 600; fill: #64748b; font-size: 8px; }
/* Passed bar */
.passed-bar { width: 100%; height: 6px; background: #334155; border-radius: 3px; margin-top: 0.5rem; overflow: hidden; }
.passed-bar-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; }
.model-meta-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem 1.5rem; font-size: 0.82rem;
}
.model-meta-grid .label { color: #64748b; }
.model-meta-grid .value { color: #e2e8f0; font-weight: 600; }
.failed-item { background: #1a1020; border-left: 3px solid #f87171; padding: 0.5rem 0.75rem; margin-bottom: 0.5rem; border-radius: 0 0.25rem 0.25rem 0; font-size: 0.8rem; }
.failed-item .fi-id { color: #f87171; font-weight: 600; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .page-body { padding: 0.75rem; }
  .hero h1 { font-size: 1.6rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .preview-grid { grid-template-columns: 1fr; }
  .site-nav { padding: 0 0.75rem; }
  .site-nav .nav-items { gap: 0; margin-left: 1rem; overflow-x: auto; }
}
