/* Flyte Pulse, styled after flyte.org: Instrument Sans, the Flyte purple, rounded
   cards, and pill controls. Dark is the default; <html data-theme="light"> switches. */

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050310;
  --surface: #15141d;
  --surface-raised: #1c1a26;
  --surface-hover: #2a2833;
  --border: #373540;
  --border-subtle: #24222e;
  --heading: #ffffff;
  --text: #e6e6e8;
  --muted: #8f8d99;
  --accent: #8c4fff;
  --accent-strong: #6f2aef;
  --accent-soft: rgba(140, 79, 255, 0.18);
  --accent-text: #b48cff;
  --on-accent: #ffffff;
  --highlight: #ffd21e;
  --danger-bg: #2a1020;
  --danger-border: #6e2a45;
  --danger-text: #ffd0dc;
  --notice-bg: rgba(255, 210, 30, 0.07);
  --grid-line: #24222e;
  --header-bg: rgba(5, 3, 16, 0.86);
  --series-a: #8c4fff;
  --series-b: #ffbc1d;
  --chart-1: #8c4fff;
  --chart-2: #ffbc1d;
  --chart-3: #3ecfb8;
  --chart-4: #ff6b9a;
  --chart-5: #5b8cff;
  --chart-6: #c9a7ff;
  --chart-7: #ff9f43;
  --chart-8: #4ade80;
  --chart-neutral: #6b6975;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f5f4f8;
  --surface-raised: #ffffff;
  --surface-hover: #ebe9f1;
  --border: #e6e6e8;
  --border-subtle: #ebe9f1;
  --heading: #050310;
  --text: #15141d;
  --muted: #6e6c78;
  --accent: #6f2aef;
  --accent-strong: #6f2aef;
  --accent-soft: rgba(111, 42, 239, 0.1);
  --accent-text: #6f2aef;
  --highlight: #ffbc1d;
  --danger-bg: #fff0f3;
  --danger-border: #f4b6c4;
  --danger-text: #8a1d3a;
  --notice-bg: rgba(255, 188, 29, 0.12);
  --grid-line: #ebe9f1;
  --header-bg: rgba(255, 255, 255, 0.88);
  --series-a: #6f2aef;
  --series-b: #f0a500;
  --chart-1: #6f2aef;
  --chart-2: #f0a500;
  --chart-3: #14b8a6;
  --chart-4: #e5487a;
  --chart-5: #3b6fe0;
  --chart-6: #a07ae8;
  --chart-7: #f08a24;
  --chart-8: #22a35a;
  --chart-neutral: #a9a7b2;
}

:root {
  --font:
    "Instrument Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius-small: 0.75rem;
  --radius-medium: 1.5rem;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 26px;
  display: flex;
  align-items: center;
  gap: 28px;
}

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

.brand-logo {
  width: 34px;
  height: 31px;
  color: var(--accent);
  flex: none;
}

.brand-name {
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.brand-name span {
  color: var(--accent-text);
}

.site-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
}

.site-nav a {
  color: var(--heading);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
}

.site-nav a:hover {
  background: var(--surface-hover);
}

.site-nav a[aria-current="page"] {
  background: var(--accent-soft);
}

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

.icon-button,
.pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--heading);
  font: 600 14px var(--font);
  text-decoration: none;
  cursor: pointer;
}

.icon-button {
  width: 40px;
  height: 40px;
}

.icon-button:hover {
  background: var(--surface-hover);
}

.icon-button svg,
.pill-button svg {
  width: 18px;
  height: 18px;
}

.pill-button {
  padding: 9px 18px;
  box-shadow: inset 0 0 0 2px var(--border);
}

