:root {
  color-scheme: light;
  --canvas: #f7f7fa;
  --paper: #fff;
  --text: #1c1b2b;
  --muted: #575668;
  --line: #e3e1ec;
  --accent: #5635b8;
  --accent-bg: #efeafd;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--text); line-height: 1.5; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #8664f0; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.16; letter-spacing: -.035em; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.1rem, 5.4vw, 4rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
.shell { width: min(1150px, calc(100% - 64px)); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 2; background: white; padding: .5rem 1rem; }
.skip:focus { top: .5rem; }
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner { display: flex; justify-content: space-between; align-items: center; min-height: 66px; gap: 1.2rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); font-size: 1.08rem; font-weight: 780; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: inline-flex; align-items: flex-end; justify-content: center; gap: 2px; padding-bottom: 7px; }
.brand-mark i { width: 3px; height: 7px; background: #f0e4ff; border-radius: 2px 2px 0 0; }
.brand-mark i:nth-child(2) { height: 11px; }
.brand-mark i:nth-child(3) { height: 16px; }
.catalog-nav { display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; }
.catalog-nav a { color: var(--muted); font-size: .9rem; font-weight: 630; padding: .5rem .75rem; border-radius: 6px; text-decoration: none; }
.catalog-nav a:hover, .catalog-nav [aria-current] { color: var(--accent); background: var(--accent-bg); }
.site-promotion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem 1.2rem;
  padding-block: .75rem;
  border-bottom: 1px solid var(--line);
}
.star-callout a {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  font-size: .9rem;
  font-weight: 680;
}
.star-callout span { color: #7e530f; }
.site-ad { min-inline-size: 0; max-inline-size: 100%; }
main { padding-block: 36px 64px; min-height: calc(100vh - 140px); }

.hero { display: grid; grid-template-columns: 1fr minmax(220px, 27%); gap: 2rem; align-items: center; padding: clamp(1.6rem, 5vw, 3.5rem); border-radius: 15px; color: white; background: radial-gradient(ellipse at 94% 0%, #392665, transparent 65%), #1e1736; }
.hero h1 { max-width: 14ch; margin: .65rem 0 .8rem; }
.eyebrow { display: flex; align-items: center; gap: .5rem; color: var(--tone, var(--accent)); font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .11em; }
.hero .eyebrow { color: #d3befc; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.lead { color: var(--muted); max-width: 66ch; font-size: 1.05rem; overflow-wrap: anywhere; }
.hero .lead { color: #dfd9ed; max-width: 50ch; }
.hero-link { display: inline-flex; gap: .75rem; color: #1f153c; background: #e5d7ff; padding: .65rem .85rem; border-radius: 7px; text-decoration: none; font-size: .92rem; font-weight: 740; margin-top: 1.35rem; }
.hero-link:hover { background: white; }
.hero-stats { display: grid; gap: 1rem; padding: 1.2rem 0 1.2rem 1.6rem; border-left: 1px solid #786697; }
.hero-stats strong, .hero-stats span { display: block; }
.hero-stats strong { font: 650 1.65rem/1.2 var(--mono); letter-spacing: -.08em; }
.hero-stats span { color: #d8cfe6; font-size: .83rem; margin-top: .16rem; }
.rankings { margin-top: 2.2rem; }
.section-head { display: flex; gap: .8rem; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; }
.section-head > a { font-size: .88rem; }
.board-grid, .sources-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.github { --tone: #5138a0; --tint: #eee9fb; }
.pypi { --tone: #16528f; --tint: #e7f1fe; }
.npm { --tone: #952c3c; --tint: #fcebed; }
.rubygems { --tone: #9a401f; --tint: #fff0e5; }
.board-card, .detail-card, .table-card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.board-card { min-width: 0; padding: 1.16rem; }
.board-card-head { display: flex; gap: .75rem; align-items: center; }
.source-mark { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 9px; background: var(--tint); color: var(--tone); font: 700 .86rem var(--mono); flex-shrink: 0; }
.board-card h3 a, .board-link { color: var(--text); text-decoration: none; }
.board-card h3 a:hover, .board-link:hover { text-decoration: underline; }
.board-card-head p { color: var(--muted); font-size: .81rem; margin-top: .2rem; }
.leaders { list-style: none; margin: 1rem 0 .6rem; padding: 0; }
.leaders li { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr) auto; align-items: baseline; gap: .5rem; border-top: 1px solid var(--line); padding: .55rem 0; }
.leaders a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .89rem; font-weight: 670; color: var(--text); }
.position, .metric, .trend { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: .87rem; }
.position { color: var(--muted); }
.metric { font-weight: 680; }
.board-link { display: inline-flex; gap: .45rem; font-size: .89rem; font-weight: 720; color: var(--tone); }

.page-head { padding: .5rem 0 1.6rem; }
.page-head h1 { margin: .45rem 0 .6rem; }
.page-head .lead { margin-top: .5rem; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; color: var(--muted); font-size: .87rem; margin-bottom: 1.4rem; }
.crumbs a { color: var(--muted); }
.page-number { color: var(--muted); font-size: .52em; font-weight: 500; }
.periods, .actions { display: flex; gap: .65rem; flex-wrap: wrap; margin-top: 1.1rem; }
.periods span { background: var(--tint, var(--accent-bg)); color: var(--tone, var(--accent)); border-radius: 6px; padding: .43rem .68rem; font-size: .83rem; }
.periods strong { margin-right: .3rem; }
.table-card { overflow: hidden; }
.table-summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 1rem; padding: 1rem 1.1rem; }
.table-summary p, .source-note, .handle { color: var(--muted); font-size: .87rem; }
.table-scroll { overflow-x: auto; }
.table-hint { display: none; }
table { border-collapse: collapse; width: 100%; min-width: 700px; text-align: left; }
table th, table td { padding: .66rem .85rem; border-top: 1px solid var(--line); }
thead th { background: #f2f0f7; vertical-align: top; font-size: .83rem; color: #424052; }
thead small { display: block; margin-top: .14rem; font-weight: 500; font-size: .73rem; }
tbody tr:hover { background: #f8f6fc; }
tbody th { font-size: .9rem; font-weight: 650; overflow-wrap: anywhere; }
tbody th a { color: var(--text); }
.numeric { text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.trend.gain { color: #116849; }
.trend.loss { color: #9d2b3d; }
.pagination { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1rem; }
.pagination a { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; display: inline-grid; min-width: 37px; min-height: 37px; place-items: center; text-decoration: none; }
.pagination [aria-current] { background: var(--accent); color: white; border-color: var(--accent); }
.source-note, .archive-list { margin-top: 1rem; }
.button { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem .8rem; font-weight: 720; font-size: .91rem; color: white; background: var(--tone, var(--accent)); border: 1px solid var(--tone, var(--accent)); border-radius: 7px; text-decoration: none; }
.button.secondary { color: var(--tone, var(--accent)); background: var(--paper); }
.button:hover { text-decoration: underline; }
.detail-card { padding: 1.2rem; margin-bottom: 1rem; }
.detail-card h2 { margin-bottom: .9rem; }
.detail-card p + p { margin-top: .6rem; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin: 0; }
.metrics div { min-width: 0; padding: .8rem; border-radius: 8px; background: #f4f2f8; }
.metrics dt { font-size: .78rem; font-weight: 640; color: var(--muted); }
.metrics dd { margin: .25rem 0 0; font: 650 clamp(1rem, 2.3vw, 1.45rem)/1.25 var(--mono); overflow-wrap: anywhere; }
.metrics .trend { font-size: inherit; }
.metrics .metric-text { font: 650 .92rem/1.3 Inter, sans-serif; }
.repo-facts { display: flex; gap: .6rem 1rem; flex-wrap: wrap; margin-top: .9rem; font-size: .87rem; }
.tag { color: var(--muted); background: #f0eef5; border-radius: 6px; padding: .18rem .4rem; font-size: .75rem; }
.entity-list { list-style: none; padding: 0; margin: 0; }
.entity-list li { display: flex; align-items: baseline; gap: .65rem; flex-wrap: wrap; padding: .64rem 0; border-top: 1px solid var(--line); }
.entity-list li a { overflow-wrap: anywhere; margin-right: auto; }
.entity-list .metric { margin-left: auto; }
.prose { max-width: 80ch; }
.site-footer { background: var(--paper); border-top: 1px solid var(--line); }
.footer-inner > a:last-child { font-size: .85rem; }
@media(max-width: 760px) {
  .shell { width: min(1150px, calc(100% - 36px)); }
  .header-inner { padding: .75rem 0 .55rem; min-height: auto; align-items: flex-start; flex-direction: column; gap: .45rem; }
  .catalog-nav { gap: .15rem; }
  .catalog-nav a { padding: .38rem .55rem; font-size: .83rem; }
  main { padding-block: 22px 42px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .hero h1 { max-width: none; }
  .hero-stats { grid-template-columns: repeat(3, minmax(0,1fr)); padding: 1rem 0 0; border: 0; border-top: 1px solid #786697; gap: .45rem; }
  .hero-stats strong { font-size: 1.2rem; }
  .hero-stats span { font-size: .76rem; }
  .board-grid, .sources-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .table-hint { display: block; padding: 0 1.1rem .65rem; color: var(--muted); font-size: .8rem; }
  table { min-width: 630px; table-layout: fixed; }
  thead th:first-child { width: 47px; }
  thead th:nth-child(2) { width: 151px; }
  thead th:nth-child(3), thead th:nth-child(4) { width: 115px; }
  table th, table td { padding-inline: .5rem; }
}
@media(max-width: 420px) {
  .detail-card { padding: .85rem; }
  .metrics { gap: .45rem; }
  .metrics div { padding: .65rem; }
  .section-head { align-items: flex-start; }
  .footer-inner { align-items: start; flex-direction: column; gap: .3rem; padding: .8rem 0; }
}

.directory-tile { display: block; padding: 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); text-decoration: none; }
.directory-tile span { display: block; color: var(--muted); font-size: .9rem; margin-top: .3rem; }
.directory-tile:hover strong { text-decoration: underline; }
.directory-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); list-style: none; margin: 0; padding: 0; gap: .5rem; }
.directory-grid a { display: block; padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 6px; overflow-wrap: anywhere; }
