@font-face {
    font-family: 'Fragment Mono';
    src: url('fonts/FragmentMono-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fragment Mono';
    src: url('fonts/FragmentMono-Italic.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}

/* Supprimer les effets de tap sur mobile */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Styles de base (mode clair) */
:root {
    --background-color: white;
    --text-color: black;
    --border-color: rgba(0, 0, 0, 0.1);
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: black;
        --text-color: white;
        --border-color: rgba(255, 255, 255, 0.1);
    }

    body {
        background-color: var(--background-color);
        color: var(--text-color);
    }

    a, .card-menu ul li a, .card-menu .card-header a {
        color: var(--text-color);
    }

    .card-menu {
        background: var(--background-color);
        border-top-color: var(--border-color);
    }

    .page-transition {
        background-color: var(--background-color);
    }

    .filters-wrapper {
        background: var(--background-color);
    }

    .pulse-button.active {
        background-color: black !important;
        border-color: var(--text-color);
    }

    .pulse-button.active .frequency {
        color: var(--text-color);
    }
}

body {
    font-family: 'Fragment Mono', monospace;
    margin: 0;
    padding: 0;
    text-transform: lowercase;
    overflow: hidden; /* Empêcher le scroll du body */
    background-color: var(--background-color);
    color: var(--text-color);
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
    color: var(--text-color);
}

header {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
    z-index: 1000;
}

header h1 {
    font-size: 18px;
    margin: 0;
    font-weight: 500;
    line-height: 24px;
}

header h1 a {
    font-weight: bold;
}

nav ul {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

main {
    padding: 0;
    position: relative;
    box-sizing: border-box;
    min-height: auto; /* Supprimer la hauteur minimale fixe */
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

main::-webkit-scrollbar {
    display: none;
}

.plus-button {
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    transition: background 0.3s ease, transform 0.3s ease;
    margin-left: auto;
    margin-right: 0;
    -webkit-tap-highlight-color: transparent; /* Supprimer le highlight sur mobile */
    color: inherit; /* Utiliser la couleur héritée */
    -webkit-appearance: none; /* Supprimer l'apparence par défaut sur iOS */
    appearance: none; /* Supprimer l'apparence par défaut */
}

.plus-button:focus,
.plus-button:active {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.plus-button.active {
    transform: rotate(45deg);
}

.card-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--background-color);
    transform: translateY(calc(100% - 80px));
    height: 400px;
    z-index: 1000;
    border-top: 1px solid var(--border-color); /* Ajouter une légère bordure */
    transition: transform 0.3s ease;
}

.card-menu.active {
    transform: translateY(100px); /* Remonter complètement */
}

.card-menu ul {
    display: flex;
    flex-direction: column; /* Afficher les pages en colonne */
    align-items: flex-end; /* Aligner les liens à droite */
    padding: 20px 20px 20px 0; /* Ajouter un padding à droite */
    margin: 0;
    list-style: none;
}

.card-menu ul li {
    width: auto;
}

.card-menu ul li a {
    padding: 12px 16px;
    display: block;
    color: var(--text-color);
}

.card-menu .card-header {
    display: flex;
    justify-content: space-between; /* Revenir à l'alignement initial */
    align-items: center;
    width: 100%;
    padding: 20px 20px;
    padding-right: 10px;
    box-sizing: border-box;
}

.card-menu .card-header a {
    font-weight: bold;
    color: var(--text-color);
    margin-right: 0; /* Supprimer la marge à droite */
}

.card-menu .card-header .plus-button {
    margin-left: 0; /* Supprimer la marge à gauche */
}

.photo {
    position: fixed; /* Positionner l'image de manière fixe */
    bottom: 0; /* Coller au coin inférieur droit */
    right: 0; /* Coller au coin inférieur droit */
    width: auto;
    height: 90%; /* Rendre l'image 10% plus petite */
    max-width: 90%;
    max-height: 90%;
    opacity: 1; /* Rendre l'image visible immédiatement */
    transition: none; /* Supprimer la transition */
}

.photo img {
    width: auto;
    height: 100%;
    object-fit: contain; /* S'assurer que l'image est contenue dans la fenêtre */
    opacity: 0;
    transition: opacity 0.5s ease;
}

.photo img.loaded {
    opacity: 1;
}

.photo-accueil {
    position: fixed;
    bottom: 0;
    right: 0;
    width: auto;
    height: 90%;
    max-width: 90%;
    max-height: 90%;
    opacity: 1;
    transition: none;
}

.photo-accueil img {
    width: auto;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.photo-accueil img.loaded {
    opacity: 1;
}

.photo-bio {
    position: relative; /* Positionner l'image de manière relative */
    width: 100%;
    height: auto;
    max-height: 400px; /* Limiter la hauteur maximale à 400px */
    margin-bottom: 20px; /* Ajouter une marge en bas */
    opacity: 1; /* Rendre l'image visible immédiatement */
    transition: none; /* Supprimer la transition */
}

.photo-bio img {
    width: 100%;
    height: auto;
    max-height: 400px; /* Limiter la hauteur maximale à 400px */
    object-fit: contain; /* S'assurer que l'image est contenue dans la fenêtre */
    opacity: 0;
    transition: opacity 0.5s ease;
}

.photo-bio img.loaded {
    opacity: 1;
}

.credit {
    font-size: 10px;
    margin-top: 5px;
}

.bio {
    text-align: justify;
    margin: 0;
    padding: 20px;
    /* padding-right: 10px; Ajouter une marge en bas */
    font-size: 16px;
    max-width: 800px;
    overflow: hidden; /* Cacher les parties de l'image qui dépassent */
    margin-bottom: 20px;
}

.contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    position: relative;
}

.contact ul li {
    margin-bottom: 40px;
}

.contact ul li:last-child {
    margin-bottom: 0;
}

.contact-page .contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Centrer verticalement */
    height: 100vh; /* Occuper toute la hauteur de la fenêtre */
    text-align: center;
}

.apropos-page .contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    max-width: none;
    min-height: calc(100vh - 60px);
}

.apropos-page main {
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.apropos-page .bio {
    margin-top: 0;
    padding-top: 20px;
    user-select: text; /* Permettre la sélection de texte */
}

.projets-page main,
.index-page main {
    overflow: initial;
    height: auto;
}

.footer-nav .footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding-right: 20px;
}

.folders {
    display: flex;
    margin-bottom: 40px;
}

.folder {
    cursor: pointer;
    padding: 10px;
}

.folder.active {
    text-decoration: underline;
}

.project {
    opacity: 1;
    transition: opacity 0.3s ease;
    padding: 0;
}

.project.hidden {
    opacity: 0;
    pointer-events: none;
}

.credits {
    text-align: left;
    margin: 0 auto;
    padding: 20px;
    max-width: 800px;
}

.credits h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.credits ul {
    list-style: none;
    padding: 0;
}

.credits ul li {
    font-size: 16px;
    margin-bottom: 10px;
}

.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.page-transition.active {
    opacity: 1;
    pointer-events: all;
}

.container {
    opacity: 0;
    transition: opacity 0.3s ease;
    margin-bottom: 80px; /* Remplacer padding-bottom par margin-bottom */
    height: calc(100vh - 80px);
    overflow-y: auto;
    position: relative;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.container::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.filters-wrapper {
    background: var(--background-color);
}

/* Supprimer la sélection de texte par défaut */
::selection {
    background: transparent;
}

::-moz-selection {
    background: transparent;
}

/* Modifier l'apparence des éléments actifs */
.folder.active {
    color: var(--text-color);
    text-decoration: none;
    opacity: 0.5;
}

a:hover {
    text-decoration: none;
    opacity: 0.5;
}

.project a:hover {
    text-decoration: none;
    opacity: 0.5;
}

.project-url {
    display: inline-block;
    opacity: 0.5;
    margin-top: 10px;
    margin-bottom: 20px;
    transition: opacity 0.3s ease;
    position: relative; /* Assurer que les éléments restent en place */
}

.project-url.hidden {
    opacity: 0;
    pointer-events: none;
}

.project-url:hover {
    opacity: 1;
}

.streaming-links {
    display: none; /* Masquer les liens par défaut */
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.3s ease, max-height 0.3s ease;
    max-height: 0; /* Initialement, la hauteur est de 0 */
    overflow: hidden; /* Masquer le contenu qui dépasse */
}

.streaming-links.show {
    display: block; /* Afficher les liens lorsqu'ils sont révélés */
    opacity: 1;
    max-height: 100px; /* Définir une hauteur maximale pour l'animation */
}

.spacer {
    height: 120px; /* Hauteur de la carte */
}

.synth-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100vw;
    min-height: 100vh;
    padding: 0;
    box-sizing: border-box;
    margin: 0;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.synth-container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 0;
    box-sizing: border-box;
}

.synth-card {
    width: 100%;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--background-color);
    border-bottom: none;
    cursor: pointer;
    transition: transform 0.5s ease;
    z-index: 1000;
    position: relative;
}

