/* ============================================= */
/*  VARIABLES & RESET                            */
/* ============================================= */

:root {
    /* Colors */
    --clr-bg: #151515;
    --clr-text: #ffffff;
    --clr-muted: #d3d3d3;
    --clr-accent: #4ee1a0;
    --clr-line: rgba(255,255,255,0.2);

    /* Fonts */
    --ff-primary: "Space Grotesk", sans-serif;

    /* Font sizes */
    --fs-h1: 50px;
    --fs-h2: 40px;
    --fs-h3: 28px;
    --fs-body: 18px;
    --fs-small: 16px;

    /* Spacing */
    --sp-section: 80px;

    /* Radius */
    --radius: 6px;

    /* Transitions */
    --transition: 0.3s ease;
    --transition-slow: 0.6s ease;
}

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

html { 
    scroll-behavior: smooth; 
}

body {
    font-family: var(--ff-primary);
    background: var(--clr-bg);
    color: var(--clr-text);
    line-height: 1.5;
    padding-bottom: 80px;
    overflow-x: hidden;
}

/* Container width */
main, header, footer {
    width: min(1200px, 90%);
    margin: auto;
}

/* ============================================= */
/*  GENERAL ANIMATIONS & TRANSITIONS             */
/* ============================================= */

.fade-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s forwards;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Nouvelle animation pour les éléments qui apparaissent de côté */
.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    animation: fadeInLeft 0.8s forwards;
}

@keyframes fadeInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    animation: fadeInRight 0.8s forwards;
}

@keyframes fadeInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation pour les éléments au scroll */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.hover-underline {
    position: relative;
}

.hover-underline::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 2px;
    background: var(--clr-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}

.hover-underline:hover::after {
    transform: scaleX(1);
}

/* Animation de pulse pour les éléments interactifs */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse:hover {
    animation: pulse 0.5s ease;
}

/* ============================================= */
/* HEADER                                        */
/* ============================================= */

header {
    height: 120px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    
    animation: fadeUp 0.8s 0.2s both;
}

header h1 {
    font-size: 32px;
    font-weight: 700;
    transition: var(--transition);
}

header h1:hover {
    color: var(--clr-accent);
    transform: translateY(-2px);
}

header a {
    color: var(--clr-text);
    text-decoration: none;
    margin-left: 20px;
    font-size: var(--fs-small);
    transition: var(--transition);
    position: relative;
}

header a:hover {
    color: var(--clr-accent);
    transform: translateY(-2px);
}
/* ============================================= */
/*  SOCIAL LINKS STYLES                          */
/* ============================================= */

.social-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    margin-left: 0;
}

.social-links a:hover {
    background: var(--clr-accent);
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 5px 15px rgba(78, 225, 160, 0.3);
}

.social-links svg {
    width: 20px;
    height: 20px;
}

/* Styles pour les liens de projet avec icônes */
.project-card div a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--clr-text);
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 2px solid var(--clr-accent);
    text-decoration: none;
    padding-bottom: 5px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.project-card div a svg {
    width: 16px;
    height: 16px;
    transition: var(--transition);
}

.project-card div a:hover svg {
    transform: scale(1.2);
}

/* Responsive pour les icônes */
@media (max-width: 600px) {
    .social-links {
        gap: 15px;
    }
    
    .social-links a {
        width: 35px;
        height: 35px;
    }
    
    .social-links svg {
        width: 18px;
        height: 18px;
    }
}

/* ============================================= */
/* HERO SECTION                                  */
/* ============================================= */

.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 80vh;
    align-items: center;
    margin-top: 60px;
    padding-bottom: var(--sp-section);
    position: relative;
}

.herotext {
    animation: fadeInLeft 0.8s 0.4s both;
}

.herotext h2 {
    font-size: var(--fs-h1);
    font-weight: 700;
    width: 90%;
    margin-bottom: 20px;
    line-height: 1.1;
}

.herotext h2 span {
    border-bottom: 4px solid var(--clr-accent);
    position: relative;
    display: inline-block;
}

.herotext h2 span::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--clr-accent);
    transform: scaleX(0);
    transform-origin: left;
    animation: expandLine 1s 1s forwards;
}

@keyframes expandLine {
    to {
        transform: scaleX(1);
    }
}

