:root {
  --bg: #050505;
  --fg: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.45);
  --line: rgba(255, 255, 255, 0.12);
  --accent: rgba(255, 255, 255, 0.85);
  --max: 28rem;
  --wide-max: 58rem;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .noise {
    opacity: 0.02 !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
}

.bg-pattern {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-pattern__canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  transform: scale(1.04);
  transform-origin: 50% 50%;
  image-rendering: auto;
  filter: contrast(1.06);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.page {
  position: relative;
  z-index: 1;
  width: min(100% - 2.5rem, var(--max));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.header__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.header__title {
  margin: 0 0 0.25rem;
  font-size: clamp(1.5rem, 5vw, 1.875rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.header__artist {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
  font-weight: 400;
}

.cover-wrap {
  margin: 0 0 1.5rem;
  padding: 0;
}

.cover {
  position: relative;
  aspect-ratio: 1;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.cover__button {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.cover__button:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: -6px;
}

.bandcamp-link a:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
}

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

.cover-preview {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.94) 15%, rgba(0, 0, 0, 0.82) 50%, rgba(0, 0, 0, 0.94) 85%, #000 100%);
  opacity: 0;
  pointer-events: none;
  cursor: zoom-out;
  transition: opacity 0.22s ease;
}

.cover-preview.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cover-preview img {
  display: block;
  width: min(100%, 92vh);
  max-height: 92vh;
  object-fit: contain;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.45);
}

body.cover-preview-open {
  overflow: hidden;
}

.copyright {
  position: fixed;
  right: 0.75rem;
  bottom: 0.6rem;
  z-index: 2;
  margin: 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.6875rem;
  line-height: 1.2;
  pointer-events: none;
}

.cover__fallback {
  display: none;
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 1.5rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
  align-content: center;
}

.cover__fallback code {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
}

.cover--missing img {
  opacity: 0;
}

.cover--missing .cover__fallback {
  display: grid;
}

.bandcamp-link {
  margin: 0 0 2.25rem;
  text-align: center;
}

.bandcamp-link a {
  display: inline-flex;
  align-items: center;
  opacity: 0.88;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.bandcamp-link a:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.bandcamp-link img {
  display: block;
  width: min(12rem, 46vw);
  height: auto;
}

.bandcamp-text-link {
  margin: 1.5rem 0 0;
  text-align: center;
}

.bandcamp-text-link a {
  color: var(--fg);
  font-size: 0.875rem;
  font-weight: 500;
  text-underline-offset: 0.25em;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.bandcamp-text-link a:hover {
  color: #fff;
  text-decoration-color: rgba(255, 255, 255, 0.85);
}

.bandcamp-text-link a:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
}

.track-list {
  margin: 0;
  padding: 0 1rem;
  list-style: none;
  background: rgba(0, 0, 0, 0.75);
  border-top: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.track-row {
  display: grid;
  grid-template-columns: 2.25rem 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.2s ease;
}

.track-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.track-row.is-active {
  background: rgba(255, 255, 255, 0.04);
}

.track-row__num {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.track-row__title {
  font-size: 0.9375rem;
  font-weight: 400;
  min-width: 0;
}

.track-row__play {
  flex-shrink: 0;
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--bg) 58%, transparent 60%),
    conic-gradient(var(--accent) calc(var(--progress, 0) * 1turn), var(--line) 0);
  color: var(--fg);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.track-row__play::before {
  content: "";
  position: absolute;
  inset: 1px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.track-row__play:hover {
  transform: scale(1.04);
}

.track-row.is-active .track-row__play {
  --progress: 0;
}

.track-row.is-active .track-row__play::before,
.track-row__play:hover::before {
  border-color: rgba(255, 255, 255, 0.35);
}

.track-row__icon {
  position: relative;
  z-index: 1;
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
}

.track-row__icon--play {
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent var(--accent);
  margin-left: 2px;
}

.track-row__icon--pause {
  display: none;
  position: relative;
  width: 12px;
  height: 14px;
  border: none;
  background: none;
}

.track-row__icon--pause::before,
.track-row__icon--pause::after {
  content: "";
  position: absolute;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
  border-radius: 0.5px;
}

.track-row__icon--pause::before {
  left: 0;
}

.track-row__icon--pause::after {
  right: 0;
}

.track-row__play[aria-pressed="true"] .track-row__icon--play {
  display: none;
}

.track-row__play[aria-pressed="true"] .track-row__icon--pause {
  display: block;
}

.hint {
  margin-top: 1.5rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.hint code {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 56rem) {
  .page {
    width: min(100% - 4rem, var(--wide-max));
    display: grid;
    grid-template-columns: minmax(18rem, 1fr) minmax(20rem, 1.1fr);
    grid-template-areas:
      "header header"
      "art details";
    column-gap: 3rem;
    row-gap: 1.5rem;
    align-items: start;
    padding-top: 4rem;
  }

  .header {
    grid-area: header;
  }

  .album-art {
    grid-area: art;
  }

  .album-details {
    grid-area: details;
  }

  .cover-wrap {
    margin-bottom: 1.5rem;
  }

  .bandcamp-link {
    margin-bottom: 0;
  }

  .bandcamp-link img {
    width: min(14rem, 100%);
  }

  .hint {
    grid-column: 1 / -1;
  }
}
