/* ===== Evals page ===== */

.evals-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8rem 2rem 6rem;
}

.evals-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1.2rem;
}

.evals-hero .hero-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.evals-intro {
  max-width: 620px;
  color: var(--text-secondary);
  margin-bottom: 3.5rem;
}

.nav-current {
  color: #000000;
  font-weight: 500;
}

/* ===== Layout: sidebar + card ===== */

.evals-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.bench-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: sticky;
  top: 6rem;
}

.bench-item {
  font-family: var(--mono);
  font-size: 0.82rem;
  text-align: left;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.bench-item:hover { border-color: #bbbbbb; }

.bench-item.active {
  border-color: #1a1a1a;
  color: var(--text);
  font-weight: 500;
}

.bench-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  flex-shrink: 0;
}

.bench-item.active .dot {
  background: var(--text);
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

.bench-item .bench-item-q {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: inherit;
  opacity: 0.65;
  font-weight: 300;
  margin-top: 0.15rem;
}

/* ===== Bench card ===== */

.evals-layout > * { min-width: 0; }

.bench-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.8rem 1.8rem 1.4rem;
  min-height: 480px;
}

.bench-loading {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 4rem 0;
  text-align: center;
}

.bench-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.bench-title-block h2 {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.bench-question {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.bench-source {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
  display: block;
}

.bench-source a { color: var(--text-secondary); border-bottom: 1px dotted #bbb; }

/* metric / game toggle */
.metric-toggle {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.metric-toggle button {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}

/* Selected state matches the sidebar card and the model picker: outline, not fill. */
.metric-toggle button.active {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: #1a1a1a;
  font-weight: 500;
  box-shadow: 0 0 0 2.5px rgba(26, 26, 26, 0.07);
}

.metric-toggle button:hover { border-color: #b0b0b0; }

.metric-note {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  margin: 0.5rem 0 0;
  text-align: right;
}

/* ===== Chart ===== */

.chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 300px;
  margin-top: 1.6rem;
  padding-bottom: 0.4rem;
}

.bar-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
  cursor: default;
}

.bar-value {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  white-space: nowrap;
}

.bar {
  width: 100%;
  max-width: 52px;
  background: #2a2a2a;
  border-radius: 4px 4px 0 0;
  transition: filter 0.15s;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
}

.bar-col:hover .bar { filter: brightness(0.9); }

/* provider chip at the bar base */
.bar-chip {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--bg-elevated);
}

.bar-chip svg {
  width: 13px;
  height: 13px;
  display: block;
}

.chip-mark {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
  line-height: 1;
}

.bar-name {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 8px;
  line-height: 1.3;
  height: 2.75em;
  overflow: hidden;
  width: 100%;
}

.bar-rank {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  margin-bottom: 4px;
}

/* tail separator */
.tail-sep {
  align-self: stretch;
  border-left: 1px dashed #c9c9c9;
  margin: 0 4px;
}

/* tooltip */
.chart-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fafafa;
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.5;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 10;
}

.bar-col:hover .chart-tip { opacity: 1; }

.chart-tip .tip-title { font-weight: 600; }
.chart-tip .tip-row { opacity: 0.85; }

/* footer of card */
.bench-foot {
  border-top: 1px solid var(--border);
  margin-top: 1.4rem;
  padding-top: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.bench-blurb {
  font-size: 0.78rem;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.55;
}

.bench-blurb .bench-footnote {
  display: block;
  margin-top: 0.4rem;
  color: var(--text-dim);
}

.bench-stamp {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-align: right;
  white-space: nowrap;
}

.bench-stamp a { color: var(--text-secondary); border-bottom: 1px dotted #bbb; }

/* ===== Mobile ===== */

@media (max-width: 780px) {
  .evals-main { padding: 7rem 1.25rem 4rem; }

  .evals-layout { grid-template-columns: minmax(0, 1fr); }

  .bench-list {
    flex-direction: row;
    position: static;
    overflow-x: auto;
    padding-bottom: 0.4rem;
    max-width: 100%;
  }

  .bench-item { flex-shrink: 0; }
  .bench-item .bench-item-q { display: none; }

  .bench-card { padding: 1.2rem 1rem 1rem; overflow-x: auto; max-width: 100%; }
  .chart { min-width: 560px; height: 260px; }
  .bench-foot { flex-direction: column; }
  .bench-stamp { text-align: left; }
}


/* ===== Head-to-head ===== */

.h2h { margin-top: 1.4rem; }

.h2h-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.h2h-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.h2h-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem 0.3rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.h2h-pick:hover { border-color: #b0b0b0; background: var(--bg); }

.h2h-pick.active {
  border-color: #1a1a1a;
  color: var(--text);
  font-weight: 500;
  box-shadow: 0 0 0 2.5px rgba(26, 26, 26, 0.07);
}

.h2h-pick .bar-chip {
  width: 20px; height: 20px;
  box-shadow: none;
  border: 1px solid var(--border);
}
.h2h-pick .bar-chip svg { width: 12px; height: 12px; }

.h2h-lead {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 640px;
  margin-bottom: 1.2rem;
}

.h2h-lead strong { color: var(--text); font-weight: 500; }
.h2h-inline { font-family: var(--mono); font-size: 0.78rem; white-space: nowrap; }
.h2h-inline.win { color: #1c5cab; }
.h2h-inline.lose { color: #a8322f; }

.h2h-head,
.h2h-row {
  display: grid;
  grid-template-columns: 128px minmax(120px, 1fr) 52px 74px;
  align-items: center;
  gap: 0.8rem;
}

.h2h-head {
  font-family: var(--mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.h2h-axis { display: flex; justify-content: space-between; }
.h2h-axis i { font-style: normal; }
.h2h-adv-h { text-align: right; }
.h2h-raw-h { text-align: right; }

.h2h-chart { display: flex; flex-direction: column; gap: 3px; }

.h2h-row {
  padding: 3px 0;
  border-radius: 6px;
  transition: background 0.12s;
}
.h2h-row:hover { background: var(--bg); }

.h2h-name {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text);
  overflow: hidden;
}

.h2h-name .bar-chip {
  width: 20px; height: 20px;
  box-shadow: none;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.h2h-name .bar-chip svg { width: 12px; height: 12px; }

.h2h-track {
  position: relative;
  height: 20px;
  background: #f4f4f2;
  border-radius: 5px;
  overflow: hidden;
}

.h2h-bar {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 3px;
  min-width: 2px;
}

.h2h-bar.win { background: #2a78d6; }
.h2h-bar.lose { background: #c74845; }

.h2h-zero {
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 1px;
  background: #d5d5d2;
}

.h2h-adv {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.h2h-adv.win { color: #1c5cab; }
.h2h-adv.lose { color: #a8322f; }

.h2h-raw {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.h2h-note {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.5;
  max-width: 620px;
  margin-top: 1rem;
}

@media (max-width: 780px) {
  .h2h-head, .h2h-row { grid-template-columns: 96px minmax(80px, 1fr) 46px; gap: 0.5rem; }
  .h2h-raw, .h2h-raw-h { display: none; }
  .h2h-axis i:first-child, .h2h-axis i:last-child { display: none; }
}

/* signed metrics: zero baseline, negatives hang below it */
.bar-track {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.bar-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
}
.bar-zone.pos {
  justify-content: flex-end;
  border-bottom: 1px solid var(--border);
}
.bar-zone.neg { justify-content: flex-start; }
.bar-zone .bar { flex-shrink: 0; }
.bar.neg {
  border-radius: 0 0 4px 4px;
  align-items: flex-start;
  padding-bottom: 0;
  padding-top: 6px;
}
.bar-zone.neg .bar-value { margin-top: 4px; margin-bottom: 0; }
.bar.chipless { padding-bottom: 0; min-height: 3px; }
.bar-chip-row {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}
.bar-chip-row .bar-chip {
  box-shadow: 0 0 0 1px var(--border);
}