.pill-button:hover {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.pill-button.primary {
  background: var(--accent) linear-gradient(rgba(255, 255, 255, 0.28), rgba(0, 0, 0, 0));
  color: var(--on-accent);
  box-shadow: none;
}

.pill-button.primary:hover {
  background-color: var(--accent-strong);
}

/* The toggle shows the current theme: a moon in dark mode, a sun in light mode. */
:root[data-theme="light"] .theme-icon-dark,
:root:not([data-theme="light"]) .theme-icon-light {
  display: none;
}

.icon-button:focus-visible,
.pill-button:focus-visible,
.site-nav a:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Page */

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px 26px 56px;
}

.page-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.eyebrow {
  color: var(--accent-text);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}

.stamp {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.page-head {
  margin: 4px 0 20px;
}

.page-head h1 {
  margin: 0;
  color: var(--heading);
  font-size: 40px;
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.page-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.error {
  display: none;
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger-text);
  border-radius: var(--radius-small);
  padding: 13px 15px;
  margin: 0 0 16px;
}

.page-loading-status {
  margin: 0 0 14px;
}

.page-loading-status[hidden] {
  display: none;
}

/* Filters and controls */

.filters {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-medium);
  padding: 16px 18px;
  margin-bottom: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 165px;
}

.field label,
.search-control label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
}

.field select,
.search-control input {
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface-raised);
  color: var(--heading);
  padding: 9px 12px;
  font: 14px var(--font);
}

.field select {
  min-width: 160px;
}

.field select:focus-visible,
.search-control input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.field.repo,
.field.repo select {
  min-width: 245px;
}

.spacer {
  flex: 1;
}

.status {
  color: var(--muted);
  font-size: 12px;
  padding: 8px 0;
}

.toggle {
  display: inline-flex;
  align-self: start;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
}

.toggle button {
  border: 0;
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  background: transparent;
  color: var(--muted);
  font: 500 12px var(--font);
  white-space: nowrap;
  cursor: pointer;
}

.toggle button:hover {
  color: var(--heading);
}

.toggle button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--heading);
}

.toggle button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.search-control {
  max-width: 460px;
  margin-bottom: 14px;
}

.search-control label {
  display: block;
  margin-bottom: 6px;
}

.search-control input {
  width: 100%;
}

.sort-button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  white-space: nowrap;
  cursor: pointer;
  padding: 0;
}

.sort-button:hover,
.sort-button:focus-visible {
  color: var(--accent-text);
}

/* Cards and panels */

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.cards.summary-cards {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.card,
.panel {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-medium);
}

.card {
  min-height: 118px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -40px;
  top: -56px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.12;
  filter: blur(18px);
}

.card-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.card-value {
  color: var(--heading);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}

.card-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

/* Leaders stand apart from the totals above them: a warm tint, border, and glow. */
.highlight-card {
  border-color: color-mix(in srgb, var(--highlight) 38%, var(--border-subtle));
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--highlight) 9%, var(--surface)),
    var(--surface) 65%
  );
}

.highlight-card::after {
  background: var(--highlight);
  opacity: 0.14;
}

.highlight-label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.highlight-icon {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--highlight);
}

.highlight-subject {
  margin-top: 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--heading);
  overflow: hidden;
  text-overflow: ellipsis;
}

.highlight-subject .user-alias {
  display: block;
  margin: 2px 0 0;
}

.highlight-value {
  margin-top: 8px;
  color: var(--text);
  font-size: 13px;
}

.link-button {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: 500 12px var(--font);
  cursor: pointer;
}

.link-button:hover,
.link-button:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.summary-link {
  color: inherit;
  text-decoration: none;
}

