/* Same CSS with updated selectors */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    font-family: 'Poppins', sans-serif;
}

:root {
    --bg-color:  #1f242d;
    --second-bg-color: #323946;
    --text-color: #fff;
    --main-color: #0ef;
}

html {
    font-size: 62.5%;
    /* overflow: hidden; */
}

body {
    background: var(--bg-color);
    color: var(--text-color);
}

section {
    min-height: 100vh;
    padding: 10rem 9% 2rem;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 9%;
    background: var(--bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.header.sticky {
    border-bottom: .1rem solid rgba(0, 0, 0, .2);
}

.logo {
    font-size: 2.5rem;
    color: var(--text-color);
    font-weight: 600;
    cursor: default;
}

.navbar a {
    font-size: 1.7rem;
    color: var(--text-color);
    margin-left: 4rem;
    transition: .3s;
}

.navbar a:hover,
.navbar a.active {
    color: var(--main-color);
}

#menu-icon {
    font-size: 3.6rem;
    color: var(--text-color);
    display: none;
}

.home {
    display: flex;
    justify-content: center;
    align-items: center;
}

.home-img img {
    width: 35vw;
    animation: floatImage 4s ease-in-out infinite;
}

@keyframes floatImage {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2.4rem);
    }
    100% {
        transform: translateY(0);
    }
}

.home-content h3 {
    font-size: 3.2rem;
    font-weight: 700;
}

.home-content h3:nth-of-type(2) {
    margin-bottom: 2rem;
}

span {
    color: var(--main-color);
}

.home-content h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
}

.social-media a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4rem;
    height: 4rem;
    background: transparent;
    border: .2rem solid var(--main-color);
    border-radius: 50%;
    font-size: 2rem;
    color: var(--main-color);
    margin: 3rem 1.5rem 3rem 0;
    transition: .5s ease;
}
.social-media a:hover {
    background: var(--main-color);
    color: var(--second-bg-color);
    box-shadow: 0 0 1rem var(--main-color);
}

.btn {
    display: inline-block;
    padding: 1rem 2.8rem;
    background: var(--main-color);
    border-radius: 4rem;
    box-shadow: 0 0 1rem var(--main-color);
    font-size: 1.6rem;
    color: var(--second-bg-color);
    letter-spacing: .1rem;
    font-weight: 600;
    transition: .5s ease;
}

.btn:hover {
    box-shadow: none;
}

.about {
    display: flex;
    justify-content: center;
    align-content: center;
    gap: 2rem;
    background: var(--second-bg-color);
}

.about-img img {
    width: 35vw;
}

.heading {
    text-align: center;
    font-size: 4.5rem;
}

.about-content h2 {
    text-align: left;
    line-height: 1.2;
}

.about-content h3 {
    font-size: 2.6rem;
}

.about-content p {
    font-size: 1.6rem;
    margin: 2rem 0 3rem;
}

.services h2 {
    margin-bottom: 5rem;
}

.services-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.services-container .services-box {
    flex: 1 1 30rem;
    background: var(--second-bg-color);
    padding: 3rem 2rem 4rem;
    border-radius: 2rem;
    text-align: center;
    border: .2rem solid var(--bg-color);
    transition: .5s ease;
}

.services-container .services-box:hover {
    border-color: var(--main-color);
    transform: scale(1.1);
}

.services-box i {
    font-size: 7rem;
    color: var(--main-color);
}

.services-box h3 {
    font-size: 2.6rem;
}

.services-box p {
    font-size: 1rem 0 3rem;
    margin-bottom: 1.5rem;
}

.portfolio {
    background: var(--second-bg-color);
}

.portfolio h2 {
    margin-bottom: 3rem;
}

/* ---- Filtres ---- */
.portfolio-filter {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: .8rem 2.5rem;
    background: transparent;
    border: .2rem solid var(--main-color);
    border-radius: 4rem;
    color: var(--text-color);
    font-size: 1.6rem;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: .3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--main-color);
    color: var(--second-bg-color);
    box-shadow: 0 0 1rem var(--main-color);
}

