/* =========================================================
   MUSIC — SACRED ARCHIVE
   Layout: Cards grid with release information
   Contrast: Ember accents with frozen highlights
   ========================================================= */

.iv-music {
    position: relative;
    padding: 64px 0;

    background:
        radial-gradient(1000px 520px at 82% 28%, rgba(127, 166, 201, 0.10), transparent 62%),
        radial-gradient(1200px 720px at 30% 50%, rgba(255, 77, 46, 0.08), transparent 65%),
        linear-gradient(180deg, rgba(6, 8, 11, 0.92), rgba(10, 12, 16, 0.98));

    --ritual: 0;
}


/* =========================================================
   GRID / WRAPPER
   ========================================================= */

.iv-music__inner {
    position: relative;
    z-index: 2;
    width: min(1320px, calc(100% - 64px));
    margin: 0 auto;
}

.iv-music__whisper {
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    pointer-events: none;
    overflow: hidden;
    z-index: 3;

    mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}

.iv-music__whisperTrack {
    display: flex;
    width: max-content;
    will-change: transform;

    --whisper-duration: 55s;
    --whisper-shift: -800px;
    animation: iv-music-whisper-loop var(--whisper-duration) linear infinite;

    animation-direction: reverse;
}

@keyframes iv-music-whisper-loop {
    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(var(--whisper-shift), 0, 0);
    }
}

.iv-music__whisperGroup {
    display: flex;
    flex: 0 0 auto;
    white-space: nowrap;
}

.iv-music__whisperItem {
    display: inline-block;
    font-size: 0.62rem;
    letter-spacing: 0.38em;
    text-transform: uppercase;
    color: rgba(230, 230, 230, 0.22);
    opacity: calc(0.10 + (var(--ritual) * 0.14));
    padding-right: 56px;
}

@media (prefers-reduced-motion: reduce) {
    .iv-music__whisperTrack {
        animation: none;
        transform: none;
    }
}


/* =========================================================
   HEADER
   ========================================================= */

.iv-music__header {
    text-align: center;
    margin-bottom: 48px;
}

.iv-music__kicker {
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    color: var(--ash-gray);
    opacity: 0.85;
    margin-bottom: 16px;
}

.iv-music__title {
    font-size: clamp(2.2rem, 3.8vw, 3.2rem);
    line-height: 1.1;

    text-shadow:
        0 0 10px rgba(0, 0, 0, 0.7),
        0 0 26px rgba(127, 166, 201, 0.12);
}


/* =========================================================
   RELEASES GRID
   ========================================================= */

.iv-music__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 40px;
}


/* =========================================================
   RELEASE CARD
   ========================================================= */

.iv-release {
    position: relative;
    padding: 24px;
    border-radius: 16px;
    max-height: 782px;
    overflow-y: auto;
    isolation: isolate;

    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.22));
    border: 1px solid rgba(127, 166, 201, 0.14);

    box-shadow:
        0 0 24px rgba(127, 166, 201, 0.06);

    transition: all 0.4s ease;
}

/* Custom scrollbar for release card */
.iv-release::-webkit-scrollbar {
    width: 6px;
}

.iv-release::-webkit-scrollbar-track {
    background: rgba(31, 36, 44, 0.5);
    border-radius: 3px;
}

.iv-release::-webkit-scrollbar-thumb {
    background: rgba(127, 166, 201, 0.3);
    border-radius: 3px;
    transition: background 0.25s ease;
}

.iv-release[data-type="album"]::-webkit-scrollbar-thumb {
    background: rgba(255, 77, 46, 0.3);
}

.iv-release::-webkit-scrollbar-thumb:hover {
    background: rgba(127, 166, 201, 0.5);
}

.iv-release[data-type="album"]::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 77, 46, 0.5);
}

.iv-release {
    scrollbar-width: thin;
    scrollbar-color: rgba(127, 166, 201, 0.3) rgba(31, 36, 44, 0.5);
}

.iv-release[data-type="album"] {
    scrollbar-color: rgba(255, 77, 46, 0.3) rgba(31, 36, 44, 0.5);
}

.iv-release:hover {
    transform: translateY(-4px);
    box-shadow:
        0 0 32px rgba(127, 166, 201, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.3);
    border-color: rgba(127, 166, 201, 0.22);
}

/* Album card has ember accent */
.iv-release[data-type="album"] {
    border-color: rgba(255, 77, 46, 0.14);
    box-shadow: 0 0 24px rgba(255, 77, 46, 0.06);
}

.iv-release[data-type="album"]:hover {
    border-color: rgba(255, 77, 46, 0.22);
    box-shadow:
        0 0 32px rgba(255, 77, 46, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.3);
}



/* =========================================================
   RELEASE HEADER
   ========================================================= */

.iv-release__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.iv-release__type {
    font-size: 0.65rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--ash-gray);
    opacity: 0.75;
}

.iv-release__status {
    font-size: 0.68rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 400;
}

.iv-release__status--released {
    color: rgba(170, 255, 195, 0.92);
    background: rgba(120, 255, 170, 0.10);
    border: 1px solid rgba(120, 255, 170, 0.25);
}

