/* =============================================================================
   VIVAPROD — Animations & Effets visuels
   ============================================================================= */

/* ─── REVEAL ON SCROLL ────────────────────────────────────────────────────── */
.reveal-up,
.reveal-left,
.reveal-right,
.reveal-scale {
    opacity: 0;
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

.reveal-up    { transform: translateY(40px); }
.reveal-left  { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }
.reveal-scale { transform: scale(0.95); }

.reveal-up.visible,
.reveal-left.visible,
.reveal-right.visible,
.reveal-scale.visible {
    opacity: 1;
    transform: none;
}

/* Délais de cascade */
[data-delay="100"] { transition-delay: 100ms; }
[data-delay="200"] { transition-delay: 200ms; }
[data-delay="300"] { transition-delay: 300ms; }
[data-delay="400"] { transition-delay: 400ms; }
[data-delay="500"] { transition-delay: 500ms; }
[data-delay="600"] { transition-delay: 600ms; }


/* ─── KINETIC TYPOGRAPHY HERO ─────────────────────────────────────────────── */
.hero__title-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(60px) rotate(2deg);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero__title-word.animated {
    opacity: 1;
    transform: none;
}

/* Badge hero */
.hero__badge {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.hero__badge.animated {
    opacity: 1;
    transform: none;
}

/* Sous-titre hero */
.hero__subtitle {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.6s, transform 0.6s ease 0.6s;
}
.hero__subtitle.animated {
    opacity: 1;
    transform: none;
}

/* CTA hero */
.hero__cta {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.8s, transform 0.6s ease 0.8s;
}
.hero__cta.animated {
    opacity: 1;
    transform: none;
}

/* Scroll indicator */
.hero__scroll {
    opacity: 0;
    transition: opacity 0.6s ease 1.2s;
}
.hero__scroll.animated { opacity: 1; }

/* Clients ticker */
.hero__clients {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 1s, transform 0.6s ease 1s;
}
.hero__clients.animated {
    opacity: 1;
    transform: none;
}


/* ─── COMPTEURS ANIMÉS ────────────────────────────────────────────────────── */
.stat__number {
    transition: none;
}
.stat__number.counting {
    display: inline-block;
}


/* ─── EFFET GLITCH ────────────────────────────────────────────────────────── */
.glitch {
    position: relative;
}
.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}
.glitch:hover::before {
    animation: glitch-1 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    color: var(--color-green-light);
    clip-path: polygon(0 30%, 100% 30%, 100% 50%, 0 50%);
    transform: translate(-2px, 0);
    opacity: 0.8;
}
.glitch:hover::after {
    animation: glitch-2 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    color: var(--color-orange);
    clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
    transform: translate(2px, 0);
    opacity: 0.6;
}
@keyframes glitch-1 {
    0%   { transform: translate(0); opacity: 0; }
    10%  { transform: translate(-2px, 0); opacity: 0.8; }
    20%  { transform: translate(2px, 0); opacity: 0; }
    30%  { transform: translate(-2px, 0); opacity: 0.8; }
    40%  { transform: translate(0); opacity: 0; }
    100% { transform: translate(0); opacity: 0; }
}
@keyframes glitch-2 {
    0%   { transform: translate(0); opacity: 0; }
    15%  { transform: translate(2px, 0); opacity: 0.6; }
    25%  { transform: translate(-2px, 0); opacity: 0; }
    35%  { transform: translate(2px, 0); opacity: 0.6; }
    45%  { transform: translate(0); opacity: 0; }
    100% { transform: translate(0); opacity: 0; }
}


/* ─── GRADIENT MESH ANIMÉ ─────────────────────────────────────────────────── */
@keyframes mesh-shift-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(30px, -20px) scale(1.05); }
    66%       { transform: translate(-20px, 15px) scale(0.98); }
}
@keyframes mesh-shift-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(-25px, 20px) scale(1.03); }
    66%       { transform: translate(20px, -15px) scale(1.06); }
}
@keyframes mesh-shift-3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%       { transform: translate(15px, 10px) scale(1.04); }
}

