/* --- VARIABLES ET RE-SET --- */
:root {
    /* charte graphique basée sur le CV */
    --main-blue: #2E75B6;
    --dark-blue: #1F4E79;
    --light-blue: #B4C7E7;
    --red-accent: #FC2526;
    --text-dark: #1F4E79;
    --text-grey: #404040;
    
    --card-bg: rgba(255, 255, 255, 0.9);
    --font-titles: 'Poppins', sans-serif;
    --font-body: 'Titillium Web', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

@media (max-width: 400px) {
    html {
        zoom: calc(100vw / 400);
        transform: scale(calc(100vw / 400));
        transform-origin: top left;
    }
}

body {
    min-width: 400px;
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    background-color: var(--light-blue);
    background-image: 
        radial-gradient(at 0% 0%, rgba(185, 203, 227, 0.4) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(35, 106, 166, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
}

/* --- HERO SECTION --- */
header {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    background: linear-gradient(180deg, var(--main-blue) 0%, var(--main-blue) 40%, transparent 100%);
}

.nowrap {
    white-space: nowrap;
}

.profile-img-container {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 2rem auto;
}

.red-rectangle {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 50px;
    height: 130px;
    background-color: var(--red-accent);
    border-radius: 4px;
    z-index: 1;
}

.profile-img-container a {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.profile-img {
    position: relative; 
    z-index: 2;         
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    border: none;
    background-color: white; 
}

header h1 {
    font-family: var(--font-titles);
    font-size: 2.8rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header .subtitle {
    font-family: var(--font-body);
    font-size: 1.4rem;
    font-weight: 600;
    color: white;
    margin-bottom: 2.5rem;
}

.links-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.75rem;
    border-radius: 4px; 
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

.btn-primary {
    background-color: var(--red-accent); 
    color: white;
    box-shadow: 0 4px 14px rgba(229, 57, 117, 0.3);
}

.btn-primary:hover {
    background-color: #E90303;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: white;
    color: var(--main-blue);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background-color: #DFECF7;
    color: var(--dark-blue);
    transform: translateY(-2px);
}

.btn {
    gap: 0.5rem;
}

/* APPARITION DU HEADER */
/* 1. État initial — tous les éléments masqués */
.profile-img-container,
header h1,
header .subtitle,
.links-container {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.6s ease;
}

/* 2. État final commun */
.profile-img-container.visible,
header h1.visible,
header .subtitle.visible,
.links-container.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 3. Délais d'apparition individuels */
.profile-img-container.visible,
header h1.visible {
    transition-delay: 0s;
}

header .subtitle.visible {
    transition-delay: 0.35s;
}

.links-container.visible {
    transition-delay: 0.5s;
}


/* --- SECTION PROJETS --- */
.projects-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem 1rem 2rem;
    overflow: hidden; 
}

/* --- SECTION PROJETS : CARTES --- */
/* Toute la carte devient cliquable */
.card-link {
    position: absolute;
    inset: 0;
    z-index: 3;
}

.project-card {
    display: block;        
    text-decoration: none; 
    color: inherit;        
    position: relative;
    overflow: hidden;
    background: var(--card-bg);
    border-radius: 4px;
    padding: 2.5rem;
    margin-bottom: 4rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.04);
    border-left: 5px solid var(--dark-blue); 
    cursor: pointer;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.project-card-bg {
    position: absolute;
    top: -3%;
    right: -2%;
    width: 60%;
    height: 40%;
    z-index: 1; 
    pointer-events: none; 
    transform: rotate(-2deg);
    transform-origin: top right;
    transition: transform 0.3s ease;
}

.project-card-bg img {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    object-fit: cover; 
    object-position: top right;
    opacity: 0.08;
    transition: opacity 0.3s ease;
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (hover: hover) {
    .project-card.visible:hover {
        background-color: #F0F5FB;
        transform: translateY(-6px);
        box-shadow: 0 20px 35px rgba(35, 106, 166, 0.12);
        border-left-color: var(--main-blue); 
    }

    .project-card.visible:hover .project-card-bg {
        transform: rotate(-2deg) scale(1.02);
    }
    
    .project-card.visible:hover .project-card-bg img {
        opacity: 0.15;
    }
}

.project-tag, .project-card h3, .project-card h4, .project-card p, .tech-stack {
    position: relative;
    z-index: 2;
}

.project-tag {
    display: inline-block;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--main-blue); 
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.project-card h3 {
    font-family: var(--font-titles);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--dark-blue);
    margin-bottom: 0.5rem;
    padding-right: 25%; 
}

.project-card h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--red-accent);
    margin-bottom: 0.5rem;
}

.project-card p {
    color: var(--text-grey);
    margin-bottom: 1.5rem;
}

.tech-stack {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tech-tag {
    background-color: #D7E0F2;
    color: var(--dark-blue);
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* --- FOOTER --- */
footer {
    font-family: var(--font-titles);
    text-align: center;
    padding: 4rem 2rem;
    font-size: 1rem;
    color: var(--main-blue);
    background: linear-gradient(180deg, transparent 0%, var(--main-blue) 150%);
}

/* --- RESPONSIVE --- */
@media (max-width: 600px) {
    header h1 { 
        font-size: 2rem; 
    }
    .project-card { 
        padding: 1.5rem; 
    }
    .links-container { 
        flex-direction: column; 
        width: 100%; 
        max-width: 280px; 
    }
    .btn { 
        justify-content: center; 
    }
}