:root {
  --bg: #000;
  --card: #111;
  --card-hover: #171717;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.28);
  --sans: Inter, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", ui-monospace, "Liberation Mono", monospace;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #fff;
  color: #000;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.45rem 0.7rem;
  background: #fff;
  color: #000;
  font-size: 0.8rem;
  text-decoration: none;
}

.skip:focus {
  top: 0.75rem;
  z-index: 2;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.75rem 1.15rem 4rem;
}

.mast {
  padding-bottom: 1.75rem;
  margin-bottom: 1.25rem;
}

.mast-top,
.colophon {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.45rem 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.mast-top p,
.colophon p {
  margin: 0;
  min-width: 0;
}

.mast h1 {
  margin: 1.15rem 0 0;
  max-width: 12ch;
  font-weight: 600;
  font-size: clamp(2.35rem, 9vw, 3.4rem);
  line-height: 0.96;
  letter-spacing: -0.045em;
}

.dek {
  margin: 1.15rem 0 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.count {
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.count .num {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.95rem;
}

.crate {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  padding: 1.15rem 1rem 1.2rem;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.top {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  min-width: 0;
}

.thumb {
  width: 4.75rem;
  height: 4.75rem;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 0.7rem;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.monogram {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
}

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

.copy {
  min-width: 0;
  flex: 1;
  padding-top: 0.1rem;
}

.kind {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.kind .no {
  color: var(--muted);
  letter-spacing: 0.08em;
}

h2 {
  margin: 0;
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.artist {
  margin: 0.28rem 0 0;
  color: #d4d4d8;
  font-size: 0.98rem;
}

.k {
  margin-right: 0.45rem;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.album {
  margin: 0.45rem 0 0;
  color: var(--text);
  font-size: 0.92rem;
}

.album.is-empty {
  color: var(--muted);
}

.posted {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin: 1.15rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.posted strong {
  color: var(--text);
  font-weight: 600;
}

.services {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.services li {
  min-width: 0;
}

.service {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.75rem;
  color: var(--text);
  background: transparent;
  text-decoration: none;
  font-size: 0.84rem;
  letter-spacing: 0.01em;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.service .name {
  min-width: 0;
}

.service.is-unmatched {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
  background: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.05) 6px,
    transparent 6px,
    transparent 12px
  );
}

.tag {
  flex: none;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.service.is-unmatched .tag {
  color: #fff;
}

@media (hover: hover) {
  .card:hover {
    background: var(--card-hover);
    border-color: rgba(255, 255, 255, 0.22);
  }

  a.service:hover {
    background: #fff;
    border-color: #fff;
    color: #000;
  }

  a.service:hover .tag {
    color: #3f3f46;
  }
}

a.service:focus-visible,
.skip:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.match {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.match[data-status="unmatched"],
.match[data-status="source_only"] {
  color: #fff;
}

.example-row {
  margin: 1rem 0 0;
}

.stamp {
  display: inline-block;
  padding: 0.22rem 0.55rem 0.18rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #d4d4d8;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.notes {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.empty-crate {
  margin: 0;
  padding: 1.5rem 0.15rem;
  color: var(--muted);
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--text);
}

.colophon {
  margin-top: 2rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  flex-direction: column;
  gap: 0.4rem;
}

@media (min-width: 640px) {
  .services {
    flex-direction: row;
  }

  .services li {
    flex: 1;
  }
}

@media (min-width: 760px) {
  .wrap {
    padding: 4rem 1.5rem 5rem;
  }

  .mast {
    padding-bottom: 2.25rem;
    margin-bottom: 1.5rem;
  }

  .card {
    padding: 1.4rem 1.35rem 1.45rem;
  }

  .top {
    gap: 1.25rem;
  }

  .thumb {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 0.8rem;
  }

  h2 {
    font-size: 1.6rem;
  }

  .crate {
    gap: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .service {
    transition: none;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .card {
    break-inside: avoid;
    background: #fff;
    border-color: #000;
  }

  a.service::after {
    content: "  " attr(href);
    font-weight: 400;
  }
}
