/* morphology: a glitched mosaic of terracotta and teal tiles, on dark grout.
   Colours are taken from the cover. */

.morphology {
    --grout: #140e0c;
    --terracotta: #c8643c;
    --teal: #3aa59a;
    --cream: #e9dcc6;
    background-color: var(--grout);
    background-image:
        linear-gradient(rgba(233, 220, 198, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(233, 220, 198, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    color: var(--cream);
}

.morphology main,
.morphology main * {
    font-family: "DejaVu Sans Mono", Menlo, Consolas, monospace;
}

/* split channels, like the cover's tiles */
.morphology h1 {
    color: var(--cream);
    font-weight: normal;
    letter-spacing: 0.3em;
    text-align: center;
    text-shadow: -2px 0 var(--terracotta), 2px 0 var(--teal);
}

.morphology .cover {
    margin: 0 auto 1.5rem;
    border: 1px solid rgba(233, 220, 198, 0.2);
}
.morphology .cover img {
    display: block;
    width: 100%;
    height: auto;
}
/* while a track plays, the mosaic shifts in steps */
.morphology .player:has(li.now) .cover img {
    animation: morphology-shift 2.4s steps(1) infinite;
}
@keyframes morphology-shift {
    0%   { filter: none; }
    25%  { filter: hue-rotate(-12deg) contrast(1.1); }
    50%  { filter: hue-rotate(8deg) saturate(1.3); }
    75%  { filter: hue-rotate(-4deg) contrast(1.2) brightness(1.05); }
}

.morphology .player-controls:not([hidden]) {
    justify-content: center;
}
.morphology .player-controls button {
    background: var(--grout);
    color: var(--cream);
    border: 1px solid var(--teal);
    border-radius: 0;
    padding: 0.35rem 0.8rem;
    cursor: pointer;
}
.morphology .player-controls button:hover,
.morphology .player-controls button:focus-visible {
    border-color: var(--terracotta);
    color: #fff;
}
.morphology .player-audio {
    color-scheme: dark;
}

/* the track list as tiles */
.morphology .playlist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: 4px;
    padding: 0;
}
.morphology .playlist li {
    list-style: decimal inside;  /* the site stylesheet gives li an image bullet */
    padding: 0.55rem 0.6rem;
    background: rgba(200, 100, 60, 0.12);
    border: 1px solid transparent;
}
.morphology .playlist li:nth-child(3n+2) {
    background: rgba(58, 165, 154, 0.12);
}
.morphology .playlist li:nth-child(3n) {
    background: rgba(233, 220, 198, 0.07);
}
.morphology .playlist li::marker {
    color: var(--terracotta);
}
.morphology .playlist a {
    color: var(--cream);
    text-decoration: none;
}
.morphology .playlist li:hover {
    border-color: var(--teal);
}
.morphology .playlist li.now {
    font-weight: normal;
    background: rgba(200, 100, 60, 0.45);
    border-color: var(--cream);
}
.morphology .playlist li.now a {
    color: #fff;
    text-shadow: -1px 0 var(--terracotta), 1px 0 var(--teal);
}

.morphology .player-m3u {
    text-align: center;
    font-size: 0.85em;
}
.morphology .player-m3u a {
    color: var(--teal);
}

@media (prefers-reduced-motion: reduce) {
    .morphology .player:has(li.now) .cover img {
        animation: none;
    }
}
