/* Awesome AI Scientist, card gallery. Flat colour, ink outlines, hard offset shadows: a brand-teal header,
   cards with a solid band in the section colour. No gradients, no translucency.
   Plus Jakarta Sans throughout. Section colours (--s-*) and the text that sits on them (--on-*) are appended by build_gallery.py. */
@font-face { font-family: "Plus Jakarta Sans"; src: url(fonts/jakarta.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  color-scheme: light;
  --ink: #0f172a; --ink-2: #334155; --ink-3: #64748b;
  --line: #0f172a; --paper: #f4f6f8; --card: #ffffff; --well: #e8edf2;
  --tone: rgba(15, 23, 42, .07);
  --teal: #12b5a5; --orange: #f5892b; --gold: #f5a623;
  --accent: var(--teal); --on-accent: #0f172a;
  --shadow: #0f172a;
  /* the header: brand teal, ink text, an orange label */
  --hero: #12b5a5; --hero-ink: #0f172a; --hero-line: #0f172a; --hero-chip: #ffffff; --hero-chip-ink: #0f172a; --hero-shadow: #0f172a;
  --text: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gut: 16px; --max: 1560px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f1f5f9; --ink-2: #cbd5e1; --ink-3: #8b98a9;
  --line: #5a687a; --paper: #0e1116; --card: #19212b; --well: #222c38;
  --tone: rgba(203, 213, 225, .05);
  --teal: #19c2b1; --orange: #f5892b; --gold: #f5a623;
  --shadow: #000000;
  --hero: #0d3b37; --hero-ink: #f1f5f9; --hero-line: #c9f2ec; --hero-chip: #19212b; --hero-chip-ink: #f1f5f9; --hero-shadow: #000000;
}
@media (min-width: 900px) { :root { --gut: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 500 16px/1.55 var(--text); -webkit-font-smoothing: antialiased;
  background: var(--paper) radial-gradient(var(--tone) 1.1px, transparent 1.3px) 0 0 / 12px 12px;
}
a { color: inherit; }
p, h1, h2, h3 { margin: 0; }
h1, h2, h3 { font-weight: 800; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--teal); color: #0f172a; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; z-index: 60; height: 58px; display: flex; align-items: center; gap: 14px;
  padding: 0 var(--gut); background: var(--paper); border-bottom: 2.5px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand .w { font: 800 17px/1 var(--text); letter-spacing: -.02em; }
.brand .w i { font-style: normal; color: #0e8c80; }
:root[data-theme="dark"] .brand .w i { color: var(--teal); }
.topbar nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topbar nav a:not(.gh) { text-decoration: none; font: 700 15px/1 var(--text); padding: 9px 11px; border-radius: 8px; color: var(--ink-2); }
.topbar nav a:not(.gh):hover { background: var(--well); color: var(--ink); }
.theme { width: 38px; height: 38px; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; color: var(--ink); padding: 0; }
.theme:hover { background: var(--teal); color: #0f172a; }
.theme svg { width: 18px; height: 18px; }
.theme .moon, :root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; }
.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font: 800 15px/1 var(--text); padding: 12px 18px;
  border: 2.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); box-shadow: 4px 4px 0 var(--shadow);
  transition: transform .1s, box-shadow .1s; white-space: nowrap; cursor: pointer; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow); }
