@font-face {
  font-family: "xkcd Script"; font-display: swap;
  src: url("/xkcd-script.woff") format("woff");
}
:root {
  --bg: #f6f4ef; --card: #fff; --ink: #1c1f24; --muted: #646b75; --line: #dedad0;
  --accent: #1f3a5f; --accent-ink: #fff;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #15181d; --card: #1e2229; --ink: #e8e6e1; --muted: #9aa1ab; --line: #30353e; --accent: #8fb4e3; --accent-ink: #10141a; }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
main { max-width: 1080px; margin: 0 auto; padding: 48px 20px 32px; }
header { text-align: center; margin-bottom: 28px; }
h1, .tagline { font-family: "xkcd Script", ui-sans-serif, system-ui, sans-serif; }
h1 { font-size: 2.6rem; margin: 0 0 4px; font-weight: 400; }
h1 span { color: var(--muted); font-weight: 400; }
header p { margin: 0; color: var(--muted); }
.tagline { font-size: 1.25rem; }
form { display: flex; gap: 8px; max-width: 640px; margin: 24px auto 0; }
.filter { margin-top: 12px; font-size: 0.9rem; color: var(--muted); }
.filter select {
  margin-left: 4px; padding: 2px 4px; font: inherit; color: inherit; cursor: pointer;
  background: transparent; border: 0; border-bottom: 1px solid var(--muted); border-radius: 0;
}
.filter select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=search] {
  flex: 1; min-width: 0; padding: 12px 16px; font: inherit; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
}
input[type=search]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button {
  padding: 12px 20px; font: inherit; font-weight: 600; cursor: pointer;
  color: var(--accent-ink); background: var(--accent); border: 0; border-radius: 10px;
}
.examples { margin-top: 10px; font-size: 0.9rem; color: var(--muted); }
.examples a { color: inherit; margin: 0 4px; white-space: nowrap; }
#status { text-align: center; color: var(--muted); min-height: 1.5em; margin: 20px 0 12px; }
#results { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
article {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
article h2 { font-size: 1.05rem; margin: 0; }
article h2 a { color: inherit; text-decoration: none; }
article h2 a:hover { text-decoration: underline; }
.num { color: var(--muted); font-weight: 400; }
.thumb {
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 8px; padding: 8px; height: 220px; overflow: hidden;
}
.thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.alt { margin: 0; font-size: 0.9rem; color: var(--muted); font-style: italic; }
.actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.actions button {
  padding: 6px 12px; font-size: 0.85rem; font-weight: 500;
  color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 8px;
}
.actions button:hover { border-color: var(--accent); }
.actions button:disabled { opacity: 0.6; cursor: default; }
.links { font-size: 0.85rem; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.links a { color: var(--accent); }
footer {
  max-width: 720px; margin: 40px auto 0; padding: 20px; text-align: center;
  font-size: 0.85rem; color: var(--muted); border-top: 1px solid var(--line);
}
footer a { color: inherit; }
