:root { --motion-ease: cubic-bezier(.22,.75,.25,1); }

@media (prefers-reduced-motion: no-preference) {
    .site-header { animation: header-in .8s var(--motion-ease) both; }
    .site-header::before { animation: edge-in 1.4s ease-out both; }
    .site-nav a { animation: nav-in .55s var(--motion-ease) both; animation-delay: .18s; }
    .site-nav a:nth-child(2) { animation-delay: .23s; }
    .site-nav a:nth-child(3) { animation-delay: .28s; }
    .site-nav a:nth-child(4) { animation-delay: .33s; }

    .rise { animation: content-in .85s var(--motion-ease) both; }
    .hero-copy h1.rise { animation-delay: .09s; }
    .hero-copy .delay-1 { animation-delay: .17s; }
    .hero-copy .delay-2 { animation-delay: .25s; }
    .hero-copy .delay-3 { animation-delay: .33s; }
    .hero-scene.rise { animation-duration: 1s; animation-delay: .24s; }
    .page-heading :is(.eyebrow,h1,.lead,.muted,.text-link),
    .contact-copy :is(.eyebrow,h1,.lead,.contact-telegram,.actions),
    .back-link { animation: content-in .75s var(--motion-ease) both; }
    .page-heading h1, .contact-copy h1 { animation-delay: .08s; }
    .page-heading .lead, .contact-copy .lead { animation-delay: .16s; }
    .page-heading :is(.muted,.text-link), .contact-copy :is(.contact-telegram,.actions) { animation-delay: .24s; }
    .project-filters { animation: content-in .75s var(--motion-ease) .22s both; }

    .btn, .icon-button { transition: scale .18s var(--motion-ease), translate .25s var(--motion-ease), background .2s, border-color .2s, box-shadow .25s; }
    .btn:active, .icon-button:active { scale: .96; }
    .text-link svg, .btn svg { transition: translate .25s var(--motion-ease); }
    .project-card.glass { transition: translate .35s var(--motion-ease), box-shadow .35s; }
    .scroll-reveal { opacity: 1; translate: none; transition: opacity .45s var(--motion-ease) var(--reveal-delay, 0ms), translate .45s var(--motion-ease) var(--reveal-delay, 0ms); }
    .scroll-reveal-pending { opacity: 0; translate: 0 10px; transition: none; }
    .scroll-reveal-instant { opacity: 1; translate: none; transition: none; }
    .showcase-panel:not([hidden]) { animation: content-in .45s var(--motion-ease); }
    .faq-item[open] p { animation: detail-in .35s var(--motion-ease); }
    .lightbox[open] { animation: dialog-in .35s var(--motion-ease); }
    .lightbox[open]::backdrop { animation: page-in .3s ease; }
    .admin-header { animation: page-in .5s ease both; }
    .login-card { animation: content-in .85s var(--motion-ease) both; }

    @media (hover: hover) and (pointer: fine) {
        .btn:hover { translate: 0 -2px; }
        .text-link:hover svg, .btn:hover svg { translate: 2px -2px; }
        .back-link:hover svg { translate: -3px 0; }
        .project-card.glass:hover { translate: 0 -4px; box-shadow: var(--glass-shadow), 0 16px 38px -22px rgba(255,255,255,.08); }
    }
    @media (max-width: 720px) {
        .site-nav.is-open { animation: menu-in .32s var(--motion-ease) both; transform-origin: top center; }
        .site-nav.is-open a { animation: nav-in .35s var(--motion-ease) both; }
        .site-nav.is-open a:nth-child(2) { animation-delay: .04s; }
        .site-nav.is-open a:nth-child(3) { animation-delay: .08s; }
        .site-nav.is-open a:nth-child(4) { animation-delay: .12s; }
    }
}

@keyframes header-in { from { opacity: 0; translate: 0 -10px; scale: .975; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes content-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes nav-in { from { opacity: 0; translate: 0 5px; } to { opacity: 1; translate: 0 0; } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes dialog-in { from { opacity: 0; transform: scale(.975); } to { opacity: 1; transform: none; } }
@keyframes detail-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes edge-in { from { opacity: .25; } to { opacity: 1; } }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .site-header, .site-nav, .site-nav a, .rise, .page-heading *, .contact-copy *, .back-link, .project-filters, .lightbox, .login-card, .admin-header { animation: none !important; }
    .scroll-reveal, .scroll-reveal-pending { opacity: 1; translate: none; transition: none; }
}