/* ---- Grille ---- */
.portfolio-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.portfolio-container .portfolio-box {
    position: relative;
    border-radius: 2rem;
    box-shadow: 0 0 1rem var(--bg-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
    transition: transform .3s ease, box-shadow .3s ease;
}

.portfolio-box.hidden {
    display: none;
}

.portfolio-box:hover {
    box-shadow: 0 0 2rem var(--main-color);
    transform: translateY(-.5rem);
}

/* ---- Image ---- */
.portfolio-img {
    width: 100%;
    height: 20rem;
    overflow: hidden;
}

.portfolio-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: .5s ease;
}

.portfolio-box:hover .portfolio-img img {
    transform: scale(1.08);
}

/* ---- Overlay hover ---- */
.portfolio-box .portfolio-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20rem;
    background: linear-gradient(rgba(0,0,0,.1), rgba(0, 239, 255, .88));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
    padding: 1.5rem 2.5rem;
    transform: translateY(100%);
    transition: .5s ease;
}

.portfolio-box:hover .portfolio-layer {
    transform: translateY(0);
}

.portfolio-layer p {
    font-size: 1.5rem;
    color: var(--second-bg-color);
    font-weight: 500;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,.5);
}

.portfolio-layer a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4.5rem;
    height: 4.5rem;
    background: var(--second-bg-color);
    border-radius: 50%;
    transition: .3s ease;
}

.portfolio-layer a:hover {
    background: var(--bg-color);
}

.portfolio-layer a i {
    font-size: 2rem;
    color: var(--main-color);
}

/* ---- Info toujours visible ---- */
.portfolio-info {
    padding: 1.5rem 2rem;
    background: var(--bg-color);
}

.portfolio-info h4 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: .8rem;
    color: var(--text-color);
}

.portfolio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.portfolio-tags span {
    background: var(--second-bg-color);
    color: var(--main-color);
    padding: .3rem 1.1rem;
    border-radius: 2rem;
    font-size: 1.3rem;
    border: .1rem solid var(--main-color);
}

.portfolio-box {
    cursor: pointer;
}

/* ========================= MODAL ========================= */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--second-bg-color);
    border-radius: 2rem;
    max-width: 80rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn .3s ease;
    border: .1rem solid rgba(0, 239, 255, .2);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(.9) translateY(2rem); }
    to   { opacity: 1; transform: scale(1)  translateY(0); }
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 4rem;
    height: 4rem;
    background: var(--bg-color);
    border: .2rem solid var(--main-color);
    border-radius: 50%;
    color: var(--main-color);
    font-size: 2.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    transition: .3s ease;
}

.modal-close:hover {
    background: var(--main-color);
    color: var(--second-bg-color);
}

.modal-img {
    width: 100%;
    height: 28rem;
    object-fit: cover;
    border-radius: 2rem 2rem 0 0;
    display: block;
}

.modal-body {
    padding: 2.5rem 3rem 3rem;
}

.modal-title {
    font-size: 2.6rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: var(--text-color);
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-bottom: 1.8rem;
}

.modal-tags span {
    background: var(--bg-color);
    color: var(--main-color);
    padding: .4rem 1.4rem;
    border-radius: 2rem;
    font-size: 1.4rem;
    border: .1rem solid var(--main-color);
}

.modal-desc {
    font-size: 1.7rem;
    line-height: 1.8;
    color: rgba(255,255,255,.85);
    margin-bottom: 2rem;
}

.modal-features {
    list-style: none;
    padding: 0;
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: .8rem;
}

.modal-features li {
    font-size: 1.6rem;
    color: rgba(255,255,255,.8);
    padding-left: 2rem;
    position: relative;
}

.modal-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .8rem;
    width: .8rem;
    height: .8rem;
    background: var(--main-color);
    border-radius: 50%;
    box-shadow: 0 0 .5rem var(--main-color);
}

.modal-btn {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    font-size: 1.6rem;
}

.contact h2 {
    margin-bottom: 5rem;
}

.contact-wrapper {
    display: flex;
    gap: 4rem;
    align-items: flex-start;
}

/* --- Colonne gauche : infos --- */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: 28rem;
}

