:root {
  --bg: #13131e;
  --card: #1c1c2a;
  --fg: #d8d8e0;
  --muted: #8a8a99;
  --accent: #7b9fc4;
  --green: #8cab79;
  --border: #2a2a3a;
  --mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
}
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: 220ms; }
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, sans-serif;
}
h1, h2, .name, code, kbd, .cmd code {
  font-family: var(--mono);
}
header {
  padding: 2rem 1.5rem 1.2rem;
  max-width: 1400px;
  margin: 0 auto;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.4rem;
}
.site-logo {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}
header h1 {
  margin: 0;
  font-size: 1.8rem;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: -0.02em;
}
header h1 .prompt { color: var(--green); margin-right: 0.4rem; }
header p { margin: 0; color: var(--muted); font-size: 0.9rem; }
header a { color: var(--accent); text-decoration: none; }
main { max-width: 1400px; margin: 0 auto; padding: 0.5rem 1.5rem 3rem; }

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 0;
  margin-bottom: 0.8rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
}
.search {
  flex: 1 1 200px;
  max-width: 360px;
  padding: 0.5rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font: inherit;
}
.search:focus { outline: none; border-color: var(--accent); }
.chips { display: flex; gap: 0.4rem; }
.chip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  padding: 0.3rem 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--fg); }
.chip.active {
  background: var(--green);
  border-color: var(--green);
  color: #10101a;
  font-weight: 600;
}
.count { color: var(--muted); font-size: 0.85rem; margin-left: auto; }
kbd {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 0.35em;
  font-size: 0.8em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  align-items: start;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: var(--fg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 18px rgba(0,0,0,0.6);
  transform: translateY(-2px);
}
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card.hidden { display: none; }
.card .thumb-wrap {
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.card img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.18s ease-out;
}
.card:hover img { transform: scale(1.03); }
.card .name {
  font-family: monospace;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.6rem 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--fg);
  letter-spacing: 0.01em;
}
.no-results { color: var(--muted); display: none; }

.detail-img-link { display: block; }
.detail-img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.full-hint { color: var(--muted); font-size: 0.8rem; margin: 0.3rem 0 0; }
.cmd-block { margin: 1.2rem 0; }
.cmd-block h2 { font-size: 1rem; color: var(--muted); margin: 0 0 0.4rem; }
.cmd {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 1rem;
}
.cmd code { flex: 1; font-size: 0.95rem; overflow-x: auto; white-space: nowrap; }
.cmd button {
  background: var(--accent);
  color: #10101a;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.cmd button:active { transform: scale(0.96); }
.cmd button:focus-visible { outline: 2px solid var(--fg); }
nav.pager {
  display: flex;
  justify-content: space-between;
  margin: 0 0 0.8rem;
  font-family: monospace;
}
nav.pager a { color: var(--accent); text-decoration: none; }
nav.pager a:hover { text-decoration: underline; }
.back { color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 1rem; }
.back:hover { color: var(--accent); }
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.cta {
  background: var(--green);
  color: #10101a;
  border-radius: 999px;
  padding: 0.55rem 1.3rem;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
}
.cta:hover { filter: brightness(1.1); }
.cta:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
#use { scroll-margin-top: 1rem; }
html { scroll-behavior: smooth; }
footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}
footer a { color: var(--accent); text-decoration: none; }
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  background: var(--accent);
  color: #10101a;
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  font-weight: 600;
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus { left: 0.5rem; }
