:root {
  --bg: #ffffff;
  --surface: #f6f6f4;
  --surface-2: #ececea;
  --ink: #111113;
  --ink-2: #3a3a40;
  --muted: #66666f;
  --line: #e4e4e7;
  --line-strong: #cfcdca;
  --accent: #1d4ed8;
  --accent-ink: #1638a8;
  --ok: #137a4b;
  --warn: #9b5a00;
  --bad: #b32322;
  --tri-b: #0b3aa8;
  --tri-y: #e0a800;
  --tri-r: #ce1126;
  --shadow: 0 8px 28px rgb(0 0 0 / .12);
  --shadow-lg: 0 24px 64px rgb(0 0 0 / .18);

  --font-head: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: 16px;
  --radius: 5px;
  color-scheme: light;
}
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #272822;
    --surface: #1d1e19;
    --surface-2: #3b3c35;
    --ink: #fdfff1;
    --ink-2: #c0c1b5;
    --muted: #919288;
    --line: #3b3c35;
    --line-strong: #57584f;
    --accent: #66d9ef;
    --accent-ink: #66d9ef;
    --ok: #a6e22e;
    --warn: #fd971f;
    --bad: #f92672;
    --tri-b: #66d9ef;
    --tri-y: #e6db74;
    --tri-r: #f92672;
    --shadow: 0 8px 28px rgb(0 0 0 / .5);
    --shadow-lg: 0 24px 64px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #272822;
  --surface: #1d1e19;
  --surface-2: #3b3c35;
  --ink: #fdfff1;
  --ink-2: #c0c1b5;
  --muted: #919288;
  --line: #3b3c35;
  --line-strong: #57584f;
  --accent: #66d9ef;
  --accent-ink: #66d9ef;
  --ok: #a6e22e;
  --warn: #fd971f;
  --bad: #f92672;
  --tri-b: #66d9ef;
  --tri-y: #e6db74;
  --tri-r: #f92672;
  --shadow: 0 8px 28px rgb(0 0 0 / .5);
  --shadow-lg: 0 24px 64px rgb(0 0 0 / .6);
  color-scheme: dark;
}
:root { --fs: 1; }
:root[data-fs="s"] { --fs: .9; }
:root[data-fs="l"] { --fs: 1.15; }
:root[data-fs="xl"] { --fs: 1.3; }
@media (min-width: 720px) { :root { --gutter: 24px; } }
@media (min-width: 1280px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 calc(16px * var(--fs))/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.locked { overflow: hidden; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -0.015em; line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
button { font: inherit; color: inherit; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 100; }
.skip:focus { top: 8px; }
.wrap { width: 100%; max-width: 1480px; margin: 0 auto; padding-inline: max(var(--gutter), env(safe-area-inset-left)); }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.small { font-size: calc(13px * var(--fs)); }
.kicker { font: 500 calc(12px * var(--fs))/1.4 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 14px; border-radius: var(--radius); border: 1px solid transparent;
  background: none; cursor: pointer; text-decoration: none; font-weight: 500; font-size: calc(15px * var(--fs)); white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); }
.btn-outline { border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--ink); }
.btn-ghost:hover { background: var(--surface); }
.btn-icon { width: 40px; padding: 0; }
.badge:not(:empty) {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--bg); font: 500 calc(11px * var(--fs))/1 var(--font-mono);
}

/* ---------- header ----------
   One grid, rearranged per breakpoint. Below 1024px the header sticks with a negative
   top (set from JS) so only the search + chip rows stay on screen. */
