/* =========================================================
   Commerce Operations Group - Global Animation Layer
   File: global-animation.css
   ========================================================= */

/* Base transition system */
.cog-card,
.cog-btn,
.cog-service-card,
.cog-case-card,
.cog-step,
.cog-stat,
.cog-feature,
.cog-problem,
.cog-solution,
.cog-process-card {
    transition:
        transform 0.28s ease,
        box-shadow 0.28s ease,
        border-color 0.28s ease,
        background-color 0.28s ease,
        color 0.28s ease;
}

/* Hero entrance */
.cog-hero .cog-eyebrow,
.cog-hero h1,
.cog-hero p,
.cog-hero .cog-btn-row,
.cog-hero .cog-hero-actions,
.cog-hero .cog-hero-meta {
    opacity: 0;
    transform: translateY(18px);
    animation: cogHeroFadeUp 0.75s ease forwards;
}

.cog-hero .cog-eyebrow {
    animation-delay: 0.05s;
}

.cog-hero h1 {
    animation-delay: 0.14s;
}

.cog-hero p {
    animation-delay: 0.24s;
}

.cog-hero .cog-btn-row,
.cog-hero .cog-hero-actions {
    animation-delay: 0.34s;
}

.cog-hero .cog-hero-meta {
    animation-delay: 0.44s;
}

@keyframes cogHeroFadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

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

/* Subtle hero background movement */
.cog-hero-bg::before {
    transform: scale(1.03);
    animation: cogHeroImageSettle 1.4s ease forwards;
}

@keyframes cogHeroImageSettle {
    from {
        transform: scale(1.06);
        opacity: 0.82;
    }

    to {
        transform: scale(1.03);
        opacity: 1;
    }
}

/* Premium card hover */
.cog-card:hover,
.cog-service-card:hover,
.cog-case-card:hover,
.cog-step:hover,
.cog-feature:hover,
.cog-problem:hover,
.cog-solution:hover,
.cog-process-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 45px rgba(8, 17, 31, 0.14);
    border-color: rgba(185, 151, 91, 0.45);
}

/* Gold accent line on hover */
.cog-card,
.cog-service-card,
.cog-case-card,
.cog-feature,
.cog-process-card {
    position: relative;
    overflow: hidden;
}

.cog-card::before,
.cog-service-card::before,
.cog-case-card::before,
.cog-feature::before,
.cog-process-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--cog-gold), transparent);
    opacity: 0;
    transform: scaleX(0.35);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.cog-card:hover::before,
.cog-service-card:hover::before,
.cog-case-card:hover::before,
.cog-feature:hover::before,
.cog-process-card:hover::before {
    opacity: 1;
    transform: scaleX(1);
}

/* Button hover animation */
.cog-btn {
    position: relative;
    overflow: hidden;
}

.cog-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(8, 17, 31, 0.18);
}

.cog-btn::after {
    content: "→";
    display: inline-block;
    margin-left: 8px;
    transition: transform 0.25s ease;
}

.cog-btn:hover::after {
    transform: translateX(4px);
}

/* Scroll reveal - starting state */
.cog-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.72s ease, transform 0.72s ease;
    will-change: opacity, transform;
}

/* Scroll reveal - visible state */
.cog-reveal.cog-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered reveal inside common grids */
.cog-grid .cog-reveal:nth-child(1),
.cog-grid-3 .cog-reveal:nth-child(1),
.cog-grid-4 .cog-reveal:nth-child(1) {
    transition-delay: 0.04s;
}

.cog-grid .cog-reveal:nth-child(2),
.cog-grid-3 .cog-reveal:nth-child(2),
.cog-grid-4 .cog-reveal:nth-child(2) {
    transition-delay: 0.12s;
}

.cog-grid .cog-reveal:nth-child(3),
.cog-grid-3 .cog-reveal:nth-child(3),
.cog-grid-4 .cog-reveal:nth-child(3) {
    transition-delay: 0.20s;
}

.cog-grid .cog-reveal:nth-child(4),
.cog-grid-3 .cog-reveal:nth-child(4),
.cog-grid-4 .cog-reveal:nth-child(4) {
    transition-delay: 0.28s;
}

/* Subtle image polish */
.cog-image,
.cog-media img,
.cog-section img {
    transition: transform 0.45s ease, box-shadow 0.45s ease;
}

.cog-media:hover img,
.cog-image:hover,
.cog-section img:hover {
    transform: scale(1.015);
}

/* Disable hover movement on mobile */
@media (max-width: 768px) {
    .cog-card:hover,
    .cog-service-card:hover,
    .cog-case-card:hover,
    .cog-step:hover,
    .cog-feature:hover,
    .cog-problem:hover,
    .cog-solution:hover,
    .cog-process-card:hover {
        transform: none;
    }

    .cog-section img:hover,
    .cog-media:hover img,
    .cog-image:hover {
        transform: none;
    }
}

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

    .cog-reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* =========================================================
   Hero Button Layout Fix
   ========================================================= */

.cog-hero .cog-btn-row,
.cog-hero .cog-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 32px;
}

.cog-hero .cog-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    line-height: 1.1;
    white-space: nowrap;
    margin: 0 !important;
}

/* Prevent the animation arrow from affecting layout too much */
.cog-hero .cog-btn::after {
    margin-left: 8px;
    line-height: 1;
}

/* Mobile button stacking */
@media (max-width: 640px) {
    .cog-hero .cog-btn-row,
    .cog-hero .cog-hero-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-top: 28px;
    }

    .cog-hero .cog-btn {
        width: 100%;
        max-width: 320px;
    }
}