/* CODE Coworking — motion-only enhancement layer (v1.0.0)
   The original Quicksand font, colours, sizing, images, grids and content are intentionally untouched.
   Remove this CSS/JS and their includes to restore the exact previous behaviour. */

/* Sticky navigation preserves original dimensions/colours; shadow appears only after scrolling. */
nav.navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    transition: box-shadow .25s ease;
}
nav.navbar.code-nav-scrolled { box-shadow: 0 4px 16px rgba(0,0,0,.10); }

/* The original Bootstrap carousel remains fully operable via manual controls. */
#carouselExampleCaptions .code-hero-picture { display: block; width: 100%; overflow: hidden; }
#carouselExampleCaptions .code-hero-picture img { display: block; width: 100%; height: auto; }
#carouselExampleCaptions .carousel-item.active .code-hero-picture img {
    animation: code-hero-breathe 6.5s ease-out both;
    transform-origin: center center;
}
@keyframes code-hero-breathe {
    from { transform: scale(1); }
    to { transform: scale(1.014); }
}
/* Only when JS and IntersectionObserver are available: otherwise content remains visible. */
.code-motion-ready .code-reveal {
    opacity: 0;
    transform: translate3d(0, 13px, 0);
    transition: opacity .56s ease-out, transform .56s cubic-bezier(.2,.7,.2,1);
    transition-delay: var(--code-reveal-delay, 0ms);
}
.code-motion-ready .code-reveal.code-is-visible {
    opacity: 1;
    transform: none;
}

/* Hover treatment only: no changes to pricing card dimensions, backgrounds or borders. */
.code-motion-card {
    transition: transform .22s ease, box-shadow .22s ease;
    will-change: auto;
}
@media (hover: hover) and (pointer: fine) {
    .code-motion-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 24px rgba(0,0,0,.11) !important;
    }
    .masonry-item { overflow: hidden; border-radius: 5px; }
    .masonry-item img { transition: transform .3s ease, filter .3s ease !important; }
    .masonry-item:hover img { transform: scale(1.025); }
    /* Existing yellow/black button colours remain unchanged. */
    .code-motion-cta {
        transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
    }
    .code-motion-cta:hover {
        transform: translateY(-2px);
        box-shadow: 0 7px 18px rgba(0,0,0,.12);
    }
}
.code-gallery-picture { display: block; }
.code-gallery-picture img { display: block; width: 100%; height: auto; }

/* Footer/logo are unchanged at rest; a quick first-visit fade adds subtle polish. */
.navbar-logo { animation: code-logo-enter .55s ease-out both; }
@keyframes code-logo-enter {
    from { opacity: .7; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}
/* Bootstrap handles the menu collapse. These only soften link entry after it opens. */
#navbarToggleExternalContent.show .nav-item { animation: code-menu-enter .26s ease-out both; }
#navbarToggleExternalContent.show .nav-item:nth-child(2) { animation-delay: 30ms; }
#navbarToggleExternalContent.show .nav-item:nth-child(3) { animation-delay: 60ms; }
#navbarToggleExternalContent.show .nav-item:nth-child(4) { animation-delay: 90ms; }
#navbarToggleExternalContent.show .nav-item:nth-child(5) { animation-delay: 120ms; }
#navbarToggleExternalContent.show .nav-item:nth-child(6) { animation-delay: 150ms; }
@keyframes code-menu-enter {
    from { opacity: .7; transform: translateY(-3px); }
    to { opacity: 1; transform: none; }
}
/* WCAG-friendly focus indication, shown only on keyboard navigation. */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible {
    outline: 2px solid var(--color-highlight-yellow, #f8cb2e) !important;
    outline-offset: 3px;
}
/* No movement on touch/low-motion devices; avoid clipping drop-downs on mobile. */
@media (max-width: 767.98px) {
    .code-motion-ready .code-reveal { transform: translate3d(0, 7px, 0); transition-duration: .4s; }
    .code-motion-ready .code-reveal.code-is-visible { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    nav.navbar, .code-motion-card, .code-motion-cta, .masonry-item img {
        transition: none !important;
    }
    .code-motion-ready .code-reveal {
        opacity: 1 !important; transform: none !important; transition: none !important;
    }
    #carouselExampleCaptions .carousel-item.active .code-hero-picture img,
    .navbar-logo, #navbarToggleExternalContent.show .nav-item {
        animation: none !important;
    }
    .code-motion-card:hover, .code-motion-cta:hover, .masonry-item:hover img {
        transform: none !important;
    }
}
