/* ========================================
   View Transitions -- Tab switching & pages
   ======================================== */

/* -- Cross-page view transitions (slide) -- */

@keyframes vt-slide-out {
    to {
        transform: translateX(-8%);
        opacity: 0;
    }
}

@keyframes vt-slide-in {
    from {
        transform: translateX(8%);
        opacity: 0;
    }
}

::view-transition-old(root) {
    animation: 0.3s cubic-bezier(0.4, 0, 0.2, 1) both vt-slide-out;
}

::view-transition-new(root) {
    animation: 0.3s cubic-bezier(0.4, 0, 0.2, 1) both vt-slide-in;
}

/* -- Tab section transitions (cross-fade + subtle slide) --
   Works with _base.css which sets .active-section { display: flex !important }
   Sections start hidden (display: none) and become visible via .active-section.
   The .vt-enter class triggers the opacity/transform animation. */

main>section[id^="section-"] {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

main>section[id^="section-"].active-section.vt-enter {
    opacity: 1;
    transform: translateY(0);
}

/* -- Reduced motion -- */

@media (prefers-reduced-motion: reduce) {

    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }

    main>section[id^="section-"] {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}