:root {
    --primary-color: #2563eb;
    --text-dark: #0f172a;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1.2rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

.logo span { color: var(--primary-color); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover { color: var(--primary-color); }

/* Hero */
.hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
    margin-bottom: 20px;
}

.hero h1 { font-size: 2.5rem; margin-bottom: 15px; }
.hero p { opacity: 0.8; font-size: 1.1rem; }

/* Sections */
.section { padding: 40px 0; }
.section-header { margin-bottom: 30px; }
.section-header h2 { font-size: 1.75rem; color: var(--text-dark); margin-bottom: 8px; }
.section-header p { color: var(--text-light); }

.divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* Table Style */
.table-wrapper {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
}

.bench-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.bench-table th {
    background-color: #f8fafc;
    padding: 18px 24px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.bench-table td {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.bench-table tbody tr:last-child td { border-bottom: none; }
.bench-table tbody tr:hover { background-color: #f1f5f9; }
.bench-table a:hover { text-decoration: underline; }

.model-name-cell { text-align: left; }
.model-name-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
    font-weight: 600;
    font-family: SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    text-decoration: none;
}
.model-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Chart Area */
.chart-container {
    position: relative;
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border);
    min-height: 420px;
    overflow-x: auto;
}
.chart-container canvas {
    cursor: pointer;
    min-width: 980px;
}

/* External bar tooltip – expands upward, stays on hover */
.bar-tooltip {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    z-index: 10;
    transition: opacity 0.25s ease-out;
    transform: translate(-50%, -100%);
    min-width: 140px;
    max-width: 220px;
}
.bar-tooltip.visible {
    pointer-events: auto;
    opacity: 1;
}
.bar-tooltip-inner {
    background: #0f172a;
    color: #fff;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.bar-tooltip-inner .tooltip-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.8rem;
    margin-bottom: 6px;
}
.bar-tooltip-inner .tooltip-meta-key { color: #94a3b8; font-weight: 700; }
.bar-tooltip-inner .tooltip-meta-val { color: #ffffff; font-weight: 700; text-align: right; }
.bar-tooltip-inner .tooltip-tasks { font-size: 0.8rem; color: #cbd5e1; line-height: 1.6; }
.bar-tooltip-inner .tooltip-task-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-weight: 700;
}
.bar-tooltip-inner .tooltip-key { text-align: left; }
.bar-tooltip-inner .tooltip-val { text-align: right; }
.bar-tooltip-inner .tooltip-details {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #334155;
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 700;
}
.bar-tooltip-inner .tooltip-details a {
    color: #60a5fa;
    text-decoration: none;
}
.bar-tooltip-inner .tooltip-details a:hover { text-decoration: underline; }

.footer {
    text-align: center;
    padding: 60px 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Footer Social Icons */
.footer-socials {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 20px;
}

.footer-socials a {
    color: var(--text-light);
    font-size: 1.5rem;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
}

.footer-socials a:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Optional: Add a subtle animation for the GitHub icon specifically */
.footer-socials a .fa-github:hover {
    color: #333; /* Classic GitHub Dark */
}

/* Model detail page */
.back-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}
.back-link:hover { text-decoration: underline; }

.model-title {
    font-family: SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 1.75rem;
}
.model-detail-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.model-detail-heading .model-detail-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}
.model-meta { color: var(--text-light); }

.leaderboard-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
}

.leaderboard-header h3 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.25rem;
}

.leaderboard-header p {
    font-size: 0.82rem;
    color: var(--text-light);
}

.leaderboard-table-wrap {
    overflow-x: auto;
}

.leaderboard-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
}

.leaderboard-table th {
    text-align: left;
    padding: 0.75rem 1.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    white-space: nowrap;
}

.leaderboard-table td {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

.leaderboard-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.leaderboard-row:hover td {
    background: #f8fbff;
}

.leaderboard-model-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.leaderboard-model-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.leaderboard-model-copy {
    min-width: 0;
}

.leaderboard-model-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
}

.leaderboard-model-org,
.leaderboard-agent,
.leaderboard-date,
.leaderboard-params {
    font-size: 0.78rem;
    color: var(--text-light);
}

.leaderboard-detail-link {
    font-size: 0.74rem;
    color: var(--primary-color);
    opacity: 0;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.leaderboard-row:hover .leaderboard-detail-link {
    opacity: 1;
}

.leaderboard-score-cell {
    min-width: 220px;
}

.leaderboard-score-meta {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.leaderboard-score-value {
    font-weight: 700;
    font-size: 0.9rem;
}

.leaderboard-score-label {
    font-size: 0.74rem;
    color: var(--text-light);
}

.leaderboard-bar-track {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.leaderboard-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.rank-1 {
    background: #fef3c7;
    color: #a16207;
}

.rank-2 {
    background: #f1f5f9;
    color: #475569;
}

.rank-3 {
    background: #ffedd5;
    color: #c2410c;
}

.rank-n {
    background: #f8fafc;
    color: #64748b;
}

.scatter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.scatter-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.scatter-card-header {
    padding: 1.25rem 1.25rem 0.75rem;
}

.scatter-card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.25rem;
}

.scatter-card-header p {
    font-size: 0.8rem;
    color: var(--text-light);
}

.scatter-svg-wrap {
    padding: 0.25rem 0.75rem 0.75rem;
    overflow-x: auto;
}

.scatter-svg {
    width: 100%;
    min-width: 520px;
    height: auto;
    display: block;
    overflow: visible;
}

.scatter-grid-line {
    stroke: #e2e8f0;
    stroke-width: 1;
}

.scatter-grid-line-vertical {
    stroke-dasharray: 4 4;
}

.scatter-axis-line {
    stroke: #94a3b8;
    stroke-width: 1.25;
}

.scatter-axis-tick {
    fill: #64748b;
    font-size: 11px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.scatter-axis-label {
    fill: #334155;
    font-size: 12px;
    font-weight: 600;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.scatter-point-label {
    fill: #0f172a;
    font-size: 11px;
    font-weight: 600;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.scatter-empty {
    padding: 2rem 1.25rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

.cta-section {
    display: flex;
    justify-content: center;
    padding-top: 0;
    padding-bottom: 56px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    padding: 0.9rem 1.5rem;
    border-radius: 10px;
    background: #2563eb;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.cta-button:hover {
    background: #1d4ed8;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
}

@media (max-width: 900px) {
    .nav-links {
        gap: 1.25rem;
    }

    .hero h1 {
        font-size: 1.85rem;
    }

    .leaderboard-header {
        padding: 1.1rem 1rem 0.9rem;
    }

    .scatter-grid {
        grid-template-columns: 1fr;
    }
}
