/* transition.css */

#page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    pointer-events: none;
}

#page-transition-overlay.is-active {
    pointer-events: auto;
}

.page-paint-svg {
    width: 100%;
    height: 100%;
}

.page-paint-path {
    stroke-dasharray: 12000;
    stroke-dashoffset: 12000;
    /* Custom organic sweep easing for the paint drawing, slowed down */
    transition: stroke-dashoffset 1200ms cubic-bezier(0.45, 0, 0.15, 1);
    will-change: stroke-dashoffset;
    stroke: #ACB780; /* Override the HTML stroke color */
}

#page-transition-overlay.animating-in .page-paint-path {
    /* Covers the viewport entirely by completing the stroke */
    stroke-dashoffset: 0;
}

#page-transition-overlay.animating-out .page-paint-path {
    /* Reverses the stroke to unpaint the screen */
    stroke-dashoffset: 12000;
}

/* Ensure no transitions are applied when we snap back */
#page-transition-overlay.no-transition .page-paint-path {
    transition: none !important;
}

/* Prefers Reduced Motion: Simple Fade */
@media (prefers-reduced-motion: reduce) {
    #page-transition-overlay {
        background-color: var(--primary-color);
        opacity: 0;
        transition: opacity 400ms ease;
    }
    
    .page-paint-svg {
        display: none;
    }

    #page-transition-overlay.animating-in {
        opacity: 1;
    }

    #page-transition-overlay.animating-out {
        opacity: 0;
    }
}
