/* RESET & BASE */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Courier New', Courier, monospace;
    background-color: #EBEBEB;
    display: block;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Navbar */
.top-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 95%;
    max-width: 1100px;
    padding: 0;
    margin: 40px auto;
    box-sizing: border-box;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.logo img {
    width : 70px;
    height : auto;
    display: block;
    object-fit: contain;
}
.logo:hover {
    transform: scale(1.05) rotate(-2deg);
}

/*Style de la barre de filtres*/
.filter-bar {
    justify-self: center;
    display: flex;
    gap: 5px;
    background: #e5e5e5;
    padding: 5px;
    border-radius: 50px;
    border: 2px solid #000;
    box-shadow: 4px 4px 0px #000;
}

/*Style des boutons*/
.nav-btn {
    background: transparent;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

/* Style des boutons survoler*/
.nav-btn:hover {
    color: #000;
}

/* Style des boutons actif*/
.nav-btn.active {
    background: #fff;
    color: #000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/*Style du lien de contact*/
.contact-link {
    justify-self: end;
    font-weight: 600;
    text-decoration: none;
    color: #000;
    font-size: 1rem;
}
.contact-link:hover {
    text-decoration: underline;
}

/* Bento */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 200px;
    gap: 20px;
    max-width: 1100px;
    width: 95%;
    margin: 0 auto;
    padding-bottom: 50px;
}

.card {
    background: #fff;
    border: 3px solid #000;
    box-shadow: 8px 8px 0px #000; /* Ombre dure (pas de flou) */
    border-radius: 12px;
    padding: 24px;
    transition: all 0.5s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

/* Effet au survol */
.card:hover {
    transform: translate(4px, 4px);
    box-shadow: 4px 4px 0px #000;
}

/* Bio */
.card-bio {
    grid-column: span 2;
    grid-row: span 2;
    background-color: #FAFAFA;
    display: flex;
    flex-direction: column;
    justify-content: space-between; 
    align-items: flex-start;
}

#bio-desc {
    color: #000;
    font-size: 0.9rem;
}
.terminal-title {
    margin: 0;
    line-height: 1.2;
}
/* Curseur clignotant */
.cursor {
    font-weight: 900;
    font-size: 1.5rem;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* SPOTIFY */
.card-spotify {
    grid-column: span 1;
    grid-row: span 1;
    background-color: #FAFAFA;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
}

.spotify-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin-bottom: 10px;
}

/* Texte "Now Playing" et barres animées */
.now-playing {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #1DB954; /* Vert Spotify */
    text-transform: uppercase;
    margin-bottom: 5px;
    height: 15px;
}

/* Animation des petites barres */
.bar {
    width: 3px;
    background-color: #1DB954;
    border-radius: 3px;
    animation-name: playing;
    animation-timing-function: ease;
    animation-iteration-count: infinite;
}
.bar:nth-child(1) { 
    height: 2px;
    animation-duration: 0.85s; 
}
.bar:nth-child(2) { 
    height: 8px;
    animation-duration: 1.26s; 
}
.bar:nth-child(3) { 
    height: 2px;
    animation-duration: 0.62s; 
}

@keyframes playing {
    0% { height: 2px; }
    50% { height: 13px; }
    100% { height: 2px; }
}

/* Titre et Artiste */
.card-spotify h3 {
    font-size: 1.1rem;
    margin: 0;
    color: #000;
}

.card-spotify p {
    font-size: 0.85rem;
    margin: 0;
    color: #555;
    font-weight: 500;
}

.spotify-link {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.spotify-link:hover h3 {
    text-decoration: underline;
}

/* Social */
.card-social {
    grid-column: span 1;
    grid-row: span 1;
    background-color: #FAFAFA;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 20px;
}
.social-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.social-item {
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    color: #000;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.2s ease;
}
.social-item:hover {
    opacity: 0.6;
    text-decoration: underline;
}
.social-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    object-position: center;
    display: block;
    margin-left: -8px;
}
.icon-gh {
    padding: 10px;
    margin-left: -7px;
}

/* Projet Principal */
.card-project-horizontale {
    grid-column: span 2;
    background-color: #FAFAFA;
}
.card-project-verticale {
    grid-row: span 2;
    background-color: #FAFAFA;
}
.card-project {
    background-color: #FAFAFA;
}

/* Contact */
.card-contact {
    grid-column: span 2;
    background-color: #FAFAFA;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    gap: 10px;
    padding: 24px;
}
.contact-arrows {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: 15px;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
    cursor: default;
    margin: 5px 0;
}
.contact-arrows span {
    animation: bounceDown 1.5s infinite ease-in-out;
}
.contact-arrows span:nth-child(2) {
    animation-delay: 0.2s;
}
@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}
.card-link {
    font-weight: 700;
    text-decoration: none;
    color: #000;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
}
.card-link:hover {
    border-color: #000;
    text-decoration: none;
}

