/* --- Réglages Globaux & Ambiance --- */
:root {
    --bg-darkest: #0d1b2a;
    --bg-dark: #1b263b;
    --bg-medium: #FFA500;
    --text-light: #e0e1dd;
    --text-secondary: #a9b4c2;
    --accent: #778da9;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background-color: var(--bg-darkest);
    color: var(--text-light);
    line-height: 1.6;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- En-tête (Header) avec effet Matrix --- */
.hero {
    background-color: var(--bg-dark);
    padding: 60px 20px;
    text-align: center;
    border-bottom: 2px solid var(--bg-medium);
    position: relative;
    overflow: hidden;
}

/* Canvas pour l'effet Matrix en arrière-plan */
#matrix-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    z-index: 0;
}

.hero h1, .hero p {
    position: relative;
    z-index: 1;
}

.hero h1 {
    margin: 0;
    font-size: 2.8rem;
    color: var(--text-light);
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

/* Effet glitch sur le nom */
.glitch {
    position: relative;
    animation: glitch-anim 3s infinite;
}

@keyframes glitch-anim {
    0%, 90%, 100% {
        text-shadow: none;
    }
    92% {
        text-shadow: 2px 2px var(--bg-medium), -2px -2px #00ff00;
    }
    94% {
        text-shadow: -2px 2px var(--bg-medium), 2px -2px #00ff00;
    }
}

.hero p {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-top: 10px;
    font-family: 'Courier New', monospace;
}

/* --- Navigation --- */
nav {
    background-color: var(--bg-darkest);
    padding: 15px 0;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--bg-medium);
}

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

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: bold;
    font-size: 1rem;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

nav a:hover, nav a:focus {
    color: var(--text-light);
    background-color: var(--bg-medium);
}

/* --- Section Accueil avec effet décryptage --- */
#accueil {
    background-color: var(--bg-darkest);
    padding: 100px 0;
    text-align: center;
    border-bottom: 1px solid var(--bg-medium);
    min-height: 400px;
}

#accueil .container {
    position: relative;
}

/* Terminal-style box */
.terminal-box {
    background-color: rgba(27, 38, 59, 0.6);
    border: 2px solid var(--bg-medium);
    border-radius: 8px;
    padding: 30px;
    margin: 20px auto;
    max-width: 800px;
    text-align: left;
    font-family: 'Courier New', monospace;
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.3);
}

.terminal-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.terminal-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--bg-medium);
    margin-right: 8px;
}

.terminal-btn:last-of-type {
    margin-right: 0;
}

.decrypt-text {
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1.8;
    min-height: 200px;
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 20px;
    background-color: var(--bg-medium);
    animation: blink 1s infinite;
}

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

/* Caractères aléatoires pendant le décryptage */
.scramble {
    color: #00ff00;
    opacity: 0.7;
}

/* --- Bouton son dans le terminal --- */
.sound-toggle-terminal {
    background: transparent;
    border: none;
    color: var(--bg-medium);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    right: 0;
    padding: 0;
    opacity: 0.6;
    line-height: 1;
}

.sound-toggle-terminal:hover {
    opacity: 1;
    transform: scale(1.2);
    filter: drop-shadow(0 0 6px rgba(255, 165, 0, 0.8));
}

.sound-toggle-terminal.muted {
    opacity: 0.3;
    color: #888;
}

/* --- Sections de Contenu --- */
section {
    padding: 60px 0;
    border-bottom: 1px solid var(--bg-dark);
}

section:last-of-type {
    border-bottom: none;
}

h2 {
    font-size: 2.2rem;
    color: var(--accent);
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 15px;
}

h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    margin: 10px auto 0;
    background-color: var(--bg-medium);
    border-radius: 2px;
}

/* --- Section "A Propos" --- */
#a-propos .container {
    max-width: 800px;
}

/* Style Timeline épuré */
.about-content {
    position: relative;
    padding-left: 40px;
    margin-bottom: 50px;
}

.about-content::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    background: linear-gradient(to bottom, var(--bg-medium), rgba(255, 165, 0, 0.2));
}

.about-section {
    margin-bottom: 40px;
    position: relative;
    padding-left: 20px;
}