.iv-release__status--upcoming {
    color: rgba(214, 183, 108, 0.92);
    background: rgba(214, 183, 108, 0.10);
    border: 1px solid rgba(214, 183, 108, 0.25);
}


/* =========================================================
   COVER IMAGE
   ========================================================= */

.iv-release__cover {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;

    background: var(--stone-dark);
    border: 1px solid var(--stone-gray);
}

.iv-release__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.iv-release:hover .iv-release__cover img {
    transform: scale(1.05);
}


/* =========================================================
   RELEASE CONTENT
   ========================================================= */

.iv-release__content {
    padding: 0 4px;
}

.iv-release__name {
    font-size: 1.35rem;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--bone-white);
    display: flex;
    align-items: center;
    gap: 8px;
}

.iv-release__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--ash-gray);
    margin-bottom: 16px;
}


/* =========================================================
   ALBUM ACTIONS (About + View Tracklist stacked)
   ========================================================= */

.iv-album-actions .iv-description {
    margin-bottom: 16px;
}

.iv-album-actions .iv-tracklist__btn {
    margin-bottom: 0;
}


/* =========================================================
   DESCRIPTION ACCORDION
   ========================================================= */

.iv-description {
    margin-bottom: 16px;
}

.iv-description__toggle {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ash-gray);
    cursor: pointer;
    padding: 8px 0;
    list-style: none;
    transition: color 0.25s ease;
    display: block;
}

.iv-description__toggle::-webkit-details-marker {
    display: none;
}

.iv-description__toggle::before {
    content: '▸ ';
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.25s ease;
}

.iv-description[open] .iv-description__toggle::before {
    transform: rotate(90deg);
}

.iv-description__toggle:hover {
    color: var(--bone-white);
}

.iv-description__content {
    margin-top: 16px;
    padding: 16px;
    border-radius: 8px;
    background: rgba(127, 166, 201, 0.05);
    border: 1px solid rgba(127, 166, 201, 0.14);
}

.iv-release[data-type="album"] .iv-description__content {
    background: rgba(255, 77, 46, 0.05);
    border-color: rgba(255, 77, 46, 0.14);
}

.iv-description__content p {
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--bone-white);
    opacity: 0.85;
    margin: 0;
}


/* =========================================================
   COPY BUTTON
   ========================================================= */

.iv-copy {
    background: none;
    border: none;
    color: var(--ash-gray);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.25s ease;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.iv-copy:hover {
    color: var(--ember-core);
    background: rgba(255, 77, 46, 0.08);
}

.iv-copy:active {
    transform: scale(0.92);
}

.iv-copy.copied {
    color: rgba(120, 255, 170, 0.92);
}

.iv-copy.copied svg {
    animation: copy-success 0.4s ease;
}

@keyframes copy-success {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3) rotate(5deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}


/* =========================================================
   TRACKLIST BUTTON
   ========================================================= */

.iv-tracklist__btn {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--bone-white);
    background: rgba(255, 77, 46, 0.08);
    border: 1px solid rgba(255, 77, 46, 0.35);
    border-radius: 999px;
    padding: 10px 18px;
    cursor: pointer;
    margin-bottom: 24px;
    transition: all 0.25s ease;
    display: inline-block;
}

.iv-tracklist__btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 77, 46, 0.14);
    box-shadow: 0 0 16px rgba(255, 77, 46, 0.18);
}

.iv-copy--small {
    padding: 4px;
}


/* =========================================================
   MODAL
   ========================================================= */

.iv-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.iv-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.iv-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(7, 8, 10, 0.92);
    backdrop-filter: blur(8px);
}

.iv-modal__content {
    position: relative;
    z-index: 1;
    width: min(640px, 100%);
    max-height: 80vh;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.22));
    border: 1px solid rgba(255, 77, 46, 0.22);
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 0 48px rgba(255, 77, 46, 0.15);
    overflow: hidden;

    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.iv-modal.is-open .iv-modal__content {
    transform: scale(1) translateY(0);
}

.iv-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 77, 46, 0.14);
}

.iv-modal__title {
    font-size: 1.5rem;
    line-height: 1.2;
    color: var(--bone-white);
    padding-right: 20px;
}

.iv-modal__close {
    background: none;
    border: none;
    color: var(--ash-gray);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.iv-modal__close:hover {
    color: var(--ember-core);
    background: rgba(255, 77, 46, 0.08);
}

.iv-modal__body {
    max-height: calc(80vh - 140px);
    overflow-y: auto;
    padding-right: 8px;
}

/* Custom scrollbar for modal */
.iv-modal__body::-webkit-scrollbar {
    width: 6px;
}

.iv-modal__body::-webkit-scrollbar-track {
    background: rgba(31, 36, 44, 0.5);
    border-radius: 3px;
}

.iv-modal__body::-webkit-scrollbar-thumb {
    background: rgba(255, 77, 46, 0.3);
    border-radius: 3px;
    transition: background 0.25s ease;
}

.iv-modal__body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 77, 46, 0.5);
}

