/* BASE */
body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: #0d0d0d;
    color: white;
    overflow-x: hidden;
}

/* HEADER */
header {
    position: fixed;
    width: 100%;
    top: 0;
    background: rgba(10,10,10,0.85);
    backdrop-filter: blur(12px);
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

nav {
    width: 90%;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
}

.section {
    scroll-margin-top: 120px;
}

.image-center {
    text-align: center;
}

html {
    scroll-behavior: smooth;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 1.6rem;
    color: #4e9eff;
    font-weight: bold;
    text-shadow: 0 0 10px #4e9eff;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(90deg, #4e9eff, #ff4ecd);
    -webkit-background-clip: text;
    color: transparent;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
    position: relative;
}

nav a::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 2px;
    background: #ff4ecd;
    transition: 0.3s;
}

nav a:hover::after {
    width: 100%;
}

.header-line {
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #4e9eff, #ff4ecd, #7dff4e);
    box-shadow: 0 0 15px #4e9eff;
}

/* CANVAS BINAIRE */
#binaryCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 90vh;
    z-index: -1;
    background: #0d0d0d;
}

/* ========================= */
/* ELEMENTS INFORMATIQUES */
/* ========================= */

.tech-elements div {
    position: absolute;
    opacity: 0.25;
    animation: float 6s infinite ease-in-out;
}

/* Fenêtre de code */
.code-window {
    width: 260px;
    height: 160px;
    background: #111;
    border: 2px solid #4e9eff;
    border-radius: 10px;
    top: 120px;
    left: 40px;
    box-shadow: 0 0 20px #4e9eff;
}

.code-window::before {
    content: "</>";
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    color: #4e9eff;
    font-family: monospace;
    font-size: 20px;
}

/* Terminal */
.terminal {
    width: 220px;
    height: 130px;
    background: black;
    border: 2px solid #7dff4e;
    border-radius: 8px;
    bottom: 120px;
    right: 10%;
    box-shadow: 0 0 20px #7dff4e;
    overflow: hidden;
    padding: 10px;
}

/* Texte terminal */
#terminalText {
    color: #7dff4e;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
}

/* Curseur clignotant */
.cursor {
    display: inline-block;
    width: 8px;
    background: #7dff4e;
    animation: blink 1s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

/* Base de données */
.database {
    width: 120px;
    height: 60px;
    background: #ff4ecd;
    border-radius: 50%;
    top: 350px;
    right: 40px;
    box-shadow: 0 0 20px #ff4ecd;
}

.database::after {
    content: "";
    position: absolute;
    width: 120px;
    height: 60px;
    border-radius: 50%;
    top: 25px;
    background: #ff4ecd;
    opacity: 0.6;
}

/* Puce électronique */
.chip {
    width: 100px;
    height: 100px;
    background: #4e9eff;
    bottom: 80px;
    left: 15%;
    box-shadow: 0 0 20px #4e9eff;
}

.chip::before,
.chip::after {
    content: "";
    position: absolute;
    background: #4e9eff;
}

/* lignes horizontales */
.chip::before {
    width: 140px;
    height: 2px;
    top: 50%;
    left: -20px;
}

/* lignes verticales */
.chip::after {
    width: 2px;
    height: 140px;
    left: 50%;
    top: -20px;
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-25px); }
    100% { transform: translateY(0); }
}

/* HERO */
.hero {
    height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.big-title {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(90deg, #ff4ecd, #4e9eff);
    -webkit-background-clip: text;
    color: transparent;
}

.subtitle {
    font-size: 1.3rem;
    opacity: 0.8;
}

/* SECTIONS */
.section {
    width: 80%;
    margin: 120px auto;
}

.alt {
    background: #111;
    padding: 60px;
    border-radius: 20px;
}

.section-title {
    font-size: 2.8rem;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #4e9eff, #7dff4e);
    -webkit-background-clip: text;
    color: transparent;
}

.section-text {
    font-size: 1.2rem;
    line-height: 1.7;
}

/* CARDS */
.cards, .projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.card, .project-card {
    background: #1a1a1a;
    padding: 25px;
    border-radius: 15px;
    transition: 0.3s;
    border: 2px solid transparent;
}

.card:hover, .project-card:hover {
    transform: translateY(-10px) scale(1.05);
    border-color: #ff4ecd;
    box-shadow: 0 0 20px rgba(255, 78, 205, 0.4);
}

/* ANIMATION SCROLL */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* FOOTER */
footer {
    text-align: center;
    padding: 30px;
    background: #0a0a0a;
    margin-top: 80px;
}

.cv-button {
    padding: 12px 20px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: 0.3s;
}

.cv-button:hover {
    background-color: #357ac9;
}

/* Bouton normal */
.cv-button {
    padding: 12px 20px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: 0.3s;
}

/* Bouton rouge quand le CV est ouvert */
.cv-button.active {
    background-color: #d9534f;
}

.cv-button:hover {
    opacity: 0.85;
}

/* Conteneur du CV */
#cv-container {
    text-align: center;
    margin-top: 20px;
}

/* Image du CV */
#cv-container img {
    width: 80%;
    max-width: 900px;
}

/* État caché */
.cv-hidden {
    display: none;
    opacity: 0;
}

/* État visible avec animation */
.cv-visible {
    display: block;
    animation: fadeSlideIn 0.5s ease forwards;
}

/* Animation de fermeture */
.cv-closing {
    animation: fadeSlideOut 0.4s ease forwards;
}

/* Animations */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(15px);
    }
}

.cv-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

/* Bouton jaune pour le téléchargement */
.download-button {
    background-color: #f1c40f; /* jaune */
}

.download-button:hover {
    opacity: 0.85;
}

.download-button:hover {
    background-color: #ffa500; /* orange */
    opacity: 1; /* pour éviter le fade si tu veux un effet net */
}

/* ========================= */
/* BOUTONS CV (CORRIGÉS)     */
/* ========================= */

/* Boutons bleus par défaut */
.cv-button {
    padding: 12px 20px;
    background-color: #4a90e2; /* bleu */
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: 0.3s;
}

/* Bouton "Afficher mon CV" → vert au survol */
#cv-btn:hover {
    background-color: #28a745; /* vert */
}

/* Bouton "Télécharger le CV" → jaune au survol */
#cv-download:hover {
    background-color: #f1c40f; /* jaune */
}

/* Bouton rouge quand le CV est ouvert */
.cv-button.active {
    background-color: #d9534f; /* rouge */
}

/* Conteneur du CV */
#cv-container {
    text-align: center;
    margin-top: 20px;
}

/* Image du CV */
#cv-container img {
    width: 80%;
    max-width: 900px;
}

/* État caché */
.cv-hidden {
    display: none;
    opacity: 0;
}

/* État visible avec animation */
.cv-visible {
    display: block;
    animation: fadeSlideIn 0.5s ease forwards;
}

/* Animation de fermeture */
.cv-closing {
    animation: fadeSlideOut 0.4s ease forwards;
}

/* Animations */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(15px);
    }
}

/* Conteneur des deux boutons */
.cv-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}