/* Reset & CSS variables */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #fef9fa;
    color: #222;
    overflow-x: hidden;
}

/* -----------------------------------
    1. ARRIÈRE-PLAN FIXE (SVG MORPHING)
----------------------------------- */
.sticky-blob-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.morphing-wrapper {
    width: 120vw;
    height: 120vh;
    max-width: 1600px;
    max-height: 1400px;
    /* Masqué par défaut (0) avec transition de 1 seconde sur l'apparition/disparition et le mouvement */
    opacity: 0;
    transition: transform 1s cubic-bezier(0.25, 1, 0.5, 1), opacity 1s cubic-bezier(0.25, 1, 0.5, 1);
    transform-origin: center;
}

.morphing-svg {
    width: 100%;
    height: 100%;
    animation: continuousOrganicPulse 20s ease-in-out infinite alternate;
    transform-origin: center;
}

.morphing-image {
    transition: d 3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* 
    POUR CHANGER LA COULEUR DE LA FORME : 
    Modifie la valeur 'fill' ci-dessous (ex: #e2e8f0, #f1f5f9, #ddd, etc.)
*/
.morphing-path {
    transition: d 3s cubic-bezier(0.25, 1, 0.5, 1);
    d: path("M1078,761C1014.2,852.1,950.1,942.6,864,988C777.9,1033.4,669.9,1033.6,561,1018C452.1,1002.4,342.1,971.1,262,906C181.9,840.9,131.9,742.1,104,639C76.1,535.9,70.1,428.4,115,334C159.9,239.6,255.9,158.1,363,111C470.1,63.9,588.4,51.1,682,75C775.6,98.9,844.6,159.6,896,238C947.4,316.4,981.4,412.6,1017,508C1052.6,603.4,1089.9,698.1,1078,761Z");
    fill: #ffffff; /* <-- MODIFIER LA COULEUR ICI */
}

@keyframes continuousOrganicPulse {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.05) rotate(4deg); }
    100% { transform: scale(0.96) rotate(-3deg); }
}

/* -----------------------------------
    VARIATIONS ET VISIBILITÉ PAR SECTION
----------------------------------- */
/* Section 1 : Home (Inviable/Masqué) */
body[data-active-section="home"] .morphing-wrapper {
    opacity: 0;
    transform: translate(0, -5vh) scaleX(1.15) scaleY(0.9);
}

/* Section 2 : Confiance & Stats (Apparaît progressivement en 1s) */
body[data-active-section="trust-and-stats"] .morphing-wrapper, body[data-active-section="service-2"] .morphing-wrapper {
    opacity: 1;
    transform: translate(-18vw, 2vh) scaleX(1.3) scaleY(0.7) rotate(-15deg);
}
body[data-active-section="trust-and-stats"] .morphing-path, body[data-active-section="service-2"] .morphing-path {
    d: path("M1150,550C1100,750,900,850,700,880C500,910,300,870,180,720C60,570,40,310,120,180C200,50,420,30,650,40C880,50,1200,350,1150,550Z");
}

/* Section 3 : Services */
body[data-active-section="services"] .morphing-wrapper, body[data-active-section="service-1"] .morphing-wrapper {
    opacity: 1;
    transform: translate(12vw, 8vh) scaleX(1.2) scaleY(1.05) rotate(10deg);
}
body[data-active-section="services"] .morphing-path, body[data-active-section="service-1"] .morphing-path {
    d: path("M978,705.5C899.4,853,820.7,1000.5,699,1062.5C577.3,1124.5,412.7,1101,289.5,1020.5C166.3,940,84.7,802.5,56,664C27.3,525.5,51.7,386,134.5,274C217.3,162,358.7,77.5,491.5,50C624.3,22.5,748.7,52,827.5,134C906.3,216,939.7,350.5,959,485.5C978.3,620.5,983.7,756,978,705.5Z");
}

