/* --- OPTIMIZED CURSOR SETTINGS --- */

/* Styles de base (cachés par défaut pour éviter le "coincé en haut" sur mobile/tablette) */
.custom-cursor-arrow,
.custom-cursor-orbit {
    display: none;
    /* Caché par défaut */
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    will-change: transform;
    /* Optimisation performance */
}

.custom-cursor-arrow {
    width: 24px;
    height: 24px;
    z-index: 10000;
    transform: translate(-12px, -12px);
    /* Center offset */
}

.custom-cursor-orbit {
    width: 40px;
    height: 40px;
    z-index: 9999;
    transform: translate(-20px, -20px);
    /* Center offset */
}

.custom-cursor-arrow svg {
    width: 100%;
    height: 100%;
}

.orbit-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: orbitRotate 3s linear infinite, colorChange 3s linear infinite;
    filter: drop-shadow(0 0 4px currentColor);
}

/* Animations globales */
@keyframes orbitRotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg) translateX(20px);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg) translateX(20px);
    }
}

@keyframes colorChange {
    0% {
        background: #00b894;
    }

    33% {
        background: #fdcb6e;
    }

    66% {
        background: #ff4d4d;
    }

    100% {
        background: #00b894;
    }
}

/* Activation sur Desktop uniquement (Souris présente + Pas de préférence mouvement réduit) */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    body {
        cursor: none;
    }

    .custom-cursor-arrow,
    .custom-cursor-orbit {
        display: block;
        /* Afficher le curseur personnalisé */
    }

    /* Hover state - faster rotation + checkmark */
    body.cursor-hover .orbit-dot {
        animation: orbitRotate 1s linear infinite, colorChange 3s linear infinite;
    }
}

/* Fallback for reduced motion preference or touch devices */
@media (hover: none),
(prefers-reduced-motion: reduce) {

    .custom-cursor-arrow,
    .custom-cursor-orbit {
        display: none !important;
    }

    body {
        cursor: auto !important;
    }
}

/* --- BASE STYLES --- */
html {
    scroll-padding-top: 100px;
}

body {
    background-color: #f5f6fa;
    color: #2d3436;
    overflow-x: hidden;
}

/* Mesh Gradient Background */
.mesh-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(at 0% 0%, hsla(168, 76%, 46%, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, hsla(355, 87%, 65%, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(43, 97%, 71%, 0.15) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(192, 100%, 50%, 0.1) 0px, transparent 50%);
    filter: blur(40px);
    /* Fallback */
    /* Hardware acceleration hack */
    transform: translateZ(0);
}

@media (prefers-reduced-motion: reduce) {
    .mesh-bg {
        filter: blur(10px);
        /* Cheaper blur */
        background: #f5f6fa;
        /* Simpler solid background if needed, but keeping gradient with less blur is usually fine */
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Typography */
h1,
h2,
h3,
h4 {
    letter-spacing: -0.03em;
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Hover Effects */
.card-hover {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
}

/* Accordion Utilities */
.accordion-content {
    transition: grid-template-rows 0.5s ease-out;
}

/* Tab Navigation Styles */
.vision-tab {
    background: transparent;
    color: #718096;
    position: relative;
    overflow: hidden;
}

.vision-tab.active {
    background: transparent;
    color: white;
}

.vision-tab:not(.active):hover {
    color: #2a9d8f;
    background: rgba(42, 157, 143, 0.05);
}

/* Dynamic Animated Border on Hover */
.vision-tab::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid #2a9d8f;
    border-radius: 0.75rem;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
    z-index: 5;
}

.vision-tab:not(.active):hover::after {
    opacity: 0.5;
    transform: scale(1);
}

/* Tab Content */
.tab-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.tab-content.active {
    opacity: 1;
    transform: translateY(0);
}

/* Hero Background Animation - Optimized */
@keyframes heroZoom {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.animate-hero-zoom {
    animation: heroZoom 25s ease-in-out infinite alternate;
}

/* Blob Animations - Simplified */
@keyframes blobby {

    0%,
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }

    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

@keyframes blobby-alt {

    0%,
    100% {
        border-radius: 40% 60% 60% 40% / 60% 30% 70% 40%;
        transform: translate(0, 0);
    }

    50% {
        border-radius: 60% 40% 30% 70% / 30% 60% 70% 60%;
        transform: translate(1%, -1%);
    }
}

.animate-blobby {
    animation: blobby 18s ease-in-out infinite;
}

.animate-blobby-2 {
    animation: blobby-alt 20s ease-in-out infinite alternate;
}

/* --- PERFORMANCE FLAGGING & REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {

    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
        background-attachment: initial !important;
    }

    /* Disable specific heavy animations */
    .animate-blobby,
    .animate-blobby-1,
    .animate-blobby-2,
    .animate-hero-zoom,
    .animate-logo-colors {
        animation: none !important;
        transform: none !important;
    }

    /* Simplify Reveal */
    .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    /* Disable Custom Cursor */
    .custom-cursor-arrow,
    .custom-cursor-orbit {
        display: none !important;
    }

    body {
        cursor: auto !important;
    }
}

/* Header Logo Animation */
@keyframes logoColors {

    0%,
    100% {
        color: #00b894;
    }

    33% {
        color: #fdcb6e;
    }

    66% {
        color: #ff4d4d;
    }
}

.animate-logo-colors {
    animation: logoColors 8s infinite linear;
}