/* work/coding-bench.html: four coding agents on 23 tasks with hidden tests. Colours come from site.css tokens.
   One colour per agent; the two local rows share the amber of the local model, the second one dimmer. */
.a-claude { --a: var(--cool); }
.a-deepseek { --a: var(--c-soft); }
.a-qwen { --a: var(--emit); }
.a-dsh { --a: #b9895a; }

.cb-anim .note { padding: 6px 18px 16px; margin: 0; }
.key { display: inline-block; width: 10px; height: 10px; vertical-align: -1px; margin-right: 2px; background: var(--muted); }
.key.hard { background: repeating-linear-gradient(135deg, var(--muted) 0 2px, transparent 2px 4px); outline: 1px solid var(--muted); outline-offset: -1px; }
.key.k-pass { background: var(--ink); }
.key.k-fail { background: none; outline: 1px solid var(--muted); outline-offset: -1px; }
.key.k-out { background: none; outline: 1px dashed var(--signal); outline-offset: -1px; }
.who { font-family: var(--font-data); font-size: var(--step--2); color: var(--muted); line-height: 1.35; }
.who b { display: block; color: var(--ink); font-weight: 600; font-size: var(--step--1); }

/* how a task is graded */
.cb-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 28px; position: relative; counter-reset: step; }
.cb-flow::before { content: ""; position: absolute; left: 6px; right: 6px; top: 6px; height: 1px; background: var(--tick); }
.cb-flow li { counter-increment: step; position: relative; padding-top: 30px; font-size: var(--step--1); color: var(--muted); line-height: 1.5; }
.cb-flow li::before { content: counter(step, decimal-leading-zero); position: absolute; top: 0; left: 0; width: 13px; height: 13px; border-radius: 50%; background: var(--bg); border: 1px solid var(--tick); font-size: 0; }
.cb-flow li.end::before { border-color: var(--c-soft); background: var(--c-soft); }
.cb-flow b { display: block; color: var(--ink); font-family: var(--font-data); font-weight: 600; margin-bottom: 4px; }

.cb-tasks { border-top: 1px solid var(--rule); }
.cb-tasks summary { cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: 44px; font-family: var(--font-data); font-size: var(--step--1); font-weight: 500; list-style: none; }
.cb-tasks summary::-webkit-details-marker { display: none; }
.cb-tasks summary::before { content: "+"; color: var(--emit); width: 1ch; }
.cb-tasks[open] summary::before { content: "−"; }
.cb-tasks summary:focus-visible { outline: 2px solid var(--emit); outline-offset: 3px; }
.cb-tasks ol { list-style: none; margin: 4px 0 12px; padding: 0; columns: 2 300px; column-gap: 36px; font-size: var(--step--1); line-height: 1.5; }
.cb-tasks li { break-inside: avoid; padding: 3px 0; }
.cb-tasks li:nth-child(n+21) { color: var(--emit); }

