:root {
  --paper: #f3eee3;
  --ink: #1c1712;
  --muted: #6b5f52;
  --rule: #d9cfc0;
  --rust: #c45c26;
  --gain: #2f6b4f;
  --loss: #9b2335;
  --gold: #b8892d;
  --chip: #efe6d6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background:
    radial-gradient(1200px 400px at 10% -10%, #fff8ea 0%, transparent 50%),
    var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

a { color: inherit; }

.sheet {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.masthead {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: flex-end;
  border-bottom: 3px solid var(--ink);
  padding-bottom: 1.25rem;
}

.kicker {
  margin: 0 0 0.35rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--rust);
  font-weight: 600;
}

h1 {
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 0.95;
  margin: 0;
  font-variation-settings: "opsz" 80;
}

.lede, .stamp {
  color: var(--muted);
  margin: 0.7rem 0 0;
  max-width: 40rem;
}

.periods {
  display: flex;
  gap: 0.4rem;
}

.periods button {
  font: inherit;
  background: transparent;
  border: 1px solid var(--ink);
  padding: 0.4rem 0.85rem;
  cursor: pointer;
}

.periods button.is-active {
  background: var(--ink);
  color: var(--paper);
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.stat {
  border: 1px solid var(--rule);
  padding: 0.9rem 1rem;
  background: #faf6ee;
}

.stat b {
  display: block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 1.35rem;
}

.stat span {
  color: var(--muted);
  font-size: 0.8rem;
}

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  margin: 0 0 1.75rem;
  font-size: 0.92rem;
}

.jump a { text-underline-offset: 0.2em; }

.panel {
  margin: 0 0 2rem;
}

.panel-head h2 {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.7rem;
  margin: 0 0 0.25rem;
}

.panel-head p {
  margin: 0 0 0.9rem;
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

#explorer-table table {
  min-width: 44rem;
}

th, td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

th {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.num, .delta {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  text-align: right;
  white-space: nowrap;
}

.repo a {
  font-weight: 600;
  text-decoration: none;
}

.repo a:hover { text-decoration: underline; }

.repo-line {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
}

.info-mark {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: italic 700 0.78rem/1 Fraunces, Georgia, serif;
  padding: 0;
  cursor: help;
}

.info-mark:hover,
.info-mark:focus,
.graph-mark:hover,
.graph-mark:focus {
  background: var(--ink);
  color: var(--paper);
  outline: none;
}

.graph-mark {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  padding: 0;
  cursor: help;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.graph-mark svg {
  width: 0.7rem;
  height: 0.7rem;
  display: block;
}

.repo .meta, .repo .notice {
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.people {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin-top: 0.35rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.75rem;
}

.people-bit {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.faces {
  display: inline-flex;
  align-items: center;
}

.faces .face {
  margin-left: -0.35rem;
  border: 1px solid var(--paper);
}

.faces .face:first-child { margin-left: 0; }

.people a.user {
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.people a.user:hover { text-decoration: underline; }

.face {
  display: inline-flex;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--chip);
  flex-shrink: 0;
}

.face img {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: cover;
}

.badge {
  display: inline-block;
  margin: 0.2rem 0 0 0.45rem;
  padding: 0.08rem 0.45rem;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  vertical-align: middle;
  border: 1px solid #6b3fa0;
  color: #5a2d8c;
  background: #f3eafb;
}

.badge-empty {
  border-color: #6b3fa0;
  color: #5a2d8c;
  background: #f3eafb;
}

.badge-unmaintained {
  border-color: var(--gold);
  color: #7a5a12;
  background: #f7eed8;
}

.lang {
  display: inline-block;
  background: var(--chip);
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
}

.up { color: var(--gain); }
.down { color: var(--loss); }
.flat { color: var(--muted); }

.empty {
  color: var(--muted);
  padding: 1rem 0;
  font-style: italic;
}

.bars { display: flex; flex-direction: column; gap: 0.65rem; }

.bar-row {
  display: grid;
  grid-template-columns: 9rem 1fr 7rem;
  gap: 0.75rem;
  align-items: center;
}

.bar-track {
  height: 0.7rem;
  background: var(--chip);
}

.bar-fill {
  height: 100%;
  background: var(--ink);
}

.bar-meta {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  text-align: right;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.8rem;
  margin: 0 0 0.9rem;
  align-items: end;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.filters select,
.filters input {
  font: inherit;
  font-size: 0.88rem;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
  color: var(--ink);
  border: 1px solid var(--ink);
  background: #faf6ee;
  padding: 0.38rem 0.55rem;
  min-width: 8rem;
}

.filters input[type="search"] { min-width: 11rem; }
.filters input[type="number"] { min-width: 7rem; width: 7rem; }

th.sortable {
  cursor: pointer;
  user-select: none;
}

th.sortable:hover { color: var(--ink); }

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.pager-actions {
  display: flex;
  gap: 0.4rem;
}

.pager button {
  font: inherit;
  background: transparent;
  border: 1px solid var(--ink);
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}

.pager button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.bar-row { cursor: pointer; }
.bar-row:hover .bar-fill { background: var(--rust); }

.colophon {
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.error {
  border: 1px solid var(--loss);
  color: var(--loss);
  padding: 0.8rem 1rem;
  margin: 1rem 0;
}

#about-tip {
  position: fixed;
  z-index: 40;
  max-width: 22rem;
  padding: 0.65rem 0.8rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.84rem;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 10px 28px rgba(28, 24, 18, 0.22);
}

#about-tip[hidden] { display: none; }

#about-tip .about-kicker {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 0.15rem;
}

#about-tip .about-name {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

#about-tip p {
  margin: 0;
  font-weight: 400;
}

#pulse-tip {
  position: fixed;
  z-index: 41;
  max-width: 22rem;
  padding: 0.7rem 0.8rem 0.8rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.84rem;
  line-height: 1.35;
  pointer-events: none;
}

#pulse-tip[hidden] { display: none; }

.pulse-bars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  height: 5.6rem;
  margin-top: 0.55rem;
  align-items: stretch;
}

.pulse-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  gap: 0.18rem;
}

.pulse-col b {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 500;
}

.pulse-track {
  flex: 1;
  width: 1.2rem;
  background: rgba(243, 238, 227, 0.16);
  display: flex;
  align-items: flex-end;
}

.pulse-fill {
  display: block;
  width: 100%;
  background: var(--paper);
  min-height: 2px;
  font-style: normal;
}

.pulse-fill.is-up { background: #d7e4d6; }
.pulse-fill.is-down { background: #e4c4c8; }

.pulse-col span {
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0.72;
  line-height: 1.2;
}

.pulse-note {
  margin: 0.55rem 0 0;
  font-size: 0.68rem;
  opacity: 0.62;
  line-height: 1.3;
}

#history-tip {
  position: fixed;
  z-index: 41;
  max-width: 24rem;
  padding: 0.7rem 0.8rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.84rem;
  line-height: 1.35;
  pointer-events: none;
}

#history-tip[hidden] { display: none; }

#history-tip .about-kicker,
#pulse-tip .about-kicker {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 0.15rem;
}

#history-tip .about-name,
#pulse-tip .about-name {
  display: block;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.history-plot {
  width: 100%;
  height: auto;
  display: block;
  margin-top: 0.35rem;
}

.history-grid { stroke: rgba(243, 238, 227, 0.14); }

.history-axis,
.history-tick { stroke: rgba(243, 238, 227, 0.45); }

.history-line {
  stroke: var(--paper);
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.history-dot { fill: var(--paper); }

.history-xlabel,
.history-ylabel {
  fill: rgba(243, 238, 227, 0.72);
  font-size: 9px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.history-ylabel { text-anchor: end; }
.history-xlabel { text-anchor: middle; }

@media (max-width: 840px) {
  .masthead, .split, .stats, .bar-row {
    grid-template-columns: 1fr;
    display: grid;
  }
  .masthead, .split { display: flex; flex-direction: column; }
  .stats { display: grid; grid-template-columns: 1fr 1fr; }
  .bar-row { grid-template-columns: 1fr; }
}