.about-section::before {
    content: '';
    position: absolute;
    left: -47px;
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--bg-medium);
    border: 3px solid var(--bg-darkest);
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
}

.about-section h3 {
    color: var(--bg-medium);
    font-size: 1.4rem;
    margin-bottom: 12px;
    margin-top: 0;
    font-weight: bold;
}

.about-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0 0 15px 0;
    text-align: justify;
}

.highlight {
    color: var(--text-light);
    font-weight: 500;
}

/* --- Section "Projets" --- */
.categorie-titre {
    color: var(--accent);
    font-size: 1.5rem;
    margin: 30px 0 20px;
    text-align: center;
}

/* Projet Phare - SecureTalk */
.projet-phare {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #2a3f5f 100%);
    border: 2px solid var(--bg-medium);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 50px;
    box-shadow: 0 8px 25px rgba(255, 165, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.projet-phare::before {
    content: '★';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 3rem;
    color: var(--bg-medium);
    opacity: 0.2;
}

.projet-phare h3 {
    color: var(--bg-medium);
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 15px;
}

.projet-phare-label {
    display: inline-block;
    background-color: var(--bg-medium);
    color: var(--bg-darkest);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.projet-phare p {
    color: var(--text-light);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Grille de projets uniforme */
.projets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.projet-carte {
    background-color: var(--bg-dark);
    border: 1px solid var(--bg-medium);
    border-radius: 8px;
    padding: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    position: relative;
}

.projet-carte:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 165, 0, 0.3);
}

.projet-carte h3 {
    margin-top: 0;
    color: var(--text-light);
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.projet-carte-content {
    flex-grow: 1;
}

.projet-description-courte {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.projet-tech {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: auto;
}

.projet-badge {
    display: inline-block;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.badge-dev {
    background-color: #D4B254;
    color: #1b263b;
}

.voir-plus {
    color: var(--bg-medium);
    font-size: 0.85rem;
    margin-top: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.voir-plus::after {
    content: '→';
    transition: transform 0.3s ease;
}

.projet-carte:hover .voir-plus::after {
    transform: translateX(5px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 27, 42, 0.95);
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
    padding: 40px 20px;
}

.modal.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--bg-dark);
    border: 2px solid var(--bg-medium);
    border-radius: 12px;
    padding: 40px;
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.3s ease;
    line-height: 1;
    z-index: 10;
}

.modal-close:hover {
    color: var(--bg-medium);
}

.modal-content h3 {
    color: var(--bg-medium);
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 20px;
    padding-right: 40px;
}

/* Placeholder pour vidéo/GIF */
.modal-media-placeholder {
    background: linear-gradient(135deg, rgba(27, 38, 59, 0.8) 0%, rgba(42, 63, 95, 0.8) 100%);
    border: 2px dashed var(--bg-medium);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    margin: 20px 0 30px 0;
    transition: all 0.3s ease;
}

.modal-media-placeholder:hover {
    background: linear-gradient(135deg, rgba(27, 38, 59, 1) 0%, rgba(42, 63, 95, 1) 100%);
    border-color: var(--text-light);
}

.modal-media-placeholder .placeholder-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
    opacity: 0.6;
}

.modal-media-placeholder p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
    font-style: italic;
}

.modal-content p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 15px;
}

.modal-content ul {
    color: var(--text-light);
    padding-left: 25px;
    margin: 15px 0;
}

.modal-content li {
    margin-bottom: 8px;
}

.modal-content strong {
    color: var(--bg-medium);
}

/* --- Pied de page --- */
footer {
    background-color: var(--bg-dark);
    color: var(--text-secondary);
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    font-size: 0.9rem;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .hero h1 {
        font-size: 2.2rem;
    }
    .hero p {
        font-size: 1.1rem;
    }
    nav ul {
        flex-direction: column;
        gap: 15px;
    }
    
    /* Responsive pour À Propos */
    .about-content {
        padding-left: 30px;
    }
    
    /* Responsive pour modals */
    .modal-content {
        padding: 30px 20px;
    }
    
    /* Responsive pour projet phare */
    .projet-phare {
        padding: 20px;
    }
}