/* PPTArena site styles. Black, white and grey for the page; color only for data. */

:root {
    color-scheme: light;
    --bg: #ffffff;
    --bg-subtle: #f5f5f5;
    --ink: #000000;
    --ink-2: #474747;
    --muted: #6e6e6e;
    --faint: #9a9a9a;
    --border: #e3e3e3;
    --border-strong: #c9c9c9;
    --hairline: #efefef;
    --data: #4a72b5;
    --data-off: #d6d6d6;
    --accent: #4a72b5;
    --accent-soft: #eaf2fc;
    --green: #0a7a0a;
    --red: #c23030;
    --amber: #9a6200;
    --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --page: 1080px;
    --gutter: clamp(18px, 4vw, 32px);
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #0f0f0f;
        --bg-subtle: #1a1a1a;
        --ink: #f5f5f5;
        --ink-2: #bdbdbd;
        --muted: #8f8f8f;
        --faint: #6a6a6a;
        --border: #2b2b2b;
        --border-strong: #3d3d3d;
        --hairline: #1f1f1f;
        --data: #7a9ed8;
        --data-off: #3a3a3a;
        --accent: #7a9ed8;
        --accent-soft: #14253b;
        --green: #2fb62f;
        --red: #e66767;
        --amber: #d9a13a;
    }
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 16px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

h1,
h2,
h3,
p,
figure {
    margin: 0;
}

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

:focus-visible {
    outline: 2px solid var(--data);
    outline-offset: 2px;
    border-radius: 2px;
}

.wrap {
    width: 100%;
    max-width: calc(var(--page) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* ---------- Header and footer (shared by every page) ---------- */

.site-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px 28px;
    flex-wrap: wrap;
    padding-block: 22px;
}

.wordmark {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    font-size: 15px;
}

.site-nav a {
    color: var(--ink-2);
    text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    color: var(--ink);
    text-decoration: underline;
}

.site-foot {
    position: relative;
    margin-top: 96px;
    padding-block: 28px 44px;
    color: var(--muted);
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    justify-content: space-between;
}

.site-foot::before {
    content: "";
    position: absolute;
    top: 0;
    left: var(--gutter);
    right: var(--gutter);
    border-top: 1px solid var(--border);
}

.site-foot a {
    color: var(--ink-2);
}

/* ---------- Leaderboard page ---------- */

.intro {
    padding-block: clamp(36px, 8vw, 84px) clamp(40px, 7vw, 72px);
}

.intro h1 {
    max-width: 17ch;
    font-size: clamp(2.3rem, 6.2vw, 4rem);
    font-weight: 600;
    line-height: 1.02;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.intro .lead {
    margin-top: 22px;
    max-width: 52ch;
    font-size: clamp(1.05rem, 1.6vw, 1.2rem);
    line-height: 1.45;
    color: var(--ink-2);
}

.intro .authors {
    margin-top: 14px;
    font-size: 14px;
    color: var(--muted);
}

.board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ink);
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.2;
}

.switch {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
}

.switch button {
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: none;
    padding: 6px 14px;
    font: 500 14px/1.2 var(--font);
    color: var(--ink-2);
    cursor: pointer;
}

.switch button span {
    color: var(--muted);
    font-weight: 400;
    margin-left: 4px;
}

.switch button[aria-selected="true"] {
    background: var(--ink);
    color: var(--bg);
}

.switch button[aria-selected="true"] span {
    color: inherit;
    opacity: 0.65;
}

/* Family colors: one muted hue per model family, worn by its bars and its dots. OpenAI, Claude
   and Gemini use the same colors as on agenttimebench.com, and so do the purple and the amber;
   rose, sage and sky were added in the same quiet range. They are placed so that neighbors on
   both boards stay easy to tell apart. A family with no color yet shows grey. */

[data-family] {
    --fam: var(--faint);
}

[data-family="gemini"] {
    --fam: #4a72b5;
}

[data-family="claude"] {
    --fam: #a64c23;
}

[data-family="openai"] {
    --fam: #357f68;
}

[data-family="baidu"] {
    --fam: #95b162;
}

[data-family="kimi"] {
    --fam: #5b3f86;
}

[data-family="deepseek"] {
    --fam: #70b4dc;
}

[data-family="glm"] {
    --fam: #da7a00;
}

[data-family="minimax"] {
    --fam: #b47699;
}

/* Family colors, dark */

@media (prefers-color-scheme: dark) {
    [data-family="gemini"] {
        --fam: #7a9ed8;
    }

    [data-family="claude"] {
        --fam: #c17450;
    }

    [data-family="openai"] {
        --fam: #55a98c;
    }

    [data-family="baidu"] {
        --fam: #afc177;
    }

    [data-family="kimi"] {
        --fam: #925ebf;
    }

    [data-family="deepseek"] {
        --fam: #345962;
    }

    [data-family="glm"] {
        --fam: #ff9a52;
    }

    [data-family="minimax"] {
        --fam: #d28bb3;
    }
}

