:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

.directory-site {
  --map-0: light-dark(#f2f0ea, #1f2127);
  --map-1: light-dark(#dfe2f2, #2a2f4a);
  --map-2: light-dark(#bfc6e8, #3a4275);
  --map-3: light-dark(#8f9bd8, #5662a8);
  --map-4: light-dark(#4f5fbf, #8792dc);
  --map-line: light-dark(#5b5852, #9a978f);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 1rem/1.55 var(--sans);
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
}

main { flex: 1; }
h1, h2, h3, p, dl, dd, figure, ol, ul { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--text); text-wrap: balance; }
h1 { font-size: clamp(1.85rem, 3.6vw, 2.75rem); line-height: 1.12; letter-spacing: -.015em; }
h2 { font-size: clamp(1.25rem, 2.2vw, 1.5rem); line-height: 1.25; }
h3 { font-size: 1.1rem; line-height: 1.3; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select { font: inherit; }
input, select { accent-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.frame { width: min(calc(100% - var(--frame-gutter) * 2), var(--frame-width)); margin-inline: auto; }
.muted { color: var(--muted); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.sr-only:focus { position: static; clip-path: none; width: auto; height: auto; white-space: normal; }
.skip-link { position: fixed; z-index: 10; top: .5rem; left: .5rem; padding: .6rem .9rem; background: var(--card); }
.skip-link:not(:focus) { transform: translateY(-200%); }
.page { padding-block: clamp(1.25rem, 3vw, 2.25rem) 1rem; }
.message-page { min-height: 22rem; }
.message-page p { margin-block: .9rem 1.4rem; }
.lede { max-width: 64ch; margin-top: .75rem; font-size: clamp(1.02rem, 1.6vw, 1.12rem); line-height: 1.6; }
.eyebrow, .rail-heading, .tally h2, .record-section > h2, .section-heading h2.small {
  font: 600 .75rem/1.3 var(--sans);
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow { margin-bottom: .4rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .5rem 1rem;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: .94rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button.primary { background: var(--button); color: var(--button-text); }
.button.primary:hover { text-decoration: underline; }
.button.secondary { background: var(--card); border-color: var(--field); color: var(--accent); }
.button.secondary:hover { background: var(--surface); }

/* Search */
.search-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .5rem;
  padding: .25rem;
  padding-inline-start: .75rem;
  border: 1px solid var(--field);
  border-radius: 2px;
  background: var(--card);
}
.search-box:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-box .search-icon { color: var(--muted); }
.search-box input { width: 100%; min-width: 0; min-height: 44px; padding: .1rem .2rem; border: 0; background: transparent; color: var(--text); }
.search-box input::placeholder { color: var(--muted); opacity: 1; }
.search-box input:focus-visible { outline: 0; }

/* Breadcrumbs */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .5rem; margin-bottom: .5rem; color: var(--muted); font-size: .9rem; }
.breadcrumb a { display: inline-flex; align-items: center; min-height: 32px; }

/* Catalogue records: one family for publications and software. */
.records { padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.record { display: grid; gap: .3rem; padding: .95rem 0 1.05rem; border-bottom: 1px solid var(--line); }
.record-kind, .record-head .record-kind {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .1rem .75rem;
  color: var(--muted);
  font: 400 .84rem/1.4 var(--sans);
}
.record-kind .kind { font-weight: 600; font-size: .75rem; letter-spacing: .07em; text-transform: uppercase; }
.record-publication .kind, .publication-page .record-kind .kind { color: var(--publication); }
.record-software .kind, .project-page .record-kind .kind { color: var(--software); }
.record-kind a { color: inherit; }
.record-title { font: 500 1.14rem/1.32 var(--serif); }
.record-software .record-title { font: 600 1.06rem/1.32 var(--sans); }
.record-title a { text-decoration: none; }
.record-title a:hover { text-decoration: underline; }
.record-byline, .record-summary { font-size: .94rem; }
.record-place, .record-evidence, .record-topic { color: var(--muted); font-size: .86rem; }
.record-topic { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.record-place a, .record-topic a, .record-evidence a:not(.evidence) { color: var(--accent); }
.retracted { color: var(--publication); font-size: .75rem; letter-spacing: .07em; text-transform: uppercase; }
.records[data-view="compact"] .record { grid-template-columns: minmax(0, 1fr) auto; column-gap: 1.5rem; padding-block: .6rem; }
.records[data-view="compact"] .record-title { grid-row: 1; grid-column: 1; }
.records[data-view="compact"] .record-kind { grid-row: 1; grid-column: 2; justify-content: end; }
.records[data-view="compact"] :is(.record-summary, .record-evidence, .record-place) { display: none; }
.records[data-view="compact"] .record-topic { grid-column: 1 / -1; }

/* Evidence labels: the only tags on the site. */
.evidence, .archive-mark {
  display: inline-block;
  padding: 0 .35rem;
  border: 1px solid var(--field);
  border-radius: 2px;
  color: var(--text);
  font: 600 .74rem/1.55 var(--sans);
  letter-spacing: .02em;
  text-decoration: none;
  vertical-align: .05em;
}
.evidence:hover { text-decoration: underline; }
.evidence-verified { background: var(--verified); color: var(--verified-text); border-color: currentColor; }
.archive-mark { color: var(--muted); }

/* Home */
.home { padding-block: clamp(1.5rem, 4vw, 3rem) 0; }
.home-intro { max-width: 52rem; padding-bottom: clamp(1.5rem, 3vw, 2.25rem); }
.home-intro .lede { margin-block: .85rem 1.25rem; }
.home-search { max-width: 44rem; }
.home-examples { margin-top: .6rem; color: var(--muted); font-size: .92rem; }
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(16rem, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.home-grid > section > h2, .home-latest .section-heading h2 { font-size: 1.35rem; }
.home-latest .records { margin-top: .6rem; }
.home-place h2 { margin-bottom: .4rem; }
.home-index {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(0, 3fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  margin-top: 2.5rem;
}
.home-software { margin-top: 2.5rem; }
.home-software .records { margin-top: .6rem; }
.home-labs { margin-top: .9rem; color: var(--muted); font-size: .9rem; max-width: 80ch; }
.as-of { max-width: 72ch; margin-top: 1.5rem; color: var(--muted); font-size: .86rem; }
.home > .as-of { padding-top: 1rem; border-top: 1px solid var(--line); }
.section-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 1rem; }
.section-heading > a { display: inline-block; padding-block: .6rem; font-size: .9rem; }

.county-figure { margin-block: .25rem .5rem; }
.county-map { display: block; width: 100%; max-width: 26rem; height: auto; overflow: visible; }
.county-map path { fill: var(--map-fill); stroke: var(--map-line); stroke-width: .8; }
.county-map a:hover path { stroke: var(--accent); stroke-width: 2; }
.county-map text { fill: var(--text); paint-order: stroke; stroke: var(--paper); stroke-width: 2.5px; text-anchor: middle; font: 600 10px var(--sans); pointer-events: none; }
[data-tone="0"] { --map-fill: var(--map-0); }
[data-tone="1"] { --map-fill: var(--map-1); }
[data-tone="2"] { --map-fill: var(--map-2); }
[data-tone="3"] { --map-fill: var(--map-3); }
[data-tone="4"] { --map-fill: var(--map-4); }
.county-figure figcaption { color: var(--muted); font-size: .84rem; }

/* Tallies: name and count rows used for indexes on home and entity pages. */
.tally h2 { padding-bottom: .35rem; border-bottom: 1px solid var(--rule); }
.tally ul { padding: 0; list-style: none; }
.tally li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  padding: .3rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .92rem;
  break-inside: avoid;
}
.tally li > span { flex: none; color: var(--muted); font-size: .86rem; }
.tally.sites li { display: block; }
.tally.sites li > span { display: block; }
.tally-columns ul { columns: 15rem 3; column-gap: 2rem; }
.tally h2 .muted { font-weight: 400; }

/* Entity, browse and what's new pages */
.entity-head { max-width: 52rem; padding-bottom: 1.25rem; }
.entity-head .lede a { color: var(--accent); }
.entity-links { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin-top: .5rem; font-size: .92rem; }
.entity-links a { display: inline-block; padding-block: .6rem; }
.research-search { max-width: 52rem; }
.research-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "filters results" "index results";
  column-gap: clamp(1.5rem, 3.5vw, 3rem);
  align-items: start;
  margin-top: 1.5rem;
}
.research-filters { grid-area: filters; display: grid; gap: .65rem; }
.research-results { grid-area: results; min-width: 0; max-width: 52rem; }
.research-index { grid-area: index; display: grid; gap: 1.5rem; margin-top: 2rem; }
.rail-heading { padding-bottom: .35rem; border-bottom: 1px solid var(--rule); }
.research-filters label { display: grid; gap: .2rem; font-size: .88rem; font-weight: 600; }
.research-filters select, .sort-value, .date-control input, .page-jump input {
  width: 100%;
  min-height: 44px;
  padding: .35rem .5rem;
  border: 1px solid var(--field);
  border-radius: 2px;
  background: var(--card);
  color: var(--text);
  font-weight: 400;
}
.rail-note { font-size: .86rem; }
.results-bar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; padding-bottom: .5rem; }
.results-count { font-size: .95rem; }
.results-links { font-size: .9rem; }
.results-links a { display: inline-flex; align-items: center; min-height: 32px; }
.day-group + .day-group { margin-top: 1.75rem; }
.day-group > h2 { margin-bottom: .4rem; font-size: 1.15rem; }
.empty-result { padding-block: 1.5rem; }
.empty-result h2, .empty-result h3 { margin-bottom: .35rem; }

.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding-top: 1.25rem; }
.page-links, .page-jump { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.page-links a, .page-links .current-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding-inline: .5rem;
  border-radius: 2px;
}
.page-links a { border: 1px solid var(--line); text-decoration: none; }
.page-links a:hover { background: var(--surface); }
.current-page { background: var(--button); color: var(--button-text); font-weight: 600; }
.page-jump { font-size: .88rem; }
.page-jump input { width: 5rem; }
.pagination > p { font-size: .88rem; }

/* Publication and project pages */
.record-page { max-width: min(100% - var(--frame-gutter) * 2, 64rem); }
.record-head { padding-bottom: 1.25rem; border-bottom: 1px solid var(--rule); }
.record-head h1 { margin-top: .35rem; max-width: 46ch; }
.record-head .lede { margin-top: .6rem; }
.byline { max-width: 80ch; margin-top: .75rem; font-size: 1rem; }
.record-head .muted { margin-top: .35rem; font-size: .9rem; }
.record-place { margin-top: .5rem; }
.record-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.retracted-notice { margin-top: .75rem; padding: .5rem .75rem; border-left: 3px solid var(--publication); background: var(--surface); }
.detail-archive { margin-top: .6rem; }
.record-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); margin-top: 1.5rem; }
.record-body > div > .record-section + .record-section, .record-page > .record-section { margin-top: 1.75rem; }
.record-section > h2 { margin-bottom: .6rem; padding-bottom: .35rem; border-bottom: 1px solid var(--rule); }
.record-section p + p { margin-top: .55rem; }
.record-section .record-evidence { color: var(--text); font-size: .95rem; }
.detail-links { display: flex; flex-wrap: wrap; column-gap: 1.1rem; }
.detail-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: .92rem; }
.facts > div { display: grid; grid-template-columns: minmax(7rem, 10rem) minmax(0, 1fr); gap: .75rem; padding-block: .45rem; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: .88rem; }
.facts dd { font-size: .94rem; }
.plain-list { padding: 0; list-style: none; }
.plain-list li { padding-block: .4rem; border-bottom: 1px solid var(--line); }
.papers { padding: 0; list-style: none; }
.papers li + li { margin-top: .6rem; padding-top: .55rem; border-top: 1px solid var(--line); }
.papers cite { font: 500 1.02rem/1.4 var(--serif); }
.papers p { color: var(--muted); font-size: .9rem; }
.related { margin-top: 2.25rem; }
.related .section-heading h2 { font-size: 1.25rem; }
.related .records { margin-top: .5rem; }
.record-report { margin-top: 1.75rem; }
.record-report a { display: inline-flex; align-items: center; min-height: 44px; }
.separator { padding-inline: .2rem; color: var(--muted); }

/* Methodology */
.prose-page { max-width: min(100% - var(--frame-gutter) * 2, 46rem); }
.prose-page section { margin-top: 1.75rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.prose-page section p, .definition-list { margin-top: .6rem; }
.definition-list div { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: .65rem; padding-block: .4rem; }
.definition-list dt { font-weight: 600; }
.definition-list-stacked div { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
.prose-page pre { max-width: 100%; overflow-x: auto; }
.definition-list :target { background: var(--surface); }

/* Project tools: the faceted software search and GitHub account pages. */
.results-intro p { margin-block: .55rem 1.15rem; color: var(--muted); }
.results-search { max-width: 52rem; margin-top: 1rem; }
.results-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.25rem, 3vw, 3rem);
  margin-top: 1.5rem;
}
.results-content, .filters-aside { min-width: 0; }
.results-content { max-width: 52rem; }
.filter-panel > summary, .facet > summary, .check-control { min-height: 44px; }
.filter-panel > summary, .facet > summary {
  align-content: center;
  padding: .4rem .2rem;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  cursor: pointer;
}
.filter-panel > summary, .filter-sheet-toolbar { display: none; }
.desktop-filter-heading { padding-bottom: .35rem; border-bottom: 1px solid var(--rule); color: var(--muted); font: 600 .75rem/1.3 var(--sans); letter-spacing: .07em; text-transform: uppercase; }
.filter-body > p, .facet p, .date-control .muted { margin-block: .4rem; font-size: .82rem; }
.facet span.selected-count { margin-left: .35rem; color: var(--muted); font-size: .8rem; }
.facet fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.facet ul { max-height: 13rem; margin: 0; padding: .1rem; list-style: none; overflow: auto; scrollbar-gutter: stable; }
#directory-institution ul { max-height: none; overflow: visible; scrollbar-gutter: auto; }
.facet-more > summary { min-height: 44px; align-content: center; padding-inline: .4rem; color: var(--accent); font-size: .86rem; cursor: pointer; }
.facet-more[open] .facet-more-expand, .facet-more:not([open]) .facet-more-collapse { display: none; }
.facet-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .2rem .3rem;
  font-size: .88rem;
  cursor: pointer;
}
.facet-option:hover, .facet-option:has(input:checked) { background: var(--surface); }
.facet-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.facet-option input:focus-visible { outline: none; }
.option-count { color: var(--muted); font-size: .82rem; }
.facet-option input, .check-control input { width: 1rem; height: 1rem; margin: 0; }
.label-help { display: inline-flex; align-items: center; min-height: 44px; font-size: .84rem; }
.check-control { display: flex; align-items: center; gap: .45rem; font-weight: 600; cursor: pointer; }
.date-control { display: grid; gap: .25rem; font-weight: 600; }
.date-control .muted { font-weight: 400; }
.filter-apply { width: 100%; margin-top: .35rem; }
.directory-enhanced .filter-apply { display: none; }
.results-toolbar, .result-controls, .sort-control, .view-switch { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .65rem; }
.results-toolbar { justify-content: space-between; padding-bottom: .5rem; }
.results-toolbar .results-count { white-space: nowrap; }
.sort-control { color: var(--muted); font-size: .88rem; }
.sort-value { width: auto; }
.view-switch { gap: 0; }
.view-switch a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: .6rem; border: 1px solid var(--field); font-size: .86rem; font-weight: 600; text-decoration: none; }
.view-switch a:first-child { border-radius: 2px 0 0 2px; }
.view-switch a:last-child { margin-inline-start: -1px; border-radius: 0 2px 2px 0; }
.view-switch a[aria-current] { background: var(--button); border-color: var(--button); color: var(--button-text); }
.active-filters { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem 1rem; padding-block: .4rem; }
.active-filters ul { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; list-style: none; }
.filter-chip, .reset-link { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; font-size: .86rem; }
.filter-chip { padding: .25rem .55rem; border: 1px solid var(--line); border-radius: 2px; text-decoration: none; }
.filter-chip:hover, .view-switch a:hover { text-decoration: underline; }
.reset-link { font-weight: 600; }
.entity-intro { max-width: 52rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.entity-kind { margin-bottom: .35rem; color: var(--muted); font: 600 .75rem/1.3 var(--sans); letter-spacing: .07em; text-transform: uppercase; }
.entity-account { margin-block: .5rem; }
.entity-stats { display: flex; flex-wrap: wrap; column-gap: 2rem; margin-block: .75rem; }
.entity-stats > div { display: flex; flex-direction: column-reverse; }
.entity-stats dt { color: var(--muted); font-size: .88rem; }
.entity-stats dd { font: 600 1.4rem/1.2 var(--serif); }
.entity-mix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1.4rem; font-size: .9rem; }
.entity-mix dt { font-weight: 600; }
.entity-mix dd span { color: var(--muted); }
.county-empty .button { margin-top: 1rem; }

@media (max-width: 53rem) {
  .research-layout { display: block; }
  .research-filters { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: .5rem .75rem; align-items: end; margin-bottom: 1.25rem; }
  .research-filters .rail-heading, .research-filters .rail-note { grid-column: 1 / -1; }
  .research-index { margin-top: 2.5rem; }
  .home-grid, .home-index, .record-body { grid-template-columns: 1fr; }
  .results-layout { display: block; }
  .filters-aside { position: relative; margin-bottom: .65rem; }
  .filter-panel > summary { display: list-item; padding-inline: .65rem; }
  .filter-panel { border: 1px solid var(--line); border-radius: 2px; background: var(--card); }
  .filter-panel:not([open]) > summary { border-bottom: 0; }
  .desktop-filter-heading { display: none; }
  .filter-body { padding: .7rem; }
  .directory-enhanced .filter-sheet-toolbar {
    position: sticky;
    top: -.7rem;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .45rem;
    padding-block: .2rem;
    border-bottom: 1px solid var(--line);
    background: var(--card);
    font-weight: 600;
  }
  .directory-enhanced .filter-body {
    position: absolute;
    z-index: 2;
    inset-inline-start: 0;
    width: min(100%, 25rem);
    max-height: min(46vh, 28rem);
    overflow: auto;
    scroll-padding-top: 3.2rem;
    background: var(--card);
    border: 1px solid var(--field);
    border-radius: 2px;
    box-shadow: 0 .6rem 1.2rem rgb(0 0 0 / .18);
  }
}
@media (max-width: 33rem) {
  .records[data-view="compact"] .record { grid-template-columns: 1fr; }
  .records[data-view="compact"] .record-kind { grid-row: auto; grid-column: 1; justify-content: start; }
  .records[data-view="compact"] .record-title { grid-row: auto; }
  .entity-mix { grid-template-columns: 1fr; }
  .search-box { gap: .3rem; padding-inline-start: .5rem; }
  .search-box .search-icon { width: 16px; }
  .search-box .button { padding-inline: .7rem; }
  .facts > div { grid-template-columns: 1fr; gap: 0; }
}
