/* ==========================================================================
   森人動態背景 – FP Floating Words & BG Slideshow
   ========================================================================== */

/* 1. 最底層：底片風格圖片輪播 */
#fp-bg-slideshow {
    position: fixed;
    inset: 0;
    z-index: -3; /* 確保在漂浮文字之下 */
    pointer-events: none;
    overflow: hidden;
    background-color: transparent;
}

.fp-bg-slide {
    position: absolute;
    inset: -5%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    
    /* 📸 新的：先色彩反轉 (invert) -> 再轉黑白 (grayscale) -> 調整透明度與對比 */
    filter: invert(100%) grayscale(100%) opacity(0.5) contrast(1.2);
    
    opacity: 0;
    transform: scale(1);
    transition: opacity 5s ease-in-out, transform 15s linear;
    will-change: opacity, transform;
}

.fp-bg-slide.active {
    opacity: 1;
    transform: scale(1.05); /* 緩慢放大 */
}

/* 2. 中間層：漂浮文字 */
#fp-bg-canvas {
    position: fixed;
    inset: 0;
    z-index: -2; /* 在圖片之上 */
    pointer-events: none;
    overflow: hidden;
}

.fp-float-word {
    position: absolute;
    white-space: nowrap;
    user-select: none;
    pointer-events: none;
    will-change: transform;
    line-height: 1;
}

/* 直排 */
.fp-float-word.is-vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* Reduce motion: 停止動畫 */
@media (prefers-reduced-motion: reduce) {
    .fp-float-word {
        animation: none !important;
    }
    .fp-bg-slide {
        transition: opacity 3s ease-in-out !important; /* 關閉縮放動畫，保留淡入淡出 */
        transform: none !important;
    }
}