.btn.pk { background: var(--teal); color: #0f172a; }
.btn.or { background: var(--orange); color: #0f172a; }
.topbar .gh { padding: 8px 13px; font-size: 14px; box-shadow: 3px 3px 0 var(--shadow); }

/* ---------- header: a flat band in the brand teal ---------- */
.hero { position: relative; padding-top: 58px; background: var(--hero); color: var(--hero-ink); border-bottom: 0; }
.hero-in { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 22px 40px;
  max-width: var(--max); margin: 0 auto; padding: 32px var(--gut) 30px; }
.title { font: 800 clamp(34px, 4vw, 56px)/1.1 var(--text); letter-spacing: -.035em; }
.title em { display: inline-block; font-style: normal; background: var(--orange); color: #0f172a; padding: .02em .2em .06em; border-radius: .14em;
  border: .05em solid var(--hero-line); box-shadow: .08em .08em 0 var(--hero-shadow); transform: rotate(-1.5deg); margin-left: .08em; }
.sub { margin-top: 12px; font: 700 clamp(15px, 1.3vw, 18px)/1.5 var(--text); max-width: 46em; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.stats li { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px 7px 8px; border-radius: 10px; background: var(--hero-chip); color: var(--hero-chip-ink);
  border: 2.5px solid var(--hero-line); box-shadow: 3px 3px 0 var(--hero-shadow); font: 600 13.5px/1.2 var(--text); }
.stats li i { width: 20px; height: 20px; border-radius: 6px; background: var(--dot); flex: none; border: 2px solid var(--hero-line); }
.stats b { font: 800 16px/1.2 var(--text); }
.cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero .btn { background: var(--hero-chip); color: var(--hero-chip-ink); border-color: var(--hero-line); box-shadow: 4px 4px 0 var(--hero-shadow); }
.hero .btn.or { background: var(--orange); color: #0f172a; }
.hero .btn:hover { box-shadow: 6px 6px 0 var(--hero-shadow); }
/* the collection by section, as the header's lower edge; each segment opens its section */
.spectrum { display: flex; height: 14px; border-top: 2.5px solid var(--hero-line); border-bottom: 2.5px solid var(--line); }
.spectrum a { flex: var(--n) 1 0; background: var(--sc); transition: flex-grow .25s; }
.spectrum a + a { border-left: 2.5px solid var(--hero-line); }
.spectrum:hover a:hover, .spectrum a:focus-visible { flex-grow: calc(var(--n) * 1.7); outline: none; }

/* ---------- controls ---------- */
.controls { display: grid; gap: 13px; padding-top: 26px; padding-bottom: 28px; }
.tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.tab { display: inline-flex; align-items: center; gap: 9px; border: 2.5px solid var(--line); background: var(--card); color: var(--ink);
  font: 800 14.5px/1 var(--text); padding: 5px 13px 5px 5px; border-radius: 10px; cursor: pointer; box-shadow: 3px 3px 0 var(--shadow); transition: transform .1s, box-shadow .1s; }
.tab .em { width: 27px; height: 27px; border-radius: 7px; display: grid; place-items: center; background: var(--sc, var(--teal)); color: var(--son, #0f172a); }
.tab .em svg { width: 15px; height: 15px; }
.tab b { font: 800 12.5px/1 var(--text); color: var(--ink-3); }
.tab:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow); }
.tab[aria-pressed="true"] { background: var(--sc, var(--teal)); color: var(--son, #0f172a); }
.tab[aria-pressed="true"] .em { background: var(--card); color: var(--ink); }
.tab[aria-pressed="true"] b { color: inherit; opacity: .8; }
.groups { display: flex; flex-wrap: wrap; gap: 8px; }
.groups[hidden] { display: none; }
.chip { border: 2px solid var(--line); background: var(--card); border-radius: 8px; padding: 6px 11px 5px; font: 700 13.5px/1 var(--text); cursor: pointer; }
.chip b { font-weight: 800; font-size: 12px; color: var(--ink-3); margin-left: 4px; }
.chip:hover { background: var(--well); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip[aria-pressed="true"] b { color: inherit; opacity: .75; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.search { display: flex; align-items: center; gap: 8px; border: 2.5px solid var(--line); background: var(--card); border-radius: 10px; padding: 0 6px 0 13px; box-shadow: 3px 3px 0 var(--shadow); }
.search svg { width: 17px; height: 17px; flex: none; color: var(--ink-3); }
.search input { width: 270px; border: 0; background: transparent; padding: 10px 0 9px; outline: 0; font: 700 15px/1 var(--text); }
.search input::placeholder { color: var(--ink-3); }
.search kbd { font: 800 12px/1 var(--text); border: 2px solid var(--ink-3); color: var(--ink-3); border-radius: 6px; padding: 3px 6px; }
.search:focus-within { box-shadow: 3px 3px 0 var(--teal); }
.grp { display: inline-flex; align-items: center; gap: 8px; font: 800 12.5px/1 var(--text); color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.seg { display: inline-flex; gap: 6px; }
.seg button { border: 2px solid var(--line); background: var(--card); border-radius: 8px; padding: 6px 11px 5px; font: 700 13.5px/1 var(--text);
  cursor: pointer; text-transform: none; letter-spacing: 0; color: var(--ink); }
.seg button:hover { background: var(--well); }
.seg button[aria-pressed="true"] { background: var(--teal); color: #0f172a; }
.cols button { width: 30px; height: 30px; border: 2px solid var(--line); background: var(--card); border-radius: 8px; cursor: pointer; font: 800 15px/1 var(--text); padding: 0; color: var(--ink); }
.cols button:hover { background: var(--well); }
.cols output { font: 800 15px/1 var(--text); min-width: 16px; text-align: center; color: var(--ink); }
.count { margin-left: auto; font: 800 13.5px/1 var(--text); color: var(--ink-2); padding: 8px 2px 7px; white-space: nowrap; }

/* ---------- the wall ---------- */
main.wrap { padding-bottom: 90px; }
#grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 30px 26px; }
/* each card spans five rows of the wall so bands, pictures, names and footers line up across a row */
.card { position: relative; display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 0; min-width: 0; padding: 8px;
  background: var(--card); border: 2.5px solid var(--line); border-radius: 14px;
  box-shadow: 6px 6px 0 0 var(--c), 6px 6px 0 2.5px var(--line);
  transition: transform .12s, box-shadow .12s; }
.card:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 0 var(--c), 9px 9px 0 2.5px var(--line); }
.card:active { transform: translate(2px, 2px); box-shadow: 3px 3px 0 0 var(--c), 3px 3px 0 2.5px var(--line); }
.card:focus-within { outline: 3px dashed var(--teal); outline-offset: 6px; }

.band { display: flex; align-items: center; gap: 8px; min-width: 0; height: 38px; padding: 0 6px 0 5px; border-radius: 8px;
  background: var(--c); color: var(--on); border: 2px solid var(--line); }
.band .em { width: 26px; height: 26px; flex: none; border-radius: 6px; display: grid; place-items: center; background: var(--card); color: var(--ink); }
.band .em svg { width: 15px; height: 15px; }
.band .no { font: 800 14px/1 var(--text); letter-spacing: .01em; white-space: nowrap; }
.band .no small { font-size: .8em; margin-right: 1px; opacity: .85; }
.band .g { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 12px/1 var(--text);
  border: 1.5px solid currentColor; border-radius: 6px; padding: 4px 7px 3px; opacity: .92; }
.band .st { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 4px; font: 800 13px/1 var(--text); background: var(--card); color: var(--ink);
  border-radius: 6px; padding: 5px 8px 4px 6px; }
.band .st svg { width: 13px; height: 13px; color: var(--gold); }
/* 1k+ stars: the star count turns gold */
.card.holo .band .st { background: var(--gold); color: #0f172a; box-shadow: 0 0 0 2px var(--line); }
.card.holo .band .st svg { color: #0f172a; }

.art { position: relative; margin-top: 8px; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 8px; border: 2px solid var(--line); background: #fff; }
.art img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.art.fit-contain img { object-fit: contain; padding: 6px; }
.art.fit-top img { object-position: 50% 0; }
.card:hover .art img { transform: scale(1.04); }
/* no picture: a title plate in the section colour */
.art.none { display: grid; place-items: center; padding: 16px 22px; text-align: center; background: var(--c); color: var(--on); }
.art.none::before { content: ""; position: absolute; inset: 0; background: radial-gradient(currentColor 1.3px, transparent 1.5px) 0 0 / 14px 14px; opacity: .22; }
.art.none span { position: relative; font: 800 clamp(20px, 2vw, 30px)/1.12 var(--text); letter-spacing: -.02em; overflow-wrap: anywhere; }
.art.none em { position: absolute; right: 12px; bottom: 10px; width: 46px; height: 46px; opacity: .45; }
.art.none em svg { width: 100%; height: 100%; }

.nm { margin: 12px 6px 0; font: 800 18.5px/1.28 var(--text); letter-spacing: -.015em; overflow-wrap: anywhere; }
.nm a { text-decoration: none; }
.nm a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 14px; }
.nm a:focus-visible { outline: none; }
.tx { margin: 5px 6px 0; font: 500 14.5px/1.5 var(--text); color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ft { align-self: end; display: flex; align-items: center; gap: 8px; min-width: 0; margin: 13px 4px 2px; padding-top: 11px; border-top: 2px dashed var(--well); }
:root[data-theme="dark"] .ft { border-top-color: #2a3440; }
.who { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font: 700 13.5px/1.2 var(--text); color: var(--ink-2); }
.who img { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--line); flex: none; background: #fff; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vn { flex: none; font: 800 12.5px/1 var(--text); padding: 5px 8px 4px; border-radius: 6px; background: var(--ink); color: var(--card);
  white-space: nowrap; max-width: 12em; overflow: hidden; text-overflow: ellipsis; }
.yr { flex: none; font: 800 12.5px/1 var(--text); color: var(--ink-3); }
.lk { margin-left: auto; display: flex; gap: 6px; flex: none; }
.lk a { position: relative; z-index: 2; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px;
  border: 2px solid var(--line); background: var(--card); color: var(--ink); transition: transform .1s, background .1s, color .1s; }
.lk a:hover { background: var(--c); color: var(--on); transform: translate(-1px, -2px); }
.lk a:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.lk svg { width: 15px; height: 15px; }

/* section openers between groups of cards: a solid block in the section colour */
.chap { grid-column: 1 / -1; position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 18px; align-items: center;
  padding: 18px 22px; margin-top: 18px; border: 2.5px solid var(--line); border-radius: 14px; background: var(--c); color: var(--on);
  box-shadow: 6px 6px 0 var(--shadow); }
.chap:first-child { margin-top: 0; }
:root[data-theme="dark"] .chap, :root[data-theme="dark"] .tab, :root[data-theme="dark"] .search, :root[data-theme="dark"] .btn { box-shadow: 4px 4px 0 #000; }
.chap .ep { grid-row: span 2; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 10px; background: var(--card); color: var(--ink);
  border: 2.5px solid var(--line); font: 800 26px/1 var(--text); letter-spacing: -.03em; transform: rotate(-4deg); }
.chap h2 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; font: 800 clamp(22px, 2.3vw, 32px)/1.12 var(--text); letter-spacing: -.025em; }
.chap h2 small { font: 800 13px/1 var(--text); letter-spacing: 0; background: var(--card); color: var(--ink); padding: 5px 9px 4px; border-radius: 6px; }
.chap p { font: 600 15px/1.45 var(--text); max-width: 60em; opacity: .92; }
.chap .kj { position: absolute; right: 30px; top: 50%; width: 104px; height: 104px; transform: translateY(-50%) rotate(-10deg); opacity: .3; pointer-events: none; }
.chap .kj svg { width: 100%; height: 100%; }
.chap.sub { padding: 12px 18px; grid-template-columns: minmax(0, 1fr); border-radius: 12px; box-shadow: 4px 4px 0 var(--shadow); }
.chap.sub h2 { font-size: clamp(18px, 1.7vw, 22px); }
.empty { text-align: center; padding: 70px 0; font: 700 17px/1.5 var(--text); color: var(--ink-2); }
.empty b { display: block; font: 800 30px/1.2 var(--text); color: var(--ink); }

/* many cards per row: keep the picture and the name */
.compact .tx, .compact .band .g, .compact .who span, .compact .yr { display: none; }
.compact .nm { font-size: 14.5px; margin: 9px 3px 0; }
.compact .band .st { padding: 4px 6px 3px 5px; font-size: 12px; }
.compact .band .em { width: 22px; height: 22px; }
.compact .band .em svg { width: 13px; height: 13px; }
.compact .band .no { font-size: 12px; }
.compact .lk a { width: 26px; height: 26px; }
.compact .lk { gap: 3px; }
.compact .vn { max-width: 6.5em; font-size: 11px; }

/* ---------- footer ---------- */
footer { border-top: 2.5px solid var(--line); background: var(--hero); color: var(--hero-ink); padding: 38px var(--gut) 48px; }
.foot-in { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 18px 28px; max-width: var(--max); margin: 0 auto; }
.foot-in > svg { width: 44px; height: 44px; flex: none; }
.fwin { flex: 1 1 380px; max-width: 820px; font: 600 15px/1.65 var(--text); }
.fwin a { text-underline-offset: 3px; font-weight: 800; }
.fwin .links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.fwin .links a { text-decoration: none; font: 800 13.5px/1 var(--text); padding: 9px 13px 8px; border-radius: 8px; border: 2px solid var(--hero-line); background: var(--hero-chip); color: var(--hero-chip-ink); box-shadow: 3px 3px 0 var(--hero-shadow); }
.fwin .links a:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--hero-shadow); }
.to-top { position: fixed; right: 18px; bottom: 18px; z-index: 50; width: 48px; height: 48px; border-radius: 12px; border: 2.5px solid var(--line); background: var(--orange);
  display: grid; place-items: center; cursor: pointer; box-shadow: 3px 3px 0 var(--shadow); opacity: 0; transform: translateY(20px); pointer-events: none; transition: opacity .2s, transform .2s; }
.to-top.on { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 20px; height: 20px; color: #0f172a; }
.to-top:hover { transform: translate(-2px, -2px); }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .topbar nav a.rd { display: none; }
  .hero-in { padding-top: 26px; padding-bottom: 24px; }
  .stats li { padding: 5px 10px 5px 6px; font-size: 12.5px; }
  .stats li i { width: 18px; height: 18px; }
  .stats b { font-size: 14px; }
  .search { flex: 1 1 100%; }
  .search input { width: 100%; min-width: 0; }
  .search kbd { display: none; }
  .count { margin-left: 0; }
  .chap { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .chap .ep { grid-row: auto; width: 42px; height: 42px; font-size: 19px; border-radius: 8px; }
  .chap .kj { width: 74px; height: 74px; right: 14px; }
}
@media (max-width: 640px) {
  .topbar { gap: 8px; }
  .topbar .brand .w { font-size: 15px; }
  .hero .cta { display: none; }
  #grid { gap: 24px 18px; }
  .card { padding: 6px; border-radius: 12px; box-shadow: 5px 5px 0 0 var(--c), 5px 5px 0 2.5px var(--line); }
  .band { height: 35px; }
  .nm { font-size: 17px; }
}
@media (max-width: 420px) { .topbar .brand .w { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

:root{--s-ai-scientists:#12b5a5;--on-ai-scientists:#0f172a;--s-research:#4c82f7;--on-research:#ffffff;--s-domains:#6366f1;--on-domains:#ffffff;--s-resources:#f5892b;--on-resources:#0f172a;--s-benchmarks:#ef4444;--on-benchmarks:#ffffff;--s-learn:#22b455;--on-learn:#0f172a;}
:root[data-theme="dark"]{--s-ai-scientists:#19c2b1;--s-research:#5b8ff8;--s-domains:#7477f3;--s-resources:#f5892b;--s-benchmarks:#f05252;--s-learn:#2cc160;}
