:root {
    --bg-main: #0f0f14;
    --bg-card: #181825;
    --bg-soft: #14141c;
    --text-main: #f4f4f5;
    --text-muted: #9a9aa3;
    --accent: #7c5cff;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
}

/* Sections : fade rejouable via JS */
.section {
    padding: 90px 20px;
    opacity: 0;
    transform: translateY(46px);
    transition: opacity .65s ease, transform .65s ease;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.container {
    max-width: 1100px;
    margin: auto;
}

.narrow {
    max-width: 720px;
}

/* HEADER */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 15, 20, .85);
    backdrop-filter: blur(8px);
    transform: translateY(-100%);
    transition: transform .3s ease;
    z-index: 100;
}

header.visible {
    transform: translateY(0);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 20px;
    min-width: 90%;
    /* border: solid red; */
}

.logo {
    font-size: 1.75rem;
    font-weight: 650;
}

.nav-links a {
    position: relative;
    color: var(--text-main);
    text-decoration: none;
    transition: color .6s ease;
    margin-left: 20px;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
            transparent,
            #7d5cffcc,
            transparent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .35s ease;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a:hover::after {
    transform: scaleX(1);
}


.cv {
    color: var(--accent);
}

.desktop {
    display: flex;
}

.mobile,
.mobile-menu {
    display: none;
}

/* HERO */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-content {
    padding: 0 10px;
}

h1 {
    font-size: 5.2rem;
    font-weight: 750;
    line-height: 1.05;
}

/* Lettres du H1 : fade couleur */
.letter {
    display: inline-block;
    transition: color .20s ease;
    cursor: default;
}

.letter:hover {
    color: var(--accent);
}

h2 {
    color: var(--accent);
    margin-top: 14px;
    font-size: 1.8rem;
}

.details {
    opacity: .6;
    margin-top: 14px;
}

/* Titres */
h3 {
    font-size: 3.1rem;
    margin-bottom: 40px;
}

h4 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

h5 {
    font-size: 1.55rem;
}

/* A PROPOS : pas de margin négatif, remonte uniquement via fade/translate */
.apropos {
    padding-top: 80px;
}

/* COMPETENCES */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
}

.skill-block {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 18px;
    text-align: center;
    border: 1px solid var(--border);
}

.skill-fade {
    opacity: 0;
    transform: translateY(6px);
}

/* CAROUSEL : non penché + impression de “tourner” (par déplacement + profondeur) */
.carousel {
    position: relative;
    height: 96px;
    margin: 28px 0;
}

.carousel .item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 46px;
    height: 46px;
    transition: transform .6s ease, opacity .6s ease;
    cursor: pointer;
}

/* CENTRE */
.item.center {
    transform: translate(-50%, -50%) translateX(0) scale(1.4);
    opacity: 1;
    z-index: 3;
}

/* GAUCHE */
.item.left {
    transform: translate(-50%, -50%) translateX(-160%) scale(.70) translateY(30%);
    opacity: .4;
    z-index: 1;
}

/* DROITE */
.item.right {
    transform: translate(-50%, -50%) translateX(160%) scale(.70) translateY(30%);
    opacity: .3;
    z-index: 1;
}

/* L'image ne capte jamais le clic */
.carousel img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.carousel img {
    pointer-events: none;
}

.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: color .20s ease, transform .20s ease;
    z-index: 5;
}

.arrow.left {
    left: -25px;
    bottom: 5px;
    padding: 10px 30px;
    padding-right: 60px;
}

.arrow.right {
    right: -25px;
    bottom: 5px;
    padding: 10px 30px;
    padding-left: 60px;
}

.arrow:hover {
    color: var(--accent);
    transform: translateY(-52%) scale(1.10);
}

/* cacher les flèches en mode liste */
#competences.list-view .arrow {
    display: none;
}

/* Texte skills */
.skill-name,
.skill-desc {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .35s ease, transform .35s ease;
}

.skill-name.show,
.skill-desc.show {
    opacity: 1;
    transform: translateY(0);
}

.colorSwitch {
    filter: invert(1);
}

/* LISTES */

.skills-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
    margin-bottom: 40px;
}

#skillsViewToggle {
    background: none;
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--accent);
    cursor: pointer;
    font-size: .9rem;
    transition: color .25s ease, border-color .25s ease;
    min-width: 110px;
    margin-bottom: 30px;
}

#skillsViewToggle:hover {
    color: var(--accent-light);
    border-color: var(--accent);
}

/* LISTE DES COMPÉTENCES — VERSION STYLÉE */
.skills-list {
    list-style: none;
    margin-top: 24px;
    padding: 0;
    display: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px 20px;
}

/* item */
.skills-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: .95rem;
    transition: transform .25s ease, background .25s ease;
}

.skills-list li:hover {
    background: rgba(124, 92, 255, .08);
    transform: translateY(-2px);
}

/* logo */
.skills-list img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

/* cacher le carousel */
#competences.list-view .carousel {
    display: none;
}

.skills-list {
    display: none;
}

/* afficher la liste */
#competences.list-view .skills-list {
    display: grid;
}

/* cacher le nom + description animés */
#competences.list-view .skill-name,
#competences.list-view .skill-desc {
    display: none;
}

/* PROJETS */
#projets {
    padding: 50px 0px;
    margin: 5%;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 26px var(--shadow);
    transition: transform .4s ease, box-shadow .4s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: rgba(124, 92, 255, .25);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
}

.project-card h4 {
    font-size: 1.45rem;
    margin-bottom: 10px;
}

.project-card p {
    color: var(--text-muted);
    margin-bottom: 18px;
}

.project-link {
    color: var(--accent);
    text-decoration: none;
    position: relative;
    transition: color .6s ease;
}


.project-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
            rgba(124, 92, 255, 0),
            rgba(124, 92, 255, .2),
            rgba(124, 92, 255, .4),
            rgba(124, 92, 255, .6),
            rgba(124, 92, 255, .9),
            rgba(124, 92, 255, 0));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .35s ease;
}

.project-link:hover {
    color: #c2b6ff;
}

.project-link:hover::after {
    transform: scaleX(1);
}

.project-skeleton {
    color: var(--text-muted);
}

/* CONTACT */
.contact {
    background: var(--bg-soft);
    padding: 50px 20px;
    /* plus court */
}

.contact h3 {
    margin-bottom: 26px;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 28px;
}

.contact-links a {
    color: var(--accent);
    text-decoration: none;
    transition: color .35s ease, text-shadow .35s ease;
}

.contact-links a:hover {
    color: #c7b9ff;
}

footer {
    margin-top: 28px;
    text-align: center;
    font-size: .85rem;
    color: var(--text-muted);
}

@media (max-width:450px) {
    .skills-header {
        flex-direction: column;
    }
}

/* MOBILE */
@media(max-width:840px) {

    .desktop {
        display: none;
    }

    .mobile {
        display: block;
        background: none;
        border: none;
        color: white;
        font-size: 1.6rem;
        cursor: pointer;
    }

    .mobile-menu {
        display: none;
        background: var(--bg-card);
        padding: 20px;
        border-top: 1px solid var(--border);
    }

    .mobile-menu.open {
        display: block;
    }

    .mobile-menu a {
        display: block;
        color: var(--text-main);
        text-decoration: none;
        padding: 10px 0;
        transition: color .6s ease;
    }

    .mobile-menu a:hover {
        color: var(--accent);
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
    }

    h1 {
        font-size: 3.4rem;
    }

    h3 {
        font-size: 2.4rem;
    }
}