/* Awesome JEV gallery: white cards on a pale ground, in the PlayJev demo's card language.
   Section hues (--s-*) are injected by build_gallery.py. */
:root {
  color-scheme: light;
  --bg: #f3f5f9; --panel: #ffffff; --card: #ffffff; --line: #e3e7ee; --line-2: #c9d0db;
  --fg: #0f172a; --body: #334155; --muted: #64748b; --dim: #94a3b8; --input: #f6f7fa; --hover: #eceff4;
  --accent: #2F80ED; --accent-ink: #fff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 20px rgba(16, 24, 40, .07);
  --shadow-2: 0 2px 4px rgba(16, 24, 40, .08), 0 14px 32px rgba(16, 24, 40, .12);
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Helvetica Neue", system-ui, sans-serif;
  --display: 'Chakra Petch', 'IBM Plex Sans', system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1115; --panel: #171a20; --card: #1b1f27; --line: #2a2f39; --line-2: #3a4150;
  --fg: #e9ebf0; --body: #c7cdd8; --muted: #9aa3b2; --dim: #6b7383; --input: #232833; --hover: #2b313d;
  --accent: #6FA8FF; --accent-ink: #fff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .35);
  --shadow-2: 0 2px 4px rgba(0, 0, 0, .35), 0 14px 32px rgba(0, 0, 0, .5);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 5px 10px; }
button:hover { background: var(--hover); }
input, select { font: inherit; color: var(--fg); background: var(--input); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
svg { vertical-align: -2px; }

/* ---------- toolbar ---------- */
header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 9px 24px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .01em; margin-right: 6px; white-space: nowrap; color: var(--fg); }
.brand:hover { text-decoration: none; }
.brand small { color: var(--muted); font-weight: 400; }
.bar input[type=search] { width: 230px; }
.grp { display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.grp label { color: var(--muted); font-size: 12px; margin-right: 2px; }
.chip { padding: 4px 12px; border-radius: 999px; font-size: 13px; white-space: nowrap; border: 1px solid var(--line); background: var(--panel); color: var(--fg); }
.chip:hover { background: var(--hover); text-decoration: none; }
.cols { display: inline-flex; align-items: center; gap: 2px; }
.cols button { padding: 3px 9px; }
.cols span { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }
.icon { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--fg); }

/* ---------- page head ---------- */
.intro { padding: 26px 24px 4px; }
.intro h1 { margin: 0 0 6px; font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: .01em; line-height: 1.15; }
.intro p { margin: 0; font-size: 16px; color: var(--body); max-width: 70ch; }

/* ---------- category pills, like the demo's mode buttons ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px; font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: .01em; border: 1px solid var(--line-2); background: var(--panel); color: var(--fg); }
.pill i { width: 9px; height: 9px; border-radius: 2px; background: var(--sc); }
.pill span { color: var(--muted); font-weight: 500; font-size: 13px; }
.pill:hover { background: var(--hover); }
.pill.on { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.pill.on span { color: var(--bg); opacity: .75; }
.pill.on i { outline: 2px solid var(--bg); outline-offset: -1px; }

/* ---------- wall: white cards, same size, in a regular grid ---------- */
main { padding: 18px 24px 44px; }
#grid { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; min-width: 0; background: var(--card); color: var(--fg); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 12px 12px; transition: transform .18s ease, box-shadow .18s ease; }
.card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-2); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .card, .ph img { transition: none; } .card:hover { transform: none; } }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 2px 10px; }
.head .t { font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: .005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head .n { display: inline-flex; align-items: center; gap: 5px; font-family: var(--display); font-weight: 600; font-size: 14px; white-space: nowrap; color: var(--fg); font-variant-numeric: tabular-nums; }
.head .n svg { width: 15px; height: 15px; }
.ph { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 9px; background: #e5e7eb; max-width: 100%; }
:root[data-theme="dark"] .ph { background: #262a33; }
.ph img { display: block; width: 100%; height: 100%; object-fit: cover; }
.why { margin: 10px 2px 0; font-size: 13.5px; line-height: 1.45; color: var(--body); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; height: calc(3 * 1.45em); }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 2px 0; font-size: 13px; color: var(--fg); }
.foot .sec { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--sc); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot .sec i { width: 8px; height: 8px; border-radius: 2px; background: var(--sc); flex: none; }
.foot .meta { display: inline-flex; align-items: center; gap: 6px; flex: none; max-width: 62%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.foot .meta img { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.foot .meta svg { width: 15px; height: 15px; flex: none; }
.empty { color: var(--muted); text-align: center; padding: 60px 0; }
footer { color: var(--muted); font-size: 13px; padding: 18px 24px 40px; border-top: 1px solid var(--line); }
footer a { color: var(--fg); }

@media (max-width: 640px) {
  .bar { padding: 8px 12px; }
  .bar input[type=search] { flex: 1 1 100%; width: auto; }
  .intro { padding: 18px 12px 0; }
  .intro h1 { font-size: 24px; }
  .pills { gap: 6px; margin-top: 12px; }
  .pill { padding: 5px 11px; font-size: 13px; }
  main { padding: 14px 12px 30px; }
  #grid { gap: 12px; }
  .card { padding: 10px; border-radius: 12px; }
  .head .t { font-size: 14px; }
  .why { display: none; }
}

:root{--s-systemone:#2F80ED;--s-reproductions:#7C5CE6;--s-builtwith:#BE2D6E;--s-evaluations:#F0545C;--s-commentary:#12866B;--s-incumbents:#D98A0B;--s-name:#1B2A6B;}
:root[data-theme="dark"]{--s-systemone:#6FA8FF;--s-reproductions:#A78BFA;--s-builtwith:#F472B6;--s-evaluations:#FF7B85;--s-commentary:#4FC0A3;--s-incumbents:#FBBF4D;--s-name:#9DB4FF;}