/* Score bars: one column per system, best first. The tallest bar fills the plot. */

.bars {
    --plot: 264px;
    position: relative;
    margin: 6px 0 30px;
}

/* The baseline is painted on the row, so dimming a column never dims it. */
.bars ol {
    display: grid;
    grid-template-columns: repeat(var(--n), minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
    background: linear-gradient(var(--border-strong), var(--border-strong)) 0 var(--plot) / 100% 1px no-repeat;
}

.bars li {
    min-width: 0;
    outline: none;
    transition: opacity 120ms;
}

.bars .col {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    height: var(--plot);
    padding-top: 28px;
}

.bars b {
    flex: none;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.bars b span + span {
    display: none;
}

.bars .bar {
    flex: none;
    display: block;
    width: 56%;
    max-width: 54px;
    min-height: 2px;
    background: var(--fam, var(--data));
    border-radius: 4px 4px 0 0;
}

.bars li:focus-visible .bar {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

.bars .tag {
    padding: 10px 3px 0;
    font-size: 12.5px;
    line-height: 1.25;
    text-align: center;
    color: var(--ink-2);
    overflow-wrap: break-word;
}

.bars .tag .micon {
    margin: 0 auto 6px;
}

/* The ranking: one row per system. */

.rank {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.rank th,
.rank td {
    padding: 13px 0 12px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    vertical-align: top;
    white-space: nowrap;
}

.rank thead th {
    padding-block: 12px 9px;
    font-size: 13px;
    font-weight: 400;
    color: var(--muted);
}

.rank thead button {
    appearance: none;
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.rank thead button:hover,
.rank thead button[aria-pressed="true"] {
    color: var(--ink);
}

.rank thead button[aria-pressed="true"]::after {
    content: "";
    display: inline-block;
    margin-left: 5px;
    border: 4px solid transparent;
    border-top-color: currentColor;
    border-bottom-width: 0;
    vertical-align: 2px;
}

.rank .pos {
    width: 2.4rem;
    text-align: left;
    color: var(--muted);
}

.rank .name {
    text-align: left;
    font-weight: 500;
    white-space: normal;
    padding-right: 20px;
}

.rank .who {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.micon {
    flex: none;
    display: block;
    width: 18px;
    height: 18px;
    margin-top: 3px;
}

/* Holds the brand marks the rows point at. Zero size, but not display: none, which would
   stop the gradients inside it from painting. */
.micon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.micon svg,
.micon img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 4px;
}

.rank .name small {
    display: block;
    margin-top: 1px;
    font-size: 13px;
    font-weight: 400;
    color: var(--muted);
}

.rank .score {
    width: 6.2rem;
    font-weight: 600;
}

.rank thead .score {
    font-weight: 400;
}

.rank .num {
    width: 6.2rem;
    color: var(--ink-2);
}

.rank .time {
    width: 6.6rem;
}

.rank tbody tr,
.heat tbody tr {
    transition: opacity 120ms;
}

@media (prefers-reduced-motion: reduce) {
    .rank tbody tr,
    .heat tbody tr,
    .bars li,
    .plot .dot,
    .plot .label {
        transition: none;
    }
}

/* Linked highlight: pointing at a system anywhere dims every other system everywhere. */
.split.has-pick [data-id]:not(.is-pick) {
    opacity: 0.32;
}

.foot-note {
    margin-top: 14px;
    max-width: 92ch;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}

/* Charts. Every plot is a 16:9 frame, like the slides the benchmark is about. */

.figs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 56px 48px;
    margin-top: 72px;
}

.fig {
    min-width: 0;
}

.fig h3 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.fig figcaption p {
    margin-top: 3px;
    max-width: 58ch;
    font-size: 14px;
    line-height: 1.45;
    color: var(--muted);
}

.plot {
    position: relative;
    margin-top: 16px;
    aspect-ratio: 16 / 9;
}

.plot svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.plot text {
    font: 400 12px var(--font);
    fill: var(--muted);
    font-variant-numeric: tabular-nums;
}

.plot .grid {
    stroke: var(--hairline);
    stroke-width: 1;
}

.plot .axis {
    stroke: var(--border-strong);
    stroke-width: 1;
}

.plot .guide {
    stroke: var(--border-strong);
    stroke-width: 1;
}

.plot .leader {
    stroke: var(--border-strong);
    stroke-width: 1;
}

.plot .axis-title {
    fill: var(--ink-2);
}

.plot .dot {
    fill: var(--fam, var(--data));
    stroke: var(--bg);
    stroke-width: 2;
    transition: fill 120ms;
}

.plot .label {
    fill: var(--ink-2);
    font-size: 12.5px;
    transition: fill 120ms;
}

.split.has-pick .plot [data-id]:not(.is-pick) .dot {
    fill: var(--data-off);
}

.split.has-pick .plot [data-id]:not(.is-pick) {
    opacity: 1;
}

.split.has-pick .plot [data-id]:not(.is-pick) .label {
    fill: var(--faint);
}

.split.has-pick .plot .is-pick .label {
    fill: var(--ink);
    font-weight: 600;
}

.tip {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    padding: 7px 10px 8px;
    border-radius: 6px;
    background: var(--ink);
    color: var(--bg);
    font-size: 13px;
    line-height: 1.35;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.tip b {
    display: block;
    font-weight: 600;
}

.tip span {
    opacity: 0.72;
}

.fig.wide {
    grid-column: 1 / -1;
}

.heat {
    width: 100%;
    min-width: 560px;
    margin-top: 16px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 2px;
    font-variant-numeric: tabular-nums;
}

.heat th {
    font-weight: 400;
    text-align: left;
}

.heat thead th {
    padding: 0 0 6px;
    font-size: 13px;
    color: var(--ink-2);
    vertical-align: bottom;
    text-align: center;
}

.heat thead th small {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.heat tbody th {
    padding: 0 16px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
}

.heat td {
    height: 32px;
    padding: 0 6px;
    border-radius: 3px;
    text-align: center;
    font-size: 13.5px;
    background: var(--bg-subtle);
}

.heat td.none,
.heat thead td {
    background: none;
}

.heat thead td {
    width: 30%;
}

.scroll-x {
    overflow-x: auto;
}

.strip {
    position: relative;
    margin-top: 16px;
}

.strip svg {
    display: block;
    overflow: visible;
}

.strip text {
    font: 400 12px var(--font);
    fill: var(--muted);
}

.strip .strip-name {
    font-size: 14px;
    font-weight: 500;
    fill: var(--ink);
}

.strip .strip-mark {
    fill: none;
    stroke: var(--ink);
    stroke-width: 1.5;
    pointer-events: none;
}

.split.has-pick .strip [data-id]:not(.is-pick) {
    opacity: 0.32;
}

/* How scoring works, the link to the live tool, and the citation. */

.method {
    margin-top: 88px;
    padding-top: 26px;
    border-top: 1px solid var(--ink);
}

.method-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 44px;
    margin-top: 22px;
}

.method-cols h3 {
    font-size: 15px;
    font-weight: 600;
}

.method-cols p {
    margin-top: 6px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink-2);
}

.cite {
    margin-top: 64px;
}

.cite-box {
    position: relative;
    margin-top: 14px;
    padding: 18px 20px;
    border-radius: 8px;
    background: var(--bg-subtle);
}

.cite-box pre {
    margin: 0;
    overflow-x: auto;
    font: 13px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    color: var(--ink-2);
}

.cite-box button {
    position: absolute;
    top: 12px;
    right: 12px;
    appearance: none;
    padding: 5px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--bg);
    color: var(--ink);
    font: 500 13px var(--font);
    cursor: pointer;
}

@media (max-width: 860px) {
    .figs {
        grid-template-columns: minmax(0, 1fr);
    }

    .method-cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .rank .time,
    .rank .num {
        display: none;
    }

    .rank .score {
        width: 3.4rem;
    }

    /* Bars on a phone: every system still fits side by side, so names run up the page. */
    .bars {
        --plot: 200px;
    }

    .bars .col {
        padding-top: 22px;
    }

    .bars b {
        margin-bottom: 5px;
        font-size: 11px;
        font-weight: 500;
    }

    .bars b span {
        display: none;
    }

    .bars b span + span {
        display: inline;
    }

    .bars .bar {
        width: 62%;
        border-radius: 3px 3px 0 0;
    }

    .bars .tag {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 8px 0 0;
        font-size: 12px;
    }

    .bars .tag .micon {
        width: 16px;
        height: 16px;
        margin: 0 0 6px;
    }

    .bars .tag span:last-child {
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        white-space: nowrap;
        text-align: right;
    }

    .heat {
        min-width: 0;
    }

    .heat thead td {
        width: 34%;
    }

    .heat thead th {
        font-size: 11.5px;
        hyphens: auto;
    }

    .heat thead th small {
        font-size: 11px;
    }

    .heat tbody th {
        padding-right: 8px;
        font-size: 13px;
        line-height: 1.25;
        white-space: normal;
    }

    .heat td {
        padding: 0 2px;
        font-size: 13px;
    }

    .rank .name {
        padding-right: 12px;
        font-size: 15px;
    }

    .plot {
        aspect-ratio: 4 / 3;
    }
}

.vh {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
