/* ========================================
   VARIABLES
   ======================================== */

:root {
    --bg-color: #0d0f13;        /* Noir avec une infime touche de bleu nuit */
    --text-primary: #fafafa;    /* Blanc cassé (le max de luminosité conseillé) */
    --text-secondary: #727272;
    --text-third: #5c6bc0;  /* Gris-Bleu industriel (change du gris triste) */
    --accent: #f4ea0c;          /* Jaune fluo sécurité */
    --hover-color: #161b22;     /* Sombre et profond */
}

/* ========================================
   BASE
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}


/* ========================================
   FORMES FOND
   ======================================== */


@keyframes idleFloat {
    0% { transform: translateY(0px) rotate(var(--base-rotation)); }
    33% { transform: translateY(-30px) rotate(calc(var(--base-rotation) + 50deg)); }
    66% { transform: translateY(30px) rotate(calc(var(--base-rotation) - 50deg)); }
    100% { transform: translateY(0px) rotate(var(--base-rotation)); }
}

#ambient-3d-scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2; /* Derrière tout */
    pointer-events: none;
    overflow: hidden;
    background: transparent;
}

.floating-mesh {
    position: absolute;
    border: 1px solid var(--accent);
    opacity: 0.22;
    translate: -50% -50%; 
    pointer-events: none;
    will-change: transform, translate;
    animation: idleFloat 6s ease-in-out infinite;

    filter: blur(1px) brightness(0.5);
    transition: opacity 0.4s ease, filter 0.4s ease;
}
.floating-mesh.lit {
    opacity: 0.42;
    filter: blur(0px) brightness(1) drop-shadow(0 0 8px var(--accent));
}

/* Triangles */
.shape-triangle {
    width: 0; height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 25px solid var(--accent);
    background: transparent !important;
    border-top: none; border-right-color: transparent; border-left-color: transparent;
}


/* Caractères {, [, < ... */
.char-item {
    border: none !important;
    color: var(--accent);
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.75rem;
    font-weight: bold;
    line-height: 1;
}


/* ========================================
   CURSEUR PERSONNALISÉ
   ======================================== */


/* Cache le curseur de base */
html, body, a, button, input, textarea {
    cursor: none !important;
}

body {
    background-color: var(--bg-color);
    min-height: 100vh;
    margin: 0;
}

/* Halo de lumiere */
#flashlight-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none; /* Laisse passer les clics vers tes boutons */
    z-index: -1;          /* Entre le fond noir (-2) et ton contenu (0) */
    background: radial-gradient(
        350px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
        rgba(244, 234, 12, 0.075),
        transparent 100%
    );
}

/* Style nouveau curseur */
#custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    
    border: 2px solid rgba(244, 234, 12, 0.35);
    background-color: transparent;
    border-radius: 7px;
    
    transform: translate(-50%, -50%);
    pointer-events: none; 
    z-index: 10000;

    transition: width 0.2s ease, height 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

/* Survole un lien ou un bouton */
#custom-cursor.hovered {
    width: 27px;
    height: 27px;
    background-color: rgba(244, 234, 12, 0.22);
    border-color: transparent;
    transform: translate(-50%, -50%) rotate(45deg);
    
}

/* Clic */
#custom-cursor.clicking {
    transform: translate(-50%, -50%) scale(0.75);
}



/* ========================================
   BARRE DE PROGESSION
   ======================================== */


/* Le "Rail" (Le fond gris fixe à gauche) */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 5px;       /* Largeur de la jauge */
    height: 100%;     /* Prend toute la hauteur de l'écran */
    background: #0e0d0d; /* Gris très sombre (le fond du rail) */
    z-index: 99999;   /* Toujours au-dessus */
}

/* Le "Liquide" (La barre jaune qui se remplit) */
.progress-bar {
    height: 0%;       /* Vide au début */
    width: 100%;      /* Prend toute la largeur du conteneur */
    background: var(--accent); /* Ton jaune */
    box-shadow: 0 0 5px var(--accent); /* Petit effet néon/lumineux */ 
}