/* Section 4 : Portfolio */
body[data-active-section="portfolio"] .morphing-wrapper {
    opacity: 1;
    transform: translate(-5vw, 22vh) scaleX(1.4) scaleY(1.8) rotate(-5deg);
}
body[data-active-section="portfolio"] .morphing-path {
    d: path("M1180,480C1120,680,850,720,600,730C350,740,120,720,50,520C-20,320,80,140,320,90C560,40,840,80,1050,220C1260,360,1240,280,1180,480Z");
}

body[data-active-section="service-3"] .morphing-wrapper {
    opacity: 1;
    transform: translate(26vw, 2vh) scaleX(1.1) scaleY(1.1);
}

/* Section 5 : Contact */
body[data-active-section="contact"] .morphing-wrapper {
    opacity: 1;
    transform: translate(0, 2vh) scaleX(1.1) scaleY(1.1);
}
body[data-active-section="service-4"] .morphing-wrapper {
    opacity: 1;
    transform: translate(-18vw, 2vh) scaleX(1.1) scaleY(1.1) rotate(75deg);
}
body[data-active-section="contact"] .morphing-path, body[data-active-section="service-3"] .morphing-path, body[data-active-section="service-4"] .morphing-path {
    d: path("M836,750C774.9,835.4,713.9,920.9,635,945C556.1,969.1,459.1,931.9,374,888C288.9,844.1,215.9,793.6,183,723C150.1,652.4,157.1,561.9,194,484C230.9,406.1,297.9,340.9,370,274C442.1,207.1,519.1,138.6,589,122C658.9,105.4,721.9,140.9,777,196C832.1,251.1,879.1,325.9,910,413C940.9,500.1,955.9,599.6,913,678C870.1,756.4,897.1,664.6,836,750Z");
}

/* -----------------------------------
    2. NAVIGATION BAR
----------------------------------- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background: rgba(20, 20, 20, 0.4);
    backdrop-filter: blur(10px);
}

/* -----------------------------------
    3. SECTIONS MIN 100VH & GLASS CARDS
----------------------------------- */
.full-screen-section {
    min-height: 100vh;
    position: relative;
    z-index: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 100px 0 60px;
}

.full-width-section {
    position: relative;
    z-index: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 0 30px;
}


.glass-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 15px 35px rgba(0,0,0,0.05);
}

/* HERO SECTION & FIX DE LA VAGUE */
.hero-section {
    background: transparent;
    color: white;
    text-align: center;
}

.hero-section::before {
    content: none;
}

.hero-section > .hero-content {
    z-index: 4;
}

