/* ========== EFFET DE VAGUE AVEC PARTICULES ========== */

/* Conteneur pour les particules */
.cursor-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

/* Particule individuelle */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFade 1.5s ease-out forwards;
}

@keyframes particleFade {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

/* Effet de vague au passage de la souris */
.wave-effect {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(106, 63, 102, 0.3) 0%, transparent 70%);
    animation: waveExpand 1s ease-out forwards;
}

@keyframes waveExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }

    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* ========== ANIMATION AMÉLIORÉE DE LA PLUME ========== */

.feather {
    position: fixed;
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    /* Transition gérée par JS pour fluidité Frame-by-Frame */
    transition: none;
}

.feather.visible {
    opacity: 1;
}

.feather svg {
    filter: drop-shadow(0 4px 16px rgba(106, 63, 102, 0.6));
    /* Animation gérée par JS */
    /* animation: featherFloat 2s ease-in-out infinite; */
}

/* Trait de soulignement dessiné par la plume */
.title-underline {
    position: absolute;
    bottom: -12px;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-plum), var(--color-rose-quartz));
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(106, 63, 102, 0.4);
    pointer-events: none;
    /* Pas de transition width car géré par JS */
    transition: none;
}

.title-underline.drawing {
    animation: drawLine 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes drawLine {
    0% {
        width: 0;
        opacity: 0.5;
    }

    100% {
        width: 100%;
        opacity: 1;
    }
}

/* Suppression de l'ancien système de soulignement */
.section-title::after,
.hero-title::after {
    display: none;
}

/* ========== ANIMATIONS WEBFLOW-STYLE ========== */

/* Animations de base */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(-80px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(80px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-5deg) scale(0.9);
    }

    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Classes d'animation au scroll */
.scroll-animate {
    opacity: 0;
}

.scroll-animate.fade-up {
    transform: translateY(60px);
}

.scroll-animate.slide-left {
    transform: translateX(-80px);
}

.scroll-animate.slide-right {
    transform: translateX(80px);
}

.scroll-animate.scale-in {
    transform: scale(0.8);
}

.scroll-animate.rotate-in {
    transform: rotate(-5deg) scale(0.9);
}

/* État "in-view" */
.scroll-animate.in-view {
    opacity: 1;
    animation-duration: 1s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: forwards;
}

.scroll-animate.fade-up.in-view {
    animation-name: fadeUp;
}

.scroll-animate.slide-left.in-view {
    animation-name: slideLeft;
}

.scroll-animate.slide-right.in-view {
    animation-name: slideRight;
}

.scroll-animate.scale-in.in-view {
    animation-name: scaleIn;
}

.scroll-animate.rotate-in.in-view {
    animation-name: rotateIn;
}

/* Expertise Cards - Animations avancées */
.expertise-card {
    position: relative;
    overflow: hidden;
}

.expertise-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.expertise-card:hover::before {
    left: 100%;
}

.expertise-icon {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--color-plum), var(--color-rose-quartz));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.expertise-card:hover .expertise-icon {
    transform: scale(1.1) rotate(10deg);
}

.expertise-icon svg {
    color: white;
}

/* Project Cards - Overlay Animation */
.project-image {
    position: relative;
    overflow: hidden;
}

.project-image img {
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .project-image img {
    transform: scale(1.2) rotate(2deg);
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(106, 63, 102, 0.95) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-view {
    padding: 16px 32px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--color-plum);
    font-weight: 600;
    transform: translateY(20px);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .project-view {
    transform: translateY(0);
}

/* Writing Cards - Image Zoom */
.writing-image img {
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.writing-card:hover .writing-image img {
    transform: scale(1.15);
    filter: brightness(1.1);
}

/* About Skills - Logo Animation */
.about-skill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(229, 200, 216, 0.3);
    backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-skill:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 20px 40px rgba(106, 63, 102, 0.2);
    border-color: var(--color-rose-quartz);
}

.skill-logo {
    width: 48px;
    height: 48px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-skill:hover .skill-logo {
    transform: scale(1.2) rotate(5deg);
}

/* Service Cards - Number Animation */
.service-number {
    font-family: var(--font-display);
    font-size: 72px;
    font-weight: 700;
    color: var(--color-plum);
    opacity: 0.1;
    position: absolute;
    top: 20px;
    right: 20px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover .service-number {
    opacity: 0.2;
    transform: scale(1.1) rotate(-5deg);
}

/* Parallax Orbs */
.section-orb,
.hero-orb {
    transition: transform 0.3s ease-out;
    will-change: transform;
}

/* Hover Effects Avancés */
.expertise-card,
.project-card,
.writing-card,
.service-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.expertise-card:hover,
.project-card:hover,
.writing-card:hover,
.service-card:hover {
    transform: translateY(-12px);
}

/* Shimmer Effect sur les boutons */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

/* Glow Effect */
@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(106, 63, 102, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(106, 63, 102, 0.6);
    }
}

.btn-primary:hover {
    animation: glow 2s ease-in-out infinite;
}

/* Stagger Animation Delays */
.scroll-animate[data-delay="0"] {
    transition-delay: 0s;
}

.scroll-animate[data-delay="80"] {
    transition-delay: 0.08s;
}

.scroll-animate[data-delay="100"] {
    transition-delay: 0.1s;
}

.scroll-animate[data-delay="120"] {
    transition-delay: 0.12s;
}

.scroll-animate[data-delay="150"] {
    transition-delay: 0.15s;
}

.scroll-animate[data-delay="200"] {
    transition-delay: 0.2s;
}

.scroll-animate[data-delay="300"] {
    transition-delay: 0.3s;
}

.scroll-animate[data-delay="400"] {
    transition-delay: 0.4s;
}

/* Micro-interactions */
.project-tag,
.about-value {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-tag:hover,
.about-value:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(106, 63, 102, 0.2);
}

/* Social Links Animation */
.social-link {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-link:hover {
    transform: translateX(12px);
    background: rgba(247, 243, 239, 1);
}

.social-link svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-link:hover svg {
    transform: scale(1.2) rotate(5deg);
}

/* Form Inputs Animation */
.form-group input:focus,
.form-group textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(106, 63, 102, 0.15);
}

/* Loading Spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spin 0.6s linear infinite;
}

/* Responsive Animations */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Performance Optimizations */
.scroll-animate,
.feather,
.section-orb,
.hero-orb {
    will-change: transform, opacity;
}

.expertise-icon,
.skill-logo,
.project-image img,
.writing-image img {
    will-change: transform;
}