/* ==========================================================================
   GAMASUSCO PAGE TRANSITIONS - CINEMATIC STYLES
   Theme-Aware Solid Color Animation:
   - White theme (Light mode / data-theme="light") -> Solid Black (#000000)
   - Black theme (Dark mode / data-theme="dark")   -> Solid White (#ffffff)
   ========================================================================== */

/* Dark Theme (Black Theme / Default) -> Pure White Animation */
:root,
html[data-theme="dark"],
body[data-theme="dark"],
html:not([data-theme="light"]) {
    --pts-color: #ffffff;
}

/* Light Theme (White Theme) -> Pure Black Animation */
:root[data-theme="light"],
html[data-theme="light"],
body[data-theme="light"] {
    --pts-color: #000000;
}

/* Zero-flash immediate cover applied before DOM paint */
html.pts-cover-active::before {
    content: '';
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: var(--pts-color) !important;
    background-color: var(--pts-color) !important;
    z-index: 999998;
    pointer-events: none;
}

/* Root overlay container */
#pts-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    pointer-events: none;
    overflow: hidden;
    contain: layout style;
    isolation: isolate;
    display: none;
}

#pts-overlay.pts-active {
    display: block;
    pointer-events: auto;
}

/* Individual transition piece */
.pts-piece {
    position: absolute;
    background: var(--pts-color) !important;
    background-color: var(--pts-color) !important;
    box-sizing: border-box;
    border: none !important;
    outline: none !important;
    will-change: transform, clip-path, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-style: flat;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    #pts-overlay, html.pts-cover-active::before {
        display: none !important;
        animation: none !important;
        transition: none !important;
    }
}
