body {
    background-color: #282828;
    overflow-x: hidden;
    /* disable scroll bar */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
    position: relative;

}

html {
    overflow-x: hidden;
}

#bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

nav,
main {
    position: relative;
    z-index: 1;
}

main {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding-top: 80px;
    min-height: 100vh;
}

#navbar {
    position: fixed;
    top: 1em;
    left: 2em;
    right: 2em;
    width: 100%;
    height: 60px;
    background-color: transparent;
    display: flex;
    align-items: center;
    z-index: 10;
}

.allo {
    position: absolute;
    right: 4em;
    top: 0em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: 'Noto Sans Mono', monospace;
    font-size: 1.2rem;
    font-weight: 500;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

.allo:hover {
    color: #FF0000;
}

#phone {
    width: 2em;
    height: 2em;
    filter: invert(27%) sepia(100%) saturate(700%) hue-rotate(330deg) brightness(1.1);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.allo:hover #phone {
    transform: rotate(15deg) scale(1.15);
}

#back {
    list-style: none;
}

#back a {
    display: inline-block;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.2s ease;
}

#back a img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
}

#back a:hover {
    transform: translateX(-5px);
    opacity: 0.7;
}

#container__title {
    position: sticky;
    top: 20em;
    left: -30em;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

#container__title h1 {
    font-family: 'Asap Condensed', sans-serif;
    font-size: 5.5em;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #FF0000;
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
    writing-mode: vertical-rl;
    transform: rotate(-90deg);
    animation: glitch-main 6s steps(1) infinite;
    transition: transform 0.1s ease-out;
    margin-left: -1.6em;
}

#container__title h1::before,
#container__title h1::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    background: transparent;
    writing-mode: vertical-rl;
}

#container__title h1 .letter {
    display: inline-block;
    opacity: 0;
    animation: letterReveal 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes letterReveal {
    from {
        opacity: 0;
        transform: rotate(90deg) translateY(10px);
    }

    to {
        opacity: 1;
        transform: rotate(90deg) translateY(0);
    }
}

#container__title h1::before {
    color: #ff006a;
    font-family: "Varela Round";
    animation: glitch-top 6s steps(1) infinite;
    clip-path: polygon(0 0, 100% 0, 100% 38%, 0 38%);
}

#container__title h1::after {
    color: #ff4400;
    animation: glitch-bot 6s steps(1) infinite;
    clip-path: polygon(0 62%, 100% 62%, 100% 100%, 0 100%);
}

#container__grille {
    flex: 1;
    max-width: 55em;
    margin: 2rem auto 4rem;
    margin-left: 15em;
    padding: 0 2rem 0 1rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    gap: 24px;
    align-items: start;
    margin-bottom: 1em;
    position: sticky;
    top: 1em;
}

.ep-card {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    /* toutes carrées */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.ep-card:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.ep-card:nth-child(odd) {
    margin-top: 48px;
}

.ep-card .face {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ep-card .face1 {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(4px);
    color: #fff;
    gap: 10px;
    z-index: 1;
}

.ep-card .face1 .track-title {
    font-family: 'Noto Sans Mono', monospace;
    font-size: 1.3rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.ep-card .face1 .track-mcs {
    font-family: 'Noto Sans Mono', monospace;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
    font-weight: 400;
}

.ep-card .face1 .track-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.ep-card .face1 .track-links a {
    font-family: 'Noto Sans Mono', monospace;
    font-size: 0.72rem;
    color: #fff;
    text-decoration: none;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    transition: background 0.2s, border-color 0.2s;
}

.ep-card .face1 .track-links a:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #FF0000;
}

.ep-card .face2 {
    z-index: 2;
    bottom: 0;
    top: auto;
    height: 100%;
    transition: height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        border-radius 0.45s ease;
    border-radius: 12px;
    overflow: hidden;
}

.ep-card .face2 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background-color: whitey;
}

.ep-card:hover .face2 {
    height: 56px;
    border-radius: 0 0 12px 12px;
}

.ep-card:nth-child(1) .face2 {
    background: #0a0a0a;
}

.ep-card:nth-child(2) .face2 {
    background: #0a0a0a;
}

.ep-card:nth-child(3) .face2 {
    background: #0a0a0a;
}

.ep-card:nth-child(4) .face2 {
    background: #0a0a0a;
}

/* Trait coloré en bas */
.ep-card:nth-child(1) .face2::after {
    --accent: #ffffff;
}

.ep-card:nth-child(2) .face2::after {
    --accent: #fb00ff;
}

.ep-card:nth-child(3) .face2::after {
    --accent: #20a049;
}

.ep-card:nth-child(4) .face2::after {
    --accent: #fb00ff;
    /* adapte la couleur */
}

.ep-card .face2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent, #fff);
    z-index: 4;
    opacity: 0;
    transition: opacity 0.3s 0.2s;
}

