/* Shared by both landing pages — the reader app (/) and the topic map
   (/ArxivNavigator/). Plain CSS, no build step, same colour tokens as the map app's
   site/site.css so the three surfaces read as one product. */

:root {
    --bg: #ffffff;
    --fg: #1a1d21;
    --muted: #5c6470;
    --line: #dfe3e8;
    --surface: #f7f8fa;
    --accent: #1f6feb;
    --accent-fg: #ffffff;
    --shadow: 0 6px 24px rgba(16, 24, 40, 0.10);
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1216;
        --fg: #e6eaf0;
        --muted: #98a2b3;
        --line: #2a313a;
        --surface: #161b22;
        --accent: #6ea8fe;
        --accent-fg: #0f1216;
        --shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
}

.wrap {
    max-width: 940px;
    margin: 0 auto;
    padding: 0 20px;
}

a { color: var(--accent); }

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.015em; }
h1 { font-size: 2rem; margin: 0 0 8px; }
h2 { font-size: 1.3rem; margin: 40px 0 12px; }
h3 { font-size: 1.05rem; margin: 28px 0 8px; }

p { margin: 0 0 14px; }
.lead { font-size: 1.1rem; color: var(--fg); }
.muted { color: var(--muted); }
small, .small { font-size: 0.875rem; }

/* ── Shared header nav ────────────────────────────────────────────────────── */

.site-nav {
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 10;
}

.site-nav .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 18px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.site-nav .brand {
    font-weight: 650;
    text-decoration: none;
    color: var(--fg);
    margin-right: 6px;
}

.site-nav a.nav-link {
    text-decoration: none;
    color: var(--muted);
    padding: 4px 2px;
    border-bottom: 2px solid transparent;
}

.site-nav a.nav-link:hover { color: var(--fg); }
.site-nav a.nav-link[aria-current="page"] {
    color: var(--fg);
    border-bottom-color: var(--accent);
}

.site-nav .spacer { flex: 1 1 auto; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 10px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--accent-fg);
    font-weight: 600;
    text-decoration: none;
}

.button:hover { filter: brightness(1.08); }

.button.secondary {
    background: transparent;
    color: var(--accent);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 18px 0 6px;
}

/* ── Cards, tables, figures ───────────────────────────────────────────────── */

.card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    padding: 18px 20px;
    margin: 20px 0;
}

.facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.facts div { min-width: 110px; }
.facts dt, .fact-label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.facts dd, .fact-value { margin: 0; font-size: 1.15rem; font-weight: 620; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 0.95rem;
}

th, td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th { color: var(--muted); font-weight: 600; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }

.map-frame {
    width: 100%;
    height: min(80vh, 760px);
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg);
}

p.tagline {
    font-size: 1.05rem;
    color: var(--muted);
    margin: -2px 0 16px;
}

p.reading-key {
    border-left: 3px solid var(--accent);
    padding: 2px 0 2px 14px;
    color: var(--muted);
    font-size: 0.95rem;
}

/* ── Map bar ──────────────────────────────────────────────────────────────── */

.map-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 8px;
}

.map-bar .spacer { flex: 1 1 auto; }

.tabs {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.tabs button {
    font: inherit;
    font-weight: 550;
    color: var(--muted);
    background: none;
    border: 0;
    border-radius: 8px;
    padding: 7px 16px;
    cursor: pointer;
}

.tabs button:hover { color: var(--fg); }

.tabs button[aria-selected="true"] {
    background: var(--accent);
    color: var(--accent-fg);
}

a.link-full {
    text-decoration: none;
    font-weight: 550;
    font-size: 0.95rem;
    padding: 6px 4px;
    border-bottom: 1px solid transparent;
}

a.link-full:hover { border-bottom-color: currentColor; }

p.citation {
    border-left: 3px solid var(--line);
    padding-left: 14px;
    color: var(--muted);
}

pre.embed-code {
    overflow-x: auto;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ── Cluster explorer ─────────────────────────────────────────────────────── */

.explore-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.explore-controls .layers { display: flex; gap: 6px; }

#explore-pick {
    flex: 1 1 260px;
    min-width: 0;
    font: inherit;
    color: inherit;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
}

#explore svg { max-width: 100%; height: auto; }

.heat-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding: 4px 12px 4px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.9rem;
}

.heat-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }

/* ── What is heating up ───────────────────────────────────────────────────── */

ol.heat-list {
    margin: 0 0 8px;
    padding: 0;
    list-style: none;
    counter-reset: heat;
}

ol.heat-list li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 9px 4px;
    border-bottom: 1px solid var(--line);
}

ol.heat-list li::before {
    counter-increment: heat;
    content: counter(heat);
    width: 1.6em;
    text-align: right;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
}

.heat-name { flex: 1 1 auto; text-decoration: none; }
.heat-name:hover { text-decoration: underline; }
.heat-value { font-weight: 650; font-variant-numeric: tabular-nums; }
.heat-size { color: var(--muted); font-size: 0.85rem; min-width: 5.5em; text-align: right; }

@media (max-width: 560px) {
    .heat-size { display: none; }
}
#explore-papers h3 { font-size: 0.95rem; margin: 18px 0 8px; }

#explore ol.papers { margin: 0; padding-left: 20px; }
#explore ol.papers li { margin-bottom: 8px; }
#explore .paper-meta { display: block; color: var(--muted); font-size: 0.8rem; }
#explore .error { color: #b3261e; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.shots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin: 18px 0;
    padding: 0;
    list-style: none;
}

.shots img {
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.shots figcaption { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }

hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }

/* ── Footer ───────────────────────────────────────────────────────────────── */

.site-footer {
    margin-top: 48px;
    border-top: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-size: 0.9rem;
}

.site-footer .wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    padding-top: 18px;
    padding-bottom: 28px;
}

main.wrap { padding-top: 28px; padding-bottom: 8px; }

@media (max-width: 640px) {
    h1 { font-size: 1.6rem; }
    .button { width: 100%; justify-content: center; }
}