/* ========================================
   TITRES ET PETIT TRUCS
   ======================================== */


h1 {
    color: var(--accent);
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

h2 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

h3{
    color: var(--accent);
}

h4{
    color: var(--text-primary);
}


.tagline {
    max-width: 300px;
    margin-bottom: 4rem;
    line-height: 1.5;
}

.highlight {
    color: var(--text-primary);
    font-weight: 600;
    transition: color 0.2s;
}

.highlight:hover {
    color: var(--accent);
}



/* ========================================
   LAYOUT PRINCIPAL
   ======================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 100vh;
    display: flex;
    gap: 4rem;
}

/* Header sticky à gauche */
.header {
    width: 40%;
    position: sticky;
    top: 0;
    height: 100vh;
    padding-top: 6rem;
    padding-bottom: 6rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Contenu à droite */
.content {
    width: 60%;
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.section {
    margin-bottom: 6rem;
    min-height: 50vh;
    padding-top: 2rem;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.section p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
}



/* ========================================
   TEXTE QUI S'ECRIT ET S'EFFACE
   ======================================== */


.txt-type {
    color: var(--text-primary); /* Ton jaune */
    border-right: 2px solid var(--text-primary); /* Le trait vertical */
    padding-right: 5px;
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0% { border-color: transparent; }
    50% { border-color: var(--text-primary); }
    100% { border-color: transparent; }
}


/* ========================================
   MENU NAV
   ======================================== */

.nav ul {
    list-style: none;
}

.nav li {
    margin-bottom: 1rem;
}

.nav a {
    text-decoration: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    width: fit-content;
    padding: 5px 0;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: color 0.3s;
}

.nav a:hover,
.nav a.active {
    color: var(--text-primary);
}

.nav-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 4px;
    background-color: #666;
    margin-right: 1rem;
    transition: width 0.3s, background-color 0.3s;
}

.nav a:hover .nav-indicator,
.nav a.active .nav-indicator {
    width: 50px;
    background-color: var(--accent);
}

/* ========================================
   RÉSEAUX
   ======================================== */

.social-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.social-icon {
    width: 30px;
    height: 30px;
    opacity: 0.3;
    transition: all 0.2s;
}

.social-links a:hover .social-icon {
    opacity: 1;
    transform: translateY(-3px);
}

/* ========================================
   PROJETS
   ======================================== */

.project-card {
    text-decoration: none;
    color: inherit;
    background: transparent;
    border: none;
    border-left: 4px solid transparent; 
    padding: 20px;
    margin-top : 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.project-card:hover {
    transform: translateX(10px);
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--accent);
}

.project-card h4 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    transition: color 0.2s ease;
}

.project-card:hover h4 {
    color: var(--accent);
}

.tags {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    background: var(--hover-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    border: 1px solid #333;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
}

.project-img {
    flex-shrink: 0; /* Empêche l'image de s'écraser si le texte est long */
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================
   FORMULAIRE DE CONTACT
   ======================================== */

#contact p{
    color: var(--text-primary);
}

.contact-form {
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.form-group {
    position: relative;
    margin-top: 1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid #333;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 10px 0;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.3s;
    resize: vertical;
}

.form-group label {
    position: absolute;
    top: 10px;
    left: 0;
    color: var(--text-secondary);
    pointer-events: none;
    transition: all 0.3s;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
}

/* Animation label flottant */
.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
    top: -20px;
    font-size: 0.9rem;
    color: var(--accent);
}

.form-group input:focus,
.form-group textarea:focus {
    border-bottom-color: var(--accent);
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    font-family: 'Rajdhani', sans-serif;
    cursor: pointer;
    border-radius: 4px;
    width: fit-content;
    transition: all 0.3s;
}

.submit-btn:hover {
    background-color: rgba(244, 234, 12, 0.1);
    transform: translateX(5px);
}

.submit-btn:hover svg {
    transform: translateX(5px);
}

.submit-btn svg {
    transition: transform 0.3s;
}



/* ========================================
   FOOTER
   ======================================== */

.footer {
    max-width: 1200px; /* Même largeur que ton container */
    margin: 4rem auto 0 auto; /* Centré avec "auto" et 4rem d'espace en haut */
    padding: 0 24px 2rem 24px; /* Aligné avec le padding du container */
}

.footer-line {
    width: 100%;
    height: 1px;
    background: var(--accent);
    margin-bottom: 2rem;
    opacity: 0.3;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-bottom: 0.5rem !important;
}


/* Ajustement pour mobile */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    .footer-right {
        text-align: center;
        margin-top: 1rem;
    }
}




/* ========================================
   RESPONSIVE
   ======================================== */

/* Tablettes (portrait et paysage) */
@media (max-width: 1024px) {

    #flashlight-layer {
        display: none !important;
    }
    
    .container {
        flex-direction: column;
        gap: 3rem;
        padding: 0 32px;
    }

    .header {
        width: 100%;
        height: auto;
        position: relative;
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .content {
        width: 100%;
        padding-top: 0;
        padding-bottom: 4rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 1.1rem;
    }
    
    .tagline {
        max-width: 100%;
        margin-bottom: 2rem;
    }
    
    .section {
        min-height: auto;
        margin-bottom: 4rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }

    /* Navigation horizontale sur tablette */
    .nav ul {
        display: flex;
        gap: 1.5rem;
        flex-wrap: wrap;
    }
    
    .nav li {
        margin-bottom: 0;
    }
    
    .nav a {
        font-size: 1rem;
    }

    /* Projets en colonne sur tablette */
    .project-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px;
    }
    
    .project-img {
        width: 100%;
        height: 200px;
        order: -1; /* Image en haut */
        margin-bottom: 16px;
    }

    /* Barre de progression horizontale */
    .progress-container {
        width: 100%;
        height: 4px;
        top: 0;
        left: 0;
    }
    
    .progress-bar {
        height: 100%;
        width: 0%;
    }
}

