/* ============================================================
   LJ3D — animations.css
   Keyframes, effets néon, 3D hover, tracé layer by layer
   ============================================================ */

/* ============================================================
   KEYFRAMES GLOBAUX
   ============================================================ */

/* Pulsation point (badge hero) */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--lj3d-neon-blue); transform: scale(1); }
    50%       { opacity: 0.5; box-shadow: 0 0 16px var(--lj3d-neon-blue); transform: scale(1.4); }
}

/* Glow néon oscillant */
@keyframes neon-glow {
    0%, 100% { text-shadow: 0 0 10px var(--lj3d-neon-blue), 0 0 30px rgba(0, 195, 255, 0.5); }
    50%       { text-shadow: 0 0 20px var(--lj3d-neon-blue), 0 0 60px rgba(0, 195, 255, 0.8), 0 0 100px rgba(0, 195, 255, 0.3); }
}

/* Scintillement néon rouge */
@keyframes neon-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 0 0 10px var(--lj3d-neon-red), 0 0 30px rgba(255, 45, 85, 0.5);
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* Float (lévitation) */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33%       { transform: translateY(-12px) rotate(1deg); }
    66%       { transform: translateY(-6px) rotate(-0.5deg); }
}

/* Rotation lente */
@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Scan line descendante (effet radar) */
@keyframes scan-line {
    0%   { top: -5%; opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { top: 105%; opacity: 0; }
}

/* Apparition en fondu + glissement */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fade-left {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fade-right {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Tracé progressif de bordure (layer by layer) */
@keyframes draw-border-top {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0 0 0); }
}

@keyframes draw-border-right {
    from { clip-path: inset(0 0 100% 0); }
    to   { clip-path: inset(0 0 0 0); }
}

/* Barre de progression impression 3D */
@keyframes progress-pulse {
    0%, 100% { box-shadow: 0 0 10px var(--lj3d-neon-blue), 0 0 25px rgba(0,195,255,0.4); }
    50%       { box-shadow: 0 0 20px var(--lj3d-neon-blue), 0 0 50px rgba(0,195,255,0.7); }
}

/* Shimmer (reflet qui balaye) */
@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* Particules (points qui montent) */
@keyframes particle-rise {
    0%   { transform: translateY(0) scale(1); opacity: 0.8; }
    100% { transform: translateY(-80px) scale(0); opacity: 0; }
}

/* Clignotement curseur terminal */
@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* Glitch horizontal */
@keyframes glitch-h {
    0%   { clip-path: inset(0 0 95% 0); transform: translateX(0); }
    20%  { clip-path: inset(30% 0 50% 0); transform: translateX(-4px); }
    40%  { clip-path: inset(60% 0 20% 0); transform: translateX(4px); }
    60%  { clip-path: inset(10% 0 80% 0); transform: translateX(-2px); }
    80%  { clip-path: inset(50% 0 10% 0); transform: translateX(2px); }
    100% { clip-path: inset(0 0 95% 0); transform: translateX(0); }
}

/* Ondulation néon (border qui brille) */
@keyframes border-glow {
    0%, 100% { border-color: rgba(0, 195, 255, 0.3); box-shadow: 0 0 5px rgba(0,195,255,0.2); }
    50%       { border-color: rgba(0, 195, 255, 0.8); box-shadow: 0 0 20px rgba(0,195,255,0.5), inset 0 0 10px rgba(0,195,255,0.05); }
}

/* Tracé SVG (stroke) — utilisé en JS via dashoffset */
@keyframes svg-draw {
    to { stroke-dashoffset: 0; }
}

/* Rotation héro 3D lente */
@keyframes hero-rotate {
    0%   { transform: perspective(800px) rotateY(0deg); }
    50%  { transform: perspective(800px) rotateY(8deg); }
    100% { transform: perspective(800px) rotateY(0deg); }
}

/* ============================================================
   CLASSES D'ANIMATION UTILITAIRES
   ============================================================ */

/* Glow animé sur texte */
.lj3d-animate-glow {
    animation: neon-glow 3s ease-in-out infinite;
}

.lj3d-animate-glow-red {
    animation: neon-flicker 4s linear infinite;
}

/* Float */
.lj3d-animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Spin lent */
.lj3d-animate-spin {
    animation: spin-slow 20s linear infinite;
}

/* Fade in au chargement */
.lj3d-animate-fade-up {
    animation: fade-up 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.lj3d-animate-fade-up--delay-1 { animation-delay: 0.1s; }
.lj3d-animate-fade-up--delay-2 { animation-delay: 0.25s; }
.lj3d-animate-fade-up--delay-3 { animation-delay: 0.4s; }
.lj3d-animate-fade-up--delay-4 { animation-delay: 0.55s; }

/* Shimmer text (effet brillant) */
.lj3d-shimmer-text {
    background: linear-gradient(
        90deg,
        var(--lj3d-neon-white) 0%,
        var(--lj3d-neon-blue) 30%,
        var(--lj3d-neon-white) 50%,
        var(--lj3d-neon-red) 70%,
        var(--lj3d-neon-white) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s linear infinite;
}

/* ============================================================
   EFFET 3D HOVER CARTE PORTFOLIO
   ============================================================ */

/* Conteneur avec perspective 3D */
.lj3d-card-3d-wrap {
    perspective: 1000px;
    transform-style: preserve-3d;
}

/* La carte se transforme en JS via mousemove */
.lj3d-card {
    transform-style: preserve-3d;
    transition: transform 0.08s linear, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Effet de profondeur interne */
.lj3d-card__body,
.lj3d-card__image-wrap {
    transform: translateZ(0);
    transition: transform 0.08s linear;
}

.lj3d-card:hover .lj3d-card__image-wrap {
    transform: translateZ(10px);
}

.lj3d-card:hover .lj3d-card__body {
    transform: translateZ(15px);
}

/* Ombre 3D dynamique */
.lj3d-card.is-tilted {
    box-shadow:
        var(--tilt-shadow-x, 0) var(--tilt-shadow-y, 0) 40px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(0, 195, 255, 0.15);
}

/* ============================================================
   BARRE DE PROGRESSION "PRINT JOB"
   ============================================================ */

/* Barre active */
#lj3d-print-progress.animating {
    animation: progress-pulse 1s ease-in-out infinite;
}

/* Séquence d'entrée pour la page */
#lj3d-print-progress.page-load {
    transition: width 0.6s cubic-bezier(0.1, 0.4, 0.6, 1);
}

/* ============================================================
   TRACÉ LAYER BY LAYER — SECTIONS
   ============================================================ */

/* Bordure qui se trace de gauche à droite */
.lj3d-trace-border {
    position: relative;
}

.lj3d-trace-border::before,
.lj3d-trace-border::after {
    content: '';
    position: absolute;
    background: var(--lj3d-neon-blue);
    transition: none;
    box-shadow: 0 0 8px var(--lj3d-neon-blue);
}

/* Ligne supérieure (trace horizontale) */
.lj3d-trace-border::before {
    top: 0; left: 0;
    height: 1px;
    width: 0;
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Ligne gauche (trace verticale) */
.lj3d-trace-border::after {
    top: 0; left: 0;
    width: 1px;
    height: 0;
    transition: height 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.8s;
}

.lj3d-trace-border.is-visible::before { width: 100%; }
.lj3d-trace-border.is-visible::after  { height: 100%; }

/* Coin bas-droit tracé */
.lj3d-trace-border-full {
    position: relative;
    overflow: hidden;
}

.lj3d-trace-border-full .trace-top,
.lj3d-trace-border-full .trace-right,
.lj3d-trace-border-full .trace-bottom,
.lj3d-trace-border-full .trace-left {
    position: absolute;
    background: var(--lj3d-neon-blue);
    box-shadow: 0 0 6px var(--lj3d-neon-blue);
    opacity: 0;
    transition: all 0s;
}

/* Top */
.lj3d-trace-border-full .trace-top {
    top: 0; left: 0;
    height: 1px; width: 0;
}
/* Right */
.lj3d-trace-border-full .trace-right {
    top: 0; right: 0;
    width: 1px; height: 0;
}
/* Bottom */
.lj3d-trace-border-full .trace-bottom {
    bottom: 0; right: 0;
    height: 1px; width: 0;
}
/* Left */
.lj3d-trace-border-full .trace-left {
    bottom: 0; left: 0;
    width: 1px; height: 0;
}

/* Quand visible → tracé séquentiel */
.lj3d-trace-border-full.is-visible .trace-top {
    opacity: 1;
    width: 100%;
    transition: width 0.5s ease 0.1s, opacity 0s;
}
.lj3d-trace-border-full.is-visible .trace-right {
    opacity: 1;
    height: 100%;
    transition: height 0.4s ease 0.6s, opacity 0s 0.6s;
}
.lj3d-trace-border-full.is-visible .trace-bottom {
    opacity: 1;
    width: 100%;
    transition: width 0.5s ease 1s, opacity 0s 1s;
}
.lj3d-trace-border-full.is-visible .trace-left {
    opacity: 1;
    height: 100%;
    transition: height 0.4s ease 1.5s, opacity 0s 1.5s;
}

/* ============================================================
   EFFET GLITCH sur titres (déclenché au hover)
   ============================================================ */
.lj3d-glitch {
    position: relative;
}

.lj3d-glitch::before,
.lj3d-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    font: inherit;
    color: inherit;
}

.lj3d-glitch::before {
    color: var(--lj3d-neon-blue);
    text-shadow: 2px 0 var(--lj3d-neon-blue);
    clip-path: inset(0 0 0 0);
    animation: none;
}

.lj3d-glitch::after {
    color: var(--lj3d-neon-red);
    text-shadow: -2px 0 var(--lj3d-neon-red);
    clip-path: inset(0 0 0 0);
    animation: none;
}

.lj3d-glitch:hover::before {
    animation: glitch-h 0.6s steps(2, start) infinite;
    transform: translateX(-2px);
}
.lj3d-glitch:hover::after {
    animation: glitch-h 0.6s steps(2, start) infinite reverse;
    transform: translateX(2px);
}

/* ============================================================
   SCAN LINE HERO
   ============================================================ */
.lj3d-hero__scan {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg,
        transparent,
        rgba(0, 195, 255, 0.6),
        transparent
    );
    animation: scan-line 6s linear infinite;
    pointer-events: none;
    z-index: 3;
}

/* ============================================================
   PARTICULES NÉON FLOTTANTES
   ============================================================ */
.lj3d-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: particle-rise 3s ease-out infinite;
}

