/* ═══════════════════════════════════════════════
   TreeLine — Premium Motion & Interactivity
   ═══════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .fx-cursor, .fx-cursor-ring { display: none !important; }
}

@media (max-width: 768px) {
    .fx-scroll-hint { display: none; }
    .rb-slide .rb-slide-bg-inner {
        inset: 0;
        animation: none !important;
        transform: none !important;
    }
    .rb-slide.active .rb-slide-bg-inner {
        animation: none !important;
        transform: none !important;
    }
}

/* ── Custom cursor (desktop) ── */
.fx-cursor {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--rb-gold, #97C922);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: width 0.25s, height 0.25s, background 0.25s;
    mix-blend-mode: difference;
    opacity: 0;
}
.fx-cursor-ring {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 1.5px solid rgba(200, 169, 81, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                height 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.25s, opacity 0.25s;
    opacity: 0;
}
body.fx-cursor-ready .fx-cursor,
body.fx-cursor-ready .fx-cursor-ring { opacity: 1; }
body.fx-cursor-hover .fx-cursor {
    width: 18px;
    height: 18px;
    background: var(--rb-primary, #004B18);
}
body.fx-cursor-hover .fx-cursor-ring {
    width: 56px;
    height: 56px;
    border-color: var(--rb-gold, #97C922);
}

/* ── Scroll reveal variants ── */
.anim {
    opacity: 0;
    transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
                filter 0.9s ease;
    will-change: transform, opacity;
}
.anim-up { transform: translateY(60px); }
.anim-down { transform: translateY(-40px); }
.anim-left { transform: translateX(-50px); }
.anim-right { transform: translateX(50px); }
.anim-zoom { transform: scale(0.88); }
.anim-blur { filter: blur(8px); transform: translateY(20px); }
.anim-flip { transform: perspective(600px) rotateX(12deg) translateY(30px); }

.anim.is-visible {
    opacity: 1;
    transform: none;
    filter: none;
}

/* Stagger children */
.anim-group .anim-child {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.anim-group.is-visible .anim-child {
    opacity: 1;
    transform: none;
}
.anim-group.is-visible .anim-child:nth-child(1) { transition-delay: 0.05s; }
.anim-group.is-visible .anim-child:nth-child(2) { transition-delay: 0.12s; }
.anim-group.is-visible .anim-child:nth-child(3) { transition-delay: 0.19s; }
.anim-group.is-visible .anim-child:nth-child(4) { transition-delay: 0.26s; }
.anim-group.is-visible .anim-child:nth-child(5) { transition-delay: 0.33s; }
.anim-group.is-visible .anim-child:nth-child(6) { transition-delay: 0.4s; }
.anim-group.is-visible .anim-child:nth-child(7) { transition-delay: 0.47s; }
.anim-group.is-visible .anim-child:nth-child(8) { transition-delay: 0.54s; }

/* ── Hero slide Ken Burns ── */
.rb-slide .rb-slide-bg-inner {
    position: absolute;
    inset: -8%;
    background-size: cover;
    background-position: center;
    transform: scale(1);
    transition: transform 8s ease-out;
}
.rb-slide.active .rb-slide-bg-inner {
    animation: fxKenBurns 8s ease-out forwards;
}
@keyframes fxKenBurns {
    from { transform: scale(1); }
    to { transform: scale(1.12); }
}

.rb-slide-content h2.fx-split span {
    display: inline-block;
    opacity: 0;
    transform: translateY(40px) rotateX(20deg);
    transition: opacity 0.6s, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.rb-slide.active .rb-slide-content h2.fx-split span {
    opacity: 1;
    transform: none;
}

.rb-slide-content .rb-hero-btns .rb-btn {
    opacity: 0;
    transform: translateY(24px);
}
.rb-slide.active .rb-hero-btns .rb-btn:nth-child(1) { animation: fxBtnIn 0.7s 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.rb-slide.active .rb-hero-btns .rb-btn:nth-child(2) { animation: fxBtnIn 0.7s 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
@keyframes fxBtnIn {
    to { opacity: 1; transform: none; }
}

/* Slide crossfade upgrade */
.rb-slide {
    transition: opacity 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Scroll indicator ── */
.fx-scroll-hint {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.7);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    animation: fxBounce 2s ease-in-out infinite;
}
.fx-scroll-hint::after {
    content: '';
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--rb-gold), transparent);
}
@keyframes fxBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ── Magnetic + ripple buttons ── */
.rb-btn, .tl-btn {
    position: relative;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.35s ease !important;
}
.rb-btn.fx-magnetic { will-change: transform; }
.rb-btn::after, .tl-btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.35) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}
.rb-btn:active::after, .tl-btn-primary:active::after { opacity: 1; transition: opacity 0.1s; }

/* ── Service pillar shine + lift ── */
.rb-svc-pillar {
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease;
}
.rb-svc-pillar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    z-index: 3;
    transition: left 0.6s ease;
    pointer-events: none;
}
.rb-svc-pillar:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 32px 64px rgba(0,0,0,0.25);
}
.rb-svc-pillar:hover::after { left: 150%; }
.rb-svc-pillar .rb-read-more i {
    transition: transform 0.3s ease;
}
.rb-svc-pillar:hover .rb-read-more i {
    transform: translateX(-6px);
}
body.ltr .rb-svc-pillar:hover .rb-read-more i {
    transform: translateX(6px);
}

/* ── Project card 3D ── */
.rb-project-card {
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    transform-style: preserve-3d;
}
.rb-project-card.fx-tilt-active {
    transition: transform 0.1s ease-out;
}

/* ── Portfolio reveal mask ── */
.rb-portfolio-item {
    overflow: hidden;
}
.rb-portfolio-item img {
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.rb-portfolio-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--rb-primary);
    z-index: 2;
    transform: scaleX(1);
    transform-origin: right;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}
