/* --- Variables et Styles Globaux --- */
:root {
    --font-family: 'Poppins', sans-serif;
    --text-color: #ffffff;
    --arrow-bg: rgba(0, 0, 0, 0.3);
    --arrow-hover-bg: rgba(0, 0, 0, 0.6);
    --indicator-color: rgba(255, 255, 255, 0.5);
    --indicator-active-color: #ffffff;

    --accent-ia: #764ba2;
    --accent-ia-2: #667eea;
    --accent-apps: #00c9a7;
    --accent-apps-2: #0f9d58;
    --accent-missions: #ff9a5a;
    --accent-missions-2: #ff5e7e;

    --card-bg: rgba(255, 255, 255, 0.12);
    --card-border: rgba(255, 255, 255, 0.22);
    --card-bg-hover: rgba(255, 255, 255, 0.18);
}

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

html {
    scroll-behavior: smooth;
}

/* Fond vivant : un grand dégradé multicolore qui dérive lentement,
   dans l'esprit des dégradés uniques par projet de l'original,
   mais continu puisqu'il n'y a plus un seul slide "actif". */
body {
    font-family: var(--font-family);
    color: var(--text-color);
    min-height: 100vh;
    background: linear-gradient(120deg,
        #0f2027 0%,
        #302b63 20%,
        #764ba2 40%,
        #232526 60%,
        #0f9d58 80%,
        #0f2027 100%);
    background-size: 400% 400%;
    animation: driftBackground 40s ease-in-out infinite;
    padding: 20px;
    padding-top: 150px;
    position: relative;
    overflow-x: hidden;
}

@keyframes driftBackground {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Halos flous qui dérivent en arrière-plan, pour donner de la profondeur
   derrière le verre dépoli des cartes (comme le fond derrière le carrousel). */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    z-index: -1;
    opacity: 0.35;
    pointer-events: none;
}

body::before {
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, #667eea, transparent 70%);
    top: -10%;
    left: -10%;
    animation: floatBlob1 26s ease-in-out infinite;
}

body::after {
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, #ff5e7e, transparent 70%);
    bottom: -10%;
    right: -10%;
    animation: floatBlob2 32s ease-in-out infinite;
}

@keyframes floatBlob1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(8vw, 10vh) scale(1.15); }
}

@keyframes floatBlob2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-6vw, -8vh) scale(1.1); }
}

/* Halo réactif : deux calques qui se relaient en crossfade (comme le fond
   d'origine qui changeait à chaque slide) pour suivre la carte active
   du carrousel actuellement manipulé. */
.bg-spotlight {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    pointer-events: none;
}

.bg-spotlight.active {
    opacity: 0.5;
}

a {
    color: inherit;
}

/* --- Photo de Profil Statique --- */
.profile-pic-static {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 101;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.profile-pic-static:hover {
    transform: scale(1.1);
}

/* --- En-tête / Navigation --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px 15px 15px 100px;
    background: rgba(15, 12, 41, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.category-nav {
    display: flex;
    gap: 8px;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.nav-link {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.08);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.external-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.external-link {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.85;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

.external-link:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
}

.external-link-accent {
    background: linear-gradient(135deg, var(--accent-ia-2), var(--accent-ia));
    opacity: 1;
    font-weight: 600;
}

.external-link-accent:hover {
    filter: brightness(1.15);
}

/* --- Hero --- */
.hero {
    max-width: 700px;
    margin: 0 auto 3rem;
    text-align: center;
}

.hero-title {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.85;
}

/* --- Sections de catégorie --- */
main {
    max-width: 1200px;
    margin: 0 auto;
}

.category-section {
    margin-bottom: 4rem;
    scroll-margin-top: 140px;
}

.category-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* --- Carrousel de cartes (une rangée par catégorie, comme l'original) --- */
.carousel-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: scale(0.96) translateY(15px);
    transition: opacity 0.7s ease-in-out, transform 0.7s ease-in-out;
}

.carousel-wrapper.in-view {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.carousel-viewport {
    flex: 1;
    overflow: hidden;
    /* Fondu sur les bords : les cartes qui entrent/sortent s'estompent,
       pour retrouver la sensation de crossfade du carrousel d'origine
       même si le mouvement lui-même est un glissement. */
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 6%, black 94%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, black 6%, black 94%, transparent 100%);
}

.carousel-track {
    display: flex;
    gap: 20px;
    transition: transform 0.6s ease-in-out;
    will-change: transform;
}

.carousel-arrow {
    flex-shrink: 0;
    background-color: var(--arrow-bg);
    color: var(--text-color);
    border: none;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    z-index: 2;
}

.carousel-arrow:hover {
    background-color: var(--arrow-hover-bg);
    transform: scale(1.08);
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1.2rem;
}

.carousel-indicators .indicator {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: var(--indicator-color);
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.carousel-indicators .indicator.active {
    background-color: var(--indicator-active-color);
    transform: scale(1.25);
}

.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px;
    /* 3 cartes visibles sur desktop, ajustées par media query plus bas */
    flex: 0 0 calc((100% - 2 * 20px) / 3);
    min-width: 0;
    border-radius: 20px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    overflow: hidden;
    transition: background-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: var(--card-accent, linear-gradient(90deg, #667eea, #764ba2));
    opacity: 0.5;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: var(--card-bg-hover);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35), 0 0 30px var(--card-glow, rgba(118, 75, 162, 0.35));
}

.project-card:hover::before {
    opacity: 1;
}

/* Vraie capture d'écran en tête de carte, comme le faisait l'original */
.project-card-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.15);
}