.hero__gradient-orb-1 {
    position: absolute;
    width: 60%;
    height: 70%;
    top: -10%;
    left: -10%;
    background: radial-gradient(ellipse, rgba(76,175,125,0.35) 0%, transparent 70%);
    animation: mesh-shift-1 12s ease-in-out infinite;
    pointer-events: none;
}
.hero__gradient-orb-2 {
    position: absolute;
    width: 50%;
    height: 60%;
    bottom: -10%;
    right: -5%;
    background: radial-gradient(ellipse, rgba(46,125,82,0.3) 0%, transparent 70%);
    animation: mesh-shift-2 15s ease-in-out infinite;
    pointer-events: none;
}
.hero__gradient-orb-3 {
    position: absolute;
    width: 40%;
    height: 50%;
    top: 30%;
    left: 40%;
    background: radial-gradient(ellipse, rgba(232,97,42,0.12) 0%, transparent 70%);
    animation: mesh-shift-3 10s ease-in-out infinite;
    pointer-events: none;
}


/* ─── PARTICULES CANVAS ───────────────────────────────────────────────────── */
#heroParticles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.4;
    pointer-events: none;
}


/* ─── LIGNE DÉCORATIVE ────────────────────────────────────────────────────── */
.deco-line {
    display: inline-block;
    position: relative;
}
.deco-line::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-green-dark), var(--color-green-light));
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.deco-line.visible::after,
.reveal-up.visible .deco-line::after { transform: scaleX(1); }


/* ─── HOVER CARD LIFT ─────────────────────────────────────────────────────── */
.card-lift {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
}
.card-lift:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 24px 60px rgba(0,0,0,0.15);
}


/* ─── MAGNETIC BUTTON ─────────────────────────────────────────────────────── */
.btn-magnetic {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* ─── TEXTE GRADIENT ANIMÉ ────────────────────────────────────────────────── */
.text-gradient-animated {
    background: linear-gradient(
        90deg,
        var(--color-green-light) 0%,
        var(--color-green-sage) 25%,
        var(--color-green-light) 50%,
        var(--color-orange-light) 75%,
        var(--color-green-light) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s linear infinite;
}
@keyframes gradient-shift {
    from { background-position: 0% center; }
    to   { background-position: 200% center; }
}


/* ─── BADGE PULSE ─────────────────────────────────────────────────────────── */
.badge-pulse {
    position: relative;
}
.badge-pulse::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: var(--color-green-light);
    opacity: 0;
    animation: badge-pulse 2.5s ease-in-out infinite;
    z-index: -1;
}
@keyframes badge-pulse {
    0%, 100% { opacity: 0; transform: scale(1); }
    50%       { opacity: 0.2; transform: scale(1.08); }
}


/* ─── LOADER PAGE ─────────────────────────────────────────────────────────── */
.page-loader {
    position: fixed;
    inset: 0;
    background: var(--color-bg-dark);
    z-index: 9997;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--space-6);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.page-loader__logo {
    width: 160px;
    opacity: 0;
    animation: loader-logo 0.6s ease 0.2s forwards;
}
@keyframes loader-logo {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}
.page-loader__bar {
    width: 200px;
    height: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
}
.page-loader__progress {
    height: 100%;
    background: linear-gradient(90deg, var(--color-green-light), var(--color-orange));
    border-radius: 2px;
    width: 0%;
    animation: loader-progress 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}
@keyframes loader-progress {
    from { width: 0%; }
    to   { width: 100%; }
}


/* ─── NOISE OVERLAY ───────────────────────────────────────────────────────── */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9996;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    mix-blend-mode: overlay;
}


/* ─── PREFERS REDUCED MOTION ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .reveal-up,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .hero__title-word,
    .hero__badge,
    .hero__subtitle,
    .hero__cta,
    .hero__scroll,
    .hero__clients {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .text-gradient-animated { animation: none; }
    .badge-pulse::before { animation: none; }
    .page-loader { display: none; }
    .hero__gradient-orb-1,
    .hero__gradient-orb-2,
    .hero__gradient-orb-3 { animation: none; }
}
