/* AMC Secure motion layer — restrained macOS-like interactions */

html {
    scroll-behavior: auto;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: var(--amc-font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a,
button,
input,
select,
textarea,
.product-card,
.ui-portal-card,
.portal-section-link article,
.admin-nav a,
.checkout-link,
.search-submit-button {
    transition:
        transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 180ms cubic-bezier(0.22, 1, 0.36, 1),
        background-color 180ms ease,
        border-color 180ms ease,
        color 180ms ease,
        opacity 180ms ease;
}

button:active:not(:disabled),
a.button:active,
.hero-actions a:active,
.product-card button:active,
.cart-button:active {
    transform: scale(0.98);
}

.market-header,
.admin-sidebar {
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.product-card:hover,
.global-product-card:hover,
.ui-portal-card:hover,
.portal-section-link:hover article {
    transform: translateY(-2px);
    box-shadow: var(--amc-shadow-lift);
}

/* Only animate overlays when open — prevents refresh blink */
.inquiry-modal.is-open .inquiry-card,
.amc-copilot-panel:not([hidden]),
.payment-gateway-modal:not([hidden]) {
    animation: amcPanelIn 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes amcPanelIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.service-icon-cloud:hover .service-icon-track,
.client-logo-track:hover {
    animation-play-state: paused;
}

:focus-visible {
    outline: none;
    box-shadow: var(--amc-focus-ring);
}

.portal-shell,
.checkout-page,
.catalog-page {
    animation: amcPageIn 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes amcPageIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
