/* Music page: dark playlist and fixed player. Scoped to body.music-page. */

.music-page {
    --player-h: 104px;
    background: #121212;
    color: #ffffff;
    color-scheme: dark;
    padding-bottom: calc(var(--player-h) + 28px + env(safe-area-inset-bottom, 0px));
}

.music-page .content {
    background:
        radial-gradient(900px 420px at 18% 0%, rgba(30, 215, 96, 0.22), transparent 60%),
        #121212;
}

.music-page main.music {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding: 124px 28px 16px;
    box-sizing: border-box;
}

.music-page h1,
.music-page p,
.music-page .header a,
.music-page .logo a {
    color: #ffffff;
}

.music-page h1 {
    margin: 0;
    padding: 0;
    font-size: clamp(2.6rem, 6vw, 4.6rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
}

.music-page .header {
    background: rgba(18, 18, 18, 0.88);
    border-color: rgba(255, 255, 255, 0.08);
}

.music-page nav a::before {
    background-color: #1ed760;
}

.music-page footer,
.music-page footer p {
    color: #b3b3b3;
}

.album-hero {
    display: flex;
    align-items: flex-end;
    gap: 28px;
    margin-bottom: 28px;
}

.album-cover {
    width: 176px;
    height: 176px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(150deg, #1ed760 0%, #146c43 42%, #10241a 100%);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.album-cover svg {
    width: 72px;
    height: 72px;
}

.album-kicker {
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.album-by,
.album-blurb,
.album-count {
    margin: 8px 0 0;
}

.album-by {
    font-size: 1rem;
}

.music-page .album-blurb,
.music-page .album-count,
.music-page .track-sub,
.music-page .player-artist {
    color: #b3b3b3;
}

.tracklist-head,
.track-row {
    display: grid;
    grid-template-columns: 48px 32px minmax(0, 1fr) 52px;
    gap: 12px;
    align-items: center;
}

.tracklist-head {
    padding: 8px 12px 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid #2a2a2a;
    color: #a7a7a7;
    font-family: "Outfit", sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.col-time,
.track-time {
    text-align: right;
}

.music-list {
    list-style: none;
    margin: 0;
    padding: 0 0 12px;
}

.track-row {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}

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

.track-row.is-current {
    background: rgba(255, 255, 255, 0.05);
}

.track-row.is-current .track-title {
    color: #1ed760;
}

.track-num,
.track-time {
    color: #b3b3b3;
    font-family: "Outfit", sans-serif;
    font-size: 0.92rem;
    font-variant-numeric: tabular-nums;
}

.track-title,
.track-sub {
    margin: 0;
}

.track-title {
    font-size: 1rem;
    line-height: 1.3;
}

.track-sub {
    margin-top: 2px;
    font-size: 0.82rem;
}

.music-page button {
    font-family: "Outfit", sans-serif;
}

#player {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.icon-btn,
.play-btn,
.track-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    cursor: pointer;
}

.icon-btn {
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 50%;
    background: transparent;
    color: #b3b3b3;
}

.icon-btn:hover {
    color: #ffffff;
}

.play-btn,
.track-play {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1ed760;
    color: #000000;
    box-shadow: 0 6px 16px rgba(30, 215, 96, 0.28);
}

.play-btn {
    width: 46px;
    height: 46px;
    flex: none;
}

.play-btn:hover,
.track-play:hover {
    transform: scale(1.06);
    background: #3be477;
}

.icon-btn svg,
.play-btn svg,
.track-play svg {
    width: 18px;
    height: 18px;
    display: block;
}

.play-btn svg {
    width: 20px;
    height: 20px;
}

.music-page button:focus-visible,
.music-page input:focus-visible {
    outline: 2px solid #1ed760;
    outline-offset: 2px;
}

/* Fixed to the viewport so playback stays visible while the list scrolls. */
.player-bar {
    position: fixed;
    z-index: 40;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(280px, 1.7fr) minmax(150px, 0.9fr);
    gap: 18px;
    align-items: center;
    min-height: var(--player-h);
    padding:
        12px
        calc(20px + env(safe-area-inset-right, 0px))
        calc(12px + env(safe-area-inset-bottom, 0px))
        calc(20px + env(safe-area-inset-left, 0px));
    box-sizing: border-box;
    background: #181818;
    border-top: 1px solid #2a2a2a;
}

.player-track {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.player-thumb {
    width: 56px;
    height: 56px;
    flex: none;
    border-radius: 4px;
    background: linear-gradient(150deg, #1ed760 0%, #146c43 48%, #10241a 100%);
}

.player-meta {
    min-width: 0;
}

.player-title,
.player-artist {
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.player-title {
    font-size: 0.92rem;
}

.player-artist {
    margin-top: 3px;
    font-size: 0.75rem;
}

.player-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.player-buttons {
    display: flex;
    align-items: center;
    gap: 14px;
}

.player-timeline {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 8px;
    width: 100%;
    color: #b3b3b3;
    font-family: "Outfit", sans-serif;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.player-timeline span:last-child {
    text-align: right;
}

.player-volume {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.player-bar input[type="range"] {
    width: 100%;
    accent-color: #1ed760;
    cursor: pointer;
}

.player-volume input[type="range"] {
    width: 112px;
}

@media only screen and (max-width: 680px) {
    .music-page {
        --player-h: 188px;
    }

    .music-page main.music {
        padding: 124px 16px 8px;
    }

    .album-hero {
        gap: 16px;
    }

    .album-cover {
        width: 112px;
        height: 112px;
    }

    .album-cover svg {
        width: 48px;
        height: 48px;
    }

    .tracklist-head,
    .track-row {
        grid-template-columns: 52px minmax(0, 1fr) 48px;
        gap: 8px;
    }

    .track-row {
        min-height: 60px;
        padding: 8px 8px;
    }

    .track-play {
        width: 44px;
        height: 44px;
        flex: none;
    }

    .track-title {
        font-size: 1rem;
        line-height: 1.35;
        overflow-wrap: break-word;
    }

    .track-info {
        min-width: 0;
    }

    .col-num {
        display: none;
    }

    .player-bar {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "track buttons"
            "timeline timeline"
            "volume volume";
        gap: 2px 8px;
        padding:
            8px
            calc(12px + env(safe-area-inset-right, 0px))
            calc(8px + env(safe-area-inset-bottom, 0px))
            calc(12px + env(safe-area-inset-left, 0px));
    }

    .player-track { grid-area: track; }
    .player-thumb {
        width: 44px;
        height: 44px;
    }
    .player-buttons {
        grid-area: buttons;
        justify-content: flex-end;
        gap: 4px;
        flex: none;
    }
    .player-center { display: contents; }
    .player-timeline { grid-area: timeline; }
    .player-volume {
        grid-area: volume;
        justify-content: stretch;
        gap: 4px;
    }

    .player-bar .icon-btn {
        width: 44px;
        height: 44px;
        flex: none;
    }

    .player-bar .play-btn {
        width: 48px;
        height: 48px;
        flex: none;
    }

    .player-volume input[type="range"] {
        width: auto;
        flex: 1;
        min-width: 0;
    }

    .player-bar input[type="range"] {
        -webkit-appearance: none;
        appearance: none;
        height: 44px;
        margin: 0;
        background: transparent;
        touch-action: manipulation;
    }

    .player-bar input[type="range"]::-webkit-slider-runnable-track {
        height: 4px;
        background: #4d4d4d;
        border-radius: 999px;
    }

    .player-bar input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 18px;
        height: 18px;
        margin-top: -7px;
        border: 0;
        border-radius: 50%;
        background: #1ed760;
    }

    .player-bar input[type="range"]:disabled::-webkit-slider-thumb {
        background: #6a6a6a;
    }

    .player-bar input[type="range"]::-moz-range-track {
        height: 4px;
        background: #4d4d4d;
        border: 0;
        border-radius: 999px;
    }

    .player-bar input[type="range"]::-moz-range-thumb {
        width: 18px;
        height: 18px;
        border: 0;
        border-radius: 50%;
        background: #1ed760;
    }
}