body.ltr .rb-portfolio-item::before { transform-origin: left; }
.rb-portfolio-item.is-revealed::before { transform: scaleX(0); }
.rb-portfolio-item:hover img { transform: scale(1.12); }

/* ── Trust stats pulse ── */
.rb-trust-stat {
    transition: transform 0.4s ease;
}
.rb-trust-stat.is-visible {
    animation: fxStatPop 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.rb-trust-stat:nth-child(2).is-visible { animation-delay: 0.15s; }
.rb-trust-stat:nth-child(3).is-visible { animation-delay: 0.3s; }
@keyframes fxStatPop {
    0% { opacity: 0; transform: scale(0.5) translateY(30px); }
    70% { transform: scale(1.05) translateY(-4px); }
    100% { opacity: 1; transform: none; }
}
.rb-trust-stat-num span {
    display: inline-block;
    transition: text-shadow 0.3s;
}
.rb-trust-stat:hover .rb-trust-stat-num span {
    text-shadow: 0 0 30px rgba(200, 169, 81, 0.5);
}

/* ── Story image float ── */
.rb-story-image img {
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.rb-story-image:hover img {
    transform: scale(1.03) rotate(-1deg);
}

/* ── Checklist slide-in ── */
.rb-checklist li {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
body.ltr .rb-checklist li { transform: translateX(-30px); }
.anim-group.is-visible .rb-checklist li {
    opacity: 1;
    transform: none;
}
.anim-group.is-visible .rb-checklist li:nth-child(1) { transition-delay: 0.1s; }
.anim-group.is-visible .rb-checklist li:nth-child(2) { transition-delay: 0.2s; }
.anim-group.is-visible .rb-checklist li:nth-child(3) { transition-delay: 0.3s; }
.anim-group.is-visible .rb-checklist li:nth-child(4) { transition-delay: 0.4s; }

/* ── FAQ enhanced ── */
.rb-faq-item {
    transition: background 0.3s ease;
}
.rb-faq-item.open {
    background: rgba(26, 67, 50, 0.03);
}
.rb-faq-q i {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.rb-faq-item.open .rb-faq-q i {
    transform: rotate(45deg) scale(1.1);
}
.rb-faq-a {
    transition: max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                padding 0.4s ease,
                opacity 0.4s ease;
    opacity: 0;
}
.rb-faq-item.open .rb-faq-a {
    opacity: 1;
}

/* ── Client logos wave ── */
.rb-client-logo {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.3s, color 0.3s, box-shadow 0.3s;
}
.rb-client-logo:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 12px 32px rgba(200, 169, 81, 0.15);
}

/* ── Marquee pause ── */
.rb-marquee:hover .rb-marquee-track {
    animation-play-state: paused;
}

/* ── Call banner glow ── */
.rb-call-banner {
    position: relative;
    overflow: hidden;
}
.rb-call-banner::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle, rgba(200,169,81,0.08) 0%, transparent 60%);
    animation: fxGlowMove 6s ease-in-out infinite;
}
@keyframes fxGlowMove {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10%, 10%); }
}
.rb-call-banner a.phone {
    transition: transform 0.3s ease, text-shadow 0.3s;
    display: inline-block;
}
.rb-call-banner a.phone:hover {
    transform: scale(1.05);
    text-shadow: 0 0 40px rgba(200, 169, 81, 0.4);
}

