/* Hallmark · genre: modern-minimal · macrostructure: Index-First
 * design-system: design.md · designed-as-app · motion: colour feedback only
 * pre-emit critique: P5 H5 E4 S5 R5 V4 */
:root {
  color-scheme: light;
  --color-paper: oklch(98.7% .005 85);
  --color-surface: oklch(95.7% .007 85);
  --color-ink: oklch(25% .008 65);
  --color-body: oklch(36% .008 65);
  --color-muted: oklch(49% .008 65);
  --color-rule: oklch(88% .008 85);
  --color-accent: oklch(48% .20 256);
  --color-accent-ink: oklch(99% .002 250);
  --color-focus: var(--color-accent);
  --color-tint: oklch(94% .025 256);
  --color-backdrop: oklch(24% .02 258 / .35);
  --font-display: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --text-sm: .8125rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5625rem;
  --text-2xl: 1.953rem;
  --radius-control: 6px;
  --radius-tag: 4px;
  --width-page: 1200px;
  --ease-out: cubic-bezier(.16,1,.3,1);
  --ease-in: cubic-bezier(.7,0,.84,0);
  --ease-in-out: cubic-bezier(.65,0,.35,1);
  --dur-micro: 120ms;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --color-paper: oklch(19% .008 65);
  --color-surface: oklch(24% .008 65);
  --color-ink: oklch(94% .005 85);
  --color-body: oklch(85% .007 85);
  --color-muted: oklch(71% .009 85);
  --color-rule: oklch(36% .008 65);
  --color-accent: oklch(75% .13 256);
  --color-accent-ink: oklch(18% .02 256);
  --color-tint: oklch(29% .04 256);
  --color-backdrop: oklch(10% .005 65 / .65);
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--color-paper); color: var(--color-body); font: 400 var(--text-base)/1.55 var(--font-body); }
h1,h2,h3 { color: var(--color-ink); font-family: var(--font-display); font-style: normal; line-height: 1.25; overflow-wrap: anywhere; min-width: 0; }
h1 { margin: 0 0 var(--space-sm); font-size: var(--text-2xl); font-weight: 600; letter-spacing: -.045em; }
h2 { font-size: var(--text-lg); } h3 { font-size: var(--text-base); }
p { margin: var(--space-sm) 0 var(--space-md); }
a { color: var(--color-accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button,input { font: inherit; color: var(--color-ink); border: 1px solid var(--color-rule); border-radius: var(--radius-control); background: var(--color-paper); min-height: 44px; max-width: 100%; }
button { cursor: pointer; padding: var(--space-sm) var(--space-md); white-space: nowrap; }
button:disabled,input:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
input { padding: var(--space-sm) var(--space-md); min-width: 0; }
input:focus { border-color: var(--color-accent); }
.masthead { display: grid; grid-template-columns: 228px minmax(0, 520px) auto; gap: var(--space-xl); align-items: center; max-width: var(--width-page); margin: auto; padding: var(--space-lg) var(--space-lg); }
.wordmark { color: var(--color-ink); font: 700 var(--text-xl) var(--font-display); letter-spacing: -.065em; text-decoration: none; white-space: nowrap; }
.wordmark span { font-weight: 400; color: var(--color-muted); }
#search-form { display: flex; align-items: center; position: relative; }
#search { width: 100%; padding-right: var(--space-2xl); background: var(--color-surface); border-color: var(--color-surface); font-size: var(--text-sm); }
#search:focus { background: var(--color-paper); border-color: var(--color-accent); }
kbd { position: absolute; right: var(--space-md); pointer-events: none; color: var(--color-muted); font: inherit; font-size: var(--text-sm); }
#search-form:focus-within kbd { display: none; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm); justify-self: end; min-width: 44px; min-height: 44px; padding: var(--space-sm); border: 0; background: transparent; color: var(--color-muted); font-size: var(--text-sm); }
.theme-toggle svg { flex: 0 0 auto; }
.theme-toggle .theme-to-light { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-to-light { display: inline; }
:root[data-theme="dark"] .theme-toggle .theme-to-dark { display: none; }
.theme-toggle:active { background: var(--color-tint); color: var(--color-ink); }
.views { display: flex; gap: var(--space-xl); align-items: center; border-block: 1px solid var(--color-rule); max-width: calc(var(--width-page) - 48px); margin: auto; font-size: var(--text-sm); }
.views a { display: inline-flex; min-height: 48px; align-items: center; text-decoration: none; color: var(--color-muted); white-space: nowrap; }
.views a[aria-current=page] { color: var(--color-ink); box-shadow: inset 0 -2px var(--color-accent); }
.views span { margin-left: auto; color: var(--color-muted); }
main { max-width: var(--width-page); margin: auto; padding: var(--space-xl) var(--space-lg) var(--space-3xl); min-height: 70vh; }
#intro { padding-bottom: var(--space-xl); }
#intro p { margin-bottom: 0; color: var(--color-muted); font-size: var(--text-sm); }
#filter-toggle { display: none; margin-bottom: var(--space-md); }
.workspace { display: grid; grid-template-columns: 208px minmax(0,1fr); gap: 52px; align-items: start; }
aside { min-width: 0; padding-right: var(--space-lg); }
.browse-label { font-size: var(--text-sm); color: var(--color-muted); font-weight: 400; margin: var(--space-sm) 0 var(--space-lg); }
#facets { display: grid; gap: var(--space-lg); }
.facet-group { min-width: 0; }
.facet-group h3 { margin: 0 0 var(--space-xs); font: 600 var(--text-sm) var(--font-body); }
.facet-links { list-style: none; margin: 0; padding: 0; }
.facet-links a { display: flex; min-height: 32px; gap: var(--space-sm); align-items: center; justify-content: space-between; text-decoration: none; font-size: var(--text-sm); padding: var(--space-xs) var(--space-sm); margin-inline: calc(-1 * var(--space-sm)); border-radius: var(--radius-tag); }
.facet-name { min-width: 0; overflow: clip; text-overflow: ellipsis; white-space: nowrap; }
.facet-count { color: var(--color-muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.facet-links a[aria-current=true] { background: transparent; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.facet-links a[aria-current=true] .facet-name::before { content: '✓ '; }
.facet-note,.sample-note,.muted { color: var(--color-muted); font-size: var(--text-sm); }
.facet-note { font-size: .75rem; line-height: 1.6; margin: var(--space-xs) 0 0; }
.text-button { background: none; border: 0; color: var(--color-accent); padding: var(--space-xs) 0; text-decoration: none; }
.facet-group .text-button { font-size: var(--text-sm); min-height: 32px; }
.result-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); min-height: 36px; }
.result-head p { margin: 0; font-size: var(--text-sm); font-weight: 600; color: var(--color-ink); }
#sort-links { display: flex; flex-wrap: wrap; gap: 0 var(--space-md); align-items: center; font-size: .75rem; }
#sort-links a { display: inline-flex; min-height: 36px; align-items: center; text-decoration: none; color: var(--color-muted); white-space: nowrap; }
#sort-links a[aria-current=true] { color: var(--color-ink); text-decoration: underline; text-decoration-color: var(--color-accent); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.sample-note { font-size: .75rem; margin: var(--space-xs) 0 var(--space-md); }
#active-filters { margin: var(--space-md) 0; }
.tags { display: flex; gap: var(--space-xs) var(--space-sm); flex-wrap: wrap; align-items: center; }
a.tag { display: inline-flex; align-items: center; min-height: 28px; max-width: 100%; padding: var(--space-xs) var(--space-sm); color: var(--color-body); background: var(--color-surface); border-radius: var(--radius-tag); font-size: .75rem; line-height: 1.35; text-decoration: none; white-space: nowrap; overflow: clip; text-overflow: ellipsis; }
a.tag[aria-current=true],a.active-tag { color: var(--color-ink); background: transparent; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.clear-link,.more-topics { display: inline-flex; align-items: center; min-height: 28px; font-size: .75rem; white-space: nowrap; }
.repo { min-width: 0; padding: var(--space-lg) 0; border-top: 1px solid var(--color-rule); }
.repo-title { margin: 0 0 var(--space-xs); font-size: 1.0625rem; font-weight: 600; letter-spacing: -.025em; }
.repo-title a { display: block; width: fit-content; max-width: 100%; color: var(--color-ink); text-decoration: none; overflow: clip; text-overflow: ellipsis; white-space: nowrap; }
.repo-owner { color: var(--color-muted); font-weight: 400; }
.repo-title a:hover,.repo-title a:hover .repo-owner { color: var(--color-accent); }
.repo-description { max-width: 72ch; margin: var(--space-xs) 0 var(--space-sm); font-size: .875rem; line-height: 1.6; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: clip; }
.repo-meta { display: flex; gap: var(--space-xs) var(--space-md); flex-wrap: wrap; align-items: center; font-size: .75rem; color: var(--color-muted); }
.repo-meta a { min-height: 28px; display: inline-flex; align-items: center; max-width: 100%; white-space: nowrap; overflow: clip; text-overflow: ellipsis; color: var(--color-muted); text-decoration: none; }
.repo-labels { gap: var(--space-xs) var(--space-sm); margin-top: var(--space-xs); }
.repo-routes { flex-wrap: nowrap; gap: var(--space-lg); }
.repo-routes .repo-url { display: block; min-width: 0; flex: 0 1 auto; line-height: 28px; }
.repo-routes .discussion-link { flex: 0 0 auto; display: inline-flex; align-items: center; gap: var(--space-xs); color: var(--color-accent); min-height: 28px; text-decoration: none; white-space: nowrap; }
.discussion-link strong { font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.discussion-link span { font-size: .75rem; }
#more { display: block; margin: var(--space-lg) auto 0; }
#pagination,.evidence-pagination { display: flex; flex-wrap: wrap; gap: var(--space-sm) var(--space-lg); justify-content: space-between; align-items: center; border-top: 1px solid var(--color-rule); padding-top: var(--space-md); margin-top: var(--space-sm); font-size: var(--text-sm); }
#pagination a,.evidence-pagination a { display: inline-flex; min-height: 44px; align-items: center; white-space: nowrap; text-decoration: none; }
.empty { padding: var(--space-2xl) 0; } .empty h2 { margin-top: 0; }
.topic-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 var(--space-xl); }
.topic-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); border-top: 1px solid var(--color-rule); padding: var(--space-sm) 0; }
.topic-row a { display: inline-flex; align-items: center; min-height: 44px; min-width: 0; max-width: 75%; white-space: nowrap; overflow: clip; text-overflow: ellipsis; text-decoration: none; font-size: .875rem; }
.topic-row > span { white-space: nowrap; font-variant-numeric: tabular-nums; }
#detail { max-width: 1000px; margin: auto; }
.back { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; margin-bottom: var(--space-xs); font-size: var(--text-sm); white-space: nowrap; text-decoration: none; }
.detail-head { border-bottom: 1px solid var(--color-rule); padding-bottom: var(--space-md); }
.detail-head h1 { margin-top: 0; }
.detail-head p { max-width: 72ch; }
.repository-url { display: block; max-width: 100%; overflow: clip; text-overflow: ellipsis; white-space: nowrap; }
.detail-head .tags { margin-block: var(--space-sm); }
.detail-head p:last-child { margin-bottom: var(--space-sm); }
.metrics { display: flex; flex-wrap: wrap; gap: var(--space-lg) var(--space-xl); margin: var(--space-lg) 0; font-variant-numeric: tabular-nums; }
.metrics strong { display: block; color: var(--color-ink); font: 600 var(--text-xl) var(--font-display); }
.metrics span { font-size: var(--text-sm); color: var(--color-muted); }
#detail > h2 { margin-top: var(--space-lg); }
.repository-facts { display: flex; flex-wrap: wrap; gap: var(--space-sm) var(--space-lg); align-items: center; margin-top: var(--space-sm); font-size: .875rem; }
.repository-facts a { text-decoration: none; }
.status-label { font-weight: 600; color: var(--color-ink); }
.linked-pages { list-style: none; margin: 0; padding: 0; }
.linked-page { border-top: 1px solid var(--color-rule); padding: var(--space-md) 0; min-width: 0; }
.linked-topline { display: flex; align-items: start; justify-content: space-between; gap: var(--space-md); margin-bottom: var(--space-xs); }
.linked-count { color: var(--color-muted); font-size: .75rem; font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: var(--space-xs); }
.linked-label { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-sm); min-width: 0; font-size: var(--text-sm); font-weight: 500; color: var(--color-ink); }
.linked-label > span { overflow-wrap: anywhere; min-width: 0; }
.linked-url { display: block; max-width: 100%; overflow-wrap: anywhere; font-size: .875rem; text-decoration: none; margin-bottom: var(--space-xs); }
.story-badge { display: inline-flex; align-items: center; min-height: 28px; color: var(--color-accent); padding: 0 var(--space-sm); font-size: .75rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.hn-links { line-height: 2; font-size: var(--text-sm); }
.hn-links a { display: inline-block; white-space: nowrap; text-decoration: none; }
.hn-reference { display: inline-block; white-space: nowrap; margin-right: var(--space-xs); }
.more-hn-links { display: inline-flex; min-height: 28px; padding: 0 var(--space-sm); font-size: .75rem; margin-left: var(--space-xs); }
.hn-links a:hover,.linked-url:hover { text-decoration: underline; }
.evidence { padding: var(--space-lg) 0; border-top: 1px solid var(--color-rule); }
.evidence h3 { font-size: var(--text-lg); margin: var(--space-sm) 0 var(--space-md); letter-spacing: -.02em; }
.evidence h3 a { color: var(--color-ink); text-decoration: none; }
.evidence-text { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 75ch; margin: var(--space-md) 0; font-size: .9375rem; line-height: 1.75; }
.topic-evidence { border-top: 1px solid var(--color-rule); padding-top: var(--space-md); }
.topic-evidence p { margin-block: var(--space-sm); }
details { margin: var(--space-md) 0; font-size: var(--text-sm); }
summary { cursor: pointer; padding: var(--space-sm) 0; color: var(--color-accent); }
.original-links { padding-left: var(--space-lg); } .original-links a { overflow-wrap: anywhere; } .original-links li { margin: var(--space-sm) 0; }
footer { border-top: 1px solid var(--color-rule); max-width: calc(var(--width-page) - 48px); margin: auto; padding: var(--space-lg) 0; display: flex; gap: var(--space-lg); justify-content: space-between; font-size: .75rem; color: var(--color-muted); }
footer p { margin: 0; max-width: 85ch; } footer a { white-space: nowrap; }
dialog { border: 1px solid var(--color-rule); border-radius: var(--radius-control); background: var(--color-paper); color: var(--color-body); width: min(760px, calc(100vw - 32px)); max-height: 85vh; padding: var(--space-lg); }
dialog::backdrop { background: var(--color-backdrop); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-md); }
#coverage-content { overflow-wrap: anywhere; font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: clip; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; top: -100px; left: var(--space-lg); background: var(--color-paper); padding: var(--space-md); z-index: 2; }
.skip:focus { top: 0; }
[hidden] { display: none !important; }
html[data-catalogue-route=filtered] #results[data-prerender] { visibility: hidden; }
#results[aria-busy=true] { opacity: .65; pointer-events: none; }
@media (hover: hover) {
  a,button,#search { transition: color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out); }
  .facet-links a:hover { background: var(--color-surface); }
  a.tag:hover { background: var(--color-surface); color: var(--color-ink); text-decoration: underline; }
  a.active-tag:hover,a.tag[aria-current=true]:hover { background: transparent; color: var(--color-ink); text-decoration: underline; }
  .text-button:hover,.repo-meta a:hover,.topic-row a:hover,.discussion-link:hover span,#sort-links a:hover,#pagination a:hover,.back:hover { text-decoration: underline; }
  .discussion-link:hover strong { color: var(--color-accent); }
  .theme-toggle:hover { background: var(--color-surface); color: var(--color-ink); }
}
a.tag:active,.facet-links a:active { background: transparent; color: var(--color-accent); text-decoration: underline; }
button:active { color: var(--color-ink); }
@media(max-width: 1000px) {
  .masthead { grid-template-columns: 184px minmax(0,1fr) auto; gap: var(--space-lg); }
  .workspace { grid-template-columns: 184px minmax(0,1fr); gap: var(--space-lg); }
  aside { padding-right: var(--space-sm); }
  .views,footer { margin-inline: var(--space-lg); }
}
@media(max-width: 640px) {
  .masthead { padding: var(--space-md); grid-template-columns: minmax(0,1fr) auto; gap: var(--space-sm) var(--space-md); }
  #search-form { grid-column: 1/-1; grid-row: 2; }
  #search { font-size: 1rem; }
  kbd { display: none; }
  .wordmark { font-size: var(--text-lg); }
  main { padding: var(--space-lg) var(--space-md) var(--space-2xl); }
  .views { margin-inline: var(--space-md); gap: var(--space-lg); font-size: .875rem; }
  .views span { display: none; }
  h1 { font-size: var(--text-xl); }
  #intro { padding-bottom: var(--space-md); }
  #filter-toggle:not([hidden]) { display: inline-flex; min-height: 44px; align-items: center; font-size: .875rem; }
  .workspace { grid-template-columns: minmax(0,1fr); gap: var(--space-lg); }
  aside { border-bottom: 1px solid var(--color-rule); padding: 0 0 var(--space-lg); }
  .browse-label { display: none; }
  #facets { grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--space-lg); }
  .facet-group:first-child { grid-column: 1/-1; }
  .facet-group:first-child .facet-links { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: var(--space-lg); }
  .facet-links a,.facet-group .text-button { min-height: 44px; font-size: .875rem; }
  .result-head { align-items: start; gap: var(--space-xs); }
  .result-head p { font-size: .875rem; }
  #sort-links { width: 100%; gap: 0 var(--space-md); font-size: .875rem; }
  #sort-links a { min-height: 44px; }
  #sort-links > span { display: none; }
  .sample-note { line-height: 1.6; }
  .repo { padding-block: var(--space-md); }
  .repo-routes { gap: var(--space-md); }
  .repo-title { font-size: 1.125rem; }
  .repo-title a { min-height: 44px; padding-block: 10px; }
  .repo-description { font-size: 1rem; }
  .repo-meta,a.tag,.clear-link,.more-topics,.discussion-link strong,.discussion-link span { font-size: .875rem; }
  a.tag,.clear-link,.more-topics,.repo-meta a { min-height: 44px; }
  .repo-title a,.repo-labels > a,#sort-links a { min-width: 44px; }
  .repo-labels > a { justify-content: center; }
  .repo-routes .discussion-link { min-height: 44px; }
  .repo-routes .repo-url { line-height: 44px; }
  .topic-grid { grid-template-columns: minmax(0,1fr); }
  .topic-row a { font-size: var(--text-sm); }
  .detail-head h1 { font-size: var(--text-xl); }
  .metrics { gap: var(--space-md) var(--space-lg); }
  footer { flex-direction: column; margin-inline: var(--space-md); }
}
@media(pointer: coarse) {
  a.tag,.clear-link,.more-topics,.repo-meta a,.facet-links a,.facet-group .text-button,#sort-links a { min-height: 44px; }
  .repo-routes .discussion-link { min-height: 44px; }
  .repo-routes .repo-url { line-height: 44px; }
  .hn-links a,.story-badge,.more-hn-links { min-height: 44px; }
  .hn-links a { display: inline-flex; align-items: center; }
}
@media(prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }

.activity-history { margin: var(--space-xl) 0; }
.activity-history h2 { margin: 0 0 var(--space-xs); }
.activity-coverage,.activity-axis,.activity-readout,.activity-note { font-size: .75rem; }
.activity-charts { max-width: 42rem; margin-top: var(--space-lg); }
.activity-chart { margin: 0; min-width: 0; color: var(--color-accent); }
.activity-chart figcaption { display: flex; justify-content: space-between; gap: var(--space-md); color: var(--color-body); font-size: .875rem; }
.activity-chart figcaption strong { font-variant-numeric: tabular-nums; }
.activity-chart svg { display: block; width: 100%; height: auto; margin-top: var(--space-sm); overflow: visible; touch-action: pan-y; }
.activity-line { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.activity-baseline { stroke: var(--color-rule); stroke-width: 1; }
.activity-cursor { stroke: currentColor; stroke-opacity: .2; stroke-width: 1; }
.activity-dot { fill: var(--color-paper); stroke: currentColor; stroke-width: 1.5; }
.activity-axis { display: flex; justify-content: space-between; color: var(--color-muted); }
.activity-readout { min-height: 1.6em; margin-top: var(--space-sm); color: var(--color-body); font-variant-numeric: tabular-nums; }
.activity-note { max-width: 85ch; line-height: 1.6; margin-bottom: var(--space-xs); }
