.npm-scene {
  --chart-ink: #33415a;
  --chart-ink-muted: #64748b;
  --chart-grid: rgb(51 65 90 / 12%);
  --chart-series: #2b7de0;
  --chart-fill-top: rgb(43 125 224 / 26%);
  --chart-fill-bottom: rgb(43 125 224 / 0%);
  --chart-panel: #ffffff;
  --chart-panel-edge: rgb(51 65 90 / 14%);

  display: flex;
  min-height: 100vh;
  box-sizing: border-box;
  flex-direction: column;
  padding: 0;
  background: transparent;
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
}

:root.dark .npm-scene {
  --chart-ink: #cbd5e1;
  --chart-ink-muted: #94a3b8;
  --chart-grid: rgb(203 213 225 / 14%);
  --chart-series: #6bb2f7;
  --chart-fill-top: rgb(107 178 247 / 30%);
  --chart-fill-bottom: rgb(107 178 247 / 0%);
  --chart-panel: #2a2536;
  --chart-panel-edge: rgb(255 255 255 / 10%);
}

.npm {
  display: flex;
  min-height: 100vh;
  box-sizing: border-box;
  flex-direction: column;
  margin: 0;
  padding: clamp(0.25rem, 1vw, 0.5rem);
}

.npm-title {
  margin: 0 0 clamp(0.5rem, 1.5vw, 0.875rem);
  color: var(--chart-ink);
  font-size: clamp(1.125rem, 2.8vw, 1.375rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
}

.npm-plot {
  position: relative;
  min-height: 0;
  flex: 1 1 0;
}

.npm-meta {
  margin: clamp(0.5rem, 1.5vw, 0.75rem) 0 0;
  color: var(--chart-ink);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
}

.npm-stats {
  --npm-stat-gap: clamp(1.25rem, 5vw, 2.75rem);

  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: clamp(0.625rem, 2vw, 1rem) 0 0;
  gap: 0.5rem var(--npm-stat-gap);
}

.npm-stat {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.15em;
}

.npm-stat + .npm-stat {
  position: relative;
}

.npm-stat + .npm-stat::before {
  position: absolute;
  top: 12%;
  bottom: 12%;
  left: calc(var(--npm-stat-gap) / -2);
  border-left: 1px solid var(--chart-grid);
  content: "";
}

@media (width < 30rem) {
  .npm-stat + .npm-stat::before {
    content: none;
  }
}

.npm-stat-value {
  margin: 0;
  color: var(--chart-ink);
  font-size: clamp(1.125rem, 3.4vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.npm-stat-label {
  color: var(--chart-ink-muted);
  font-size: clamp(0.625rem, 1.6vw, 0.75rem);
}

.npm-deps {
  width: 100%;
  border-collapse: collapse;
  margin: clamp(0.875rem, 2.5vw, 1.375rem) 0 0;
  font-size: clamp(0.625rem, 1.5vw, 0.75rem);
  text-align: left;
}

.npm-deps th {
  padding: 0 0 0.4rem;
  border-bottom: 1px solid var(--chart-grid);
  color: var(--chart-ink-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.npm-deps th.npm-dep-num {
  padding-left: 0.75rem;
  text-align: right;
}

.npm-deps td {
  padding: 0.28rem 0;
}

.npm-deps tbody tr:first-child td {
  padding-top: 0.5rem;
}

.npm-dep-name {
  position: relative;
  overflow: hidden;
  max-width: 0;
  width: 99%;
  padding-right: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.npm-dep-name b {
  position: relative;
  font-weight: 400;
}

.npm-dep-bar {
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: -0.3rem;
  border-radius: 3px;
  background: var(--chart-fill-top);
}

.npm-dep-num {
  padding-left: 0.75rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.npm-dep-share {
  color: var(--chart-ink-muted);
}

.npm-deps tfoot td {
  padding-top: 0.5rem;
  border-top: 1px solid var(--chart-grid);
  color: var(--chart-ink-muted);
}

@media (width < 26rem) {
  .npm-deps th:nth-child(2),
  .npm-deps td:nth-child(2) {
    display: none;
  }

  .npm-deps tfoot td {
    padding-top: 0.45rem;
  }
}

.npm-source {
  margin: clamp(0.5rem, 1.6vw, 0.875rem) 0 0;
  font-size: clamp(0.625rem, 1.6vw, 0.8125rem);
  overflow-wrap: anywhere;
}

.npm-source a {
  color: var(--chart-ink-muted);
  text-decoration: none;
}

.npm-source a:hover,
.npm-source a:focus-visible {
  color: var(--chart-series);
  text-decoration: underline;
}

.npm-meta {
  opacity: 0;
  animation: npm-fade 0.6s ease-out 1.5s forwards;
}

@keyframes npm-fade {
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .npm-meta {
    animation: none;
    opacity: 1;
  }
}