.contact-info-box {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--second-bg-color);
    padding: 1.8rem 2rem;
    border-radius: 1rem;
    border: .2rem solid transparent;
    transition: .3s ease;
    color: var(--text-color);
    text-decoration: none;
}

.contact-info-box:hover {
    border-color: var(--main-color);
    transform: translateX(.5rem);
}

.contact-info-box i {
    font-size: 3rem;
    color: var(--main-color);
    flex-shrink: 0;
}

.contact-info-box h3 {
    font-size: 1.7rem;
    margin-bottom: .2rem;
}

.contact-info-box p {
    font-size: 1.4rem;
    color: rgba(255,255,255,.7);
}

/* --- Colonne droite : formulaire --- */
.contact-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.contact-input-row {
    display: flex;
    gap: 1.2rem;
}

.contact-input-row input {
    flex: 1;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1.5rem;
    font-size: 1.6rem;
    color: var(--text-color);
    background: var(--second-bg-color);
    border-radius: .8rem;
    border: .2rem solid transparent;
    outline: none;
    transition: .3s ease;
    font-family: 'Poppins', sans-serif;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--main-color);
}

.contact-form textarea {
    resize: vertical;
}

.contact-form .btn {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: .8rem;
}

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 2rem 9%;
    background: var(--second-bg-color);
}

.footer-text p {
    font-size: 1.6rem;
}

.footer-iconTop a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: .8rem;
    background: var(--main-color);
    border-radius: .8rem;
    transition: .5s ease;
}

.footer-iconTop a:hover {
    box-shadow: 0 0 1rem var(--main-color);
}

.footer-iconTop a i {
    font-size: 2.4rem;
    color: var(--second-bg-color);
}

/* ========================= BOUTON PDF ========================= */

.btn-download-pdf {
    position: fixed;
    bottom: 3rem;
    right: 3rem;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 5rem;
    height: 5rem;
    padding: 0 1.5rem;
    gap: 0;
    background: var(--main-color);
    color: #1f242d;
    border: .2rem solid var(--main-color);
    border-radius: 5rem;
    font-size: 1.5rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 0 1.5rem var(--main-color);
    transition: width .4s ease, gap .4s ease, background .3s ease, color .3s ease, box-shadow .3s ease;
    white-space: nowrap;
}

.btn-download-pdf:hover {
    width: 17rem;
    gap: .8rem;
    background: transparent;
    color: var(--main-color);
    box-shadow: 0 0 2.5rem var(--main-color);
}

.btn-download-pdf i {
    font-size: 2.2rem;
    flex-shrink: 0;
}

.btn-download-pdf span {
    opacity: 0;
    max-width: 0;
    transition: opacity .25s ease .15s, max-width .4s ease;
    overflow: hidden;
}

.btn-download-pdf:hover span {
    opacity: 1;
    max-width: 12rem;
}

.btn-download-pdf.loading {
    opacity: .7;
    cursor: wait;
}

.experiences {
    background: var(--second-bg-color);
}

.experiences h2 {
    margin-bottom: 5rem;
}

.experiences-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.experience-item {
    display: flex;
    gap: 2rem;
    background: var(--bg-color);
    border-radius: 1.5rem;
    padding: 2.5rem;
    border: .2rem solid transparent;
    transition: .3s ease;
}

.experience-item:hover {
    border-color: var(--main-color);
    transform: translateX(1rem);
}

.experience-icon {
    flex-shrink: 0;
    width: 6rem;
    height: 6rem;
    background: var(--second-bg-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.experience-icon i {
    font-size: 2.8rem;
    color: var(--main-color);
}

.experience-content h3 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: .5rem;
}

.experience-company {
    display: block;
    font-size: 1.7rem;
    color: var(--main-color);
    font-weight: 500;
    margin-bottom: .3rem;
}

.experience-date {
    display: block;
    font-size: 1.6rem;
    color: rgba(255, 255, 255, .6);
    margin-bottom: 1rem;
}

.experience-content ul {
    padding-left: 1.8rem;
}

.experience-content ul li {
    font-size: 1.7rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, .85);
}

/* ========================= SKILLS ========================= */

.skills {
    background: var(--bg-color);
}