.herotext p {
    font-size: var(--fs-body);
    color: var(--clr-muted);
    width: 80%;
    margin-bottom: 30px;
    animation: fadeUp 0.8s 0.6s both;
}

.herotext a {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: var(--fs-small);
    color: var(--clr-text);
    text-decoration: none;
    border-bottom: 2px solid var(--clr-accent);
    padding-bottom: 5px;
    transition: var(--transition);
    display: inline-block;
    animation: fadeUp 0.8s 0.8s both;
}

.herotext a:hover {
    color: var(--clr-accent);
    transform: translateY(-3px);
    letter-spacing: 3px;
}

.heroimg {
    text-align: right;
    animation: fadeInRight 0.8s 0.4s both;
}

.heroimg img {
    width: 100%;
    border-radius: var(--radius);
    filter: grayscale(100%) contrast(1.1);
    transition: var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.heroimg img:hover {
    filter: grayscale(0%) contrast(1.1);
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(78, 225, 160, 0.2);
}

/* Effet de brillance sur l'image au hover */
.heroimg::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: var(--transition-slow);
    z-index: 1;
}

.heroimg:hover::before {
    left: 100%;
}

/* Line under hero */
.hero::after {
    content: "";
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: var(--clr-line);
    animation: expandWidth 1s 1.2s forwards;
    transform: scaleX(0);
    transform-origin: left;
}

@keyframes expandWidth {
    to {
        transform: scaleX(1);
    }
}

/* ============================================= */
/* TECHNOLOGIES SECTION                           */
/* ============================================= */

.technologies {
    padding: var(--sp-section) 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    row-gap: 60px;
    border-bottom: 1px solid var(--clr-line);
}

.technologies > div {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.6s forwards;
}

.technologies > div:nth-child(1) { animation-delay: 0.1s; }
.technologies > div:nth-child(2) { animation-delay: 0.2s; }
.technologies > div:nth-child(3) { animation-delay: 0.3s; }
.technologies > div:nth-child(4) { animation-delay: 0.4s; }
.technologies > div:nth-child(5) { animation-delay: 0.5s; }
.technologies > div:nth-child(6) { animation-delay: 0.6s; }

.technologies h2 {
    font-size: var(--fs-h3);
    transition: var(--transition);
    position: relative;
    display: inline-block;
}

.technologies h2::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--clr-accent);
    transition: var(--transition-slow);
}

.technologies > div:hover h2::after {
    width: 100%;
}

.technologies > div:hover h2 {
    color: var(--clr-accent);
    transform: translateX(5px);
}

.technologies p {
    font-size: var(--fs-small);
    color: var(--clr-muted);
    margin-top: 8px;
    transition: var(--transition);
}

.technologies > div:hover p {
    color: var(--clr-text);
    transform: translateX(5px);
}

/* ============================================= */
/* PROJECTS                                      */
/* ============================================= */

.projects {
    padding-top: 100px;
}

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeUp 0.8s both;
}

.projects-header h2 {
    font-size: var(--fs-h2);
}

.projects-header button {
    background: none;
    border: none;
    color: var(--clr-text);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: var(--fs-small);
    border-bottom: 2px solid var(--clr-accent);
    cursor: pointer;
    padding-bottom: 5px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.projects-header button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(78, 225, 160, 0.2), transparent);
    transition: var(--transition-slow);
}

.projects-header button:hover::before {
    left: 100%;
}

.projects-header button:hover {
    color: var(--clr-accent);
    letter-spacing: 3px;
    transform: translateY(-2px);
}

/* Project cards */
.project-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 50px;
    margin-top: 60px;
}

.project-card {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s forwards;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }

.project-card img {
    width: 100%;
    border-radius: var(--radius);
    transition: var(--transition-slow);
    filter: brightness(0.9);
    position: relative;
    overflow: hidden;
}

.project-card:hover img {
    transform: translateY(-10px) scale(1.02);
    filter: brightness(1);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.project-card h3 {
    font-size: 22px;
    margin-top: 15px;
    transition: var(--transition);
}

.project-card:hover h3 {
    color: var(--clr-accent);
    transform: translateX(5px);
}

.project-card ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin-top: 10px;
    color: var(--clr-muted);
}

