
/* =========================================================
   POLICE GRAFFITI
========================================================= */

@font-face {

    font-family: "GraffitiPiece";

    src:
        url("./fonts/GraffitiPieceRegular-gwXVE.ttf")
        format("truetype");

    font-weight: normal;

    font-style: normal;

}


/* =========================================================
   POLICE TITRES PLAYLIST
========================================================= */

@font-face {

    font-family: "DS-Digit";

    src:
        url("./fonts/DS-DIGIT.TTF")
        format("truetype");

    font-weight: normal;

    font-style: normal;

}


/* =========================================================
   RESET
========================================================= */

* {

    margin: 0;

    padding: 0;

    box-sizing: border-box;

    -webkit-user-select: none;

    -moz-user-select: none;

    -ms-user-select: none;

    user-select: none;

}

::selection {

    background: transparent;

    color: inherit;

}

::-moz-selection {

    background: transparent;

    color: inherit;

}


@font-face {

    font-family: "Inkspot";

    src:
        url("./fonts/Inkspot.ttf")
        format("truetype");

    font-weight: normal;

    font-style: normal;

}

img {

    -webkit-user-drag: none;

    user-drag: none;

    -webkit-user-select: none;

    -moz-user-select: none;

    -ms-user-select: none;

    user-select: none;

    -webkit-touch-callout: none;

}


/* =========================================================
   HTML
========================================================= */

html {

    width: 100%;

    height: 100%;

    overflow: hidden;

}


/* =========================================================
   BODY
========================================================= */

body {

    width: 100%;

    height: 100vh;

    overflow: hidden;

    background-color: #000;

    background-image:
        url("./images/playlist-texture.jpg");

    background-size: cover;

    background-position: center;

    background-repeat: no-repeat;

    color: #fff;

}

body::before {

    content: "";

    position: fixed;

    inset: 0;

    pointer-events: none;

    background: rgba(0, 0, 0, 1);

    opacity: 0.25;

    z-index: 900;

}

body.page-transition-start::before {

    animation: page-dark-flicker 2.0s ease-out both;

}

@keyframes page-dark-flicker {

    0% {
        opacity: 0;
    }

    8% {
        opacity: 0.30;
    }

    20% {
        opacity: 0.14;
    }

    34% {
        opacity: 0.24;
    }

    48% {
        opacity: 0.16;
    }

    62% {
        opacity: 0.22;
    }

    74% {
        opacity: 0.14;
    }

    82% {
        opacity: 0.10;
    }

    88% {
        opacity: 0.08;
    }

    92% {
        opacity: 0.05;
    }

    96% {
        opacity: 0.03;
    }

    100% {
        opacity: 0;
    }

}


/* =========================================================
   BANDEAU
========================================================= */

.top-bar {

    position: relative;

    width: 100%;

    height: 90px;

    background: #000;

    display: flex;

    align-items: center;

    justify-content: center;

    z-index: 1000;

}


.top-bar h1 {

    font-family:
        "GraffitiPiece",
        sans-serif;

    font-size: 46px;

    font-weight: normal;

    color: #ff0000;

    letter-spacing: 2px;

}


/* =========================================================
   BOUTON RETOUR
========================================================= */

.back {

    position: absolute;

    left: 30px;

    top: 50%;

    transform:
        translateY(-50%);

    width: 110px;

    height: 110px;

    display: block;

    z-index: 1100;

}


.back img {

    width: 100%;

    height: 100%;

    object-fit: contain;

    display: block;

}


.back:hover {

    opacity: 0.6;

}


/* =========================================================
   ZONE CD
========================================================= */

.cd-section {

    position: relative;

    width: 100%;

    height:
        calc(100vh - 90px);

    overflow: hidden;

    display: flex;

    align-items: center;

    justify-content: center;

}


/* =========================================================
   PANNEL TEXTUEL
========================================================= */

.cd-info {

    position: absolute;

    left: calc(50% + 55px);

    top: calc(50% - 130px);

    width: 145px;

    height: 123px;

    transform:
        translateY(-50%)
        rotate(30deg);

    transform-origin: center center;

    --cd-info-sat: 95%;

    z-index: 120;

    pointer-events: none;

}


.cd-info-image {

    position: absolute;

    inset: 0;

    width: 100%;

    height: 100%;

    object-fit: contain;

    display: block;

    filter:
        saturate(var(--cd-info-sat))
        drop-shadow(0 10px 28px rgba(0, 0, 0, 0.82))
        drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));

}


.cd-info-text {

    position: absolute;

    inset: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 30px 24px 24px 30px;

    -webkit-mask-image: url("./images/text.png");

    mask-image: url("./images/text.png");

    -webkit-mask-repeat: no-repeat;

    mask-repeat: no-repeat;

    -webkit-mask-position: center;

    mask-position: center;

    -webkit-mask-size: contain;

    mask-size: contain;

    text-align: center;

    color: rgba(0, 0, 0, 0.9);

    font-family: "Inkspot", "Bringthanoize", Arial, Helvetica, sans-serif;

    font-size: clamp(11px, 1.2vw, 14px);

    line-height: 0.95;

    letter-spacing: 0.2px;

    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.24);

    transform: rotate(-2deg);

    text-transform: lowercase;

    word-break: break-word;

    overflow-wrap: anywhere;

    white-space: pre-line;

}


/* =========================================================
   PILE HORIZONTALE
========================================================= */

.cd-stack {

    position: absolute;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    display: flex;

    align-items: center;

    justify-content: center;

    overflow: visible;

}


