/* Décoration uniquement, sans effet sur le contenu ni la navigation. */
.du-halloween {
    --du-halloween-spider-width: 32px;
    position: fixed;
    inset-block-start: 0;
    inset-inline-start: auto;
    width: 88px;
    height: 128px;
    z-index: 1060;
    pointer-events: none;
    user-select: none;
    overflow: visible;
}
.du-halloween--left {
    left: 0;
    right: auto;
}
.du-halloween--right {
    left: auto;
    right: 0;
}
.du-halloween .du-halloween-web {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 88px;
    height: 88px;
    opacity: 0.14;
}
.du-halloween--right .du-halloween-web {
    transform: scaleX(-1);
}
.du-halloween .du-halloween-hanging {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--du-halloween-spider-width);
    height: 120px;
}
.du-halloween--right .du-halloween-hanging {
    left: auto;
    right: 0;
}
.du-halloween .du-halloween-silk {
    position: absolute;
    top: 0;
    left: 50%;
    display: block;
    width: 1px;
    height: 28px;
    background: #10263C;
    opacity: 0.45;
    transform-origin: 50% 0;
}
.du-halloween .du-halloween-spider {
    position: absolute;
    top: 28px;
    left: 0;
    display: block;
    width: var(--du-halloween-spider-width);
    max-width: none;
    height: auto;
    transform-origin: 50% 0;
}
.du-halloween--animated .du-halloween-spider {
    animation: du-halloween-spider 4.8s ease-in-out 1 both;
}
.du-halloween--animated .du-halloween-silk {
    animation: du-halloween-silk 4.8s ease-in-out 1 both;
}
@keyframes du-halloween-spider {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    28% { transform: translateY(28px) rotate(5deg); }
    50% { transform: translateY(16px) rotate(-4deg); }
    72% { transform: translateY(23px) rotate(3deg); }
}
@keyframes du-halloween-silk {
    0%, 100% { transform: scaleY(1); }
    28% { transform: scaleY(2); }
    50% { transform: scaleY(1.5714286); }
    72% { transform: scaleY(1.8214286); }
}
@media (max-width: 767px) {
    .du-halloween {
        --du-halloween-spider-width: 24px;
        width: 60px;
        height: 112px;
    }
    .du-halloween .du-halloween-web {
        width: 60px;
        height: 60px;
        opacity: 0.1;
    }
    .du-halloween .du-halloween-hanging { left: 0; }
    .du-halloween--right .du-halloween-hanging { left: auto; right: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .du-halloween--animated .du-halloween-spider,
    .du-halloween--animated .du-halloween-silk {
        animation: none;
    }
}
@media print {
    .du-halloween { display: none; }
}

/* Apparition facultative. La page reste cliquable et ne change pas de taille. */
.du-halloween-michael[hidden] { display: none !important; }
.du-halloween-michael {
    position: fixed;
    inset: 0;
    z-index: 1080;
    overflow: hidden;
    pointer-events: none;
    isolation: isolate;
    user-select: none;
}
.du-halloween-michael .du-halloween-michael__shade {
    position: absolute;
    inset: 0;
    background: #09182D;
    opacity: 0;
}
.du-halloween-michael .du-halloween-michael__stage {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    transform-origin: 50% 50%;
    opacity: 0;
}
.du-halloween-michael .du-halloween-michael__image {
    display: block;
    width: auto;
    height: min(78vh, 850px);
    height: min(78svh, 850px);
    max-width: 90vw;
    object-fit: contain;
}
.du-halloween-michael .du-halloween-michael__close {
    position: absolute;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 16px;
    margin: 0;
    background: #10263C;
    color: #FFFFFF;
    border: 1px solid #FFFFFF;
    border-radius: 7px;
    font: 600 14px/1.4 system-ui, sans-serif;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 12px #09182D26;
}
.du-halloween-michael .du-halloween-michael__close:hover { background: #1D3A54; }
.du-halloween-michael .du-halloween-michael__close:focus-visible {
    outline: 3px solid #EC591E;
    outline-offset: 3px;
}
.du-halloween-michael--playing .du-halloween-michael__stage {
    will-change: transform, opacity, filter;
    animation: du-halloween-michael-rush 1.5s cubic-bezier(.4, 0, .3, 1) 1 both;
}
.du-halloween-michael--playing .du-halloween-michael__shade {
    animation: du-halloween-michael-shade 1.5s ease-out 1 both;
}
@keyframes du-halloween-michael-rush {
    0% { transform: scale(.05); opacity: 0; filter: blur(8px); }
    18% { transform: scale(.16); opacity: 1; filter: blur(3px); }
    58% { transform: scale(1.08); opacity: 1; filter: blur(0); }
    74% { transform: scale(1.2); opacity: 1; filter: blur(0); }
    100% { transform: scale(1.28); opacity: 0; filter: blur(1px); }
}
@keyframes du-halloween-michael-shade {
    0%, 100% { opacity: 0; }
    28%, 74% { opacity: .16; }
}
@media (prefers-reduced-motion: reduce) {
    .du-halloween-michael { display: none !important; }
    .du-halloween-michael--playing .du-halloween-michael__stage,
    .du-halloween-michael--playing .du-halloween-michael__shade { animation: none; }
}
@media print {
    .du-halloween-michael { display: none !important; }
}
