/* ============================================
   Saxho.net — Animations
   ============================================ */

/* --- Scroll Reveal --- */
.reveal {
    opacity: 0;
    transition: opacity var(--transition-slow), transform var(--transition-slow);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1 !important;
    transform: none;
}

.reveal-fade {
    opacity: 0;
}

.reveal-up {
    opacity: 0;
    transform: translateY(40px);
}

.reveal-down {
    opacity: 0;
    transform: translateY(-40px);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
}

/* Stagger delays for groups — ecart progressif pour effet 1…2…3 marque */
.reveal-delay-1 { transition-delay: 200ms; }
.reveal-delay-2 { transition-delay: 450ms; }
.reveal-delay-3 { transition-delay: 700ms; }
.reveal-delay-4 { transition-delay: 950ms; }
.reveal-delay-5 { transition-delay: 1200ms; }

/* --- Parallax --- */
[data-parallax] {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* --- Hero typed cursor --- */
.typed-cursor {
    display: inline-block;
    width: 3px;
    background-color: var(--c-secondary);
    margin-left: 2px;
    animation: cursor-blink 0.8s step-end infinite;
}

@keyframes cursor-blink {
    50% { opacity: 0; }
}

/* --- Scroll indicator --- */
.scroll-indicator {
    position: absolute;
    bottom: var(--sp-xl);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-sm);
    color: rgba(255, 255, 255, 0.5);
    font-size: var(--fs-xs);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    animation: scroll-bounce 2s ease-in-out infinite;
    z-index: 2;
}

.scroll-indicator__arrow {
    width: 24px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    position: relative;
}

.scroll-indicator__arrow::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background-color: var(--c-secondary);
    border-radius: var(--radius-full);
    animation: scroll-dot 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

@keyframes scroll-dot {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
    50% { transform: translateX(-50%) translateY(12px); opacity: 0.3; }
}

/* --- Floating geometric shapes (hero background) --- */
.geo-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.geo-shape {
    position: absolute;
    opacity: 0.06;
}

.geo-shape--circle {
    border-radius: 50%;
    border: 2px solid var(--c-primary-light);
}

.geo-shape--square {
    border: 2px solid var(--c-secondary);
    transform: rotate(45deg);
}

.geo-shape--triangle {
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 52px solid var(--c-tertiary);
    opacity: 0.04;
}

.geo-shape--1 {
    width: 120px;
    height: 120px;
    top: 15%;
    left: 8%;
    animation: geo-float-1 20s ease-in-out infinite;
}

.geo-shape--2 {
    width: 80px;
    height: 80px;
    top: 60%;
    right: 10%;
    animation: geo-float-2 25s ease-in-out infinite;
}

.geo-shape--3 {
    top: 35%;
    right: 20%;
    animation: geo-float-3 18s ease-in-out infinite;
}

.geo-shape--4 {
    width: 60px;
    height: 60px;
    bottom: 20%;
    left: 15%;
    animation: geo-float-2 22s ease-in-out infinite reverse;
}

.geo-shape--5 {
    width: 200px;
    height: 200px;
    top: 5%;
    right: 5%;
    animation: geo-float-1 30s ease-in-out infinite;
}

.geo-shape--6 {
    width: 40px;
    height: 40px;
    bottom: 30%;
    right: 30%;
    animation: geo-float-3 15s ease-in-out infinite;
}

@keyframes geo-float-1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, -30px) rotate(10deg); }
    50% { transform: translate(-10px, 20px) rotate(-5deg); }
    75% { transform: translate(15px, 10px) rotate(8deg); }
}

@keyframes geo-float-2 {
    0%, 100% { transform: translate(0, 0) rotate(45deg); }
    33% { transform: translate(-25px, 15px) rotate(55deg); }
    66% { transform: translate(15px, -20px) rotate(35deg); }
}

@keyframes geo-float-3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -25px); }
}

/* --- Pulse animation (for CTAs) --- */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 74, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(255, 107, 74, 0); }
}

.btn--pulse {
    animation: pulse-glow 2.5s ease-in-out infinite;
}

/* --- Gradient text --- */
.gradient-text {
    background: linear-gradient(135deg, var(--c-primary-light), var(--c-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Reduce motion for accessibility --- */
@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal-fade,
    .reveal-up,
    .reveal-down,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .scroll-indicator,
    .geo-shape,
    .typed-cursor {
        animation: none;
    }

    .btn--pulse {
        animation: none;
    }

    /* Desactiver le gradient titre anime */
    .hero__title {
        animation: none;
        -webkit-text-fill-color: var(--c-white);
        background: none;
    }

    /* Le canvas neural se desactive tout seul via JS */

    [data-parallax] {
        transform: none !important;
    }

    /* Masonry hover : pas de transition */
    /* Le JS verifie aussi prefersReducedMotion, ceci est un filet CSS */
    .masonry__card {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }

    /* Constellation : pas de transitions */
    .constellation__label,
    .constellation-svc__label {
        transition: none !important;
    }
}