/* Stack technique */
.card-stack {
    grid-column: span 2;
    background-color: #FAFAFA;
}

/* Parcours */
.card-parcours {
    grid-column: span 2;
    background-color: #FAFAFA;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
}
.card-parcours h3 {
    font-size: 1.1rem;
    margin: 0;
    color: #000;
}
.card-parcours p {
    font-size: 0.85rem;
    margin: 0;
    color: #555;
    font-weight: 500;
}
.card-parcours span {
    font-size: 0.8rem;
    margin: 0;
    color: #555;
    font-weight: 500;
}
.parcours-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 10px;
}

/* Bouton Voir plus */
.more-container {
    display: none;
    grid-column: 1 / -1;
    order: 0;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 10px;
    width: 100%;
    z-index: 10;
}
.more-btn {
    display: inline-block;
    background-color: #000;
    color: #fff;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: transform 0.2s ease, background-color 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.more-btn:hover {
    transform: scale(1.05);
    background-color: #333;
}

/* --- BOUTON TOGGLE (Carte) --- */
.card-toggle {
    grid-column: span 1;
    grid-row: span 1;
    background-color: #FAFAFA;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Bouton arrow */
.arrow-btn {
    text-decoration: none;
    color: #000;
    font-size: 3rem;
    line-height: 1;
    align-self: flex-end;
    transition: transform 0.3s ease, color 0.3s ease;
    display: block;
}

/* Animation au survol de la flèche */
.arrow-btn:hover {
    transform: translateX(5px);
    opacity: 0.7;
}

.card-bio-xl {
    grid-column: span 2;
    grid-row: span 2;
    background-color: #FAFAFA;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.bio-tags {
    margin-top: 20px;
}

.bento-section-title {
    grid-column: 1 / -1;
    font-size: 2rem;
    font-weight: 900;
    margin-top: 40px;
    margin-bottom: 10px;
    text-transform: uppercase;
    color: #000;
    border-bottom: 4px solid #000;
    padding-bottom: 10px;
}

.card-media {
    grid-column: span 1;
    grid-row: span 1;
    background-color: #FAFAFA;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 15px;
}
.media-icon {
    font-size: 2.5rem;
}
.media-desc {
    margin-bottom: 15px;
}
.media-img {
    width: 100px;
    height: 100px;
    margin-top: 30px;
    object-fit: contain;
}
.card-media-horizontale {
    grid-column: span 2;
    grid-row: span 1;
    background-color: #FAFAFA;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 5px;
}
.card-media-horizontale-large {
    grid-column: span 3;
    grid-row: span 1;
    background-color: #FAFAFA;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 5px;
    padding-bottom: 50px;
}
.card-cv {
   background-color: #FAFAFA;
   display: flex;
   flex-direction: column;
   justify-content: space-between;
   align-items: flex-start;
}
.cv-container {
    background: #000;
    align-self: center;
    border-radius: 50px;
    padding: 12px 20px;
}
.lien-cv {
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    font-size: 0.9rem;
}
.lien-cv:hover {
    text-decoration: underline;
}

/* Switch fixe */
.fixed-theme-switch {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.project-grid {
    grid-template-rows: auto;
}
.project-header {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
}
.project-header h1 {
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
    margin: 0;
}
.subtitle {
    font-size: 1.1rem;
    color: #555;
}
.project-visual {
    grid-column: span 2;
    grid-row: span 2;
    padding: 0;
    overflow: hidden;
    background: #000;
}
.project-visual img {
    width: 100%;
    height: 100%;
    cursor: zoom-in;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.project-visual:hover img {
    transform: scale(1.02);
}
.image-modal {
    display: none;
    position: fixed; 
    z-index: 2000;
    padding-top: 50px; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
}
.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1000px;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    animation-name: zoom;
    animation-duration: 0.3s;
}
@keyframes zoom {
    from {transform:scale(0.8); opacity: 0;} 
    to {transform:scale(1); opacity: 1;}
}
.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001;
}
.close-modal:hover,
.close-modal:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}
.project-desc {
    grid-column: span 2;
    grid-row: span 2;
    justify-content: flex-start;
}
.project-links {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 15px;
}
.link-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.project-details {
    grid-column: span 3;
}
.project-navigation {
    max-width: 1100px;
    margin: 20px auto 60px auto;
    padding: 0 20px;
}
.back-link {
    display: inline-block;
    background-color: #000;
    color: #fff;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: transform 0.2s ease, background-color 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.back-link:hover {
    transform: scale(1.05);
    background-color: #333;
}


