:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #5c5c57;
  --border: #deded8;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --code-bg: #f1efe9;
  --radius: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --surface: #1e1e1c;
    --text: #ecebe6;
    --muted: #a9a8a1;
    --border: #34342f;
    --accent: #fb923c;
    --accent-ink: #1c1c1a;
    --code-bg: #2a2a26;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Nav */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.nav { max-width: 960px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; min-height: 60px; flex-wrap: wrap; }
.brand { font-weight: 700; text-decoration: none; font-size: 1.05rem; }
.nav-links { list-style: none; display: flex; gap: 24px; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: var(--muted); }
.nav-links a:hover { color: var(--text); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 1.2rem; min-width: 44px; min-height: 44px; cursor: pointer; }

@media (max-width: 640px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links { display: none; width: 100%; flex-direction: column; gap: 0; padding-bottom: 8px; }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 12px 0; }
}

/* Layout */
main { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.hero { padding: 48px 0 24px; }
h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.02em; }
.lede { color: var(--muted); font-size: 1.1rem; margin: 0; max-width: 60ch; }

.controls { display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.field { display: grid; gap: 6px; }
.label { font-size: .85rem; font-weight: 600; color: var(--muted); }
input[type="search"] {
  font: inherit; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); width: 100%;
}
.chips { border: 0; padding: 0; margin: 0; }
.chips legend { padding: 0; margin-bottom: 6px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: .9rem; padding: 8px 14px; min-height: 40px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.count { color: var(--muted); margin: 20px 0 10px; }

.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.card { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; }
.card h3 { margin: 0; font-size: 1rem; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; }
.tag { justify-self: start; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cmd { display: flex; gap: 8px; align-items: stretch; }
.cmd code {
  flex: 1; min-width: 0; background: var(--code-bg); border-radius: 6px; padding: 8px 10px;
  font: .88rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere;
}
.btn {
  font: inherit; font-size: .85rem; padding: 8px 12px; min-height: 40px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.btn:hover { border-color: var(--accent); }

.state { text-align: center; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 32px 20px; }
.state p { margin: 0 0 8px; color: var(--muted); }
.state .state-title { color: var(--text); font-weight: 600; }
.state-error { border-color: var(--accent); }

.about { padding: 48px 0; }
.about h2 { margin: 0 0 8px; }
.about p { color: var(--muted); margin: 0; }

.site-footer { border-top: 1px solid var(--border); text-align: center; color: var(--muted); font-size: .85rem; padding: 20px; }
