/* Mixtapes: the home section, /mixtapes/, and each /mixtapes/NNN/ page.
   Every mixtape is drawn as a CD jewel case: the square cover is the front
   insert under the plastic, the hinge on the left carries the spine number,
   and the disc sits behind the case with its edge showing. */

/* ── Jewel case ─────────────────────────────────────── */
.jewel,
.jewel:hover {
  display: block;
  color: inherit;
  text-decoration: none;
}

/* The right-hand padding is the room the disc peeks into. */
.jewel-case {
  position: relative;
  display: block;
  padding-right: 20%;
}

.jewel-front {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 9% 1fr;
  aspect-ratio: 1.09;
  overflow: hidden;
  background: #101010;
  border: 1px solid #3a3a3a;
  border-radius: 3px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65), 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* The plastic: a diagonal sheen and a faint inner edge, over everything. */
.jewel-front::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(125deg,
      rgba(255, 255, 255, 0.20) 0%,
      rgba(255, 255, 255, 0.06) 28%,
      rgba(255, 255, 255, 0) 45%,
      rgba(255, 255, 255, 0) 70%,
      rgba(255, 255, 255, 0.07) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  transition: opacity 0.3s;
}

/* The hinge: a ridged strip of plastic with the number printed down it. */
.jewel-hinge {
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  overflow: hidden;
  font-family: var(--font-mark);
  font-size: clamp(0.7rem, 2.2vw, 1.05rem);
  letter-spacing: 0.08em;
  color: var(--muted);
  background:
    repeating-linear-gradient(90deg,
      rgba(255, 255, 255, 0.05) 0 1px,
      rgba(255, 255, 255, 0) 1px 3px),
    #1a1a1a;
  border-left: 1px solid #333;
}

.jewel-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.jewel-cover--blank {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mark);
  font-size: 2rem;
  color: var(--green-dim);
  background: var(--bg-card);
}

/* The disc, behind the case. The wrapper slides; the face spins, so the two
   motions never fight over one transform. */
.jewel-disc {
  position: absolute;
  top: 50%;
  right: 0;
  width: 70%;
  aspect-ratio: 1;
  transform: translate(0, -50%);
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.jewel-disc-face {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(circle,
      var(--bg) 0 7%,
      #8c8c8c 7% 8%,
      rgba(210, 210, 210, 0.55) 8% 16%,
      #6e6e6e 16% 17%,
      rgba(0, 0, 0, 0) 17% 97%,
      #9a9a9a 97% 100%),
    conic-gradient(from 20deg,
      #b9b9c4, #e9e6ff, #a9d6ff, #c7c7cf,
      #ffd9f2, #c2ffe2, #b9b9c4, #fff1b8,
      #d6d6de, #a9d6ff, #b9b9c4);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
}

.jewel-title {
  display: block;
  margin-top: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--text);
  transition: color 0.15s;
}

.jewel-number { color: var(--amber); }

.jewel-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

a.jewel:hover .jewel-title,
a.jewel:focus-visible .jewel-title { color: var(--green); }

a.jewel:hover .jewel-disc,
a.jewel:focus-visible .jewel-disc { transform: translate(18%, -50%); }

a.jewel:hover .jewel-front::after,
a.jewel:focus-visible .jewel-front::after { opacity: 0.6; }

@keyframes jewel-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: no-preference) {
  a.jewel:hover .jewel-disc-face,
  a.jewel:focus-visible .jewel-disc-face { animation: jewel-spin 2.4s linear infinite; }
}

@media (prefers-reduced-motion: reduce) {
  .jewel-disc { transition: none; }
}

/* ── Grids: /mixtapes/ and the home section ─────────── */
.jewel-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem 2.25rem;
}

/* Two across even on a phone: one per row makes each case screen-sized. */
@media (max-width: 800px) {
  .jewel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1.25rem; }
  .jewel-title { font-size: 0.82rem; }
  .jewel-meta { font-size: 0.72rem; }
}

.home-mixtapes { margin-top: 3.5rem; }

/* Two across leaves the third alone on a row, so the home page shows two. */
@media (max-width: 800px) {
  .home-mixtapes .jewel-grid > :nth-child(n + 3) { display: none; }
}

/* ── /mixtapes/NNN/: the opened case ────────────────── */
.mixtape {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 2.5rem;
  align-items: start;
}

/* The case stays in view while the longer tracklist scrolls past it. The
   offset clears the sticky site header. */
.mixtape-front {
  position: sticky;
  top: 5.5rem;
}

@media (max-width: 800px) {
  .mixtape { grid-template-columns: minmax(0, 1fr); }
  .mixtape-front { position: static; max-width: 24rem; }
}

/* On the detail page the disc is already half out, as if just opened. */
.mixtape-front .jewel-case { padding-right: 26%; }
.mixtape-front .jewel-disc { width: 66%; }

@media (prefers-reduced-motion: no-preference) {
  .mixtape-front .jewel-disc-face { animation: jewel-spin 6s linear infinite; }
}

.mixtape-listen-row { margin: 1.25rem 0 0; }

.mixtape-listen {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--amber);
  text-decoration: none;
}

.mixtape-listen::before { content: '[ '; }
.mixtape-listen::after  { content: ' ]'; }

.mixtape-listen::before,
.mixtape-listen::after {
  white-space: pre;
  color: var(--muted);
}

.mixtape-listen:hover { color: var(--green); }

/* The back tray card: a printed insert with a folded spine down each edge. */
.mixtape-back {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr) 1.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

.mixtape-spine {
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: #181818;
}

.mixtape-spine:first-child {
  transform: rotate(180deg);
  border-left: 1px solid var(--border);
}

.mixtape-spine:last-child { border-left: 1px solid var(--border); }

.mixtape-card { padding: 1.1rem 1.25rem 1rem; }

.mixtape-card-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.mixtape-tracks {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mixtape-track {
  display: grid;
  grid-template-columns: 2.2ch minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: baseline;
  padding: 0.42rem 0;
  border-bottom: 1px dashed var(--border);
}

.mixtape-track:last-child { border-bottom: none; }

.mixtape-track-number,
.mixtape-track-duration {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.mixtape-track-number { color: var(--green-dim); }

.mixtape-track-main { min-width: 0; }

.mixtape-track-title {
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
}

.mixtape-track-title:hover { color: var(--green); }

.mixtape-track-artist {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

.mixtape-total {
  display: flex;
  justify-content: space-between;
  margin: 0.6rem 0 0;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.mixtape-total span { color: var(--amber); }

.mixtape-notes { margin-top: 2rem; max-width: var(--measure); }

.mixtape-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
}

.mixtape-nav > :last-child { text-align: right; }

.mixtape-refreshed {
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
