
:root {
    --plum: #21172b;
    --plum-light: #33243f;
    --plum-soft: #493650;

    --gold: #b99a68;
    --gold-light: #d3bb91;

    --ivory: #f7f4ed;
    --ivory-dark: #eee9df;

    --text-dark: #29232b;
    --text-muted: #827a7d;

    --heading-font: 'Cormorant Garamond', serif;
    --body-font: 'DM Sans', sans-serif;
}


/* GENERAL */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--ivory);
    color: var(--text-dark);
    font-family: var(--body-font);
}

body.viewer-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}


/* NAVIGATION */

.header {
    background: var(--plum);
    padding: 22px 10%;
    position: relative;
    z-index: 10;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-family: var(--heading-font);
    font-size: 34px;
    font-weight: 700;
    color: var(--ivory);
    letter-spacing: 2px;
}

.logo-sub {
    font-size: 8px;
    color: var(--gold);
    letter-spacing: 1.7px;
}

.navigation {
    display: flex;
    align-items: center;
    gap: 35px;
}

.navigation > a {
    color: rgba(247, 244, 237, 0.7);
    font-size: 12px;
}

.navigation > a.active {
    color: var(--gold-light);
}


/* SNOW TOGGLE */

.snow-toggle {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 9px 13px;

    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(211, 187, 145, 0.25);
    border-radius: 30px;

    color: var(--ivory);
    cursor: pointer;

    transition: background 0.2s, border-color 0.2s;
}

.snow-toggle:hover {
    background: rgba(255, 255, 255, 0.11);
    border-color: var(--gold);
}

.snow-icon {
    color: var(--gold-light);
    font-size: 15px;
}

#snowLabel {
    font-size: 10px;
    letter-spacing: 0.5px;
}

.toggle-track {
    width: 32px;
    height: 18px;
    background: #63586a;
    border-radius: 20px;
    position: relative;
    transition: background 0.25s;
}

.toggle-knob {
    width: 12px;
    height: 12px;
    background: var(--ivory);
    border-radius: 50%;

    position: absolute;
    top: 3px;
    left: 3px;

    transition: transform 0.25s;
}

.snow-toggle.is-on .toggle-track {
    background: var(--gold);
}

.snow-toggle.is-on .toggle-knob {
    transform: translateX(14px);
}


/* LIBRARY HEADING */

.library-heading {
    background:
        radial-gradient(circle at 50% 100%, #493650 0%, transparent 45%),
        linear-gradient(115deg, #21172b, #302139);

    padding: 90px 10% 85px;
    text-align: center;
    color: var(--ivory);
}

.section-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;

    color: var(--gold);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 3px;
}

.section-label span {
    width: 25px;
    height: 1px;
    background: var(--gold);
}

.library-heading h1 {
    font-family: var(--heading-font);
    font-size: clamp(55px, 7vw, 82px);
    font-weight: 500;
    line-height: 1;
    margin-top: 23px;
}

.library-heading h1 em {
    color: var(--gold-light);
    font-weight: 400;
}

.library-heading > p {
    max-width: 510px;
    margin: 22px auto 0;

    color: rgba(247, 244, 237, 0.7);
    font-size: 13px;
    line-height: 1.9;
}

.heading-divider {
    width: 55px;
    height: 1px;
    background: var(--gold);
    margin: 35px auto 0;
}


/* COLLECTION */

.collection-section {
    background: var(--ivory-dark);
    padding: 80px 10% 110px;
}

.collection-top {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 35px;
}

.left-label {
    justify-content: flex-start;
}

.collection-top h2 {
    font-family: var(--heading-font);
    font-size: 49px;
    font-weight: 500;
    color: var(--plum);
    margin-top: 8px;
}

.collection-top h2 em {
    color: var(--gold);
}

#collectionCount {
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: 1.5px;
    padding-bottom: 12px;
}


/* SEARCH */

.search-container {
    display: flex;
    align-items: center;
    gap: 14px;

    background: var(--ivory);
    border: 1px solid #ded7cb;

    padding: 0 20px;
    height: 55px;

    margin-bottom: 35px;
    max-width: 570px;

    transition: border-color 0.2s;
}

.search-container:focus-within {
    border-color: var(--gold);
}

.search-icon {
    font-family: var(--heading-font);
    font-size: 28px;
    color: var(--gold);
}

.search-container input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;

    font-size: 12px;
    color: var(--text-dark);
}

.search-container input::placeholder {
    color: #a29a99;
}


/* MUSIC CARDS */

.collection-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.music-card {
    background: var(--ivory);
    border: 1px solid rgba(33, 23, 43, 0.06);
    overflow: hidden;

    transition: transform 0.25s, box-shadow 0.25s;
}

.music-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(33, 23, 43, 0.08);
}