/* ── CTA strip particles ── */
.rb-cta-strip {
    overflow: hidden;
}
.rb-cta-strip .fx-cta-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.fx-cta-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(200,169,81,0.3);
    border-radius: 50%;
    animation: fxFloatDot 8s linear infinite;
}
@keyframes fxFloatDot {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-20vh) scale(1); opacity: 0; }
}

/* ── Section divider line draw ── */
.fx-line-draw {
    position: relative;
}
.fx-line-draw::after {
    content: '';
    display: block;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--rb-gold), var(--rb-primary-light));
    margin: 20px auto 0;
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.fx-line-draw.is-visible::after { width: 80px; }

/* ── Page hero parallax text ── */
.rb-page-hero .container {
    transition: transform 0.1s linear;
    will-change: transform;
}

/* ── Form interactions ── */
.tl-form-group input,
.tl-form-group textarea,
.tl-form-group select {
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.tl-form-group input:focus,
.tl-form-group textarea:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26, 67, 50, 0.12);
}
.tl-form-panel {
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.tl-form-panels .tl-form-panel:not(.active) {
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    position: absolute;
    inset: 0;
    width: 100%;
}
.tl-form-panels .tl-form-panel.active {
    opacity: 1;
    transform: none;
    position: relative;
}

/* ── Filter buttons ripple ── */
.tl-filter-btn {
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.tl-filter-btn.active {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(26, 67, 50, 0.25);
}

/* ── Lightbox zoom ── */
.tl-lightbox.open img {
    animation: fxLbZoom 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes fxLbZoom {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ── Back to top pulse ── */
.tl-back-top.visible {
    animation: fxBackPulse 2s ease-in-out infinite;
}
@keyframes fxBackPulse {
    0%, 100% { box-shadow: 0 4px 24px rgba(26,67,50,0.2); }
    50% { box-shadow: 0 4px 32px rgba(200,169,81,0.4); }
}

/* ── Brand title shimmer ── */
.rb-brand h2.fx-shimmer {
    background: linear-gradient(90deg, var(--rb-primary) 0%, var(--rb-gold) 50%, var(--rb-primary) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fxShimmer 4s linear infinite;
}
@keyframes fxShimmer {
    to { background-position: 200% center; }
}

/* ── Carousel drag cursor ── */
.rb-carousel.fx-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
}
.rb-carousel { cursor: grab; }

/* ── Nav mobile slide ── */
.tl-nav.open a {
    animation: fxNavIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.tl-nav.open a:nth-child(1) { animation-delay: 0.05s; }
.tl-nav.open a:nth-child(2) { animation-delay: 0.1s; }
.tl-nav.open a:nth-child(3) { animation-delay: 0.15s; }
.tl-nav.open a:nth-child(4) { animation-delay: 0.2s; }
.tl-nav.open a:nth-child(5) { animation-delay: 0.25s; }
@keyframes fxNavIn {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: none; }
}
