:root {
  --navy: #12314f;
  --navy-deep: #0b2238;
  --blue: #185c96;
  --ochre: #c8971f;
  --ochre-soft: #f4e8bd;
  --paper: #f7f6f1;
  --white: #ffffff;
  --ink: #1d2a34;
  --muted: #63717b;
  --line: #d9dde0;
  --line-dark: #b7c0c7;
  --shadow: 0 14px 36px rgba(18, 49, 79, 0.1);
  color-scheme: light;
}

html[data-theme="dark"] {
  --navy: #dcecff;
  --navy-deep: #07131f;
  --blue: #79bfff;
  --ochre: #e2b84d;
  --ochre-soft: #3a311b;
  --paper: #0b141d;
  --white: #132331;
  --ink: #edf4f8;
  --muted: #a9b8c4;
  --line: #2a3d4c;
  --line-dark: #405363;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

button, input, select { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(200, 151, 31, 0.48);
  outline-offset: 3px;
}

.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;
}

.site-header {
  max-width: 1220px;
  margin: 0 auto;
  padding: 24px 32px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  color: var(--navy);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  display: block;
  width: clamp(190px, 24vw, 290px);
  height: 72px;
  object-fit: contain;
  object-position: left center;
  border-radius: 8px;
}

.brand-mark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.brand-label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.source-note {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  flex: 0 0 auto;
}

.header-actions { display: flex; align-items: center; gap: 14px; }

.theme-toggle {
  min-height: 40px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--white);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 750;
  font-size: 0.8rem;
  cursor: pointer;
}

.theme-toggle:hover { border-color: var(--blue); }
.theme-icon { width: 1.1em; text-align: center; font-size: 1rem; }

.source-count {
  background: var(--ochre-soft);
  color: #684b08;
  border-radius: 99px;
  padding: 5px 10px;
  font-weight: 750;
}

main { min-height: 80vh; }

.search-stage {
  background: var(--navy);
  color: #ffffff;
  padding: 54px max(32px, calc((100vw - 1156px) / 2)) 42px;
  position: relative;
  overflow: hidden;
}

.search-stage::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  right: -100px;
  top: -150px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  box-shadow: 0 0 0 48px rgba(255, 255, 255, 0.03), 0 0 0 96px rgba(255, 255, 255, 0.02);
  pointer-events: none;
}

.search-copy, .search-form, .prompt-row { position: relative; z-index: 1; }

.search-copy { max-width: 780px; }

.eyebrow, .results-kicker {
  margin: 0 0 8px;
  color: var(--ochre);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.45rem, 5vw, 4.35rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 600;
}

.lede {
  max-width: 720px;
  margin: 18px 0 0;
  color: #d8e2ea;
  font-size: 1.08rem;
}

.search-form { max-width: 980px; margin-top: 32px; }

.search-box {
  min-height: 72px;
  background: var(--white);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow);
}

.search-glyph {
  width: 20px;
  height: 20px;
  margin-left: 16px;
  border: 2px solid var(--navy);
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto;
}

.search-glyph::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  right: -6px;
  bottom: -3px;
  background: var(--navy);
  transform: rotate(45deg);
  border-radius: 2px;
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 12px 20px;
  color: var(--ink);
  background: transparent;
  font-size: 1.08rem;
}

