/*
 * UI enhancements (additive layer). Loaded after the page styles.
 * To revert: delete this file, public/js/ui-enhance.js and the two
 * "ui-enhance" lines in resources/views/layouts/app.blade.php.
 */

:root {
    /* Site blue only; no new colours. */
    --ui-accent: #1d4ed8;
    --ui-blue: #2563eb;
    --ui-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
    scroll-behavior: smooth;
}

/* ---------- Header: glass blur + shadow once the page scrolls ---------- */
header {
    transition: background-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

/*
 * The blur lives on a pseudo-element, not on <header>: backdrop-filter on the
 * header itself would turn it into the containing block of the position:fixed
 * mobile menu (.nav-container) and break it.
 */
header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-color: rgba(255, 255, 255, 0);
    transition: background-color 0.3s ease;
    pointer-events: none;
}

header.ui-scrolled {
    background-color: transparent;
    box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.08);
}

header.ui-scrolled::before {
    background-color: rgba(255, 255, 255, 0.86);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
}

.nav-links a {
    position: relative;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.35rem;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--ui-blue), var(--ui-accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ui-ease);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    transform: scaleX(1);
}

/* ---------- Hero: gradient headline + soft glow ---------- */
.hero-title .highlight {
    background: linear-gradient(90deg, var(--ui-blue), var(--ui-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--ui-blue);
}

.hero::before {
    content: "";
    position: absolute;
    top: -8rem;
    right: -6rem;
    width: 26rem;
    height: 26rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.16), transparent 65%);
    pointer-events: none;
    animation: ui-float 9s ease-in-out infinite;
}

.hero > * {
    position: relative;
}

@keyframes ui-float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(-1.5rem, 1.5rem, 0); }
}

/* ---------- Buttons ---------- */
.btn,
.contact-btn {
    transition: transform 0.3s var(--ui-ease), box-shadow 0.3s ease, background-color 0.3s ease;
}

.btn:hover,
.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.6rem 1.4rem rgba(37, 99, 235, 0.22);
}

.btn:active,
.contact-btn:active {
    transform: translateY(0);
}

/* ---------- Cards: lift, shadow, image zoom ---------- */
.service-card,
.industry-card,
.testimonial-card,
.stat-card {
    transition: transform 0.35s var(--ui-ease), box-shadow 0.35s ease, border-color 0.35s ease;
}

.industry-card:hover,
.testimonial-card:hover {
    transform: translateY(-6px);
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 1rem 2.2rem rgba(37, 99, 235, 0.12);
}

.service-card:hover {
    box-shadow: 0 1rem 2.2rem rgba(37, 99, 235, 0.16);
}

.case-study-image img,
.blog-card img,
.blog-image img {
    transition: transform 0.6s var(--ui-ease);
}

.case-study-item:hover .case-study-image img,
.blog-card:hover img,
.blog-image:hover img {
    transform: scale(1.06);
}

.case-study-item {
    transition: transform 0.35s var(--ui-ease);
}

.case-study-item:hover {
    transform: translateY(-4px);
}

/* ---------- Scroll reveal (class added by ui-enhance.js) ---------- */
.ui-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s var(--ui-ease), transform 0.7s var(--ui-ease);
    transition-delay: var(--ui-delay, 0ms);
    will-change: opacity, transform;
}

.ui-reveal.ui-in {
    opacity: 1;
    transform: none;
}

/* ---------- Trusted-by logos: gentle hover only (logo colours untouched) ---------- */
.trusted-companies img {
    transition: transform 0.3s ease;
}

.trusted-companies img:hover {
    transform: scale(1.05);
}

/* ---------- Accessibility ---------- */
:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.55);
    outline-offset: 3px;
    border-radius: 4px;
}

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

    .hero::before {
        animation: none;
    }

    .ui-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    * {
        transition-duration: 0.01ms !important;
    }
}