/* Le Switch (Design) */
.theme-switch {
    display: none;
}
.switch-label {
    width: 70px;
    height: 35px;
    background-color: #EBEBEB;
    border-radius: 50px;
    border: 2px solid #000;
    position: relative;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px;
    box-shadow: inset 2px 2px 0px rgba(0,0,0,0.1);
}
.icon-moon, .icon-sun {
    font-size: 14px;
    z-index: 1; 
}
/* La boule qui bouge */
.ball {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 25px;
    height: 25px;
    background-color: #000;
    border-radius: 50%;
    transition: transform 0.3s ease;
}
/* Animation quand on clique */
.theme-switch:checked + .switch-label .ball {
    transform: translateX(34px);
    background-color: #fff;
}
.theme-switch:checked + .switch-label {
    background-color: #333;
    border-color: #555;
}

/* --- MODE SOMBRE (Couleurs) --- */
body.dark-mode {
    background-color: #050505;
}
/* Changement des cartes en mode sombre */
body.dark-mode .card, 
body.dark-mode .card-bio,
body.dark-mode .card-social,
body.dark-mode .card-spotify,
body.dark-mode .card-project-horizontale,
body.dark-mode .card-project-verticale,
body.dark-mode .card-stack,
body.dark-mode .card-contact,
body.dark-mode .card-parcours,
body.dark-mode .card-toggle {
    background-color: #111;
    border-color: #333;
    box-shadow: none;
    color: #fff;
}
/* Textes spécifiques */
body.dark-mode h2, 
body.dark-mode h3, 
body.dark-mode p, 
body.dark-mode a,
body.dark-mode .tag,
body.dark-mode .terminal-title,
body.dark-mode #bio-desc strong {
    color: #fff !important;
}
body.dark-mode .tag {
    background-color: #333;
    border: 1px solid #555;
}
/* Navbar et boutons */
body.dark-mode .nav-btn {
    color: #aaa;
}
body.dark-mode .nav-btn.active {
    background-color: #333;
    color: #fff;
    border-color: #555;
}
body.dark-mode .filter-bar {
    background-color: #111;
    border-color: #333;
    box-shadow: none;
}
body.dark-mode .contact-link {
    color: #fff;
}
body.dark-mode .card-link:hover {
    border-color: #fff;
    text-decoration: none;
}
/* Ajustement logos en mode sombre */
body.dark-mode .social-icon {
    filter: invert(1);
}
/* Exception Spotify */
body.dark-mode .spotify-img {
    filter: none; 
}
body.dark-mode .icon-li {
    filter: none; 
}
body.dark-mode .bento-section-title {
    border-bottom: 4px solid #eee;
    color: #fff;
}
body.dark-mode .more-btn {
    background-color: #777;
    color: #fff;
}
body.dark-mode .more-btn:hover {
    background-color: #aaa;
}
body.dark-mode .arrow-btn {
    color: #fff;
}
body.dark-mode .cv-container {
    background-color: #777;
}
body.dark-mode .subtitle {
    color: #aaa;
}
body.dark-mode .back-link {
    background-color: #777;
    color: #fff;
}
body.dark-mode .back-link:hover {
    background-color: #aaa;
}

/* TYPOGRAPHIE */
h2 { font-size: 1.5rem; margin-bottom: 10px; font-weight: 900; text-transform: uppercase;}
p { font-size: 0.9rem; line-height: 1.4; font-weight: 600;}
.tag { 
    display: inline-block; background: #000; color: #fff; 
    padding: 4px 8px; font-size: 0.7rem; border-radius: 4px; margin-right: 5px;
}

/* MOBILE */
@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }
    .top-header {
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding: 20px 15px;
    }
    .nav-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    .filter-bar {
        max-width: 100%;
        overflow-x: auto; 
        scrollbar-width: none; 
        -ms-overflow-style: none;
    }
    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .card { 
        grid-column: span 1 !important;
        grid-row: auto !important;
        min-height: 200px;}
    .card-bio {
        height: auto !important;
        min-height: 250px;
        padding-bottom: 30px;
    }
    .fixed-theme-switch {
        bottom: 20px;
        right: 20px;
    }
    .card-bio-xl {
        grid-column: span 1 !important;
        height: auto !important;
    }
    .bento-section-title {
        font-size: 1.5rem;
        margin-top: 30px;
    }
    .project-header,
    .project-visual,
    .project-desc,
    .project-links,
    .project-details {
        grid-column: span 1 !important;
        grid-row: auto !important;
    }
    .project-header h1 {
        font-size: 1.5rem;
    }
    .modal-content {
        width: 95%;
    }
}