.ep-card:hover .face2::after {
    opacity: 1;
}

@keyframes glitch-top {

    0%,
    90%,
    100% {
        transform: translate(0);
        opacity: 0;
    }

    91% {
        transform: translate(-4px, -2px);
        opacity: 1;
    }

    92% {
        transform: translate(4px, 1px);
        opacity: 1;
    }

    93% {
        transform: translate(-3px, 0);
        opacity: 1;
    }

    94% {
        transform: translate(0);
        opacity: 0;
    }
}

@keyframes glitch-bot {

    0%,
    90%,
    100% {
        transform: translate(0);
        opacity: 0;
    }

    91% {
        transform: translate(4px, 2px);
        opacity: 1;
    }

    92% {
        transform: translate(-4px, -1px);
        opacity: 1;
    }

    93% {
        transform: translate(3px, 1px);
        opacity: 1;
    }

    94% {
        transform: translate(0);
        opacity: 0;
    }
}

@keyframes glitch-main {

    0%,
    90%,
    100% {
        transform: rotate(-90deg) translate(0) skewX(0deg);
    }

    91% {
        transform: rotate(-90deg) translate(3px, 0) skewX(-3deg);
    }

    92% {
        transform: rotate(-90deg) translate(-3px, 0) skewX(3deg);
    }

    93% {
        transform: rotate(-90deg) translate(0) skewX(0deg);
    }
}


@media (max-width: 768px) {

    main {
        flex-direction: column;
        align-items: center;
        padding-top: 100px;
        gap: 20px;
    }

    .allo {
        top: 0em;
        margin-top: -2em;
    }

    #back {
        margin-top: -2.2em;
        right: 500px;
    }


    #container__title {
        position: relative;
        top: auto;
        left: auto;
        margin: 1rem 0;
        text-align: center;
    }

    #container__title h1 {
        writing-mode: horizontal-tb;
        transform: none;
        font-size: clamp(2.2rem, 8vw, 3.5rem);
        margin: 0;
    }

    #container__title h1 .letter {
        display: inline-block;
        transform: rotate(90deg);
        transform-origin: center;
    }

    #container__grille {
        display: grid;
        grid-template-columns: 1fr;
        width: 80%;
        max-width: 800px;
        min-width: 80%;

        margin: 0;
        padding: 0 1rem;
        gap: 20px;
        margin-bottom: 2vh;
    }

    .ep-card {
        width: 95%;
        aspect-ratio: 1 / 1;
        border-radius: 14px;
    }

    .ep-card:nth-child(1),
    .ep-card:nth-child(2),
    .ep-card:nth-child(3) {
        grid-column: auto;
        grid-row: auto;
    }

    .ep-card .face1 {
        padding: 16px;
        gap: 8px;
    }

    .track-title {
        font-size: 1.05rem;
        line-height: 1.2;
    }

    .track-mcs {
        font-size: 0.75rem;
    }

    .track-links a {
        font-size: 0.7rem;
        padding: 5px 10px;
    }

    .ep-card .face2 {
        height: 100%;
    }

    .ep-card.tapped .face2 {
        height: 56px;
        border-radius: 0 0 14px 14px;
    }

    .ep-card.tapped .face2::after {
        opacity: 1;
    }

    #navbar {
        left: 1em;
        right: 1em;
    }

    .allo {
        right: 1em;
        top: 1em;
        transform: scale(0.75);
    }

    #bg-grid {
        opacity: 0.3;
    }
}
