@keyframes navigation-enter {
    from { opacity: 0; transform: translateY(-0.75rem); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes hero-accent-enter {
    from { opacity: 0; transform: scale(0.96) rotate(-1deg); }
    to { opacity: 1; transform: scale(1) rotate(0); }
}

.navigation {
    animation: navigation-enter 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.motion-reveal {
    opacity: 0;
    transform: translateY(1.25rem);
    transition:
        opacity 520ms cubic-bezier(0.22, 1, 0.36, 1) var(--motion-delay, 0ms),
        transform 520ms cubic-bezier(0.22, 1, 0.36, 1) var(--motion-delay, 0ms);
    will-change: opacity, transform;
}

.motion-reveal.motion-visible {
    opacity: 1;
    transform: translateY(0);
    will-change: auto;
}

.hero__visual.motion-reveal {
    transform: scale(0.96) rotate(-1deg);
}

.hero__visual.motion-visible {
    transform: scale(1) rotate(0);
}

.project-card__image,
.document-media img {
    transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), filter 420ms ease;
}

.project-card:hover .project-card__image {
    transform: scale(1.025);
    filter: saturate(1.08);
}

.document-media {
    overflow: hidden;
}

.button,
.contact-submit,
.navigation__links a,
.text-link,
.project-card__link {
    transition-duration: 180ms;
    transition-timing-function: ease-out;
}

.button:active,
.contact-submit:active {
    transform: translateY(0) scale(0.98);
}

.navigation__links a {
    position: relative;
}

.navigation__links a::after {
    position: absolute;
    right: 0;
    bottom: -0.35rem;
    left: 0;
    height: 2px;
    background: var(--color-primary);
    content: "";
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 180ms ease-out;
}

.navigation__links a:hover::after,
.navigation__links a:focus-visible::after {
    transform: scaleX(1);
    transform-origin: left;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }

    .motion-reveal {
        opacity: 1;
        transform: none;
    }
}