.project-card ul li {
    transition: var(--transition);
    position: relative;
}

.project-card ul li::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--clr-accent);
    transition: var(--transition);
}

.project-card ul li:hover {
    color: var(--clr-text);
}

.project-card ul li:hover::after {
    width: 100%;
}

.project-card div {
    margin-top: 20px;
    display: flex;
    gap: 20px;
}

.project-card div a {
    color: var(--clr-text);
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 2px solid var(--clr-accent);
    text-decoration: none;
    padding-bottom: 5px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.project-card div a::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(78, 225, 160, 0.1), transparent);
    transition: var(--transition-slow);
}

.project-card div a:hover::before {
    left: 100%;
}

.project-card div a:hover {
    color: var(--clr-accent);
    letter-spacing: 3px;
    transform: translateY(-2px);
}

/* ============================================= */
/* CONTACT                                       */
/* ============================================= */

.contact {
    padding-top: 120px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    border-bottom: 1px solid var(--clr-line);
    padding-bottom: 80px;
}

.contact > div {
    animation: fadeInLeft 0.8s both;
}

.contact h2 {
    font-size: var(--fs-h2);
}

.contact p {
    color: var(--clr-muted);
    margin-top: 20px;
    width: 90%;
    transition: var(--transition);
}

.contact > div:hover p {
    color: var(--clr-text);
    transform: translateX(5px);
}

.contact form {
    display: flex;
    flex-direction: column;
    gap: 30px;
    animation: fadeInRight 0.8s both;
}

.contact input,
.contact textarea {
    background: none;
    border: none;
    border-bottom: 1px solid var(--clr-text);
    padding: 15px;
    font-size: var(--fs-small);
    color: var(--clr-text);
    outline: none;
    transition: var(--transition);
    position: relative;
}

.contact input:focus,
.contact textarea:focus {
    border-bottom-color: var(--clr-accent);
    transform: translateY(-2px);
}

.contact input::placeholder,
.contact textarea::placeholder {
    color: var(--clr-muted);
    transition: var(--transition);
}

.contact input:focus::placeholder,
.contact textarea:focus::placeholder {
    color: transparent;
}

.contact textarea {
    height: 120px;
    resize: none;
}

.contact button {
    background: none;
    border: none;
    margin-left: auto;
    color: var(--clr-text);
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 2px solid var(--clr-accent);
    cursor: pointer;
    padding-bottom: 5px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.contact button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(78, 225, 160, 0.2), transparent);
    transition: var(--transition-slow);
}

.contact button:hover::before {
    left: 100%;
}

.contact button:hover {
    color: var(--clr-accent);
    letter-spacing: 3px;
    transform: translateY(-2px);
}

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

footer {
    margin-top: 60px;
    padding-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeUp 0.8s both;
}

footer h3 {
    font-size: var(--fs-h3);
    transition: var(--transition);
}

footer h3:hover {
    color: var(--clr-accent);
    transform: translateY(-2px);
}

footer a {
    color: var(--clr-text);
    margin-left: 20px;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

footer a::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--clr-accent);
    transition: var(--transition);
}

footer a:hover {
    color: var(--clr-accent);
    transform: translateY(-2px);
}

footer a:hover::after {
    width: 100%;
}

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

/* Tablet */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .heroimg {
        text-align: center;
        margin-top: 40px;
        order: -1;
    }

    .technologies {
        grid-template-columns: repeat(2, 1fr);
    }

    .project-cards {
        grid-template-columns: 1fr;
    }

    .contact {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .contact button {
        margin: auto;
    }
}

/* Mobile */
@media (max-width: 600px) {

    :root {
        --fs-h1: 35px;
        --fs-h2: 28px;
        --fs-body: 16px;
    }
    header{
        flex-wrap: wrap;
        text-align: center;
    }
    header h1 { 
        text-align: center;
        width: 100%;
        font-size: 26px; }

    .heroimg img {
        width: 260px;
    }

    .technologies {
        grid-template-columns: 1fr;
        text-align: center;
    }

    footer {
        flex-direction: column;
        gap: 20px;
    }
    
    /* Ajustements des animations pour mobile */
    .herotext, .heroimg {
        animation: fadeUp 0.8s both;
    }
}