.summary-link:hover,
.summary-link:focus-visible {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.grid > *,
.page-grid > * {
  min-width: 0;
}

.grid > .page-section,
.overview-shares .page-section {
  margin-bottom: 0;
}

.panel {
  padding: 20px 22px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 14px;
}

.panel h2,
.page-section h2 {
  color: var(--heading);
  font-size: 17px;
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.page-section h2 {
  margin-bottom: 10px;
}

.panel-head h2 {
  margin-bottom: 0;
}

.subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.page-section {
  margin: 0 0 16px;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.page-copy {
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}

.page-copy p {
  margin: 0 0 8px;
}

.notice {
  border-left: 3px solid var(--highlight);
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
  padding: 10px 14px;
  color: var(--text);
  background: var(--notice-bg);
  font-size: 13px;
  margin: 0 0 16px;
}

.empty {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 28px 10px;
}

.muted {
  color: var(--muted);
}

.tag-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-size: 12px;
}

.pill {
  display: inline-block;
  color: var(--accent-text);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
}

.profile-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-right: 10px;
  border-radius: var(--radius-small);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
  vertical-align: middle;
}

.affiliation-history {
  margin-top: 16px;
}

/* Links */

.data-link {
  color: var(--heading);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-underline-offset: 3px;
}

.data-link:hover {
  color: var(--accent-text);
  text-decoration-color: currentColor;
}

.external-link {
  color: var(--accent-text);
  text-decoration: none;
}

.external-link:hover {
  text-decoration: underline;
}

.user-alias {
  display: inline-block;
  margin-left: 0.4em;
  color: var(--muted);
  font-size: 0.88em;
  font-weight: 400;
}

td .user-alias {
  display: block;
  margin-left: 0;
}

td small .user-alias {
  display: inline-block;
  margin-left: 0.4em;
}

/* Tables */

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

/* Separate borders keep sticky headers opaque while rows scroll beneath them. */
table {
  width: 100%;
  min-width: max-content;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* About ten rows of people (name and username lines at 1.5 line height, 24px padding,
   1px border), then scroll; the header stays visible. */
.table-scroll {
  max-height: calc(38px + 10 * 62px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
}

tbody tr:hover td {
  background: color-mix(in srgb, var(--surface-hover) 45%, transparent);
}

.secondary {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

.num,
.count {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table-link {
  white-space: normal;
  min-width: 180px;
}

.table-link small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

/* Activity chart */

.legend {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--series-a);
}

.dot.orange {
  background: var(--series-b);
}

.chart {
  width: 100%;
  height: 230px;
  display: block;
  overflow: visible;
}

.gridline {
  stroke: var(--grid-line);
  stroke-width: 1;
}

.axis-label {
  fill: var(--muted);
  font: 10px var(--mono);
}

.series-a,
.series-b {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.series-a {
  stroke: var(--series-a);
}

.series-b {
  stroke: var(--series-b);
}

.point-a,
.point-b {
  stroke: var(--surface);
  stroke-width: 2;
}

.point-a {
  fill: var(--series-a);
}

.point-b {
  fill: var(--series-b);
}

/* Share pies */

.overview-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "activity contributors" "shares contributors";
  align-items: start;
}

.contributors-panel th,
.contributors-panel td {
  padding-left: 8px;
  padding-right: 8px;
}

.overview-grid .activity-panel {
  grid-area: activity;
}

.overview-grid .contributors-panel {
  grid-area: contributors;
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

/* The list fills the panel down to the bottom of the charts beside it and scrolls;
   `contain: size` keeps its rows from making the grid taller. */
.contributors-results {
  flex: 1 1 0;
  min-height: 320px;
  contain: size;
}

.contributors-results > .data-table,
.contributors-results > .data-table > .table-wrap {
  height: 100%;
}

.contributors-results .table-scroll {
  max-height: none;
}

.overview-shares {
  grid-area: shares;
  display: grid;
  gap: 16px;
  min-width: 0;
}

.share-pie {
  --pie-size: 112px;
  display: grid;
  grid-template-columns: var(--pie-size) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 120px;
}

.share-pie-large {
  --pie-size: 168px;
}

.share-pie svg {
  display: block;
  width: var(--pie-size);
  height: var(--pie-size);
  overflow: visible;
}

.share-pie-total {
  fill: var(--heading);
  font: 500 17px var(--font);
}

.share-pie-unit {
  fill: var(--muted);
  font: 10px var(--font);
}

.share-pie-large .share-pie-total {
  font-size: 14px;
}

.share-pie-large .share-pie-unit {
  font-size: 8px;
}

.share-pie-legend {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
  max-height: 220px;
  overflow: auto;
}

.share-pie-legend li {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  transition: opacity 160ms ease;
}

/* A hovered slice pops out along its middle and thickens; the rest fade. */
.share-pie-slice {
  transition:
    transform 180ms ease,
    opacity 160ms ease;
}

.share-pie-slice circle {
  transition: stroke-width 180ms ease;
}

.share-pie-slice.is-active {
  transform: translate(var(--dx), var(--dy));
}

.share-pie-slice.is-active circle {
  stroke-width: 28;
}

.share-pie.is-active .share-pie-slice:not(.is-active),
.share-pie.is-active .share-pie-legend li:not(.is-active) {
  opacity: 0.4;
}

@media (prefers-reduced-motion: reduce) {
  .share-pie-slice,
  .share-pie-slice circle,
  .share-pie-legend li {
    transition: none;
  }
}

.share-pie-key {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--slice-color);
}

.share-pie-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-pie-name .data-link {
  font-size: 12px;
}

.share-pie-value {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.share-pie-panel > .subtitle {
  margin-top: 12px;
}

/* Languages */

.language-bar {
  display: flex;
  gap: 2px;
  height: 8px;
  margin: 16px 0 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-hover);
}

.language-bar > span {
  flex-basis: 0;
  min-width: 2px;
  background: var(--language-color);
}

.language-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
}

.language-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.language-key {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--language-color);
}

.language-name {
  color: var(--heading);
  font-weight: 600;
}

.language-share {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Contributor and repository pages */

.contributor-list-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.contributor-list-count {
  margin-bottom: 10px;
}

.contributor-ai h3 {
  color: var(--heading);
  font-size: 14px;
  font-weight: 500;
  margin: 8px 0 4px;
}

.contributor-ai .cards {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 0 12px;
}

.review-panel .cards {
  margin: 0 0 12px;
}

.contributor-ai .card,
.review-panel .card {
  min-height: 88px;
  padding: 13px 15px;
}

.contributor-ai .card-value,
.review-panel .card-value {
  font-size: 24px;
  margin-top: 5px;
}

.contributor-ai .page-copy {
  margin-bottom: 10px;
}

/* Loading */

.loading-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.5;
}

.loading-inline {
  font-size: 13px;
  vertical-align: middle;
  min-height: 1.5em;
}

.loading-spinner {
  display: inline-block;
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loading-spin 0.8s linear infinite;
}

.loading-inline .loading-spinner {
  width: 15px;
  height: 15px;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 24px 12px;
}

.loading-state[hidden] {
  display: none;
}

.is-refreshing {
  position: relative;
}

.is-refreshing::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 10px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  background: var(--surface);
  opacity: 1;
  filter: none;
  pointer-events: none;
  animation: loading-spin 0.8s linear infinite;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner,
  .is-refreshing::after {
    animation: none;
  }
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border-subtle);
  margin-top: 24px;
}

