/* Dark theme and the Compare headline. Loads after styles.css, screening.css
   and explore.css, so its colours win. The short tokens (--bg, --s1 … --unk)
   are also used by the model picker (roster.css) and the model map
   (modelmap.css). */
:root {
  color-scheme: dark;
  --bg: #0d0b0a; --s1: #171412; --s2: #211d19; --s3: #2c2621;
  --ln: #352e28; --ln2: #4a4038; --tx: #f4ece2; --tx2: #b3a596;
  --acc: #ffad5c; --acc-ink: #1d1209; --a: #ff8a4c; --b: #8fb4ff;
  --pos: #6fdc8c; --mix: #f2c14e; --neg: #ff7a6b; --neu: #8fb4ff; --unk: #8b8b93;
  --glow: #ff8a4c33;
  --paper: var(--bg); --surface: var(--s1); --ink: var(--tx); --muted: var(--tx2); --line: var(--ln);
  --night: var(--bg); --night-2: var(--s2); --night-3: var(--s3); --night-line: var(--ln2);
  --night-ink: var(--tx); --night-muted: var(--tx2);
  --peach: var(--acc); --orange: var(--a); --blue: var(--b); --lilac: var(--b); --lime: var(--acc); --forest: var(--tx2);
  background: var(--bg);
  color: var(--tx);
}
body { background: var(--bg); }
::selection { background: var(--acc); color: var(--acc-ink); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* Masthead */
.mast { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--ln); }
.mast nav a[aria-current="page"] { background: var(--s3); color: var(--acc); }
.yt { background: var(--s3); color: var(--tx); }