.synth-card h2 {
    display: none;
}

.synth-buttons, .pulse-container {
    position: absolute;
    top: -200px; /* Position initiale hors écran */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 10px);
    display: flex;
    justify-content: space-between;
    gap: 5px;
    padding: 5px;
    z-index: 100;
    opacity: 1;
    pointer-events: auto;
    transition: transform 0.5s ease;
}

.synth-buttons.visible, .pulse-container.visible {
    transform: translateX(-50%) translateY(200px);
}

.synth-button {
    background: none;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 0;
    cursor: pointer;
    font-family: 'Roboto Mono', monospace;
    text-transform: lowercase;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    touch-action: manipulation;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.synth-button:hover {
    background: none;
}

.synth-button.active {
    background-color: var(--text-color);
    color: var(--background-color);
}

.wave-visualizer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    background-color: black;
}

.synth-button.active .wave-visualizer {
    opacity: 1;
}

.frequency {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: inherit;
    font-size: 14px;
    z-index: 1;
    transition: opacity 0.3s ease;
    width: 100%;
    text-align: center;
    font-family: 'Roboto Mono', monospace;
}

.synth-button.active .frequency {
    opacity: 0;
}

.pulse-container {
    position: absolute;
    top: -200px; /* Position initiale hors écran */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 10px);
    display: flex;
    justify-content: space-between;
    gap: 5px;
    padding: 5px;
    z-index: 100;
    opacity: 1;
    pointer-events: auto;
    transition: transform 0.5s ease;
}