.hdr { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.hdr-in {
  display: grid; align-items: center; column-gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "brand link" "tabs tabs" "search filters" "chips chips";
}
.brand { grid-area: brand; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; text-decoration: none; min-width: 0; }
.brand-name {
  position: relative; display: inline-grid; overflow: hidden; height: 1.3em; perspective: 300px;
  font: 600 calc(17px * var(--fs))/1.3 var(--font-head); letter-spacing: -.01em; white-space: nowrap;
}
/* Rotating title. A tricolour band sweeps across the ink-coloured text; each swap picks
   one effect (data-fx): .out moves the old text away, .in is where the new text enters from. */
.brand-name > span {
  grid-area: 1 / 1; display: block;
  background: linear-gradient(100deg, var(--ink) 0 34%, var(--tri-b) 42%, var(--tri-y) 50%, var(--tri-r) 58%, var(--ink) 66% 100%);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sweep 7s linear infinite;
  transition: transform .36s cubic-bezier(.5,0,.2,1), opacity .36s, filter .36s, clip-path .42s cubic-bezier(.6,0,.2,1), letter-spacing .42s;
  clip-path: inset(0 0 0 0);
}
.brand-name > span.in { transition: none; }
.brand-name > .out, .brand-name > .in { opacity: 0; }
[data-fx="rise"] > .out { transform: translateY(-60%) skewX(-8deg); filter: blur(3px); }
[data-fx="rise"] > .in { transform: translateY(60%) skewX(8deg); filter: blur(3px); }
[data-fx="drop"] > .out { transform: translateY(70%); }
[data-fx="drop"] > .in { transform: translateY(-70%); }
[data-fx="flip"] > .out { transform: rotateX(90deg); }
[data-fx="flip"] > .in { transform: rotateX(-90deg); }
[data-fx="wipe"] > .out { clip-path: inset(0 0 0 100%); opacity: 1; }
[data-fx="wipe"] > .in { clip-path: inset(0 100% 0 0); opacity: 1; }
[data-fx="zoom"] > .out { transform: scale(1.35); filter: blur(5px); }
[data-fx="zoom"] > .in { transform: scale(.6); }
[data-fx="slide"] > .out { transform: translateX(-40%); filter: blur(2px); }
[data-fx="slide"] > .in { transform: translateX(40%); filter: blur(2px); }
[data-fx="spread"] > .out { letter-spacing: .4em; filter: blur(4px); }
[data-fx="spread"] > .in { letter-spacing: -.25em; }
@keyframes sweep { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .brand-name > span { transition: none; animation: none; background-position: 100% 0; }
}
.tools { display: contents; }
.hdr-links { grid-area: link; display: inline-flex; align-items: center; justify-content: flex-end; gap: 10px; }
.hdr-help { font: 500 calc(14px * var(--fs))/1 var(--font-mono); padding-left: 0; }
.hdr-link { font-size: calc(15px * var(--fs)); color: var(--muted); text-decoration: none; padding: 8px 0 8px 8px; }
.hdr-link:hover { color: var(--ink); }
.hdr-link { display: inline-flex; align-items: center; }
svg.gh { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.gh-link { display: inline-flex; align-items: center; gap: 8px; color: inherit; }
.gh-link svg.gh, .gh-link svg.rss { width: 16px; height: 16px; }
.gh-link svg.rss { fill: currentColor; }
.tabs { grid-area: tabs; display: flex; justify-content: center; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px 12px; border: 0; background: none; cursor: pointer;
  font-size: calc(15px * var(--fs)); color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.tab .n { font: 400 calc(12px * var(--fs))/1 var(--font-mono); color: var(--muted); }
.search { grid-area: search; position: relative; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px 0 12px; margin: 8px 0; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg); cursor: text; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.search > svg { color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: calc(17px * var(--fs)); color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.kbd { font: 500 calc(11px * var(--fs))/1 var(--font-mono); color: var(--muted); border: 1px solid var(--line-strong); border-radius: 3px; padding: 3px 5px; }
@media (hover: none) { .kbd { display: none; } }
.filters-btn { grid-area: filters; }
.chips { grid-area: chips; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 11px;
  border-radius: 16px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-size: calc(14px * var(--fs)); white-space: nowrap;
}
.chip .n { font: 400 calc(11px * var(--fs))/1 var(--font-mono); color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .7; }
@media (min-width: 1024px) {
  .hdr-in { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "brand tabs tools"; column-gap: 24px; min-height: 60px; }
  .brand { min-height: 60px; }
  .tabs { margin: 0; padding: 0; align-self: stretch; }
  .tab { padding: 0 12px; }
  .tools { grid-area: tools; display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-width: 0; }
  .search { flex: 0 1 340px; margin: 0; }
  .hdr-link { padding: 8px 0; }
  .filters-btn, .chips { display: none; }
}

/* ---------- autocomplete ---------- */
.ac {
  position: absolute; z-index: 35; top: calc(100% + 6px); left: -1px; right: -1px; max-height: min(70vh, 520px); overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px 0;
}
.ac[hidden] { display: none; }
@media (min-width: 1024px) { .ac { left: auto; width: max(100%, 420px); } }
.ac-group { padding: 8px 12px 4px; font: 500 calc(11px * var(--fs))/1.4 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ac-opt { display: flex; align-items: center; gap: 10px; padding: 7px 12px; cursor: pointer; font-size: calc(15px * var(--fs)); line-height: 1.3; }
.ac-opt[aria-selected="true"] { background: var(--surface-2); }
.ac-opt mark { background: none; color: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 2px; }
.ac-opt .l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-opt .r { font: 400 calc(12px * var(--fs))/1 var(--font-mono); color: var(--muted); flex: none; }
.ac-opt .ico { width: 20px; height: 20px; border-radius: 3px; object-fit: contain; flex: none; background: var(--surface); }
.ac-opt .ico.blank { display: inline-block; }
.ac-hint { padding: 10px 12px; font-size: calc(14px * var(--fs)); color: var(--muted); }

/* ---------- layout ---------- */
.layout { display: grid; gap: 24px; padding-top: 16px; padding-bottom: 48px; }
.side { display: none; }
@media (min-width: 1024px) {
  .layout { grid-template-columns: 230px minmax(0, 1fr); gap: 40px; padding-top: 24px; }
  .side { display: block; position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; overflow-x: hidden; scrollbar-width: thin; padding: 0 8px; margin: 0 -8px; }
}

/* ---------- facets ---------- */
.facet { padding: 10px 0 12px; }
.facet + .facet { border-top: 1px solid var(--line); }
.facet > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 4px 0 6px; user-select: none; }
.facet > summary::-webkit-details-marker { display: none; }
.facet > summary::after { content: ""; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; }
.facet:not([open]) > summary::after { transform: rotate(-45deg); }
.facet > summary:hover .kicker { color: var(--ink); }
.facet:not([open]) { padding-bottom: 6px; }
.flist { display: grid; }
.fopt {
  display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 4px 8px; margin: 0 -8px; width: calc(100% + 16px);
  border: 0; border-radius: 4px; background: none; cursor: pointer; text-align: left; font-size: calc(15px * var(--fs)); line-height: 1.25;
}
.fopt:hover { background: var(--surface); }
.fopt .l { flex: 1; min-width: 0; }
.fopt .n { font: 400 calc(12px * var(--fs))/1 var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.fopt.radio[aria-pressed="true"] { background: var(--ink); color: var(--bg); font-weight: 500; }
.fopt.radio[aria-pressed="true"] .n { color: inherit; opacity: .7; }
.fopt:disabled { opacity: .35; cursor: default; }
.fopt:disabled:hover { background: none; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 7px; border: 0; border-radius: 3px;
  background: var(--surface); cursor: pointer; font-size: calc(14px * var(--fs)); line-height: 1.3; color: var(--ink-2);
}
.tag:hover { background: var(--surface-2); color: var(--ink); }
.tag .n { font: 400 calc(11px * var(--fs))/1 var(--font-mono); color: var(--muted); }
.tag[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.tag[aria-pressed="true"] .n { color: inherit; opacity: .7; }
.tag:disabled { opacity: .35; cursor: default; }
.tag:disabled:hover { background: var(--surface); color: var(--ink-2); }
.facet .tags { padding-bottom: 2px; }
.toggle { display: flex; align-items: center; gap: 8px; min-height: 30px; cursor: pointer; font-size: calc(15px * var(--fs)); }
.toggle input { width: 14px; height: 14px; accent-color: var(--ink); margin: 0 1px; flex: none; }
.toggle .l { flex: 1; }
.toggle .n { font: 400 calc(12px * var(--fs))/1 var(--font-mono); color: var(--muted); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 16px; min-height: 36px; }
.count { font: 500 calc(13px * var(--fs))/1 var(--font-mono); color: var(--muted); }
.count b { color: var(--ink); font-weight: 500; }
.active { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 8px 0 10px; border-radius: 14px; border: 0; background: var(--surface-2); cursor: pointer; font-size: calc(14px * var(--fs)); }
.pill svg { width: 13px; height: 13px; }
.pill:hover { background: var(--line-strong); }
.linkbtn { border: 0; background: none; padding: 4px 0; font-size: calc(13px * var(--fs)); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkbtn:hover { color: var(--ink); }
.tool-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.select {
  appearance: none; min-height: 32px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366666f' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 13px;
  font: 400 calc(13px * var(--fs))/1 var(--font-mono); color: var(--ink); cursor: pointer;
}
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); padding: 2px; }
.seg button { display: grid; place-items: center; width: 30px; height: 26px; border: 0; border-radius: 3px; background: none; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); }

/* ---------- groups ---------- */
.group { margin-bottom: 36px; }
.group-head { display: flex; align-items: baseline; gap: 10px; padding-top: 10px; border-top: 1px solid var(--ink); margin-bottom: 14px; }
.group-head h2 { font-size: calc(21px * var(--fs)); font-weight: 600; }
.group-head .n { font: 400 calc(13px * var(--fs))/1 var(--font-mono); color: var(--muted); }
.group-head p { margin-left: auto; color: var(--muted); font-size: calc(14px * var(--fs)); text-align: right; }
@media (max-width: 719px) { .group-head p { display: none; } }

/* ---------- media ---------- */
.media { position: relative; overflow: hidden; background: color-mix(in srgb, var(--c, var(--surface-2)) 22%, var(--surface)); aspect-ratio: 1.91 / 1; }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .3s, transform .4s; }
.media-screenshot img { object-position: top center; }
.media-logo img { object-fit: contain; inset: 18% 25%; width: 50%; height: 64%; }
.media-none { display: flex; flex-direction: column; justify-content: space-between; padding: 10px 12px; background: hsl(var(--h) 30% 94%); color: hsl(var(--h) 35% 28%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .media-none { background: hsl(var(--h) 18% 16%); color: hsl(var(--h) 40% 78%); } }
:root[data-theme="dark"] .media-none { background: hsl(var(--h) 18% 16%); color: hsl(var(--h) 40% 78%); }
.media-none .mark { font: 700 calc(34px * var(--fs))/1 var(--font-head); letter-spacing: -.04em; }
.media-none .dom { font: 400 calc(12px * var(--fs))/1.3 var(--font-mono); opacity: .8; overflow-wrap: anywhere; }
.media-none .ico { width: 32px; height: 32px; border-radius: 6px; object-fit: contain; background: #fff; padding: 3px; }
/* Unify a heterogeneous set of images: monochrome at rest, colour on interaction. */
@media (hover: hover) {
  .card .media img:not(.ico) { filter: grayscale(1) contrast(1.04); }
  .card:hover .media img, .card:focus-within .media img { filter: none; }
}
.inactive .media img, .inactive .thumb img, .inactive .fav-name { filter: grayscale(1) opacity(.55) !important; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 22px 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.card { position: relative; display: flex; flex-direction: column; color: inherit; min-width: 0; border-radius: var(--radius); }
/* The name link covers the whole card/row; .ext links sit above it. */
.stretch { color: inherit; text-decoration: none; }
.stretch::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.stretch:focus-visible { outline: none; }
.stretch:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
.ext { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 3px; min-width: 0; color: inherit; text-decoration: none; }
.ext svg { width: 12px; height: 12px; opacity: .55; flex: none; }
.ext:hover { color: var(--accent); }
/* Icon-only link next to the name on narrow rows: a bigger hit area than the glyph. */
.ext-m { padding: 6px; margin: -6px -6px -6px -2px; }
.ext-m svg { width: 14px; height: 14px; }
.ext:hover svg { opacity: 1; }
.ext .dom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.card .media { border-radius: var(--radius); border: 1px solid var(--line); }
.card-body { display: flex; flex-direction: column; gap: 3px; padding: 8px 1px 0; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font: 400 calc(11px * var(--fs))/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.card h3 { font-size: calc(17px * var(--fs)); font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.card:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.card .tagline { color: var(--ink-2); font-size: calc(14px * var(--fs)); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.foot { display: flex; align-items: center; gap: 8px; margin-top: 2px; font: 400 calc(12px * var(--fs))/1.3 var(--font-mono); color: var(--muted); min-width: 0; }
.foot .dom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.code-tag { display: inline-flex; align-items: center; gap: 3px; padding: 1px 5px; border: 1px solid var(--line); border-radius: 3px; font: 500 calc(10px * var(--fs))/1.4 var(--font-mono); letter-spacing: .04em; color: var(--ink-2); text-transform: uppercase; flex: none; }
.code-tag svg { width: 10px; height: 10px; }
.new-tag { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.new-tag.launch { color: var(--bg); background: var(--ok); border-color: var(--ok); }
.status-tag { color: var(--bad); }
.status-tag.warn { color: var(--warn); }

/* ---------- list rows ---------- */
.list { display: grid; }
.row {
  position: relative;
  display: grid; grid-template-columns: 75px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
}
.row:hover .row-title { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.thumb { width: 75px; height: 75px; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); background: color-mix(in srgb, var(--c, var(--surface-2)) 22%, var(--surface)); display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.logo img, .thumb.icon img { width: 62%; height: 62%; object-fit: contain; }
.thumb.none { background: hsl(var(--h) 30% 94%); color: hsl(var(--h) 35% 28%); font: 700 calc(17px * var(--fs))/1 var(--font-head); letter-spacing: -.03em; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .thumb.none { background: hsl(var(--h) 18% 16%); color: hsl(var(--h) 40% 78%); } }
:root[data-theme="dark"] .thumb.none { background: hsl(var(--h) 18% 16%); color: hsl(var(--h) 40% 78%); }
.row-main { display: grid; gap: 1px; min-width: 0; }
.row-title { font: 600 calc(16px * var(--fs))/1.25 var(--font-head); display: flex; align-items: center; gap: 7px; overflow-wrap: anywhere; }
.row-tag { font-size: calc(14px * var(--fs)); color: var(--ink-2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-desc { font-size: calc(13px * var(--fs)); color: var(--muted); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-kw { display: flex; flex-wrap: wrap; gap: 0 8px; font: 400 calc(11.5px * var(--fs))/1.5 var(--font-mono); color: var(--muted); }
.row-side, .list-head { display: none; }
@media (min-width: 720px) {
  .row, .list-head { grid-template-columns: 75px minmax(0, 1fr) 96px calc(44px * var(--fs)) calc(60px * var(--fs)) 170px; gap: 12px; }
  .row {
  position: relative; padding: 7px 0; }
  .thumb { width: 75px; height: 75px; }
  .row-side { display: block; font: 400 calc(12px * var(--fs))/1.4 var(--font-mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .row-side .ext { max-width: 100%; }
  .row-links { display: flex; align-items: center; gap: 2px; overflow: visible; }
  .row-links .rl { padding: 3px; margin: -3px 0; border-radius: var(--radius); color: var(--ink-2); }
  .row-links .rl svg { width: 15px; height: 15px; opacity: 1; }
  .row-links .rl svg.logo { fill: currentColor; stroke: none; }
  .row-links .rl .fav { width: 15px; height: 15px; }
  .row-links .rl:hover { color: var(--accent-ink); }
  .rl-more { font: 400 calc(11px * var(--fs))/1 var(--font-mono); color: var(--muted); padding-left: 2px; }
  .row .ext-m { display: none; }
  .related .row .ext-m { display: inline-flex; }
  .row-side.faint { opacity: .6; }
  .row .meta-m { display: none; }
  .list-head { display: grid; padding: 0 0 6px; border-bottom: 1px solid var(--line); }
  .list-head span { font: 500 calc(11px * var(--fs))/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .list-head span:first-child { grid-column: 2; }
}

.empty { padding: 40px 0; max-width: 46ch; display: grid; gap: 8px; }
.empty h3 { font-size: calc(21px * var(--fs)); }
.empty p { color: var(--muted); }

/* ---------- drawer (detail) & sheet (filters) ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgb(10 10 12 / .42); animation: fade .2s; }
.drawer, .sheet { position: fixed; z-index: 50; background: var(--bg); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.drawer[hidden], .sheet[hidden], .scrim[hidden] { display: none; }
.drawer { inset: 0; animation: up .22s cubic-bezier(.2,.8,.2,1); }
@media (min-width: 720px) {
  .drawer { inset: 0 0 0 auto; width: min(560px, 92vw); animation: left .22s cubic-bezier(.2,.8,.2,1); border-left: 1px solid var(--line); }
}
.d-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 6px 6px var(--gutter); border-bottom: 1px solid var(--line); padding-top: max(6px, env(safe-area-inset-top)); }
@media (min-width: 720px) { .d-bar { padding-left: 28px; } }
.d-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 20px var(--gutter) 28px; display: grid; grid-auto-rows: max-content; gap: 14px; align-content: start; }
@media (min-width: 720px) { .d-scroll { padding: 24px 28px 32px; } }
.d-scroll .media { border-radius: var(--radius); border: 1px solid var(--line); }
.d-scroll h2 { font-size: calc(clamp(24px, 4vw, 32px) * var(--fs)); font-weight: 700; letter-spacing: -.025em; overflow-wrap: anywhere; }
.d-open { display: flex; }
.d-open .btn { white-space: normal; text-align: left; }
.d-tag { font-size: calc(17px * var(--fs)); color: var(--ink-2); line-height: 1.4; margin-top: -6px; }
.d-desc { font-size: calc(16px * var(--fs)); line-height: 1.6; }
.d-src { font: 400 calc(12px * var(--fs))/1.4 var(--font-mono); color: var(--muted); margin-top: -8px; }
.d-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.d-badges > span { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 9px; border-radius: 12px; background: var(--surface); font: 400 calc(12px * var(--fs))/1 var(--font-mono); }
.d-badges > .new { color: var(--ok); }
.d-badges > .new.launch { color: var(--bg); background: var(--ok); }
.dl { display: grid; grid-template-columns: minmax(0, 110px) minmax(0, 1fr); gap: 8px 14px; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: calc(15px * var(--fs)); }
.dl dt { font: 400 calc(11px * var(--fs))/1.9 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.dl a { color: var(--accent-ink); text-underline-offset: 3px; }
.dl .links { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; }
.dl a.lk { display: inline-flex; align-items: center; gap: 6px; }
.fav { width: 14px; height: 14px; flex: none; object-fit: contain; border-radius: 2px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fav { box-sizing: content-box; padding: 1px; background: #fff; } }
:root[data-theme="dark"] .fav { box-sizing: content-box; padding: 1px; background: #fff; }
/* The project's logo (its icon, up to 128 px): 24 px before the name in a row, 72 px beside the title in the drawer. */
.fav-name { width: 24px; height: 24px; border-radius: 4px; }
.d-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px 16px; align-items: start; }
.d-head.no-logo { grid-template-columns: minmax(0, 1fr); }
.d-head-text { display: grid; gap: 10px; min-width: 0; }
.d-head-text .d-tag { margin-top: 0; }
.d-logo { width: 72px; height: 72px; object-fit: contain; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
@media (max-width: 480px) { .d-logo { width: 56px; height: 56px; padding: 6px; border-radius: 10px; } }
.dl a.net { display: inline-flex; padding: 4px; margin: -2px -4px; color: var(--ink-2); border-radius: var(--radius); }
.dl a.net:hover { color: var(--accent-ink); }
.dl a.net svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.dl .repo { font-size: calc(13px * var(--fs)); line-height: 1.7; color: var(--ink-2); }
.related { padding-top: 14px; border-top: 1px solid var(--line); display: grid; }
.related .kicker { margin-bottom: 4px; }
.related .row {
  position: relative; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 8px 0; }
.related .row:last-child { border-bottom: 0; }
.related .thumb { width: 36px; height: 36px; }
.related .row-side, .related .row-desc, .related .row-kw { display: none; }
.d-cta { display: flex; gap: 8px; padding: 10px var(--gutter); padding-bottom: max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.d-cta .btn-primary { flex: 1; }
@media (min-width: 720px) { .d-cta { padding-inline: 28px; } .d-cta .btn-primary { flex: none; } }

.sheet { left: 0; right: 0; bottom: 0; max-height: 88vh; border-radius: 14px 14px 0 0; animation: up .22s cubic-bezier(.2,.8,.2,1); }
.sheet .d-scroll { gap: 0; }
.sheet .grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 8px auto 0; }

@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@keyframes left { from { transform: translateX(32px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- footer ---------- */
.footer { display: grid; gap: 20px; padding-top: 28px; padding-bottom: max(40px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--ink-2); font-size: calc(15px * var(--fs)); }
.footer .kicker { margin-bottom: 6px; }
.footer p { max-width: 62ch; }
.footer .keys { max-width: none; }
@media (hover: none) { .footer .keys { display: none; } }
@media (min-width: 720px) { .footer { grid-template-columns: 1fr 1fr; } .footer > .mono { grid-column: 1 / -1; } }

/* ---------- display preferences (footer) ---------- */
.prefs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; }
.prefs .kicker { margin: 0; flex-basis: 100%; max-width: none; }
.pref { display: flex; align-items: center; gap: 10px; }
.seg-txt button { width: auto; min-width: 34px; padding: 0 9px; font: 500 calc(13px * var(--fs)) / 1 var(--font-mono); }
@media (min-width: 720px) { .prefs { grid-column: 1 / -1; } }

/* ---------- organisation card and works of an author (drawer) ---------- */
.org-card { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: inherit; text-decoration: none; }
.org-card:hover { border-color: var(--line-strong); }
.org-card:hover strong { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.org-card .fav-org { width: 24px; height: 24px; border-radius: 4px; }
.org-mark { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 4px; background: var(--surface-2); font: 700 calc(11px * var(--fs)) / 1 var(--font-head); }
.org-text { display: grid; gap: 1px; min-width: 0; }
.org-text .kicker { margin: 0; }
.org-text strong { font: 600 calc(16px * var(--fs)) / 1.25 var(--font-head); }
.org-blurb { font-size: calc(14px * var(--fs)); color: var(--ink-2); line-height: 1.35; }

/* Dark theme: project images (often on a white page) get some alpha, so they blend into the dark background. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.media, .thumb) img:not(.ico, .fav) { opacity: .85; } }
:root[data-theme="dark"] :is(.media, .thumb) img:not(.ico, .fav) { opacity: .85; }

/* ---------- "Semnalează o problemă" (drawer) ---------- */
.flag { padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: calc(15px * var(--fs)); }
.flag summary { cursor: pointer; color: var(--muted); font: 500 calc(13px * var(--fs)) / 1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.flag summary:hover { color: var(--ink); }
.flag[open] summary { margin-bottom: 8px; color: var(--ink); }
.flag p { margin: 0 0 8px; }
.flag ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.flag li { display: grid; gap: 1px; }
.flag li span { color: var(--muted); font-size: calc(14px * var(--fs)); line-height: 1.4; }

/* ---------- archive pages: /proiect/, /organizatie/, /resursa/ (written by build.py) ---------- */
.arch-hdr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.arch-brand { font: 600 calc(17px * var(--fs)) / 1.3 var(--font-head); letter-spacing: -.01em; color: inherit; text-decoration: none; }
.arch-nav { display: flex; flex-wrap: wrap; gap: 0 18px; flex: 1; }
.arch-nav a { padding: 8px 0; font-size: calc(15px * var(--fs)); color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.arch-nav a:hover { color: var(--ink); }
.arch-nav a[aria-current] { color: var(--ink); border-bottom-color: var(--ink); }
.arch-nav .n { font: 400 calc(12px * var(--fs)) / 1 var(--font-mono); color: var(--muted); }
.arch { display: grid; gap: 22px; padding-top: 28px; padding-bottom: 44px; max-width: 920px; }
.arch h1 { font-size: calc(clamp(28px, 5vw, 40px) * var(--fs)); font-weight: 700; letter-spacing: -.025em; }
.arch-lead { margin: 0; max-width: 62ch; color: var(--ink-2); }
.arch-group { display: grid; gap: 4px; }
.arch-group h2 { display: flex; align-items: baseline; gap: 10px; padding-top: 14px; border-top: 1px solid var(--ink); font-size: calc(21px * var(--fs)); font-weight: 600; }
.arch-group h2 .n { font: 400 calc(13px * var(--fs)) / 1 var(--font-mono); color: var(--muted); }
.arch-hint { margin: 0; font-size: calc(14px * var(--fs)); color: var(--muted); }
.arch-list { list-style: none; margin: 0; padding: 0; }
.arch-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.arch-name { display: inline-flex; align-items: center; gap: 8px; align-self: center; font: 600 calc(16px * var(--fs)) / 1.25 var(--font-head); color: inherit; text-decoration: none; }
.arch-name:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.arch-gone { font: 500 calc(11px * var(--fs)) / 1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--bad); }
.arch-meta { font: 400 calc(12px * var(--fs)) / 1.4 var(--font-mono); letter-spacing: .04em; color: var(--muted); }
.arch-blurb { flex-basis: 100%; margin: 0; color: var(--ink-2); font-size: calc(14px * var(--fs)); line-height: 1.4; }