/* Generic controls */
button, select, input[type="search"] { background-color: var(--s2); color: var(--tx); border-color: var(--ln2); }
button:hover, .action:hover { background: var(--s3); border-color: var(--tx2); }
select { background: var(--s2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='none' stroke='%23b3a596' stroke-width='1.5' d='m1 1 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 0.7rem center; }
.action { border-color: var(--ln2); }
a { text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
a:hover, .card-links a:hover, .table-wrap a:hover { color: var(--acc); }

/* Compare headline: "[A] vs [B] / on [task]" over the light leak */
.deck { position: relative; isolation: isolate; overflow: hidden; margin: 1.2rem 0 0; border: 1px solid var(--ln); border-radius: 14px; background: var(--bg); color: var(--tx); }
.deck > .leak { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; display: block; }
.deck::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, #0009 0%, #0004 45%, transparent 75%), linear-gradient(0deg, #000b 0, transparent 50%); }
.sentence { display: grid; gap: .3em; margin: 0; padding: clamp(36px, 6vw, 84px) clamp(16px, 3.4vw, 44px) clamp(20px, 3vw, 36px); font: 800 1rem/1 var(--display); text-transform: uppercase; letter-spacing: -.005em; }
.sentence .line { display: flex; align-items: center; justify-content: flex-start; gap: 0; width: 100%; padding: .1em .2em; margin: -.1em -.2em; overflow: hidden; white-space: nowrap; font-size: var(--fs, 4.5rem); }
.sentence .line > * { flex: none; }
.sentence .w { margin: 0 .55em; color: var(--tx2); font-size: .5em; letter-spacing: .04em; }
.sentence .l2 .w { margin-left: 0; }
.slot { display: inline-flex; align-items: center; gap: .22em; margin: 0 -.16em; padding: .06em .16em .1em; border: 0; border-radius: .12em;
  background: none; color: var(--tx); font: inherit; text-transform: inherit; box-shadow: inset 0 -.06em var(--acc); transition: background .15s; }
.slot svg { flex: none; width: .3em; height: .3em; fill: none; stroke: var(--acc); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transform: translateY(.04em); transition: transform .15s; }
.slot:hover, .slot[aria-expanded="true"] { background: color-mix(in srgb, var(--acc) 16%, transparent); border: 0; }
.slot:hover svg { transform: translateY(.1em); }
.slot.bench { color: var(--acc); }
.slot-static { color: var(--tx2); }
.deck-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .75rem clamp(16px, 3.4vw, 44px); border-top: 1px solid #ffffff14; background: #0000004d; backdrop-filter: blur(10px); }
.deck-meta { color: var(--tx2); font: 500 .85rem/1.4 var(--mono); }
.deck-tools output { color: var(--acc); font-size: .85rem; }
.deck-tools output:empty { display: none; }
.deck-buttons { display: flex; flex-wrap: wrap; gap: .4rem; margin-left: auto; }
.deck-buttons button { display: inline-flex; align-items: center; gap: .4rem; padding: .42rem .8rem; border: 1px solid var(--ln2); border-radius: 8px; background: transparent; color: var(--tx); font-size: .88rem; font-weight: 600; }
.deck-buttons svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.deck .match-launch { border: 0; background: var(--acc); color: var(--acc-ink); font-weight: 750; box-shadow: 0 6px 28px var(--glow); }
.deck .match-launch:hover { background: var(--tx); color: var(--bg); }

/* Run cards: footage first, no coloured strip */
.card { overflow: hidden; border: 1px solid var(--ln); border-top: 1px solid var(--ln); border-radius: 12px; background: var(--s1); box-shadow: 0 30px 80px -40px var(--glow); }
.card.b { border-top-color: var(--ln); }
.card .play { background: #000c; color: var(--acc); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .15rem; }
.card-title h2 { margin: 0; font: 800 clamp(1.5rem, 2.4vw, 2.1rem)/1.05 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.card-body .meta { color: var(--tx2); }
.panel, .model-tile, .bench-idea { background: var(--s1); border-color: var(--ln); }
.panel { border-top: 1px solid var(--ln); }
.model-tile { border: 1px solid var(--ln); }
.model-tile:hover, .bench-idea:hover, .bench-idea:focus-visible { background: var(--s2); border-color: var(--ln2); }
th, td { border-bottom-color: var(--ln); }
.benchbar { background: var(--s2); border-color: var(--ln); }
.pair-shortcuts button { background: var(--s1); border-color: var(--ln); }

/* Verdict badges */
.state { background: color-mix(in srgb, var(--unk) 16%, transparent); color: var(--unk); }
.positive { background: color-mix(in srgb, var(--pos) 15%, transparent); color: var(--pos); }
.mixed { background: color-mix(in srgb, var(--mix) 15%, transparent); color: var(--mix); }
.negative { background: color-mix(in srgb, var(--neg) 15%, transparent); color: var(--neg); }
.neutral { background: color-mix(in srgb, var(--neu) 15%, transparent); color: var(--neu); }
.tone-positive, .bar { background: color-mix(in srgb, var(--pos) 62%, var(--bg)); }
.tone-mixed { background: color-mix(in srgb, var(--mix) 72%, var(--bg)); }
.tone-negative { background: color-mix(in srgb, var(--neg) 75%, var(--bg)); }
.tone-neutral { background: color-mix(in srgb, var(--neu) 70%, var(--bg)); }
.tone-unknown { background: #4a4a50; }

/* Charts */
.bars { border-bottom-color: var(--ln2); background: repeating-linear-gradient(to top, transparent, transparent 24px, var(--ln) 25px); }
.hbar { background: var(--s3); }
.month.chosen { background: var(--s3); }
.trend-cols, .version-chart { background: var(--s2); }
.version-chart li { border-color: var(--ln); }
.version-bar { background: var(--s3); }

/* Pickers and dialogs */
.picker, .still-dialog, .matchup-dialog, .matchup-dialog footer, .model-picker { background: var(--s1); color: var(--tx); border-color: var(--ln); }
.pick-list button:hover, .pick-list button:focus, .mp-row:hover, .mp-row:focus-visible { background: var(--s3); }
.mp-row[aria-selected="true"] { background: color-mix(in srgb, var(--acc) 18%, var(--s1)); }
.model-search { background: var(--s2); }
.duel button { background: color-mix(in srgb, var(--a) 16%, var(--s2)); color: var(--tx); border-color: var(--ln2); }
.duel button + button { background: color-mix(in srgb, var(--b) 16%, var(--s2)); border-color: var(--ln2); }
.matchup-dialog footer { color: var(--tx2); }
.caption-hit mark { background: color-mix(in srgb, var(--acc) 35%, transparent); color: var(--tx); }
.match-card:hover, .match-card:focus-visible { border-color: var(--acc); }

/* Verdict pills and dots used by the model picker and the model map */
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .55rem; border-radius: 999px; font: 650 .74rem/1.4 Inter, sans-serif; white-space: nowrap; }
.v-positive { color: var(--pos); background: color-mix(in srgb, var(--pos) 14%, transparent); }
.v-mixed { color: var(--mix); background: color-mix(in srgb, var(--mix) 14%, transparent); }
.v-negative { color: var(--neg); background: color-mix(in srgb, var(--neg) 14%, transparent); }
.v-neutral { color: var(--neu); background: color-mix(in srgb, var(--neu) 14%, transparent); }
.v-unknown { color: var(--unk); background: color-mix(in srgb, var(--unk) 14%, transparent); }
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; }

/* Models: map or grid */
.view-switch { display: inline-flex; gap: 3px; margin: 0 0 1rem; padding: 3px; border: 1px solid var(--ln2); border-radius: 10px; background: var(--s1); }
.view-switch a { padding: .4rem 1rem; border-radius: 7px; color: var(--tx2); font-weight: 600; text-decoration: none; }
.view-switch a[aria-current="page"] { background: var(--tx); color: var(--bg); }
.model-map { margin-bottom: 2rem; }

.head { border-bottom-color: var(--ln2); }
footer.shell { border-top: 1px solid var(--ln); color: var(--tx2); }
@media (max-width: 640px) { .deck-buttons { margin-left: 0; } }

/* Remaining fixed colours from the light theme */
.matchups, .matchup-dialog header { background: var(--s2); }
a.match-card, .presets button, .cue-time { background: var(--s3); color: var(--tx); }
.match-card:focus-visible, .suggestions [aria-pressed="true"] { background: color-mix(in srgb, var(--acc) 20%, var(--s2)); }
.transcript-form button, .matchup-dialog [data-open] { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); font-weight: 700; }
.transcript-form button:hover, .matchup-dialog [data-open]:hover { background: var(--tx); color: var(--bg); }
.month:hover .bar { background: var(--pos); }
.swatch, .hbar i { background: color-mix(in srgb, var(--pos) 62%, var(--bg)); }

/* No eyebrows: labels follow the thing they describe, in plain sentence case */
.bench-idea b, .presets small, .suggestions small, .duel small, .eyeline, .pair-shortcuts small {
  font: 500 .8rem/1.4 Inter, system-ui, sans-serif; text-transform: none; letter-spacing: 0; color: var(--tx2);
}
.pair-shortcuts button, .pair-shortcuts button + button { border-top: 1px solid var(--ln); }
.panel-heading h2 { margin-bottom: .2rem; }
button.match-launch, .deck button.match-launch { border: 0; background: var(--acc); color: var(--acc-ink); font-weight: 700; }
button.match-launch:hover, .deck button.match-launch:hover { background: var(--tx); color: var(--bg); }
