.np-card {
  --np-inset: 18px;
  --np-top: 22px;
  --np-avatar: 46px;
  --np-ctl: 58px;
  --np-profile: 58px;
  --np-gap: 8px;
  position: relative;
  display: block;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  isolation: isolate;
  container-type: inline-size;
  background: #1a1a1a;
  color: #fff;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.np-card,
.np-card * { box-sizing: border-box; }
.np-card > * { --np-extra: 0px; }
.np-card.has-profile > * { --np-extra: calc(var(--np-profile) + var(--np-gap)); }

.np-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
.np-link:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }

.np-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.np-pill,
.np-open,
.np-profile {
  position: absolute;
  top: var(--np-top);
  background: rgba(0, 0, 0, 0.28);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
}

.np-pill {
  left: var(--np-inset);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: min(230px, 100% - 2 * var(--np-inset) - var(--np-ctl) - var(--np-extra) - 12px);
  max-width: calc(100% - 2 * var(--np-inset) - var(--np-ctl) - var(--np-extra) - 12px);
  padding: 6px 28px 6px 6px;
  border-radius: 999px;
}
.np-avatar {
  flex: none;
  width: var(--np-avatar);
  height: var(--np-avatar);
  border-radius: 50%;
  object-fit: cover;
  background: #2a2a2a;
}
.np-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}
.np-artist,
.np-title {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-transform: uppercase;
}
.np-artist {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.5px;
}
.np-title {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.2px;
  color: rgba(255, 255, 255, 0.82);
}

.np-open,
.np-profile {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  transition: background 160ms ease;
}
.np-open svg,
.np-profile svg { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); }

.np-open {
  right: calc(var(--np-inset) + var(--np-extra));
  width: var(--np-ctl);
  height: var(--np-ctl);
}
.np-open svg,
.np-profile svg { width: 26px; height: 26px; }
.np-card:has(.np-link:hover) .np-open { background: rgba(0, 0, 0, 0.42); }

.np-profile {
  z-index: 2;
  top: calc(var(--np-top) + (var(--np-ctl) - var(--np-profile)) / 2);
  right: var(--np-inset);
  width: var(--np-profile);
  height: var(--np-profile);
}
.np-profile[hidden] { display: none; }
.np-profile:hover { background: rgba(0, 0, 0, 0.42); }
.np-profile:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.np-shade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.5));
  pointer-events: none;
}

.np-bottom {
  position: absolute;
  left: 25px;
  right: 25px;
  bottom: 28px;
}
.np-track {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
  overflow: hidden;
}
.np-fill {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
  transition: width 1s linear;
}
.np-times {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.np-card.is-idle .np-fill,
.np-card.is-idle .np-times { visibility: hidden; }

.np-card.is-loading > * { visibility: hidden; }

@container (max-width: 400px) {
  .np-card > * {
    --np-inset: 12px;
    --np-top: 14px;
    --np-avatar: 36px;
    --np-ctl: 48px;
    --np-profile: 48px;
    --np-gap: 6px;
  }
  .np-pill { gap: 10px; padding-right: 20px; }
  .np-artist { font-size: 15px; }
  .np-title { font-size: 11px; }
  .np-open svg,
  .np-profile svg { width: 22px; height: 22px; }
  .np-bottom { left: 18px; right: 18px; bottom: 20px; }
  .np-times { margin-top: 10px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .np-fill, .np-open, .np-profile { transition: none; }
}