/* =========================================================
   CD
========================================================= */

.cd {

    position: absolute;

    left: 50%;

    top: 50%;

    width: 400px;

    height: 450px;

    margin-left: -200px;

    margin-top: -225px;

    display: block;

    text-decoration: none;

    transform-origin: center center;

    transition:
        transform 0.32s cubic-bezier(
            0.22,
            1,
            0.36,
            1
        ),
        opacity 0.32s ease,
        filter 0.25s ease;

    cursor: pointer;

}


/* =========================================================
   IMAGE CD
========================================================= */

.cd img {

    position: absolute;

    top: 50%;

    left: 50%;

    width: 400px;

    height: 400px;

    object-fit: contain;

    display: block;

    pointer-events: none;

    transform: translate(-50%, -50%);
    /* allow an initial rotation offset via CSS variable */
    --init-rot: 0deg;
    animation: cd-spin 8s linear infinite;
    /* shadow only around the PNG (no cast shadow below) */
    filter: drop-shadow(0 0 28px rgba(0,0,0,0.85)) drop-shadow(0 0 12px rgba(0,0,0,0.65));

}


/* =========================================================
   NOM DE LA PLAYLIST
========================================================= */

.playlist-name {

    position: absolute;

    left: 50%;

    bottom: 0;

    transform:
        translateX(-50%);

    width: 280px;

    min-height: 48px;

    padding:
        9px 20px;

    display: flex;

    align-items: center;

    justify-content: center;

    background: #07152b;

    color: #eaf6ff;

    font-family:
        "DS-Digit",
        sans-serif;

    font-size: 24px;

    font-weight: normal;

    letter-spacing: 1px;

    text-align: center;

    white-space: nowrap;

}


/* =========================================================
   ROTATION
========================================================= */

@keyframes cd-spin {

    from {
        transform: translate(-50%, -50%) rotate(var(--init-rot, 0deg));
    }

    to {
        transform: translate(-50%, -50%) rotate(calc(var(--init-rot, 0deg) + 360deg));
    }

}


/* =========================================================
   CD SÉLECTIONNÉ
========================================================= */

.cd.selected {

    filter:
        drop-shadow(
            0 0 25px
            rgba(
                255,
                0,
                0,
                0.55
            )
        );

}


/* =========================================================
   SURVOL
========================================================= */

.cd:hover {

    filter:
        drop-shadow(
            0 0 35px
            rgba(
                255,
                0,
                0,
                0.85
            )
        );

}


/* =========================================================
   ÉCRANS MOYENS
========================================================= */

@media (max-height: 800px) {

    .top-bar {

        height: 75px;

    }


    .cd-section {

        height:
            calc(100vh - 75px);

    }


    .cd {

        width: 360px;

        height: 410px;

        margin-left: -180px;

        margin-top: -205px;

    }


    .cd img {

        width: 360px;

        height: 360px;

    }


    .playlist-name {

        width: 250px;

        min-height: 43px;

        font-size: 22px;

    }


    .back {

        width: 90px;

        height: 90px;

    }

}


/* =========================================================
   PETITS ÉCRANS
========================================================= */

@media (max-height: 650px) {

    .top-bar {

        height: 60px;

    }


    .cd {

        width: 300px;

        height: 345px;

        margin-left: -150px;

        margin-top: -172px;

    }


    .cd img {

        width: 300px;

        height: 300px;

    }


    .playlist-name {

        width: 220px;

        min-height: 40px;

        font-size: 20px;

    }


    .back {

        width: 80px;

        height: 80px;

    }

}


/* =========================================================
   ÉCRANS ÉTROITS
========================================================= */

@media (max-width: 1000px) {
    .top-bar {

        height: 60px;

    }

    .cd {

        width: 350px;

        height: 395px;

        margin-left: -175px;

        margin-top: -197px;

    }


    .cd img {

        width: 350px;

        height: 350px;

    }


    .playlist-name {

        width: 240px;

    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 700px) {

    html,
    body {

        overflow: hidden;

    }


    .top-bar {

        height: 75px;

    }


    .top-bar h1 {

        font-size: 34px;

        color: #ff0000;

    }


    .back {

        left: 20px;

        width: 80px;

        height: 80px;

    }


    .cd-section {

        height:
            calc(100vh - 75px);

        display: flex;

        flex-direction: column;

        overflow-y: auto;

        overflow-x: hidden;

        -webkit-overflow-scrolling: touch;

        touch-action: pan-y;

        scroll-behavior: smooth;

        background: linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0.85));

        align-items: center;

        padding: 15px 0;

    }


    .cd-stack {

        position: static;

        width: 100%;

        height: fit-content;

        display: flex;

        flex-direction: column;

        align-items: center;

        gap: 6px;

    }


    .cd {

        display: flex;

        flex-direction: column;

        align-items: center;

        justify-content: center;

        width: 260px;

        height: 300px;

        margin: 0;

        flex-shrink: 0;

        cursor: pointer;

        filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.8));

        transition: filter 0.2s ease, transform 0.2s ease;

    }


    .cd:hover {

        filter: drop-shadow(0 14px 26px rgba(255, 0, 0, 0.5));

        transform: scale(1.04);

    }


    .cd img {

        width: 260px;

        height: 260px;

        object-fit: contain;

        display: block;

    }


    .playlist-name {

        width: 240px;

        padding: 10px 12px;

        font-size: 16px;

        text-align: center;

        color: #dffcff;

        font-family: "DS-Digital", monospace;

        letter-spacing: 1px;

    }

}