/* tasks passed */
.cb-bars { padding: 22px 18px 10px; display: grid; gap: 18px; }
.cb-row { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr) 76px; grid-template-areas: "who track n" "who split n"; gap: 6px 16px; align-items: center; }
.cb-row .who { grid-area: who; }
.cb-row .track { grid-area: track; display: flex; height: 14px; background: var(--rule); position: relative; }
.cb-row .track::after { content: ""; position: absolute; top: -4px; bottom: -4px; left: calc(20 / 23 * 100%); width: 1px; background: var(--muted); opacity: .6; } /* where the hard tier starts */
.cb-row .track b { display: block; height: 100%; transform-origin: left; }
.cb-row .std { background: var(--a); }
.cb-row .hard { background: repeating-linear-gradient(135deg, var(--a) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--a); }
.cb-row em { grid-area: n; font-style: normal; font-family: var(--font-display); font-size: var(--step-1); color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.cb-row em small { font-size: var(--step--2); color: var(--muted); }
.cb-row .split { grid-area: split; white-space: nowrap; font-family: var(--font-data); font-variant-numeric: tabular-nums; font-size: var(--step--2); color: var(--muted); }

/* every run */
.cb-grid { --cols: minmax(150px, 230px) repeat(20, minmax(0, 1fr)) 10px repeat(3, minmax(0, 1fr)); display: grid; grid-template-columns: var(--cols); gap: 4px; padding: 20px 18px 10px; align-items: center; }
.cb-grid > span { grid-row: var(--r); grid-column: var(--c); }
.cb-grid .h { font-family: var(--font-data); font-variant-numeric: tabular-nums; font-size: 10px; color: var(--muted); text-align: center; }
.cb-grid .who { padding-right: 10px; }
.cb-grid .c { aspect-ratio: 1; max-height: 34px; background: var(--a); cursor: default; transition: transform .2s var(--ease-out); }
.cb-grid .c.fail { background: none; box-shadow: inset 0 0 0 1px var(--tick); }
.cb-grid .c.out { background: none; box-shadow: inset 0 0 0 1px var(--signal); background-image: linear-gradient(135deg, transparent 46%, var(--signal) 47% 53%, transparent 54%); opacity: .8; }
.cb-grid .c.sel { outline: 2px solid var(--ink); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) { .cb-grid .c:hover { transform: scale(1.12); } }
#cb-cell { min-height: 3.2em; }

/* time per task */
.cb-times { padding: 26px 18px 6px; display: grid; gap: 14px; }
.cb-trow, .cb-axis { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr); gap: 16px; align-items: center; }
.strip, .ticks { position: relative; height: 34px; }
.strip::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--rule); }
.strip .d { position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--a); opacity: .85; }
.strip .d.fail, .strip .d.out { background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--a); }
.strip .med { position: absolute; top: 2px; bottom: 2px; width: 2px; margin-left: -1px; background: var(--ink); }
.strip .med em { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-style: normal; font-family: var(--font-data); font-variant-numeric: tabular-nums; font-size: 11px; color: var(--ink); white-space: nowrap; }
.cb-trow:first-child .strip { margin-top: 10px; }
.cb-trow .strip { margin-top: 12px; }
.ticks { height: 22px; border-top: 1px solid var(--tick); }
.ticks span { position: absolute; top: 0; transform: translateX(-50%); padding-top: 6px; font-family: var(--font-data); font-variant-numeric: tabular-nums; font-size: 10px; color: var(--muted); white-space: nowrap; }
.ticks span::before { content: ""; position: absolute; top: -1px; left: 50%; height: 5px; width: 1px; background: var(--muted); }
.ticks span:last-child { transform: translateX(-100%); }
.ticks span:last-child::before { left: auto; right: 0; }

/* plays once, when the figure first scrolls into view (coding-bench.js); without the script it is already final */
.cb-anim.play .track b { animation: cb-grow 1.1s var(--ease-out) both; }
.cb-anim.play .track .hard { animation-delay: .9s; animation-duration: .5s; }
.cb-anim.play .c { animation: cb-in .5s var(--ease-out) both; animation-delay: calc(var(--c) * 28ms + var(--r) * 60ms); }
.cb-anim.play .d { animation: cb-in .6s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 1ms); }
.cb-anim.play .med { animation: cb-in .6s .5s var(--ease-out) both; }
@keyframes cb-grow { from { transform: scaleX(0); } }
@keyframes cb-in { from { opacity: 0; transform: scale(.4); } }

@media (max-width: 760px) {
  .cb-flow { grid-template-columns: 1fr; gap: 18px; padding-left: 26px; }
  .cb-flow::before { left: 6px; right: auto; top: 6px; bottom: 6px; width: 1px; height: auto; }
  .cb-flow li { padding-top: 0; }
  .cb-flow li::before { left: -26px; }
}
@media (max-width: 640px) {
  .cb-bars, .cb-times { padding-inline: 14px; }
  .cb-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who n" "track track" "split split"; }
  .cb-trow, .cb-axis { grid-template-columns: 1fr; gap: 2px; }
  .cb-axis .who { display: none; }
  .cb-trow .strip, .cb-trow:first-child .strip { margin-top: 14px; }
  /* the grid turns on its side: tasks down, agents across */
  .cb-grid { grid-template-columns: 28px repeat(4, minmax(0, 1fr)); grid-template-rows: auto repeat(20, 16px) 6px repeat(3, 16px); gap: 3px 6px; padding-inline: 14px; }
  .cb-grid > span { grid-row: var(--c); grid-column: var(--r); }
  .cb-grid .h { text-align: left; }
  .cb-grid .who { padding: 0 0 6px; align-self: end; font-size: 11px; }
  .cb-grid .who b { font-size: 12px; }
  .cb-grid .c { aspect-ratio: auto; height: 16px; max-height: none; }
  .cb-anim.play .c { animation-delay: calc(var(--c) * 30ms + var(--r) * 40ms); }
}
@media (prefers-reduced-motion: reduce) {
  .cb-anim.play .track b, .cb-anim.play .c, .cb-anim.play .d, .cb-anim.play .med { animation: none; }
  .cb-grid .c { transition: none; }
}
.ticks i { font-style: normal; }
@media (max-width: 640px) { .ticks .t600, .ticks i { display: none; } }