.skills h2 {
    margin-bottom: 5rem;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
}

.skills-category {
    background: var(--second-bg-color);
    border-radius: 1.5rem;
    padding: 3rem 2.5rem;
    border: .2rem solid transparent;
    transition: .3s ease;
}

.skills-category:hover {
    border-color: var(--main-color);
}

.skills-category h3 {
    font-size: 2rem;
    color: var(--main-color);
    margin-bottom: 1.8rem;
    display: flex;
    align-items: center;
    gap: .8rem;
}

.skills-category h3 i {
    font-size: 2.6rem;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
}

.skills-tags span {
    background: var(--bg-color);
    color: var(--text-color);
    padding: .6rem 1.6rem;
    border-radius: 2rem;
    font-size: 1.6rem;
    border: .1rem solid var(--main-color);
    transition: .3s ease;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.skills-tags span i {
    font-size: 1.9rem;
    color: var(--main-color);
    transition: .3s ease;
}

.skills-tags span:hover {
    background: var(--main-color);
    color: var(--second-bg-color);
}

.skills-tags span:hover i {
    color: var(--second-bg-color);
}

/* ========================= LANGUAGES ========================= */

.languages {
    background: var(--second-bg-color);
}

.languages h2 {
    margin-bottom: 5rem;
}

.languages-container {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.language-item {
    background: var(--bg-color);
    border-radius: 1rem;
    padding: 2rem 2.5rem;
}

.language-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.language-name {
    font-size: 2rem;
    font-weight: 600;
}

.language-level {
    font-size: 1.7rem;
    color: var(--main-color);
    font-weight: 600;
}

.language-bar {
    height: .8rem;
    background: var(--second-bg-color);
    border-radius: 1rem;
    overflow: hidden;
}

.language-fill {
    height: 100%;
    background: var(--main-color);
    border-radius: 1rem;
    box-shadow: 0 0 .8rem var(--main-color);
}

/* BREAKPOINTS */

@media (max-width: 1200px) {
    html {
        font-size: 55%;
    }
}

@media (max-width: 991px) {
    .header {
        padding: 2rem 3%;
    }
    section {
        padding: 10rem 3% 2rem;
    }
    .services {
        padding-bottom: 7rem;
    }
    .experiences {
        padding-bottom: 7rem;
    }
    .skills {
        padding-bottom: 7rem;
    }
    .portfolio {
        padding-bottom: 7rem;
    }
    .contact {
        min-height: auto;
    }
    .footer {
        padding: 2rem 3%;
    }
}

@media (max-width: 768px) {
    #menu-icon {
        display: block;
    }
    .navbar {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 1rem 3%;
        background: var(--bg-color);
        border-top: .1rem solid rgba(0, 0, 0, .2);
        box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .2);
        display: none;
    }
    .navbar.active {
        display: block;
    }
    .navbar a {
        display: block;
        font-size: 2rem;
        margin: 3rem 0;
    }
    .home {
        flex-direction: column;
    }
    .home-img img {
        width: 70vw;
        margin-top: 4rem;
    }
    .about {
        flex-direction: column-reverse;
    }
    .about img {
        width: 100vw;
        margin-top: 4rem;
    }
    .services h2 {
        margin-bottom: 3rem;
    }
    .portfolio h2 {
        margin-bottom: 3rem;
    }
    .skills-container {
        grid-template-columns: 1fr;
    }
    .portfolio-container {
        grid-template-columns: repeat(2, 1fr);
    }
    .contact-wrapper {
        flex-direction: column;
    }
    .contact-info {
        min-width: unset;
        width: 100%;
    }
    .contact-input-row {
        flex-direction: column;
    }
}

@media (max-width: 617px) {
    .portfolio-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 450px) {
    html {
        font-size: 50%;
    }
    .contact form .input-box input {
        width: 100%;
    }
}

@media (max-width: 365px) {
    .home-img img {
        width: 90vw;
    }
    .about-img img {
        width: 90vw;
    }
    .footer {
        flex-direction: column-reverse;
    }
    .footer p {
        text-align: center;
        margin-top: 2rem;
    }
}
