*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: #0a0a0a;
    color: #f0f0f0;
    font-family: 'Montserrat', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 40px;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 50% 0%, #1a1500 0%, #050505 60%);
    background-attachment: fixed;
}

::-webkit-scrollbar {
    width: 11px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #8a6d1c;
    border-radius: 5px;
    border: 3px solid #0a0a0a;
}

::-webkit-scrollbar-thumb:hover {
    background: #d4af37;
}

/* ========================================= */
/* STRUCTURE PAGE DETAIL                     */
/* ========================================= */
.main-container {
    max-width: 1090px;
    width: 89%;
    margin: 0 auto 95px auto;
    position: relative;
    z-index: 10;
}

.back-btn-container {
    margin-bottom: 35px;
    display: flex;
    gap: 20px;
}

.back-link {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    font-size: 0.9rem;
    color: #d4af37;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: 0.3s;
    font-weight: 600;
    padding: 10px 0;
}

.back-link svg {
    transition: transform 0.3s;
}

.back-link:hover {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
}

.back-link:hover svg {
    transform: translateX(-5px);
}

.project-header-simple {
    text-align: center;
    margin-bottom: 65px;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 5vw, 3.9rem);
    margin: 0 0 10px 0;
    font-weight: 400;
    font-style: italic;
    background: linear-gradient(to right, #ffffff 30%, #d4af37 60%, #ffffff 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 28px rgba(0, 0, 0, 0.8));
    line-height: 1.1;
    animation: fadeDown 1s ease-out;
}

.subtitle-instruction {
    font-family: 'Montserrat', sans-serif;
    color: #d4af37;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 3.5px;
    padding-bottom: 9px;
    border-bottom: 1px solid #d4af37;
    display: inline-block;
    animation: fadeUp 1s ease-out 0.3s backwards;
}

.featured-card {
    background-color: #0a0a0a;
    border-radius: 9px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 48px;
    margin-bottom: 58px;
    position: relative;
    box-shadow: 0 28px 58px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    animation: fadeUp 1s ease-out 0.4s backwards;
}

.featured-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(135deg, #d4af37 0%, #aa8c2c 100%);
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.95rem;
    color: #f9e5a0;
    margin-top: 0;
    margin-bottom: 20px;
}

.card-text {
    font-size: 1.02rem;
    color: #a0a0a0;
    line-height: 1.75;
}

.card-text strong {
    color: #d4af37;
    font-weight: 600;
}

.tech-tags {
    margin-top: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-tags span {
    font-size: 0.74rem;
    color: #d4af37;
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 5px 13px;
    border-radius: 45px;
    background: rgba(212, 175, 55, 0.05);
    font-weight: 600;
    letter-spacing: 1px;
    display: inline-block;
}

/* ========================================= */
/* MODULES DE CODE (DÉROULANTS)              */
/* ========================================= */
.code-modules-container {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.code-module {
    opacity: 0;
    animation: fadeUp 0.8s ease-out forwards;
}

.code-module:nth-child(1) {
    animation-delay: 0.12s;
}

.code-module:nth-child(2) {
    animation-delay: 0.22s;
}

.code-module:nth-child(3) {
    animation-delay: 0.32s;
}

details {
    background-color: #080808;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

details summary.module-header {
    cursor: pointer;
    list-style: none;
    padding: 20px 25px;
    user-select: none;
    transition: background 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

details summary.module-header::-webkit-details-marker {
    display: none;
}

details summary.module-header:hover {
    background: rgba(212, 175, 55, 0.05);
}

details summary h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.55rem;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: #e0e0e0;
}

details summary h3::after {
    content: '+';
    float: right;
    font-weight: 300;
    font-size: 1.45rem;
    color: #d4af37;
    margin-left: 14px;
    transition: transform 0.3s ease;
}

details[open] summary h3::after {
    content: '−';
    transform: rotate(180deg);
    color: #f0f0f0;
}

.module-header p {
    margin: 0;
    font-size: 0.88rem;
    color: #a0a0a0;
}

.binome-module details {
    border-left: 3px solid #333;
}

.badge-binome {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.68rem;
    background: #222;
    color: #888;
    padding: 3px 9px;
    border-radius: 3px;
    letter-spacing: 1px;
    margin-left: 10px;
    display: inline-block;
    vertical-align: middle;
}

.my-module details {
    border-left: 3px solid #d4af37;
}

.badge-me {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.68rem;
    background: #d4af37;
    color: #000;
    padding: 3px 9px;
    border-radius: 3px;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 0 9px rgba(212, 175, 55, 0.15);
    margin-left: 10px;
    display: inline-block;
    vertical-align: middle;
}

details[open] .code-window {
    animation: slideDown 0.4s ease-out;
}

.code-window {
    background-color: #050505;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    padding: 20px 0;
}

pre {
    margin: 0;
    padding: 30px 20px 20px 20px;
    overflow-x: auto;
    width: 100%;
}

code {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #d4d4d4;
    display: block;
    white-space: pre;
}

.code-comment {
    color: #6a9955 !important;
    font-style: italic;
}

.code-docstring {
    color: #ce9178 !important;
}

.code-keyword {
    color: #d4af37 !important;
    font-weight: bold;
}

.explanation-box {
    margin: 10px 20px 0 20px;
    padding: 14px;
    background: rgba(212, 175, 55, 0.05);
    border-left: 2px solid #d4af37;
    color: #ccc;
    font-size: 0.88rem;
    border-radius: 0 4px 4px 0;
}

.explanation-box strong {
    color: #d4af37;
}

/* ========================================= */
/* BOUTON RETOUR EN BAS (FOOTER PROJET)      */
/* ========================================= */
.project-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 78px;
    padding-top: 48px;
    text-align: center;
}

.btn-cv {
    height: 40px;
    padding: 0 30px;
    background: linear-gradient(135deg, #d4af37 0%, #aa8c2c 100%);
    color: #000000 !important;
    font-weight: 700;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.35);
    border: 1px solid #f0d78c;
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.btn-cv:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, #fff7cc 0%, #d4af37 100%);
}

/* ========================================= */
/* ANIMATIONS                                */
/* ========================================= */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================= */
/* JS PARTICULES ET LUEUR                    */
/* ========================================= */
#gold-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, rgba(212, 175, 55, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 0;
    transition: opacity 0.3s ease;
}

/* ========================================= */
/* RESPONSIVE MOBILE                         */
/* ========================================= */
@media (max-width: 900px) {
    .main-container {
        width: 92%;
        margin-top: 20px;
    }

    .page-title {
        font-size: 2.3rem;
    }

    .featured-card {
        padding: 30px 20px;
    }

    details summary h3 {
        font-size: 1.15rem;
    }

    .badge-binome, 
    .badge-me {
        float: none;
        display: block;
        width: fit-content;
        margin: 5px 0 0 0;
    }
}

/* ========================================= */
/* FOOTER DE LA PAGE                         */
/* ========================================= */
.site-footer {
    padding: 19px;
    text-align: center;
    color: #d4af37;
    font-size: 0.88rem;
    border-top: 1px solid rgba(212, 175, 55, 0.18);
    background-color: #0a0a0a;
    margin-top: auto;
}
