:root {
    --ink: #161616;
    --paper: #f3f1e9;
    --paper-alt: #e8e8e4;
    --sheet: #f8f7f1;
    --frame: #d9d9d5;
    --panel: #deded9;
    --rule: #c7c7c1;
    --row-alt: #eeede6;
    --row-hover: #e3e3dc;
    --muted: #4d4d4d;
    --good: #1a6b24;
    --good-bg: #d8efd3;
    --good-bg-soft: #e8f4e3;
    --bad: #b52b23;
    --bad-bg: #f9e0dc;
    --good-on-ink: #a9dba5;
    --bad-on-ink: #f2a39b;
    --font: 'Plus Jakarta Sans', system-ui, sans-serif;
}

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

::selection {
    background: var(--good-bg);
    color: var(--ink);
}

:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

body {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 28px;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.35;
}

/* Navigation */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 0 12px;
    background: var(--paper);
    border-bottom: 3px solid var(--ink);
}

.nav-logo {
    color: var(--ink);
    text-decoration: none;
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    text-transform: uppercase;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--ink);
    border-radius: 3px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.button:hover {
    opacity: 0.8;
}

.button-filled {
    background: var(--ink);
    color: #fff;
}

.button-ghost {
    background: transparent;
    color: var(--ink);
}

/* Hero */
.hero {
    padding: 72px 0 64px;
}

.hero-headline {
    max-width: 900px;
    margin-bottom: 24px;
    font-size: clamp(46px, 7vw, 92px);
    font-weight: 800;
    line-height: 0.96;
    letter-spacing: -0.03em;
    text-transform: uppercase;
}

.hero-headline em {
    color: var(--good);
}

.hero-subhead {
    max-width: 660px;
    margin-bottom: 28px;
    color: var(--muted);
    line-height: 1.5;
}

.hero-cta {
    display: flex;
    gap: 12px;
    margin-bottom: 40px;
}

/* Sections */
.section {
    padding: 42px 0 56px;
}

.section-alt {
    background: var(--paper-alt);
}

.section-title {
    width: fit-content;
    margin-bottom: 18px;
    padding: 12px 16px;
    background: var(--ink);
    color: #fff;
    font-size: 23px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

.section-subhead {
    margin-bottom: 24px;
    color: var(--muted);
    font-size: 15px;
}

/* Tables */
.sheet {
    margin-bottom: 40px;
    background: var(--sheet);
    border: 12px solid var(--frame);
    border-radius: 3px;
}

.table-container {
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

table {
    width: 100%;
    border-collapse: collapse;
}

#comparison-table {
    min-width: 1600px;
}

th, td {
    padding: 9px 10px;
    border: 1px solid var(--rule);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    text-align: left;
}

th {
    background: var(--ink);
    color: #fff;
    font-weight: 800;
}

thead th {
    text-transform: uppercase;
    vertical-align: top;
}

thead th:first-child,
tbody th {
    position: sticky;
    left: 0;
}

thead th:first-child {
    z-index: 20;
}

tbody th {
    z-index: 5;
}

tr:nth-child(even) {
    background: var(--row-alt);
}

tr:hover {
    background: var(--row-hover);
}

.winner {
    background: var(--good-bg);
    color: var(--good);
    font-weight: 600;
}

.runner-up {
    background: var(--good-bg-soft);
    font-weight: 500;
}

.warning {
    background: var(--bad-bg);
    color: var(--bad);
}

.warning[data-auto-warning]::before {
    content: "⚠️ ";
}

.score-negative {
    color: var(--bad);
    font-weight: 600;
}

.model-status {
    display: block;
    margin-top: 4px;
    color: var(--good-on-ink);
    font-size: 12px;
    font-weight: 600;
}

.model-status-estimate {
    color: var(--bad-on-ink);
}

/* Model cards */
.model-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 28px;
}

.model-card {
    padding: 18px;
    background: var(--sheet);
    border: 1px solid var(--rule);
    border-radius: 3px;
}

.model-card h3 {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--ink);
    font-size: 19px;
    font-weight: 800;
    text-transform: uppercase;
}

.model-card h4 {
    margin-top: 16px;
    color: var(--good);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.model-card h4:nth-of-type(2) {
    color: var(--bad);
}

.model-card ul {
    margin: 8px 0 0 20px;
    font-size: 14px;
}

.model-card li + li {
    margin-top: 4px;
}

/* Notes */
.note {
    margin-top: 40px;
    padding: 24px;
    background: var(--good-bg);
    color: var(--good);
    border-radius: 3px;
}

.note h3 {
    margin-bottom: 16px;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.18;
}

.note p + p {
    margin-top: 8px;
}

.source-status {
    margin-top: 40px;
    padding: 8px 22px;
    background: var(--panel);
    border-radius: 3px;
}

.source-status summary {
    padding: 10px 0;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
}

.source-status p {
    margin-top: 4px;
}

.source-status ul {
    margin: 16px 0 10px 20px;
}

.source-status li + li {
    margin-top: 8px;
}

.source-status a {
    color: inherit;
    text-underline-offset: 2px;
}

.nav-link[aria-current="page"] {
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 6px;
}

/* About page */
.prose {
    max-width: 68ch;
}

.prose p + p,
.prose p + ul,
.prose ul + p {
    margin-top: 12px;
}

.prose ul {
    margin-left: 20px;
}

.prose li + li {
    margin-top: 6px;
}

.prose a,
footer a {
    color: inherit;
    text-underline-offset: 2px;
}

footer p + p {
    margin-top: 4px;
}

footer {
    margin: 32px 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

@media (max-width: 768px) {
    body {
        padding: 0 14px;
        font-size: 16px;
    }

    .nav-links {
        display: none;
    }

    nav .button {
        padding: 0 12px;
        font-size: 14px;
    }

    .hero {
        padding: 52px 0 44px;
    }

    .hero-cta {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 24px;
    }

    .section-title {
        font-size: 19px;
    }

    .sheet {
        border-width: 7px;
    }

    th, td {
        padding: 8px;
        font-size: 12px;
        white-space: nowrap;
    }

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