.project-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.project-card:hover .project-card-media img {
    transform: scale(1.06);
}

.project-card-media-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed rgba(255, 255, 255, 0.25);
}

.project-card-icon {
    font-size: 2.2rem;
}

.project-card-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.project-card-pitch {
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.5;
    opacity: 0.85;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-status {
    margin-top: auto;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* --- Bloc Méthode --- */
.method-block {
    max-width: 850px;
    margin: 0 auto;
    padding: 30px;
    border-radius: 18px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.method-text {
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.7;
    margin-bottom: 1.2rem;
}

.method-tag {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-ia-2), var(--accent-ia));
    font-size: 0.85rem;
    font-weight: 600;
}

/* --- Bloc Débuts --- */
.debuts-block {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.debuts-text {
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.7;
    opacity: 0.8;
    font-style: italic;
}

/* --- Modal Projet --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.project-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    z-index: 1001;
    width: 90vw;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    /* Même verre dépoli clair que la fiche profil d'origine, pas un fond sombre opaque */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 2.2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
}

.project-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-title {
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.2rem;
}

.modal-tags .tag {
    padding: .25rem .7rem;
    border-radius: 999px;
    font-size: .8rem;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.modal-description {
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.7;
    margin-bottom: 1.3rem;
    opacity: 0.95;
}

.modal-meta {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.modal-meta-line {
    font-size: 0.9rem;
    line-height: 1.5;
}

.modal-meta-line strong {
    font-weight: 600;
    opacity: 0.9;
}

.modal-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin-bottom: 1.3rem;
}

.modal-gallery img {
    height: 160px;
    border-radius: 12px;
    flex-shrink: 0;
}

.modal-link {
    display: inline-block;
    text-decoration: none;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--accent-ia-2), var(--accent-ia));
    padding: 10px 22px;
    border-radius: 50px;
    font-weight: 600;
    transition: filter 0.3s ease;
}

.modal-link:hover {
    filter: brightness(1.15);
}

.modal-link-disabled {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 50px;
    font-weight: 400;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.08);
    opacity: 0.6;
}

/* --- Fiche de Profil --- */
.profile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.profile-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.profile-card {
    position: fixed;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
}

.profile-card.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background-color 0.3s ease;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.4);
}

.profile-card-content {
    text-align: center;
}

.profile-card-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.profile-card-name {
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.profile-card-contact a {
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    transition: border-color 0.3s ease;
}

.profile-card-contact a:hover {
    border-color: #fff;
}

/* --- Responsive --- */
@media (max-width: 767px) {
    body {
        padding: 15px;
        padding-top: 130px;
    }

    .profile-pic-static {
        top: 12px;
        left: 12px;
        width: 44px;
        height: 44px;
    }

    .site-header {
        padding-left: 70px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .category-title {
        font-size: 1.3rem;
    }

    .project-card {
        flex: 0 0 100%;
    }

    .carousel-arrow {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    .project-modal {
        padding: 1.5rem;
        max-height: 90vh;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .project-card {
        flex: 0 0 calc((100% - 20px) / 2);
    }
}

@media (min-width: 1024px) {
    .project-card {
        flex: 0 0 calc((100% - 2 * 20px) / 3);
    }
}