.lj3d-particle--blue {
    background: var(--lj3d-neon-blue);
    box-shadow: 0 0 10px var(--lj3d-neon-blue);
}

.lj3d-particle--red {
    background: var(--lj3d-neon-red);
    box-shadow: 0 0 10px var(--lj3d-neon-red);
}

/* ============================================================
   BARRE DE COMPÉTENCE / STAT (décoratif)
   ============================================================ */
.lj3d-stat-bar {
    position: relative;
    height: 3px;
    background: rgba(232, 244, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.4rem;
}

.lj3d-stat-bar__fill {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--lj3d-neon-blue), var(--lj3d-neon-red));
    box-shadow: 0 0 8px var(--lj3d-neon-blue);
    transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 2px;
}

/* Curseur buse sur la barre */
.lj3d-stat-bar__fill::after {
    content: '';
    position: absolute;
    right: -3px; top: -3px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--lj3d-neon-white);
    box-shadow: 0 0 12px var(--lj3d-neon-blue), 0 0 25px rgba(0,195,255,0.6);
}

/* ============================================================
   CURSEUR TERMINAL (effet type machine)
   ============================================================ */
.lj3d-typewriter::after {
    content: '█';
    display: inline-block;
    color: var(--lj3d-neon-blue);
    animation: blink-cursor 0.8s step-end infinite;
    margin-left: 2px;
    font-size: 0.8em;
}

/* ============================================================
   HOVER SCALE SIMPLE
   ============================================================ */
.lj3d-hover-scale {
    transition: transform var(--lj3d-transition);
}
.lj3d-hover-scale:hover {
    transform: scale(1.04);
}

/* ============================================================
   LOADING OVERLAY (transition de page)
   ============================================================ */
#lj3d-page-transition {
    position: fixed;
    inset: 0;
    background: var(--lj3d-bg);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--lj3d-space-md);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

#lj3d-page-transition.is-active {
    opacity: 1;
    pointer-events: all;
}

.lj3d-transition__logo {
    font-family: var(--lj3d-font-primary);
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.2em;
    color: var(--lj3d-neon-blue);
    text-shadow: var(--lj3d-glow-blue);
    animation: neon-glow 1.5s ease-in-out infinite;
}

.lj3d-transition__bar {
    width: 200px;
    height: 2px;
    background: rgba(232, 244, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.lj3d-transition__bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--lj3d-neon-blue), var(--lj3d-neon-red));
    box-shadow: 0 0 10px var(--lj3d-neon-blue);
    animation: shimmer 1s linear infinite;
    background-size: 200% auto;
    width: 100%;
}


