/* ==========================================================================
   Future Rize — motion layer
   --------------------------------------------------------------------------
   Everything here sits on top of the existing page styles. To switch the
   whole layer off, remove the two lines that load motion.css and motion.js
   from resources/views/layouts/app.blade.php.

   Honours prefers-reduced-motion at the bottom of the file.
   ========================================================================== */

:root {
    --ease-out: cubic-bezier(0.22, 0.75, 0.2, 1);
    --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.35, 0.64, 1);
}

/* ── Scroll progress ─────────────────────────────────────────────────────── */
.scroll-progress {
    position: fixed; top: 0; left: 0; right: 0;
    height: 2px; z-index: 200;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    transform-origin: 0 50%;
    transform: scaleX(0);
    pointer-events: none;
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.nav-links a.is-active::after { transform: scaleX(1); }
.nav-links a.is-active { color: white; }
.nav.scrolled .nav-links a.is-active { color: var(--forest); }

.nav-logo { transition: color 0.4s, letter-spacing 0.4s var(--ease-out); }
.nav-logo:hover { letter-spacing: 0.05em; }

/* hamburger morphs into a cross */
.nav-toggle span { transition: transform 0.35s var(--ease-out), opacity 0.2s; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
    .nav-links.open { animation: menuDrop 0.35s var(--ease-out); }
}
@keyframes menuDrop {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
}

/* ── Reveals: smoother curve, small scale, label lines draw in ──────────── */
.reveal {
    transform: translateY(28px) scale(0.985);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.reveal.visible { transform: none; }

.section-label::before { transition: width 0.8s var(--ease-out) 0.15s; }
.section-label.reveal:not(.visible)::before { width: 0 !important; }

/* ── Heroes: slowly drifting gold light ─────────────────────────────────── */
.hero::after,
.page-hero::after {
    content: '';
    position: absolute; inset: -20%;
    pointer-events: none;
    background:
        radial-gradient(38% 45% at 25% 30%, rgba(201,168,76,0.10), transparent 70%),
        radial-gradient(32% 40% at 78% 70%, rgba(226,196,122,0.07), transparent 70%);
    animation: drift 22s ease-in-out infinite alternate;
    z-index: -1;   /* paints above the section background, below its content */
}
.hero, .page-hero { isolation: isolate; }

@keyframes drift {
    0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
    50%  { transform: translate3d(4%, -3%, 0) rotate(4deg); }
    100% { transform: translate3d(-3%, 4%, 0) rotate(-3deg); }
}

/* word-by-word headline (words are wrapped by motion.js) */
.split-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.55em);
    animation: wordUp 0.9s var(--ease-out) forwards;
}
@keyframes wordUp { to { opacity: 1; transform: none; } }

/* page-hero titles get the same entrance as the homepage */
.page-hero h1 { animation: heroRise 0.9s var(--ease-out) 0.1s both; }
.page-hero-breadcrumb { animation: heroRise 0.8s var(--ease-out) both; }
.page-hero-sub { animation: heroRise 0.9s var(--ease-out) 0.25s both; }
@keyframes heroRise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}

.hero-scroll { transition: opacity 0.5s; }
.hero-scroll.is-hidden { opacity: 0; }

/* ── Buttons: gold sheen sweep + press ──────────────────────────────────── */
.btn-primary, .btn-outline, .nav-cta, .btn-submit, .sort-btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.25s var(--ease-out), box-shadow 0.3s,
                background 0.3s, color 0.3s, border-color 0.3s;
}
.btn-primary::after, .btn-outline::after, .nav-cta::after, .btn-submit::after {
    content: '';
    position: absolute; top: 0; bottom: 0; left: -60%;
    width: 50%;
    background: linear-gradient(105deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-18deg);
    transition: left 0.7s var(--ease-soft);
    pointer-events: none;
    z-index: 1;
}
.btn-primary:hover::after, .btn-outline:hover::after,
.nav-cta:hover::after, .btn-submit:hover::after { left: 120%; }

.btn-primary:hover { box-shadow: 0 10px 28px -12px rgba(201,168,76,0.7); }
.btn-primary:active, .btn-outline:active, .nav-cta:active,
.btn-submit:active, .sort-btn:active { transform: translateY(0) scale(0.97); }

/* ── Cards ──────────────────────────────────────────────────────────────── */
/* "body" prefix: page <style> blocks load after this file and would otherwise win */
body .service-card, body .feature-card, body .stat-item,
body .contact-detail-item, body .client-logo-item {
    transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out),
                background 0.3s, border-color 0.3s;
}

/* homepage services grid */
.service-card .service-num { transition: color 0.4s, transform 0.5s var(--ease-out); }
.service-card:hover .service-num { color: rgba(201,168,76,0.75); transform: translateX(4px); }
.service-card h3 { transition: transform 0.45s var(--ease-out); }
.service-card:hover h3 { transform: translateX(4px); }

/* what sets us apart */
body .feature-card:hover { transform: translateY(-6px); }
.feature-icon { transition: transform 0.5s var(--ease-spring), background 0.3s; }
.feature-card:hover .feature-icon { transform: rotate(-6deg) scale(1.08); background: var(--forest-mid); }

/* project cards (homepage + projects page) */
body .project-card {
    transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out),
                border-color 0.3s;
}
body .project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 50px -24px rgba(10,26,16,0.45);
}
.project-card img { transition: transform 1.2s var(--ease-out) !important; }
.project-card:hover img { transform: scale(1.06) !important; }

/* about page stats + contact details */
body .stat-item:hover { transform: translateY(-3px); }
body .contact-detail-item:hover { transform: translateX(4px); }

/* services page media zooms gently as the section arrives */
.service-media img, .service-media video {
    transition: transform 1.6s var(--ease-out);
    transform: scale(1.06);
}
.service-item.in-view .service-media img,
.service-item.in-view .service-media video { transform: scale(1); }

/* homepage image collage */
.about-img img { transition: transform 1.2s var(--ease-out); }
.about-img:hover img { transform: scale(1.05); }

/* approaches: bars settle with a slight overshoot */
.approach-bar-fill { transition: width 1.5s var(--ease-spring) !important; }

/* gold strip items */
.intro-strip-item { transition: opacity 0.3s, transform 0.3s var(--ease-out); }
.intro-strip-item:hover { opacity: 1; transform: translateY(-2px); }

/* footer links nudge */
.footer-col ul li a { display: inline-block; transition: color 0.2s, transform 0.3s var(--ease-out); }
.footer-col ul li a:hover { transform: translateX(3px); }

/* ── Respect reduced-motion ─────────────────────────────────────────────── */
/* "Reduce motion" (Windows Animation effects off, iPhone Reduce Motion...):
   most visitors with it off never chose it, so keep the fades and small
   effects and drop only the drifting background light. The large movements
   are handled in interact.css and scroll.css. */
@media (prefers-reduced-motion: reduce) {
    .hero::after, .page-hero::after { animation: none; }
}

/* clients ticker slows on hover instead of stopping dead (motion.js eases it) */
.clients-ticker:hover { animation-play-state: running !important; }
