/* Shared styles for project pages; tokens mirror index.html */

:root {
    --bg: #fbfbfd;
    --surface: #ffffff;
    --text: #1a1a2e;
    --muted: #5b6070;
    --faint: #8a8f9c;
    --border: #e6e7ee;
    --accent: #3d4fd1;
    --accent-soft: #eef0fc;
    --shadow: 0 1px 2px rgba(20, 22, 40, 0.04), 0 8px 24px rgba(20, 22, 40, 0.06);
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1117;
        --surface: #171a22;
        --text: #e7e8ee;
        --muted: #a0a5b4;
        --faint: #6e7383;
        --border: #262a36;
        --accent: #8b97ff;
        --accent-soft: #1d2140;
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    }
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

.page {
    max-width: 760px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3rem;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- Top bar ---------- */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 0.85rem;
}

.topbar a {
    color: var(--muted);
}

.topbar a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* ---------- Header ---------- */

.project-header {
    margin-top: 2.5rem;
}

.meta {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--faint);
}

.status {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    margin-left: 0.4rem;
    background: var(--accent-soft);
    color: var(--accent);
    vertical-align: 0.1em;
}

h1 {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-top: 0.5rem;
}

.authors {
    font-size: 0.9rem;
    color: var(--muted);
    margin-top: 0.75rem;
}

.authors .me {
    color: var(--text);
    font-weight: 600;
}

.lede {
    font-size: 1.08rem;
    color: var(--muted);
    margin-top: 1rem;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.btn-row a {
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--muted);
    transition: border-color 0.2s, color 0.2s;
}

.btn-row a:hover {
    text-decoration: none;
    color: var(--accent);
    border-color: var(--accent);
}

/* ---------- Key numbers ---------- */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-top: 2rem;
}

.stat {
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.stat strong {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.stat span {
    font-size: 0.82rem;
    color: var(--muted);
}

/* ---------- Body ---------- */

section {
    margin-top: 2.75rem;
}

h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 1rem;
}

h2::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

section p + p,
section p + ul,
section ul + p,
section p + ol,
section .table-wrap + p {
    margin-top: 0.85rem;
}

section ul,
section ol {
    padding-left: 1.25rem;
}

section li + li {
    margin-top: 0.35rem;
}

code {
    font-family: var(--mono);
    font-size: 0.85em;
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
    background: var(--accent-soft);
}

figure {
    margin: 1.5rem 0;
}

figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
}

figcaption {
    font-size: 0.85rem;
    color: var(--faint);
    margin-top: 0.5rem;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

th,
td {
    text-align: left;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

th {
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--faint);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr.best td {
    font-weight: 600;
    color: var(--accent);
}

.callout {
    padding: 1rem 1.2rem;
    border-left: 3px solid var(--accent);
    border-radius: 0 10px 10px 0;
    background: var(--accent-soft);
    margin-top: 1rem;
}

.footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--faint);
    font-size: 0.82rem;
    font-family: var(--mono);
    text-align: center;
}

@media (max-width: 640px) {
    .page {
        padding: 1.5rem 1rem 2rem;
    }

    h1 {
        font-size: 1.5rem;
    }
}