.iv-modal__body {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 77, 46, 0.3) rgba(31, 36, 44, 0.5);
}

.iv-modal__tracklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
    counter-reset: track;
}

.iv-modal__tracklist li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.25s ease;
    counter-increment: track;
}

.iv-modal__tracklist li::before {
    content: counter(track, decimal-leading-zero) " ";
    font-size: 0.75rem;
    color: var(--ash-gray);
    margin-right: 14px;
    font-variant-numeric: tabular-nums;
}

.iv-modal__tracklist li:hover {
    background: rgba(255, 255, 255, 0.04);
}

.iv-modal__trackName {
    font-size: 0.95rem;
    color: var(--bone-white);
    flex: 1;
}


/* =========================================================
   PLATFORMS
   ========================================================= */

.iv-release__platforms {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(127, 166, 201, 0.10);
}

.iv-release[data-type="album"] .iv-release__platforms {
    border-top-color: rgba(255, 77, 46, 0.10);
}

.iv-release__platformLabel {
    font-size: 0.65rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ash-gray);
    opacity: 0.75;
    margin-bottom: 16px;
}

.iv-release__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.iv-platform {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 999px;

    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-decoration: none;

    color: var(--bone-white);
    background: rgba(127, 166, 201, 0.08);
    border: 1px solid rgba(127, 166, 201, 0.25);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        background-color 0.25s ease;
}

.iv-release[data-type="album"] .iv-platform {
    background: rgba(255, 77, 46, 0.08);
    border-color: rgba(255, 77, 46, 0.25);
}

.iv-platform:hover {
    transform: translateY(-2px);
    background: rgba(127, 166, 201, 0.14);
    box-shadow: 0 0 16px rgba(127, 166, 201, 0.18);
}

.iv-release[data-type="album"] .iv-platform:hover {
    background: rgba(255, 77, 46, 0.14);
    box-shadow: 0 0 16px rgba(255, 77, 46, 0.18);
}


/* =========================================================
   UPCOMING NOTICE
   ========================================================= */

.iv-release__notice {
    padding: 18px;
    border-radius: 12px;
    background: rgba(214, 183, 108, 0.05);
    border: 1px solid rgba(214, 183, 108, 0.18);
    margin-top: 24px;
}

.iv-release__notice p {
    font-size: 0.88rem;
    color: rgba(214, 183, 108, 0.85);
    text-align: center;
    margin: 0;
}


/* =========================================================
   CAROUSEL DOTS (Mobile Only)
   ========================================================= */

.iv-carousel-dots {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
    padding: 0 0 24px;
}

.iv-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(127, 166, 201, 0.25);
    border: 1px solid rgba(127, 166, 201, 0.35);
    cursor: pointer;
    transition: all 0.3s ease;
}

.iv-carousel-dot.is-active {
    width: 24px;
    background: rgba(127, 166, 201, 0.65);
    border-color: rgba(127, 166, 201, 0.75);
    box-shadow: 0 0 12px rgba(127, 166, 201, 0.3);
}

.iv-carousel-dot:hover {
    background: rgba(127, 166, 201, 0.45);
    transform: scale(1.2);
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 980px) {
    .iv-music {
        padding: 48px 0;
    }

    /* Enable horizontal carousel on mobile */
    .iv-music__inner {
        width: 100%;
        overflow: hidden;
    }

    .iv-music__grid {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        gap: 0;
        margin: 0;
        padding: 0 5vw;

        /* Hide scrollbar but keep functionality */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .iv-music__grid::-webkit-scrollbar {
        display: none;
    }

    .iv-release {
        flex: 0 0 85vw;
        max-width: 85vw;
        scroll-snap-align: center;
        scroll-snap-stop: always;
        margin-right: 5vw;
        max-height: none;
    }

    .iv-release:last-child {
        margin-right: 5vw;
    }

    /* Show carousel dots */
    .iv-carousel-dots {
        display: flex;
    }
}

@media (max-width: 520px) {
    .iv-release {
        padding: 16px;
    }

    .iv-release__name {
        font-size: 1.15rem;
    }

    .iv-release__links {
        gap: 8px;
    }

    .iv-platform {
        font-size: 0.68rem;
        padding: 7px 12px;
    }

    .iv-modal {
        padding: 12px;
    }

    .iv-modal__content {
        padding: 24px 20px;
    }

    .iv-modal__title {
        font-size: 1.25rem;
    }

    .iv-modal__tracklist li {
        padding: 10px 12px;
    }

    .iv-modal__trackName {
        font-size: 0.88rem;
    }

    .iv-description__content {
        padding: 12px;
        font-size: 0.85rem;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .iv-release,
    .iv-release__cover img,
    .iv-release__content,
    .iv-copy,
    .iv-platform,
    .iv-tracklist__btn,
    .iv-description__toggle,
    .iv-modal,
    .iv-modal__content,
    .iv-modal__close {
        transition: none;
    }

    .iv-copy.copied svg {
        animation: none;
    }
}
