:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1b1f24;
  --muted: #57606a;
  --border: #d8dee4;
  --accent: #0b5cad;
  --accent-soft: #e7f0fa;
  --focus: #0b5cad;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --surface: #161c23;
    --text: #e6edf3;
    --muted: #9aa6b2;
    --border: #2d3640;
    --accent: #6cb6ff;
    --accent-soft: #15283b;
    --focus: #6cb6ff;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1rem; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem .75rem; z-index: 10; }

header.site { border-bottom: 1px solid var(--border); background: var(--surface); }
header.site .wrap { display: flex; align-items: center; gap: .75rem; padding-top: .75rem; padding-bottom: .75rem; }
header.site img { width: 36px; height: 36px; }
header.site .brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
header.site nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; font-size: .95rem; }

.search-hero { padding: 3.5rem 0 2rem; max-width: 52rem; }
.eyebrow { color: var(--accent); font-size: .85rem; font-weight: 700; letter-spacing: .06em; margin: 0 0 .35rem; text-transform: uppercase; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.15; margin: 0 0 1rem; }
.search-hero > p:not(.eyebrow) { color: var(--muted); max-width: 43rem; }

form { margin-top: 2rem; }
form label { display: block; font-weight: 650; margin-bottom: .4rem; }
.search-row { display: flex; gap: .65rem; }
input, select, button { font: inherit; }
input, select { background: var(--surface); border: 1px solid var(--border); border-radius: 7px; color: var(--text); }
input { flex: 1; min-width: 0; padding: .75rem .9rem; }
select { padding: .45rem .7rem; }
button { background: var(--accent); border: 1px solid var(--accent); border-radius: 7px; color: var(--surface); cursor: pointer; font-weight: 650; padding: .75rem 1.25rem; }

.search-output { border-top: 1px solid var(--border); padding: 1.75rem 0 2rem; }
.results-heading { align-items: end; display: flex; justify-content: space-between; gap: 1rem; }
.results-heading h2 { margin: 0; }
.status { color: var(--muted); margin: .25rem 0 0; }
.site-filter { display: grid; font-size: .9rem; font-weight: 650; gap: .2rem; }
.results { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.result { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; margin-bottom: .8rem; padding: 1rem 1.1rem; }
.result h3 { font-size: 1.1rem; line-height: 1.35; margin: 0 0 .25rem; }
.result h3 a { overflow-wrap: anywhere; text-decoration: none; }
.result h3 a:hover { text-decoration: underline; }
.result p { color: var(--muted); margin: .4rem 0 0; }
.result-meta { align-items: center; display: flex; flex-wrap: wrap; gap: .5rem; }
.site-badge { background: var(--accent-soft); border-radius: 999px; color: var(--accent); font-size: .78rem; font-weight: 700; padding: .08rem .55rem; }
.result-path { color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.notice { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 1rem; }

footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; margin-top: 2rem; }
footer .wrap { padding-top: 1.5rem; padding-bottom: 2rem; }

@media (max-width: 42rem) {
  header.site .wrap { align-items: flex-start; flex-wrap: wrap; }
  header.site nav { margin-left: 0; width: 100%; }
  .search-hero { padding-top: 2.25rem; }
  .search-row { align-items: stretch; flex-direction: column; }
  .results-heading { align-items: stretch; flex-direction: column; }
  .site-filter { max-width: 18rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
