/* cohesive-llm-benchmark static site */

:root {
  --navy: #0B3A5E;
  --navy-2: #1d5887;
  --red: #C0392B;
  --green: #27AE60;
  --amber: #D3681B;
  --grey: #555;
  --light: #EFF2F6;
  --code-bg: #1E1E1E;
  --code-fg: #E6E6E6;
  --border: #d6dce5;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #222; }
body { background: #fafbfc; }
a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  background: var(--navy);
  color: #fff;
  padding: 1.4rem 2rem 1rem;
  border-bottom: 4px solid var(--navy-2);
}
header h1 { margin: 0 0 0.4rem; font-size: 1.6rem; }
header .tagline { color: #cfe2f3; font-size: 1rem; }
header nav { margin-top: 0.8rem; }
header nav a { color: #fff; margin-right: 1.4rem; opacity: 0.9; }
header nav a:hover { opacity: 1; }
header nav a.active { font-weight: 600; border-bottom: 2px solid #fff; padding-bottom: 2px; }
header .github-link { float: right; font-size: 0.9rem; opacity: 0.85; }

main { max-width: 1280px; margin: 0 auto; padding: 1.5rem 2rem 3rem; }
h2 { color: var(--navy); margin-top: 2rem; }
h3 { color: var(--navy-2); margin-top: 1.5rem; }
p, li { line-height: 1.55; }

/* Metric cards */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}
.card .label { font-size: 0.85rem; color: var(--grey); text-transform: uppercase; letter-spacing: 0.05em; }
.card .value { font-size: 1.9rem; font-weight: 700; color: var(--navy); margin: 0.4rem 0 0.2rem; }
.card .sub { font-size: 0.85rem; color: var(--grey); }

/* Tables */
table.bench {
  width: 100%;
  border-collapse: collapse;
  margin: 0.8rem 0;
  background: #fff;
  font-size: 0.9rem;
}
table.bench thead { background: var(--navy); color: #fff; }
table.bench th, table.bench td { padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.bench tr:hover td { background: #f4f6f9; cursor: pointer; }
table.bench code { font-family: ui-monospace, "Consolas", monospace; font-size: 0.85rem; color: #333; }

.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.pill.pass { background: #d4f1de; color: #1e6c3a; }
.pill.fail { background: #f9dbd6; color: #8b2520; }
.pill.warn { background: #fff1c2; color: #856106; }
.pill.muted { background: #e6e6e6; color: #555; }

/* Verdict tags (chips) -- richer signal than PASS/FAIL alone */
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-right: 4px;
  line-height: 1.5;
  vertical-align: middle;
  cursor: help;
}
.tag.literal-match       { background: #d4f1de; color: #1e6c3a; }
.tag.extras-best-practice{ background: #d1e5f8; color: #1f4f8b; }
.tag.extras-irrelevant   { background: #fff1c2; color: #856106; }
.tag.missing-steps       { background: #f9dbd6; color: #8b2520; }
.tag.hallucinated        { background: #f3d6f9; color: #6b228b; }
.tag.upstream-rate-limited { background: #ffe2c2; color: #884d06; }

/* LLM reply collapsible */
details.llm-reply {
  margin-top: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfbfb;
}
details.llm-reply summary {
  cursor: pointer;
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
  color: var(--grey);
  user-select: none;
}
details.llm-reply summary:hover { background: #f3f4f5; }
details.llm-reply[open] summary { border-bottom: 1px solid var(--border); }
details.llm-reply .reply-text {
  padding: 0.6rem 0.8rem;
  font-family: ui-monospace, "Consolas", monospace;
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-word;
  background: #fff;
}
details.llm-reply .turn-trail {
  padding: 0.4rem 0.8rem 0.6rem;
  font-size: 0.78rem;
  color: #666;
  border-top: 1px dashed var(--border);
}
.trail-turn {
  border-left: 3px solid #d1d5db;
  padding: 0.3rem 0.6rem;
  margin: 0.4rem 0;
  background: #fff;
}
.trail-head {
  font-family: ui-monospace, "Consolas", monospace;
  font-size: 0.72rem;
  color: #888;
  margin-bottom: 0.3rem;
}
.trail-user, .trail-llm {
  font-family: ui-monospace, "Consolas", monospace;
  font-size: 0.78rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0.2rem 0;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
}
.trail-user { background: #eef2ff; color: #1e3a8a; }
.trail-llm  { background: #f3f4f6; color: #1f2937; }
.trail-actor { font-weight: 700; opacity: 0.7; margin-right: 4px; }

/* Filter bar */
.filters {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 1rem;
}
.filters label { font-size: 0.85rem; color: var(--grey); }
.filters select, .filters input[type="text"] {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
}
.filters .stat { margin-left: auto; font-size: 0.85rem; color: var(--grey); }

/* Accordion-style inline detail row */
tr.active-row td { background: #eef3fa !important; box-shadow: inset 3px 0 0 var(--navy-2); }
tr.detail-row td { background: #fbfcfd; padding: 0; }
.detail-inline {
  border: 1px solid var(--navy-2);
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: #fff;
  margin: 0 0 0.6rem 0;
}
.detail-inline .detail-header {
  background: var(--navy);
  color: #fff;
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.detail-inline .detail-title { font-weight: 600; font-size: 0.95rem; }
.detail-inline .detail-close {
  background: transparent; border: 1px solid #fff; color: #fff;
  padding: 0.15rem 0.6rem; border-radius: 4px; cursor: pointer;
  font-family: inherit; font-size: 0.82rem;
}
.detail-inline .detail-body { padding: 0.8rem 1rem 1rem; }
.detail-inline .row { margin: 0.5rem 0; }
.detail-inline .row .key { font-weight: 600; color: var(--navy); margin-right: 0.5rem; }
.detail-inline .codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 0.5rem;
}
.detail-inline .codes pre {
  background: var(--code-bg); color: var(--code-fg);
  padding: 0.7rem; border-radius: 6px;
  font-size: 0.8rem; line-height: 1.45;
  margin: 0; overflow-x: auto;
  font-family: ui-monospace, "Consolas", monospace;
  white-space: pre-wrap; word-break: break-word;
}
.detail-inline .codes .label {
  font-size: 0.78rem; color: var(--grey);
  margin-bottom: 0.25rem; text-transform: uppercase; letter-spacing: 0.05em;
}
@media (max-width: 900px) {
  .detail-inline .codes { grid-template-columns: 1fr; }
}

/* Version-pin banner above the explorer */
.meta-banner {
  background: linear-gradient(180deg, #f3f7fb 0%, #fff 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: 6px;
  padding: 0.7rem 1rem;
  margin: 0 0 1rem 0;
  font-size: 0.88rem;
}
.meta-banner .meta-title { font-weight: 600; color: var(--navy); margin-bottom: 0.4rem; }
.meta-banner .meta-time { font-weight: 400; color: var(--grey); font-size: 0.85rem; }
.meta-banner .meta-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.4rem 1.2rem;
}
.meta-banner .meta-key { color: var(--grey); font-weight: 600; margin-right: 0.3rem; }
.meta-banner .meta-notes { font-size: 0.82rem; color: var(--grey); margin-top: 0.3rem; font-style: italic; }

/* Reproduce-on-CLI section in each turn-card */
details.reproduce { margin-top: 0.8rem; border: 1px dashed var(--border); border-radius: 6px; padding: 0; }
details.reproduce summary {
  cursor: pointer;
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
  color: var(--navy);
  background: #f4f6f9;
  border-radius: 6px;
  user-select: none;
}
details.reproduce[open] summary { border-bottom: 1px solid var(--border); border-radius: 6px 6px 0 0; }
details.reproduce .reproduce-body { padding: 0.6rem 0.8rem 0.8rem; }
details.reproduce .reproduce-section { margin: 0.5rem 0; }
details.reproduce .reproduce-label { font-size: 0.78rem; color: var(--grey); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.3rem; }
details.reproduce pre {
  background: var(--code-bg); color: var(--code-fg);
  padding: 0.6rem 0.8rem; border-radius: 5px;
  font-size: 0.79rem; line-height: 1.45;
  margin: 0; overflow-x: auto;
  font-family: ui-monospace, "Consolas", monospace;
  white-space: pre-wrap; word-break: break-word;
}

/* Multi-turn conversation view */
.turn-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  background: #fafbfc;
  margin: 0.7rem 0;
}
.turn-card.turn-current {
  border-color: var(--navy-2);
  box-shadow: 0 0 0 2px rgba(29, 88, 135, 0.15);
  background: #fff;
}
.turn-card .turn-header {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.95rem; margin-bottom: 0.5rem;
}
.turn-card .turn-tag {
  background: var(--navy); color: #fff;
  padding: 1px 8px; border-radius: 4px;
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.turn-card .turn-prompt { flex: 1; font-style: italic; color: #333; }
.turn-card .turn-meta { font-size: 0.85rem; color: var(--grey); margin: 0.3rem 0 0.4rem; }
.turn-card .turn-meta code { font-size: 0.82rem; }
.turn-card .turn-steps { font-size: 0.85rem; color: var(--grey); margin-bottom: 0.6rem; }
.turn-card .turn-steps .key { color: var(--navy); font-weight: 600; }
.turn-card .turn-steps code { font-size: 0.78rem; }
.turn-arrow {
  text-align: center;
  font-size: 1.4rem;
  color: var(--navy-2);
  margin: 0.1rem 0;
  opacity: 0.6;
}
.muted { color: var(--grey); font-size: 0.85rem; }

footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  color: var(--grey);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}