.search-box input::placeholder { color: #7b8790; }

.search-box button, .empty-state button {
  border: 0;
  border-radius: 7px;
  background: var(--ochre);
  color: #172332;
  padding: 14px 21px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.search-box button:hover, .empty-state button:hover { background: #ddb13e; }

.prompt-row {
  min-height: 34px;
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #b9c8d4;
  font-size: 0.86rem;
}

.prompt-row button {
  color: #edf3f7;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.19);
  border-radius: 99px;
  padding: 6px 11px;
  cursor: pointer;
}

.prompt-row button:hover { background: rgba(255, 255, 255, 0.15); }

.access-note {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd8e1;
  font-size: 0.86rem;
}

.access-note strong { color: #ffffff; }

.finder-shell {
  max-width: 1220px;
  margin: 0 auto;
  padding: 38px 32px 70px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 42px;
  align-items: start;
}

.filters {
  position: sticky;
  top: 18px;
  border-right: 1px solid var(--line);
  padding-right: 26px;
}

.filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.filter-heading h2, .region-filter h3 {
  margin: 0;
  color: var(--navy);
  font-size: 0.83rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.clear-button {
  border: 0;
  padding: 2px;
  background: transparent;
  color: var(--blue);
  font-size: 0.78rem;
  cursor: pointer;
}

.category-list { display: grid; gap: 3px; }

.category-list button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #465661;
  border-radius: 7px;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.category-list button:hover { background: #eceeea; color: var(--navy); }

.category-list button.active {
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
}

.category-list .category-count {
  color: #7f8b94;
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
}

.category-list button.active .category-count { color: #cdd8e0; }

.region-filter { margin-top: 28px; }

.institution-filter {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.institution-filter label, .mobile-access {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
}

.institution-filter input, .mobile-access input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--navy);
  flex: 0 0 auto;
}

.institution-filter span { display: grid; gap: 2px; }
.institution-filter strong { color: var(--navy); font-size: 0.82rem; }

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 11px;
  border: 1px solid var(--line-dark);
  border-radius: 7px;
  padding: 3px;
  background: var(--white);
}

.segmented button {
  border: 0;
  border-radius: 5px;
  padding: 7px 4px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
}

.segmented button.active { background: var(--ochre-soft); color: #674a08; font-weight: 750; }

.mobile-filter-row { display: none; }

.results-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-dark);
}

.results-heading h2 {
  margin: 0;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.results-heading p:last-child { margin: 7px 0 0; color: var(--muted); }

.result-count {
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.2rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.results-grid { display: grid; }

.resource-card {
  padding: 25px 0 24px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
}

.resource-main { min-width: 0; }

.resource-card h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.17rem;
  line-height: 1.3;
}

.resource-card h3 a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.resource-card h3 a:hover { color: var(--blue); }

.resource-description { margin: 9px 0 0; color: #495761; max-width: 750px; }

.match-reason {
  margin: 10px 0 0;
  color: #75550b;
  font-size: 0.84rem;
}

.match-reason strong { font-weight: 800; }

.tag-row { margin-top: 13px; display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  border: 1px solid var(--line);
  color: #5d6972;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 99px;
  padding: 3px 8px;
  font-size: 0.72rem;
  line-height: 1.25;
}

.tag.access-tag {
  border-color: #d4bd70;
  background: var(--ochre-soft);
  color: #674a08;
  font-weight: 750;
}

.resource-action {
  align-self: start;
  color: var(--blue);
  border: 1px solid #b9cbd9;
  background: var(--white);
  border-radius: 7px;
  padding: 8px 11px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 750;
  white-space: nowrap;
}

.resource-action:hover { border-color: var(--blue); background: #f2f7fb; }

.load-more {
  width: 100%;
  margin-top: 24px;
  border: 1px solid var(--navy);
  color: var(--navy);
  background: transparent;
  border-radius: 7px;
  padding: 13px 18px;
  font-weight: 750;
  cursor: pointer;
}

.load-more:hover { color: var(--white); background: var(--navy); }

.empty-state {
  text-align: center;
  padding: 64px 20px;
}

.empty-symbol {
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ochre-soft);
  color: #74530a;
  font-family: Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
}

.empty-state h3 { margin: 0; color: var(--navy); font-size: 1.25rem; }
.empty-state p:not(.empty-symbol) { max-width: 470px; margin: 8px auto 22px; color: var(--muted); }

footer {
  max-width: 1156px;
  margin: 0 auto;
  padding: 28px 0 38px;
  border-top: 1px solid var(--line-dark);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 0.82rem;
}

footer p { margin: 0; }
footer strong { color: var(--navy); }
footer > div { display: grid; gap: 4px; }
.creator-credit { white-space: nowrap; }
.creator-credit span { color: #c94c63; }
.creator-credit a { color: var(--blue); font-weight: 800; text-underline-offset: 3px; }

html[data-theme="dark"] .search-stage { background: #0d263a; }
html[data-theme="dark"] .source-count,
html[data-theme="dark"] .tag.access-tag,
html[data-theme="dark"] .segmented button.active { color: #f3d477; }
html[data-theme="dark"] .category-list button { color: #c0ced8; }
html[data-theme="dark"] .category-list button:hover { background: #152633; color: var(--navy); }
html[data-theme="dark"] .category-list button.active { background: #1f5276; color: #fff; }
html[data-theme="dark"] .resource-description { color: #c1ccd4; }
html[data-theme="dark"] .match-reason { color: #e1bd63; }
html[data-theme="dark"] .tag { background: #132331; color: #b8c6d0; }
html[data-theme="dark"] .resource-action { background: #10202d; }
html[data-theme="dark"] .resource-action:hover { background: #193044; }

@media (max-width: 860px) {
  .source-note span:last-child, .filters { display: none; }
  .finder-shell { grid-template-columns: 1fr; gap: 0; padding-top: 26px; }
  .mobile-filter-row { display: grid; gap: 7px; margin-bottom: 24px; }
  .mobile-filter-row label { color: var(--navy); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
  .mobile-filter-row select { width: 100%; border: 1px solid var(--line-dark); border-radius: 7px; background: var(--white); color: var(--ink); padding: 11px 12px; }
  .mobile-access { align-items: center; margin-top: 4px; font-size: 0.86rem; }
  footer { margin: 0 32px; }
}

@media (max-width: 620px) {
  .site-header { padding: 18px 20px; }
  .brand { gap: 8px; }
  .brand-mark { font-size: 1.55rem; }
  .brand-label { font-size: 0.7rem; }
  .brand img { width: 170px; height: 52px; }
  .source-note { font-size: 0.75rem; }
  .source-note { display: none; }
  .theme-toggle { padding: 7px 10px; }
  .theme-label { display: none; }
  .search-stage { padding: 42px 20px 32px; }
  h1 { font-size: 2.55rem; }
  .lede { font-size: 1rem; }
  .search-box { min-height: auto; display: grid; grid-template-columns: auto 1fr; padding: 8px; }
  .search-glyph { margin-left: 10px; }
  .search-box input { padding: 13px 14px; font-size: 1rem; }
  .search-box button { grid-column: 1 / -1; width: 100%; margin-top: 3px; }
  .prompt-row { align-items: flex-start; }
  .prompt-row > span { width: 100%; }
  .finder-shell { padding: 24px 20px 56px; }
  .results-heading { align-items: flex-start; }
  .result-count { font-size: 1.65rem; }
  .resource-card { grid-template-columns: 1fr; gap: 14px; }
  .resource-action { justify-self: start; }
  footer { margin: 0 20px; padding: 24px 0 30px; display: grid; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