/* Smartphones (paysage) */
@media (max-width: 768px) {
    .container {
        padding: 0 24px;
        gap: 2rem;
    }
    
    .header {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }
    
    .content {
        padding-bottom: 3rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1rem;
    }
    
    .tagline {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    
    .section {
        margin-bottom: 3rem;
        padding-top: 1rem;
    }
    
    .section-title {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .section p {
        font-size: 0.95rem;
        margin-bottom: 1.2rem;
    }

    /* Navigation */
    .nav ul {
        gap: 1rem;
    }
    
    .nav a {
        font-size: 0.9rem;
    }
    
    .nav-indicator {
        width: 8px;
        height: 8px;
        margin-right: 0.75rem;
    }
    
    .nav a:hover .nav-indicator,
    .nav a.active .nav-indicator {
        width: 40px;
    }

    /* Réseaux sociaux */
    .social-links {
        gap: 1.5rem;
        margin-top: 2.5rem;
    }
    
    .social-icon {
        width: 28px;
        height: 28px;
    }

    /* Projets */
    .project-card {
        padding: 20px;
        margin-top: 20px;
        margin-bottom: 20px;
    }
    
    .project-card h4 {
        font-size: 1.15rem;
    }
    
    .project-img {
        width: 100%;
        height: 180px;
        margin-bottom: 16px;
    }
    
    .tags {
        gap: 8px;
        margin-top: 12px;
    }
    
    .tag {
        font-size: 0.8rem;
        padding: 5px 10px;
    }

    /* Formulaire */
    .contact-form {
        max-width: 100%;
        gap: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .form-group {
        margin-top: 0.75rem;
    }
    
    .form-group input,
    .form-group textarea {
        font-size: 0.95rem;
        padding: 8px 0;
    }
    
    .form-group label {
        font-size: 0.9rem;
        top: 8px;
    }
    
    .form-group input:focus ~ label,
    .form-group input:not(:placeholder-shown) ~ label,
    .form-group textarea:focus ~ label,
    .form-group textarea:not(:placeholder-shown) ~ label {
        top: -18px;
        font-size: 0.85rem;
    }
    
    .submit-btn {
        font-size: 0.9rem;
        padding: 10px 20px;
        width: 100%;
        justify-content: center;
    }
}

/* Smartphones (portrait) */
@media (max-width: 480px) {
    .container {
        padding: 0 20px;
        gap: 1.5rem;
    }
    
    .header {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    h1 {
        font-size: 1.75rem;
        margin-bottom: 0.3rem;
    }
    
    h2 {
        font-size: 0.9rem;
    }
    
    .tagline {
        font-size: 0.9rem;
        margin-bottom:  0.5rem;
    }
    
    .section {
        margin-bottom: 2.5rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .section p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    /* Navigation en colonne sur petit mobile */
    .nav ul {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .nav a {
        font-size: 0.85rem;
        padding: 3px 0;
    }
    
    .nav-indicator {
        width: 6px;
        height: 6px;
        margin-right: 0.6rem;
    }
    
    .nav a:hover .nav-indicator,
    .nav a.active .nav-indicator {
        width: 35px;
    }

    /* Réseaux sociaux */
    .social-links {
        gap: 1.3rem;
        margin-top: 3rem;
    }
    
    .social-icon {
        width: 26px;
        height: 26px;
    }

    /* Projets */
    .project-card {
        padding: 18px;
        margin-top: 18px;
        margin-bottom: 18px;
    }
    
    .project-card h4 {
        font-size: 1.05rem;
        margin-bottom: 0.4rem;
    }
    
    .project-card p {
        font-size: 0.9rem;
    }
    
    .project-img {
        width: 100%;
        height: 150px;
        margin-bottom: 14px;
    }
    
    .tags {
        gap: 6px;
        margin-top: 10px;
    }
    
    .tag {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    /* Formulaire */
    .contact-form {
        gap: 1.2rem;
        margin-top: 1.2rem;
    }
    
    .submit-btn {
        font-size: 0.85rem;
        padding: 9px 16px;
    }
    
    .submit-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Curseur personnalisé plus petit sur mobile */
    #custom-cursor {
        width: 16px;
        height: 16px;
    }
    
    #custom-cursor.hovered {
        width: 22px;
        height: 22px;
    }

    /* Formes de fond moins nombreuses (via JS) */
    .floating-mesh {
        opacity: 0.15;
    }
    
    .floating-mesh.lit {
        opacity: 0.3;
    }
}

/* Très petits écrans */
@media (max-width: 360px) {
    h1 {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .project-img {
        height: 120px;
    }
}

/* Optimisation pour écrans tactiles */
@media (hover: none) and (pointer: coarse) {
    /* Désactive le curseur personnalisé sur tactile */
    #custom-cursor {
        display: none;
    }
    
    html, body, a, button, input, textarea {
        cursor: auto !important;
    }
    
    /* Augmente les zones de clic */
    .nav a {
        padding: 8px 0;
    }
    
    .submit-btn {
        padding: 14px 24px;
    }
    
    /* Désactive les effets hover sur tactile */
    .project-card:hover {
        transform: none;
        background: transparent;
    }
    
    .social-links a:hover .social-icon {
        transform: none;
    }
    
    /* Réduit l'impact des animations */
    .floating-mesh {
        animation-duration: 10s !important;
    }
}

/* Mode paysage pour smartphones */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding-top: 1rem;
        padding-bottom: 0.5rem;
    }
    
    h1 {
        font-size: 1.5rem;
        margin-bottom: 0.2rem;
    }
    
    h2 {
        font-size: 0.85rem;
    }
    
    .tagline {
        margin-bottom: 1rem;
    }
    
    .section {
        margin-bottom: 2rem;
        padding-top: 0.5rem;
    }
}