.hero-background {
    position: absolute !important;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.hero-section h1 {
    font-size: 4rem;
    font-family: 'Comic Sans MS', 'Caveat', cursive, sans-serif;
}

/* Correction du conteneur de la vague pour éviter tout décollement */
.hero-wave-container {
    display: none;
}

.full-screen-section > *:not(.hero-wave-container) {
    position: relative;
    z-index: 3;
}

.full-width-section > *:not(.hero-wave-container) {
    position: relative;
    z-index: 3;
}

/* PARTENAIRES LOGOS */
.logos-container {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    width: 100%;
    padding: 20px 0;
}

.logos-track {
    display: inline-flex;
    animation: scrollLogos 60s linear infinite;
    will-change: transform;
    backface-visibility: hidden;
}

.logo-item {
    padding: 0 30px;
    flex-shrink: 0;
}

.logo-item img {
    filter: grayscale(1);
    opacity: 0.6;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

.logo-item img:hover {
    filter: grayscale(0);
    opacity: 1;
}

@keyframes scrollLogos {
    0% { 
        transform: translateX(0); 
    }
    100% { 
        transform: translateX(-50%); 
    }
}

/* Portfolio Cards */
.portfolio-card {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(217, 70, 166, 0.2);
}

/* YouTube Placeholders */
.youtube-placeholder,
.youtube-placeholder-modal {
    background: linear-gradient(135deg, #fef9fa 0%, #f8ecf2 100%);
    border: 2px solid #d946a6;
    position: relative;
}

.youtube-placeholder-modal button {
    transition: background-color 0.2s ease;
}

.youtube-placeholder-modal button:hover {
    background-color: #c44569 !important;
}

/* MASQUES PHOTO ORGANIK */

/* SOCIAL BUTTONS */
.btn-social {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
    color: white;
    background: #d946a6;
    transition: transform 0.2s;
}

.btn-social:hover {
    transform: translateY(-3px);
    color: white;
}

/* -----------------------------------
   SERVICES SECTIONS - BLOB MORPHING
----------------------------------- */
.service-section {
    position: relative;
    padding: 60px 0;
    overflow: visible;
    min-height: 87vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media screen and (min-width: 2000px) {
    .service-section {
        min-height: 100vh;
    }
}

/* Conteneur du blob morphing en arrière-plan */
.morphing-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 1;
    overflow: visible;
}

.service-morphing-svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    overflow: visible;
}

.morphing-bg-container .morphing-path {
    fill: #d0d0d0;
    transition: d 3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Contenu du service (au-dessus du blob) */
.service-section .row {
    position: relative;
    z-index: 2;
}

/* Image blob du service */
.service-image-blob {
    width: 100%;
    max-width: 400px;
    height: 400px;
    margin: 0 auto;
}

.blob-morphing {
    width: 100%;
    height: 100%;
}

/* Texte du service */
.service-section h3 {
    color: #1a1a1a;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.service-section p {
    line-height: 1.8;
    color: #444;
}

.service-section .list-unstyled li {
    color: #555;
    font-weight: 500;
}

.service-section .text-primary {
    color: #d946a6 !important;
}
/* Modal Styles - Clean and Simple */
.modal-dialog {
    max-height: calc(100vh - 20px);
    margin: 10px auto;
}

.modal-content {
    max-height: calc(100vh - 20px);
    display: flex;
    flex-direction: column;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    flex-shrink: 0;
    border-bottom: 1px solid #e0e0e0;
    background: #fafafa;
}

.modal-title {
    color: #d946a6;
    font-weight: 600;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
    padding: 30px;
}

/* Gallery Container */
[data-portfolio-gallery-target="mainContainer"] {
    height: 400px;
    min-height: 400px;
    max-height: 400px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 20px;
}

[data-portfolio-gallery-target="mainContainer"] img,
[data-portfolio-gallery-target="mainContainer"] iframe {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

[data-portfolio-gallery-target="mainContainer"] > div {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Thumbnails */
[data-portfolio-gallery-target="thumbnail"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

[data-portfolio-gallery-target="thumbnail"]:hover {
    transform: scale(1.05);
}

[data-portfolio-gallery-target="thumbnail"].border-primary {
    border-color: #d946a6 !important;
    box-shadow: 0 0 10px rgba(217, 70, 166, 0.3);
}

/* Scrollbar for modal body */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #d946a6;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #c44569;
}

/* Ensure thumbnails container fits */
[data-portfolio-gallery-target="thumbnailContainer"] {
    max-height: 100px;
}

/* Boutons de filtre */
.filter-btn {
    border: 1px solid #d946a6;
    color: #d946a6;
    background-color: transparent;
    transition: all 0.25s ease-in-out;
}

.filter-btn:hover,
.filter-btn.active {
    background-color: #d946a6;
    color: #fff;
    box-shadow: 0 4px 12px rgba(217, 70, 166, 0.3);
}

/* Carte portfolio : fondu sans écrasement de largeur */
.portfolio-item {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

/* État transitoire avant le display: none */
.portfolio-item.is-fading-out {
    opacity: 0;
    transform: scale(0.85);
    pointer-events: none;
}

/* Retrait total du flux DOM une fois le fondu terminé */
.portfolio-item.is-hidden {
    display: none !important;
}