/**
 * MP Vision - Illustrations animées (SVG inline)
 * Vocabulaire commun à toutes les illustrations de includes/illustrations/*.php.
 * Animations CSS + SMIL ; mises en pause par js/site.js si prefers-reduced-motion.
 */

.ill {
    position: relative;
    margin: 0;
    width: 100%;
    max-width: 520px;
    margin-left: auto;
    aspect-ratio: 4 / 3;
}

.ill::before {
    content: "";
    position: absolute;
    inset: 8% 6%;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(124, 92, 246, 0.28), rgba(56, 189, 248, 0.08) 60%, transparent);
    filter: blur(20px);
    z-index: 0;
}

.ill svg {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Blocs */
.ill-node {
    fill: #15151d;
    stroke: rgba(226, 224, 255, 0.16);
    stroke-width: 1.2;
}

.ill-node--soft {
    fill: rgba(21, 21, 29, 0.7);
}

.ill-node--accent {
    fill: #17162a;
    stroke: url(#ill-grad);
    stroke-width: 1.6;
}

.ill-node--human {
    fill: rgba(34, 211, 238, 0.08);
    stroke: #22d3ee;
    stroke-width: 1.4;
}

/* Textes */
.ill-label {
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 13px;
    fill: #a3a1b8;
}

.ill-label--strong {
    font-family: 'Geist', system-ui, sans-serif;
    font-size: 15px;
    font-weight: 600;
    fill: #ecebf5;
}

.ill-label--accent {
    fill: #b4a9fb;
}

.ill-label--human {
    fill: #67e8f9;
}

/* Liens et flux */
.ill-link {
    fill: none;
    stroke: rgba(226, 224, 255, 0.14);
    stroke-width: 1.2;
}

.ill-flow {
    fill: none;
    stroke: url(#ill-grad);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-dasharray: 4 8;
    animation: ill-flow 1.6s linear infinite;
}

@keyframes ill-flow {
    to { stroke-dashoffset: -24; }
}

/* Tracé qui se dessine une fois visible */
.ill-draw {
    fill: none;
    stroke: url(#ill-grad);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.is-visible .ill-draw,
.ill.is-visible .ill-draw {
    animation: ill-draw 2.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--d, 0s);
}

@keyframes ill-draw {
    to { stroke-dashoffset: 0; }
}

/* Paquets de données (cercles qui suivent un chemin avec <animateMotion>) */
.ill-packet {
    fill: #c4b5fd;
    filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.9));
}

.ill-packet--blue {
    fill: #7dd3fc;
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.9));
}

/* Pulsation */
.ill-pulse {
    fill: none;
    stroke: #8b7cf8;
    stroke-width: 1.4;
    transform-box: fill-box;
    transform-origin: center;
    animation: ill-pulse 2.6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
    animation-delay: var(--d, 0s);
}

@keyframes ill-pulse {
    0% { opacity: 0.8; transform: scale(0.6); }
    100% { opacity: 0; transform: scale(1.8); }
}

/* Apparitions en séquence (boucle) */
.ill-seq {
    opacity: 0;
    animation: ill-seq var(--loop, 6s) ease-in-out infinite;
    animation-delay: var(--d, 0s);
}

@keyframes ill-seq {
    0%, 4% { opacity: 0; transform: translateY(4px); }
    10%, 82% { opacity: 1; transform: none; }
    92%, 100% { opacity: 0; }
}

/* Clignotement doux (curseur, voyant) */
.ill-blink {
    animation: ill-blink 1.1s steps(2, start) infinite;
}

@keyframes ill-blink {
    to { visibility: hidden; }
}

/* Flottement léger */
.ill-float {
    transform-box: fill-box;
    animation: ill-float 6s ease-in-out infinite;
    animation-delay: var(--d, 0s);
}

@keyframes ill-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Barres qui se remplissent (jauges, scores) */
.ill-bar {
    transform-box: fill-box;
    transform-origin: left center;
    transform: scaleX(0);
}

.is-visible .ill-bar,
.ill.is-visible .ill-bar {
    animation: ill-bar 1.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--d, 0s);
}

@keyframes ill-bar {
    to { transform: scaleX(var(--to, 1)); }
}

/* Rotation lente (orbites) */
.ill-spin {
    transform-box: view-box;
    animation: ill-spin 40s linear infinite;
}

@keyframes ill-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .ill *,
    .ill *::before {
        animation: none !important;
    }

    .ill-draw {
        stroke-dashoffset: 0;
    }

    .ill-seq {
        opacity: 1;
    }

    .ill-bar {
        transform: scaleX(var(--to, 1));
    }
}

/* ---------- Héros à deux colonnes (texte + illustration) ---------- */
.content-hero--illustrated .content-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

@media (max-width: 991px) {
    .content-hero--illustrated .content-hero__grid {
        grid-template-columns: 1fr;
    }

    .content-hero--illustrated .ill {
        max-width: 460px;
        margin: 0 auto;
    }
}

/* Illustrations dans les blocs d'offres */
.service-illustration .ill {
    max-width: 440px;
    margin: 0 0 1.5rem;
}