.pulse-container.visible {
    transform: translateX(-50%) translateY(200px);
}

.pulse-button {
    background: none;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 0;
    cursor: pointer;
    font-family: 'Roboto Mono', monospace;
    text-transform: lowercase;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    touch-action: manipulation;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pulse-button:hover {
    background: none;
}

.pulse-button.active {
    background-color: var(--text-color);
}

/* Mode clair uniquement */
@media (prefers-color-scheme: light) {
    .pulse-button.active {
        background-color: var(--text-color);
    }
}

.pulse-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    opacity: 0;
    top: 50%;
    left: 50%;
    transform: translate(calc(-50% + var(--rand-x, 0px)), calc(-50% + var(--rand-y, 0px)));
    filter: blur(1px);
    transition: none;
}

.pulse-button.active .pulse-dot {
    opacity: 1;
    animation: pulseDot var(--pulse-duration, 1s) steps(2, jump-none) infinite;
}

.pulse-button .frequency {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: inherit;
    font-size: 14px;
    z-index: 1;
    transition: opacity 0.3s ease;
    width: 100%;
    text-align: center;
    font-family: 'Roboto Mono', monospace;
    opacity: 1;
}

.pulse-button.active .frequency {
    opacity: 0;
}

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

.index-page {
    position: relative;
    min-height: 100vh;
}

@media (max-width: 768px) {
    .synth-container {
        padding: 0;
    }

    .synth-buttons, .pulse-container {
        width: calc(100% - 10px);
        padding: 0;
        gap: 5px;
    }

    .synth-button, .pulse-button {
        font-size: 12px;
    }
}

/* Mode clair uniquement */
@media (prefers-color-scheme: light) {
    .pulse-dot {
        background-color: var(--background-color);
    }
}

.keystep-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--background-color);
    color: var(--text-color);
    padding: 20px;
    border: 1px solid var(--text-color);
    opacity: 0;
    pointer-events: none;
    z-index: 2000;
    font-family: 'Fragment Mono', monospace;
    transition: opacity 0.3s ease;
    text-align: center;
    line-height: 2;
    display: none; /* Masquer complètement l'élément */
}

.keystep-message.visible {
    opacity: 1;
    pointer-events: auto;
    display: block; /* Afficher l'élément quand il est visible */
}

.keystep-zone {
    position: absolute;
    width: 15%;
    height: 10%;
    left: 50%;
    top: 75%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 1000;
}

/* Styles de base pour toutes les images */
img {
    opacity: 0;
    transition: opacity 0.5s ease;
}

img.loaded {
    opacity: 1;
}

.apropos-page .container {
    margin-bottom: 0;
    height: 100vh;
    overflow-y: auto;
}

.apropos-page main {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    padding-bottom: 80px;
}

.apropos-page .card-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--background-color);
    transform: translateY(calc(100% - 80px));
    height: 400px;
    z-index: 1000;
    border-top: 1px solid var(--border-color);
    transition: transform 0.3s ease;
}

.apropos-page .card-menu.active {
    transform: translateY(100px);
}

.apropos-page .card-menu.scrolled {
    transform: translateY(calc(100% - 80px));
}

.apropos-page .card-menu.bottom {
    transform: translateY(0);
}