.card-image {
    height: 225px;

    background:
        radial-gradient(circle at center, #493650, #251a30);

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;
    overflow: hidden;
}

.card-image::before,
.card-image::after {
    content: "";
    position: absolute;

    width: 190px;
    height: 190px;

    border: 1px solid rgba(211, 187, 145, 0.2);
    border-radius: 50%;
}

.card-image::after {
    width: 155px;
    height: 155px;
}

.card-symbol {
    font-family: var(--heading-font);
    font-size: 85px;
    color: rgba(255, 255, 255, 0.18);
    z-index: 1;
}

.card-content {
    padding: 25px;
}

.card-category {
    color: var(--gold);
    font-size: 9px;
    letter-spacing: 1.7px;
    font-weight: 700;
    text-transform: uppercase;
}

.card-content h3 {
    font-family: var(--heading-font);
    font-size: 27px;
    font-weight: 600;
    color: var(--plum);

    margin-top: 10px;
    line-height: 1.15;
}

.card-content p {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 9px;
    line-height: 1.7;
}

.card-link {
    display: inline-block;
    margin-top: 23px;
    padding: 0 0 5px;

    background: none;
    border: none;
    border-bottom: 1px solid var(--gold);

    color: var(--plum);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;

    cursor: pointer;
}

.card-link span {
    color: var(--gold);
    margin-left: 10px;
}

.empty-message {
    display: none;
    padding: 50px 0;
    text-align: center;

    color: var(--text-muted);
    font-family: var(--heading-font);
    font-size: 25px;
}


/* SHEET MUSIC VIEWER */

.viewer-overlay {
    display: none;

    position: fixed;
    inset: 0;
    z-index: 10000;

    background: rgba(15, 10, 19, 0.94);

    padding: 30px 5%;
    overflow-y: auto;
}

.viewer-overlay.visible {
    display: block;
}

.viewer {
    max-width: 1050px;
    margin: 0 auto;
}

.viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 10px 0 25px;
    border-bottom: 1px solid rgba(211, 187, 145, 0.25);
}

.viewer-label {
    color: var(--gold);
    font-size: 9px;
    letter-spacing: 2px;
    font-weight: 700;
}

.viewer-header h2 {
    font-family: var(--heading-font);
    font-size: 35px;
    color: var(--ivory);
    font-weight: 500;
    margin-top: 5px;
}

.viewer-close {
    background: none;
    border: none;
    color: var(--ivory);
    font-family: var(--heading-font);
    font-size: 42px;
    cursor: pointer;
    line-height: 1;
}

.viewer-close:hover {
    color: var(--gold-light);
}

.viewer-pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    padding: 30px 0;
}

.viewer-page {
    width: 100%;
    max-width: 850px;
    background: white;
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.25);
}

.viewer-page img {
    display: block;
    width: 100%;
    height: auto;
}

.viewer-page-error {
    padding: 35px;
    color: #8a3030;
    font-size: 13px;
    text-align: center;
}

.viewer-footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;

    border-top: 1px solid rgba(211, 187, 145, 0.25);
    padding: 20px 0 10px;

    color: rgba(247, 244, 237, 0.5);
    font-size: 9px;
    letter-spacing: 1px;
}


/* FOOTER */

.footer {
    background: #19111f;
    padding: 45px 10% 25px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 35px;
}

.footer-brand p {
    color: var(--gold);
    font-size: 10px;
    letter-spacing: 1px;
}

.footer-note {
    color: rgba(247, 244, 237, 0.5);
    font-family: var(--heading-font);
    font-size: 20px;
    text-align: right;
    line-height: 1.3;
}

.footer-bottom {
    border-top: 1px solid rgba(211, 187, 145, 0.18);
    padding-top: 20px;

    display: flex;
    justify-content: space-between;
    gap: 15px;

    color: rgba(247, 244, 237, 0.4);
    font-size: 8px;
    letter-spacing: 1px;
}


/* RESPONSIVE */

@media (max-width: 1000px) {

    .collection-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .collection-section {
        padding-left: 7%;
        padding-right: 7%;
    }

}

@media (max-width: 700px) {

    .header {
        padding: 18px 6%;
    }

    .nav-container {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }

    .navigation {
        width: 100%;
        justify-content: space-between;
        gap: 15px;
    }

    .library-heading {
        padding: 75px 7%;
    }

    .library-heading h1 {
        font-size: 57px;
    }

    .library-heading > p {
        font-size: 12px;
    }

    .collection-section {
        padding: 65px 7% 80px;
    }

    .collection-top {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .collection-top h2 {
        font-size: 42px;
    }

    .collection-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card-image {
        height: 210px;
    }

    .viewer-overlay {
        padding: 18px 4%;
    }

    .viewer-header h2 {
        font-size: 28px;
    }

    .viewer-footer {
        flex-direction: column;
    }

    .footer {
        padding: 40px 7% 25px;
    }

    .footer-top {
        align-items: flex-start;
        flex-direction: column;
        gap: 25px;
    }

    .footer-note {
        text-align: left;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
    }

}

#collection {
    scroll-margin-top: -430px;
}


/* =========================================
   SHEET MUSIC AUDIO PLAYER
========================================= */

.viewer-audio-container {
    width: 100%;
    max-width: 850px;
    margin: 0 auto 35px;
    padding: 24px 28px;

    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(201, 164, 92, 0.3);
    border-radius: 12px;

    box-sizing: border-box;
}

.viewer-audio-heading {
    color: #c9a45c;
    font-family: "DM Sans", sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.viewer-audio-description {
    color: #d8d0c8;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    margin: 0 0 18px;
}

.viewer-audio {
    display: block;
    width: 100%;
    height: 42px;
}

.audio-error .viewer-audio {
    display: none;
}

@media (max-width: 600px) {

    .viewer-audio-container {
        padding: 20px 16px;
        margin-bottom: 25px;
    }

}

/* Rounded corners on sheet music pages */

.viewer-page {
    overflow: hidden;
    border-radius: 10px;
}

.viewer-page img {
    display: block;
    width: 100%;
    border-radius: 10px;
}

/* =========================================
   PAGE TRANSITION
========================================= */

body {
    opacity: 1;
    transition: opacity 0.4s ease;
}

body.page-leaving {
    opacity: 0;
}

/* Respect reduced motion preferences */

@media (prefers-reduced-motion: reduce) {
    body {
        transition: none;
    }
}

/* =========================================
   PAGE FADE IN
========================================= */

@keyframes pageFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

body {
    animation: pageFadeIn 0.5s ease-in-out both;
}
