/* Dark, cover-first layout: the box art does most of the talking. */

:root {
  --bg: #0f1012;
  --surface: #181a1e;
  --surface-raised: #20232a;
  --border: #2c3039;
  --text: #ecedf0;
  --muted: #9aa0ab;
  --accent: #f2b544;
  --accent-ink: #1a1405;
  --good: #57c48a;
  --warn: #f0a04b;
  --bad: #e5646a;
  --radius: 10px;
  --page-width: 1280px;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
}

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

h1, h2, h3 {
  line-height: 1.2;
  margin: 0;
}

/* Header and footer */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 12px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.brand__mark {
  width: 26px;
  height: 26px;
}

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

.site-nav__link {
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.site-nav__link:hover {
  color: var(--text);
  background: var(--surface);
}

.site-nav__link.is-active {
  color: var(--accent-ink);
  background: var(--accent);
}

.site-search {
  margin-left: auto;
}

input[type="search"], select {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.site-search input {
  width: 220px;
}

.site-footer {
  max-width: var(--page-width);
  margin: 48px auto 0;
  padding: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.site-footer__credit {
  margin-bottom: 0;
  color: var(--text);
}

.page {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 24px;
}

/* Home */

.hero {
  padding: 32px 0 8px;
}

.hero h1 {
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: -0.03em;
}

.hero p {
  max-width: 60ch;
  color: var(--muted);
  font-size: 17px;
}

.shelf {
  margin-top: 40px;
}

.shelf__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.shelf__header h2 {
  font-size: 22px;
}

.shelf__header h2 a {
  text-decoration: none;
}

.shelf__header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.shelf__more {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

/* Listing pages */

.listing-header h1 {
  font-size: 30px;
  letter-spacing: -0.02em;
}

.listing-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 20px 0 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.filters__search {
  flex: 1 1 200px;
}

.filters select {
  max-width: 220px;
}

.filters__check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.filters__clear {
  color: var(--muted);
  font-size: 13px;
}

.button {
  display: inline-block;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  line-height: 34px;
  text-decoration: none;
  cursor: pointer;
}

.button--primary {
  height: 44px;
  padding: 0 20px;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  line-height: 42px;
}

.button--primary:hover {
  color: var(--accent-ink);
  filter: brightness(1.08);
}

.result-count {
  color: var(--muted);
  font-size: 13px;
}

.empty {
  padding: 32px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 32px;
  color: var(--muted);
}

.pagination a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

/* Product cards */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

/* One row of six on the home page. */
.grid--shelf {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .grid--shelf {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .grid, .grid--shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .site-header__inner {
    flex-wrap: wrap;
    gap: 12px;
  }

  .site-search, .site-search input {
    width: 100%;
    margin-left: 0;
  }
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: transform 120ms ease, background 120ms ease;
}

.card:hover {
  transform: translateY(-2px);
  background: var(--surface-raised);
}

.card__cover {
  display: block;
  aspect-ratio: 3 / 4;
  background: #0b0c0e;
}

.cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cover--blank {
  display: grid;
  place-items: center;
  color: var(--border);
  font-size: 64px;
  font-weight: 800;
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
}

.card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card__title {
  font-size: 15px;
  font-weight: 650;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__title a {
  text-decoration: none;
}

.card__meta {
  display: flex;
  flex-direction: column;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.card__meta span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Wraps: a release several stores sell names them all. */
.card__meta .card__store {
  white-space: normal;
  font-size: 12px;
  opacity: 0.8;
}

.card__price {
  margin: 0;
  font-weight: 700;
}

.card__note {
  margin: 0;
  color: var(--good);
  font-size: 13px;
  font-weight: 600;
}

.card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card__badges:empty {
  display: none;
}

/* Format chips and status badges */

.chip, .badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.chip {
  border: 1px solid var(--border);
  color: var(--muted);
}

.chip--4k-uhd {
  border-color: #6d5a2a;
  color: #f2cf74;
}

.chip--blu-ray {
  border-color: #2b4f7a;
  color: #7fb3f0;
}

.chip--vhs {
  border-color: #6b3a3d;
  color: #f08b90;
}

.chip--vinyl, .chip--cd, .chip--cassette, .chip--laserdisc {
  border-color: #4d3b6b;
  color: #c3a4f2;
}

.badge--preorder {
  background: #22344d;
  color: #9cc7fa;
}

.badge--scarce {
  background: #4a2f12;
  color: var(--warn);
}

.badge--partial {
  background: #2c2f36;
  color: var(--muted);
}

.badge--soldout {
  background: #3d1d20;
  color: var(--bad);
}

/* Product page */

.product {
  display: grid;
  grid-template-columns: minmax(240px, 420px) 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 800px) {
  .product {
    grid-template-columns: 1fr;
  }
}

.product__cover {
  border-radius: var(--radius);
  background: #0b0c0e;
  overflow: hidden;
  aspect-ratio: 3 / 4;
}

.product__details {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: start;
}

.product__details h1 {
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.02em;
}

.product__meta, .product__notes {
  margin: 0;
  color: var(--muted);
}

.editions {
  width: 100%;
  border-collapse: collapse;
}

.editions caption {
  text-align: left;
  font-weight: 700;
  padding-bottom: 6px;
}

.editions th, .editions td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.editions th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.editions .is-sold-out td {
  color: var(--muted);
}

.editions .is-sold-out td:last-child {
  color: var(--bad);
}

.elsewhere, .history, .description {
  width: 100%;
}

.elsewhere h2, .history h2, .description h2 {
  font-size: 16px;
  margin-bottom: 6px;
}

.elsewhere ul {
  margin: 0;
  padding-left: 18px;
}

/* A store's description: its own headings and spacing toned down to fit the page. */
.description__body {
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.description__body :is(h1, h2, h3, h4, h5, h6) {
  margin: 16px 0 6px;
  color: var(--text);
  font-size: 15px;
}

.description__body :is(p, ul, ol, blockquote, table) {
  margin: 0 0 10px;
}

.description__body :is(ul, ol) {
  padding-left: 20px;
}

.description__body :is(strong, b) {
  color: var(--text);
}

.description__body a {
  color: var(--text);
}

.description__body table {
  border-collapse: collapse;
}

.description__body :is(th, td) {
  padding: 2px 10px 2px 0;
  text-align: left;
  vertical-align: top;
}

.description__body hr {
  border: 0;
  border-top: 1px solid var(--border);
}

.description__body.is-folded {
  overflow: hidden;
  mask-image: linear-gradient(to bottom, #000 65%, transparent);
}

.description__more {
  margin-top: 8px;
}

.description__source {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.history ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.history time {
  color: var(--text);
  margin-right: 6px;
}

/* Labels */

.labels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.labels__item {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
}

.labels__item:hover {
  color: inherit;
  background: var(--surface-raised);
}

.labels__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.labels__name {
  font-weight: 650;
}

.labels__count {
  font-size: 13px;
}

.labels__stores {
  color: var(--muted);
  font-size: 12px;
}

.label-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  overflow: hidden;
}

.label-icon--dark {
  background: #f4f4f5;
}

.label-icon--light {
  background: #0b0c0e;
  border: 1px solid var(--border);
}

.label-icon__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.label-icon--monogram {
  background: hsl(var(--hue) 45% 32%);
  color: hsl(var(--hue) 70% 88%);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.label-header {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.label-header h1 {
  font-size: 30px;
  letter-spacing: -0.02em;
}

.label-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.label-logo {
  display: grid;
  place-items: center;
  min-width: 220px;
  max-width: 100%;
  min-height: 120px;
  padding: 20px 28px;
  border-radius: calc(var(--radius) + 4px);
}

.label-logo img {
  max-width: 420px;
  max-height: 110px;
  width: auto;
  height: auto;
}

.label-logo--on-light {
  background: #f4f4f5;
}

.label-logo--on-dark,
.label-logo--icon {
  background: #0b0c0e;
  border: 1px solid var(--border);
}

.label-logo--icon .label-icon {
  width: 96px;
  height: 96px;
}

.label-logo--wordmark {
  background: var(--surface);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.label-views {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.label-views__link {
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
}

.label-views__link.is-active {
  color: var(--accent-ink);
  background: var(--accent);
}

.card__label {
  text-decoration: none;
}

/* Sales */

.shelf--sale {
  padding: 20px;
  border: 1px solid #5a2a2e;
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(180deg, #2a1416, transparent 70%);
}

.shelf__eyebrow {
  margin: 0 0 4px;
  color: var(--bad);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sales {
  display: grid;
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.sales__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--surface);
}

.sales__item.is-active {
  border-left: 3px solid var(--bad);
}

.sales__name {
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

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