/* Shared by every project page: transitions + the way back. Each page styles everything else itself. */
@view-transition { navigation: auto; }

::view-transition-group(*) { animation-duration: .6s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }

/* Arriving from the hub: the project page opens as a circle from the point that was clicked. */
html.vt-reveal::view-transition-old(root) { animation: none; }
html.vt-reveal::view-transition-new(root) { animation: vt-reveal .8s cubic-bezier(.7, 0, .2, 1) both; }
@keyframes vt-reveal {
    from { clip-path: circle(0% at var(--vt-x, 50%) var(--vt-y, 50%)); }
    to   { clip-path: circle(150% at var(--vt-x, 50%) var(--vt-y, 50%)); }
}

/* Close: top right, back to the hub. Pages only recolor it. */
.close {
    position: fixed; z-index: 50;
    top: max(16px, env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px));
    width: 44px; height: 44px; border-radius: 50%;
    display: grid; place-items: center;
    color: inherit; text-decoration: none;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    transition: transform .25s cubic-bezier(.2, .8, .2, 1), background-color .2s;
    animation: close-in .4s .45s cubic-bezier(.2, .8, .2, 1) backwards;
}
.close svg { width: 18px; height: 18px; }
.close:hover { transform: rotate(90deg); }
.close:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
@keyframes close-in { from { opacity: 0; transform: scale(.6) rotate(-90deg); } }

@media (prefers-reduced-motion: reduce) {
    .close { animation: none; transition: none; }
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