.site-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 26px 48px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.footer-brand p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 360px;
}

.footer-brand .brand-logo {
  width: 26px;
  height: 24px;
}

.footer-brand .brand-name {
  font-size: 18px;
}

.footer-meta {
  font-size: 12px !important;
}

.footer-heading {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.footer-links a {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  padding: 4px 0;
}

.footer-links a:hover {
  color: var(--accent-text);
}

/* Responsive */

@media (max-width: 1050px) {
  .cards.summary-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .site-header-inner {
    flex-wrap: wrap;
    gap: 12px 20px;
  }
  .site-nav {
    order: 3;
    flex-basis: 100%;
  }
  .header-actions {
    margin-left: auto;
  }
}

@media (max-width: 900px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid,
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .overview-grid {
    grid-template-areas: "activity" "contributors" "shares";
  }
  /* Stacked, the list has no neighbor to match; it scrolls after about ten rows. */
  .contributors-results {
    flex: none;
    min-height: 0;
    contain: none;
  }
  .contributors-results .table-scroll {
    max-height: calc(38px + 10 * 62px);
  }
  .site-footer-inner {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .share-pie {
    --pie-size: 104px;
    gap: 10px;
  }
  .contributor-ai .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .cards.summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .page-grid {
    grid-template-columns: 1fr;
  }
  .page-head h1 {
    font-size: 30px;
  }
  .site-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .site-nav a {
    padding: 7px 11px;
    font-size: 13px;
    white-space: nowrap;
  }
  .pill-button.github {
    display: none;
  }
}

@media (max-width: 560px) {
  .site-header-inner,
  .shell,
  .site-footer-inner {
    padding-left: 16px;
    padding-right: 16px;
  }
  .page-meta {
    display: block;
  }
  .stamp {
    text-align: left;
    margin-top: 4px;
  }
  .filters {
    gap: 10px;
  }
  .field,
  .field select,
  .field.repo,
  .field.repo select {
    min-width: 100%;
    width: 100%;
  }
  .cards {
    gap: 10px;
  }
  .card {
    padding: 14px;
    min-height: 105px;
  }
  .card-value {
    font-size: 28px;
  }
  .panel {
    padding: 16px 14px;
  }
  .panel-head {
    display: block;
  }
  .legend,
  .toggle {
    margin-top: 10px;
  }
  .chart {
    height: 200px;
  }
  .share-pie {
    --pie-size: 96px;
  }
  .share-pie-large {
    --pie-size: 128px;
  }
  .site-footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .cards.summary-cards {
    grid-template-columns: 1fr;
  }
}

/* Contributor tabs and journey */

.page-tabs {
  display: flex;
  gap: 4px;
  margin: -6px 0 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.page-tabs a {
  padding: 10px 16px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.page-tabs a:hover {
  color: var(--heading);
}

.page-tabs a[aria-current="page"] {
  color: var(--heading);
  border-bottom-color: var(--accent);
}

.page-tabs a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius-small);
}

.journey-grid {
  align-items: start;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 4px;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 112px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 26px;
  padding: 10px 0;
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 103px;
  top: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--muted);
  box-sizing: border-box;
}

.timeline-item.kind-milestone::before,
.timeline-item.kind-record::before {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.timeline-item.kind-first::before,
.timeline-item.kind-anniversary::before {
  border-color: var(--highlight);
  background: color-mix(in srgb, var(--highlight) 25%, var(--surface));
}

.timeline-item time {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
  text-align: right;
}

.timeline-kind {
  display: inline-block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.timeline-title {
  color: var(--heading);
  font-size: 14px;
  font-weight: 500;
}

.timeline-detail {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.badge {
  display: flex;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-small);
  padding: 12px 14px;
  background: var(--surface-raised);
}

.badge-text {
  min-width: 0;
  flex: 1;
}

.badge-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-hover);
  color: var(--muted);
}

.badge.unlocked .badge-icon {
  background: var(--accent-soft);
  color: var(--accent-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}

.badge-glyph {
  width: 22px;
  height: 22px;
}

.badge.unlocked {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: linear-gradient(160deg, var(--accent-soft), var(--surface-raised) 70%);
}

.badge.locked {
  opacity: 0.72;
}

.badge-name {
  color: var(--heading);
  font-size: 14px;
  font-weight: 600;
}

.badge-description,
.badge-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.badge-progress {
  height: 4px;
  margin-top: 8px;
  border-radius: 2px;
  background: var(--surface-hover);
  overflow: hidden;
}

.badge-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
}

@media (max-width: 700px) {
  .timeline::before {
    left: 6px;
  }
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 2px;
    padding-left: 24px;
  }
  .timeline-item::before {
    left: 1px;
    top: 14px;
  }
  .timeline-item time {
    text-align: left;
  }
  .badge-grid {
    grid-template-columns: 1fr;
  }
}
