/* Shared styles for the paper project pages. Colours and type follow the
   home page; everything a demo needs to theme itself is a token here. */
:root {
    --accent: #a37d0b;
    --accent-soft: rgba(163, 125, 11, 0.10);
    --fg: #1f2937;
    --fg-strong: #111827;
    --muted: #6b7280;
    --faint: #9ca3af;
    --line: #e5e7eb;
    --surface: #ffffff;
    --surface-2: #f9fafb;
    --code-bg: #f4f4f5;
    --good: #15803d;
    --bad: #b91c1c;
    /* Two neutral series colours for charts, alongside the accent */
    --series-2: #4b5563;
    --series-3: #94a3b8;
}
html.dark {
    --accent: #d9b04a;
    --accent-soft: rgba(217, 176, 74, 0.12);
    --fg: #e5e7eb;
    --fg-strong: #ffffff;
    --muted: #9ca3af;
    --faint: #6b7280;
    --line: #1f2937;
    --surface: #030712;
    --surface-2: #0b1120;
    --code-bg: #111827;
    --good: #4ade80;
    --bad: #f87171;
    --series-2: #cbd5e1;
    --series-3: #64748b;
}

body { background: var(--surface); color: var(--fg); }

.accent { color: var(--accent); }
.accent:hover { text-decoration: underline; }

body, header, h1, h2, h3, p, a, button {
    transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.section-title {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Paper / arXiv / Code / Slides buttons under the title */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 9999px;
    color: var(--fg-strong);
    font-size: 0.875rem;
    font-weight: 500;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill i { font-size: 0.85em; }

.venue {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border: 1px solid var(--accent);
    border-radius: 9999px;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* The demo sits in its own bordered panel so it reads as interactive */
.demo {
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--surface-2);
    padding: 1.25rem;
}
@media (min-width: 640px) { .demo { padding: 1.5rem; } }

.demo-note { color: var(--faint); font-size: 0.75rem; }

/* Segmented control and form bits shared by the demos */
.seg { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.2rem; border: 1px solid var(--line); border-radius: 0.5rem; background: var(--surface); }
.seg button { padding: 0.3rem 0.7rem; border-radius: 0.375rem; font-size: 0.8125rem; color: var(--muted); }
.seg button:hover { color: var(--fg-strong); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

input[type="range"] { accent-color: var(--accent); width: 100%; }
select.field, input.field, textarea.field {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.375rem;
    padding: 0.35rem 0.6rem;
    color: var(--fg);
    font-size: 0.875rem;
}

.figure img { border-radius: 0.5rem; background: #fff; }
.figure figcaption { color: var(--muted); font-size: 0.8125rem; margin-top: 0.6rem; }

/* BibTeX block with a copy button */
.bibtex {
    position: relative;
    background: var(--code-bg);
    border-radius: 0.5rem;
    padding: 1rem 1.1rem;
    font-size: 0.78rem;
    line-height: 1.55;
    overflow-x: auto;
    color: var(--fg);
}
/* Long booktitles wrap rather than scroll sideways on phones */
.bibtex pre { white-space: pre-wrap; word-break: break-word; }
.copy-btn {
    position: absolute;
    top: 0.5rem; right: 0.5rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 0.375rem;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.75rem;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }

/* Results tables */
.results { width: 100%; font-size: 0.875rem; border-collapse: collapse; }
.results th { color: var(--muted); font-weight: 600; text-align: left; }
.results th, .results td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); }
.results td.num, .results th.num { text-align: right; font-variant-numeric: tabular-nums; }
.results tr.ours td { color: var(--fg-strong); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
