/* ══════════════════════════════════════════════════════════════
   MORTGAGE FEEDERS - SUPERCHARGED ANIMATIONS
   Premium, luxury motion design system
   ══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────
   CUSTOM EASING CURVES
   ───────────────────────────────────── */
:root {
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out-circ: cubic-bezier(0.85, 0, 0.15, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}


/* ─────────────────────────────────────
   FADE-IN-UP (Hero Elements)
   ───────────────────────────────────── */
.fade-in-up {
    opacity: 0;
    transform: translateY(50px) scale(0.97);
    filter: blur(4px);
    transition: opacity 1s var(--ease-out-expo),
                transform 1s var(--ease-out-expo),
                filter 0.8s var(--ease-out-expo);
}
.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.delay-1 { transition-delay: 0.15s; }
.delay-2 { transition-delay: 0.3s; }
.delay-3 { transition-delay: 0.45s; }
.delay-4 { transition-delay: 0.6s; }
.delay-5 { transition-delay: 0.75s; }


/* ─────────────────────────────────────
   REVEAL ANIMATIONS (Sections)
   ───────────────────────────────────── */
.reveal-up {
    opacity: 0;
    transform: translateY(80px) scale(0.96);
    filter: blur(3px);
    transition: opacity 1.1s var(--ease-out-expo),
                transform 1.1s var(--ease-out-expo),
                filter 0.9s var(--ease-out-expo);
}
.reveal-up.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-80px) rotate(-1deg);
    filter: blur(3px);
    transition: opacity 1.1s var(--ease-out-expo),
                transform 1.1s var(--ease-out-expo),
                filter 0.9s var(--ease-out-expo);
}
.reveal-left.visible {
    opacity: 1;
    transform: translateX(0) rotate(0);
    filter: blur(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(80px) rotate(1deg);
    filter: blur(3px);
    transition: opacity 1.1s var(--ease-out-expo),
                transform 1.1s var(--ease-out-expo),
                filter 0.9s var(--ease-out-expo);
}
.reveal-right.visible {
    opacity: 1;
    transform: translateX(0) rotate(0);
    filter: blur(0);
}

/* Scale Reveal */
.reveal-scale {
    opacity: 0;
    transform: scale(0.85);
    filter: blur(6px);
    transition: opacity 1s var(--ease-out-expo),
                transform 1s var(--ease-spring),
                filter 0.8s var(--ease-out-expo);
}
.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

/* Rotate Reveal */
.reveal-rotate {
    opacity: 0;
    transform: perspective(800px) rotateY(15deg) translateX(40px);
    transition: opacity 1.2s var(--ease-out-expo),
                transform 1.2s var(--ease-out-expo);
}
.reveal-rotate.visible {
    opacity: 1;
    transform: perspective(800px) rotateY(0) translateX(0);
}


/* ─────────────────────────────────────
   STAGGERED CHILDREN
   auto-stagger for grid children
   ───────────────────────────────────── */
.stagger-children > * {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s var(--ease-out-expo),
                transform 0.7s var(--ease-out-expo);
}
.stagger-children.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.12s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.19s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.26s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.33s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.40s; }
.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
}


/* ─────────────────────────────────────
   SERVICE CARD - 3D TILT + GLOW
   ───────────────────────────────────── */
.service-card {
    transition: transform 0.5s var(--ease-out-expo),
                box-shadow 0.5s var(--ease-out-expo);
    transform-style: preserve-3d;
    will-change: transform;
}
.service-card:hover {
    transform: translateY(-12px) rotateX(2deg) rotateY(-1deg);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(107, 115, 57, 0.08);
}
.service-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.5s;
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
                rgba(107, 115, 57, 0.08), transparent 40%);
    pointer-events: none;
}
.service-card:hover::after {
    opacity: 1;
}

/* Service card image zoom */
.service-card-image img {
    transition: transform 1.2s var(--ease-out-expo);
}
.service-card:hover .service-card-image img {
    transform: scale(1.08);
}

/* Service icon float */
.service-icon-wrapper {
    transition: transform 0.6s var(--ease-spring);
}
.service-card:hover .service-icon-wrapper {
    transform: translateY(-6px) scale(1.1);
}


/* ─────────────────────────────────────
   MAGNETIC HOVER BUTTONS
   ───────────────────────────────────── */
.btn {
    position: relative;
    overflow: hidden;
    transition: transform 0.4s var(--ease-out-expo),
                box-shadow 0.4s var(--ease-out-expo);
}
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s var(--ease-out-expo),
                height 0.6s var(--ease-out-expo);
    pointer-events: none;
}
.btn:hover::before {
    width: 300px;
    height: 300px;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(107, 115, 57, 0.25);
}
.btn:active {
    transform: translateY(0) scale(0.98);
    transition-duration: 0.1s;
}

/* Arrow slide */
.btn-arrow {
    display: inline-block;
    transition: transform 0.3s var(--ease-out-expo);
}
.btn:hover .btn-arrow {
    transform: translateX(4px);
}


/* ─────────────────────────────────────
   HERO PARTICLES (Enhanced)
   ───────────────────────────────────── */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: particleDrift linear infinite;
    background: radial-gradient(circle, rgba(107, 115, 57, 0.5), transparent);
    box-shadow: 0 0 6px rgba(107, 115, 57, 0.2);
}
@keyframes particleDrift {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg) scale(1);
        opacity: 0;
    }
    8% { opacity: 1; }
    50% {
        transform: translateY(-50vh) translateX(30px) rotate(360deg) scale(0.8);
    }
    92% { opacity: 0.8; }
    100% {
        transform: translateY(-100vh) translateX(-20px) rotate(720deg) scale(0.3);
        opacity: 0;
    }
}


/* ─────────────────────────────────────
   GRADIENT TEXT SHIMMER
   ───────────────────────────────────── */
.text-gradient {
    background-size: 200% 200%;
    animation: gradientShimmer 5s ease infinite;
}
@keyframes gradientShimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}


/* ─────────────────────────────────────
   COUNTER ANIMATIONS
   ───────────────────────────────────── */
@keyframes countUp {
    from { opacity: 0; transform: translateY(20px) scale(0.9); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}


/* ─────────────────────────────────────
   SMOOTH GLOW PULSE
   ───────────────────────────────────── */
@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(107, 115, 57, 0.15); }
    50% { box-shadow: 0 0 40px rgba(107, 115, 57, 0.35), 0 0 80px rgba(107, 115, 57, 0.1); }
}

@keyframes glowGold {
    0%, 100% { box-shadow: 0 0 20px rgba(197, 165, 90, 0.15); }
    50% { box-shadow: 0 0 40px rgba(197, 165, 90, 0.35); }
}


/* ─────────────────────────────────────
   NAVBAR TRANSITIONS
   ───────────────────────────────────── */
.navbar {
    transition: background 0.4s var(--ease-smooth),
                padding 0.4s var(--ease-smooth),
                box-shadow 0.4s var(--ease-smooth),
                backdrop-filter 0.4s var(--ease-smooth),
                -webkit-backdrop-filter 0.4s var(--ease-smooth);
}
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--brand), var(--gold, #C5A55A));
    transition: width 0.4s var(--ease-out-expo), left 0.4s var(--ease-out-expo);
    border-radius: 1px;
}
.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
    left: 0;
}


/* ─────────────────────────────────────
   ABOUT IMAGE PARALLAX FLOAT
   ───────────────────────────────────── */
.about-image-wrapper {
    transition: transform 0.6s var(--ease-out-expo);
}
.about-floating-card {
    animation: floatBadge 4s ease-in-out infinite;
}
@keyframes floatBadge {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-8px) rotate(1deg); }
    66% { transform: translateY(4px) rotate(-0.5deg); }
}

.about-experience-badge {
    animation: pulseBadge 3s ease-in-out infinite;
}
@keyframes pulseBadge {
    0%, 100% { transform: scale(1); box-shadow: 0 10px 40px rgba(107, 115, 57, 0.2); }
    50% { transform: scale(1.05); box-shadow: 0 15px 50px rgba(107, 115, 57, 0.35); }
}


/* ─────────────────────────────────────
   PROCESS STEPS – STAGGER SLIDE
   ───────────────────────────────────── */
.process-step {
    transition: transform 0.5s var(--ease-out-expo),
                box-shadow 0.5s var(--ease-out-expo);
}
.process-step:hover {
    transform: translateX(8px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}
.step-number {
    transition: transform 0.4s var(--ease-spring),
                background 0.4s;
}
.process-step:hover .step-number {
    transform: scale(1.15) rotate(-5deg);
}


/* ─────────────────────────────────────
   TESTIMONIAL CARD HOVER
   ───────────────────────────────────── */
.testimonial-card {
    transition: transform 0.5s var(--ease-out-expo),
                box-shadow 0.5s var(--ease-out-expo);
}
.testimonial-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}


/* ─────────────────────────────────────
   WHY-US STAT CIRCLE DRAW
   ───────────────────────────────────── */
.stat-circle svg circle:last-child {
    stroke-dashoffset: 339.29;
    transition: stroke-dashoffset 2s var(--ease-out-expo);
}
.why-us-visual.visible .stat-circle svg circle:last-child {
    stroke-dashoffset: 6.79;
}


/* ─────────────────────────────────────
   CALCULATOR RANGE SLIDER GLOW
   ───────────────────────────────────── */
.calc-range::-webkit-slider-thumb {
    transition: box-shadow 0.3s;
}
.calc-range:active::-webkit-slider-thumb {
    box-shadow: 0 0 0 8px rgba(107, 115, 57, 0.15);
}


/* ─────────────────────────────────────
   SCROLL INDICATOR PULSE
   ───────────────────────────────────── */
.hero-scroll-indicator {
    animation: scrollPulse 2.5s ease-in-out infinite;
}
@keyframes scrollPulse {
    0%, 100% { opacity: 1; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.5; transform: translateX(-50%) translateY(10px); }
}

.scroll-line {
    animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine {
    0% { transform: scaleY(0); transform-origin: top; }
    50% { transform: scaleY(1); transform-origin: top; }
    51% { transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}


/* ─────────────────────────────────────
   WHATSAPP FLOAT BUTTON
   ───────────────────────────────────── */
.whatsapp-float {
    transition: transform 0.4s var(--ease-spring),
                box-shadow 0.4s var(--ease-out-expo);
    animation: whatsappPulse 3s ease-in-out infinite;
}
@keyframes whatsappPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3); }
    50% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3), 0 0 0 12px rgba(37, 211, 102, 0.08); }
}
.whatsapp-float:hover {
    transform: scale(1.12) translateY(-4px);
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.5);
}


/* ─────────────────────────────────────
   BACK-TO-TOP BUTTON
   ───────────────────────────────────── */
.back-to-top {
    transition: opacity 0.4s, transform 0.4s var(--ease-spring),
                box-shadow 0.3s;
}
.back-to-top:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 8px 25px rgba(107, 115, 57, 0.3);
}


/* ─────────────────────────────────────
   CONTACT INFO ITEMS
   ───────────────────────────────────── */
.contact-item {
    transition: transform 0.4s var(--ease-out-expo),
                background 0.4s;
}
.contact-item:hover {
    transform: translateX(6px);
}


/* ─────────────────────────────────────
   FORM FOCUS EFFECTS
   ───────────────────────────────────── */
.contact-form input,
.contact-form select,
.contact-form textarea {
    transition: border-color 0.3s,
                box-shadow 0.3s var(--ease-out-expo),
                transform 0.2s var(--ease-out-expo);
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    transform: translateY(-1px);
    box-shadow: 0 0 0 4px rgba(107, 115, 57, 0.1),
                0 4px 12px rgba(0, 0, 0, 0.05);
}


/* ─────────────────────────────────────
   FORM SUCCESS ANIMATION
   ───────────────────────────────────── */
@keyframes formSuccess {
    0% { transform: scale(0.8) translateY(20px); opacity: 0; filter: blur(8px); }
    60% { transform: scale(1.03) translateY(-4px); filter: blur(0); }
    100% { transform: scale(1) translateY(0); opacity: 1; filter: blur(0); }
}

.form-success-message {
    animation: formSuccess 0.7s var(--ease-out-expo) forwards;
    text-align: center;
    padding: 40px;
}
.form-success-message .success-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    animation: successBounce 0.8s var(--ease-spring) 0.3s both;
}
@keyframes successBounce {
    0% { transform: scale(0) rotate(-20deg); }
    60% { transform: scale(1.3) rotate(5deg); }
    100% { transform: scale(1) rotate(0); }
}
.form-success-message h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--brand);
    margin-bottom: 8px;
}
.form-success-message p {
    color: var(--text-secondary);
}


/* ─────────────────────────────────────
   MAP CONTAINER HOVER
   ───────────────────────────────────── */
.map-container {
    transition: box-shadow 0.5s var(--ease-out-expo),
                transform 0.5s var(--ease-out-expo);
}
.map-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}


/* ─────────────────────────────────────
   FOOTER LINKS HOVER
   ───────────────────────────────────── */
.footer-links a {
    transition: color 0.3s, transform 0.3s var(--ease-out-expo);
    display: inline-block;
}
.footer-links a:hover {
    transform: translateX(4px);
}


/* ─────────────────────────────────────
   IMAGE REVEAL MASK
   ───────────────────────────────────── */
.about-image,
.why-us-image {
    transition: transform 1.5s var(--ease-out-expo);
}
.about-image-wrapper:hover .about-image {
    transform: scale(1.05);
}
.why-us-image-wrapper:hover .why-us-image {
    transform: scale(1.05);
}


/* ─────────────────────────────────────
   HERO BADGE SHINE
   ───────────────────────────────────── */
.hero-badge {
    position: relative;
    overflow: hidden;
}
.hero-badge::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 100%
    );
    transform: rotate(25deg) translateX(-100%);
    animation: badgeShine 4s ease-in-out infinite;
}
@keyframes badgeShine {
    0%, 60%, 100% { transform: rotate(25deg) translateX(-100%); }
    30% { transform: rotate(25deg) translateX(100%); }
}


/* ─────────────────────────────────────
   HERO STATS COUNTER SLIDE
   ───────────────────────────────────── */
.stat-item {
    transition: transform 0.4s var(--ease-out-expo);
}
.stat-item:hover {
    transform: translateY(-4px);
}
.stat-divider {
    transition: height 0.4s var(--ease-out-expo);
}


/* ─────────────────────────────────────
   HIGHLIGHT ITEMS HOVER
   ───────────────────────────────────── */
.highlight-item {
    transition: transform 0.4s var(--ease-out-expo),
                background 0.4s,
                box-shadow 0.4s;
}
.highlight-item:hover {
    transform: translateX(6px);
}
.highlight-icon {
    transition: transform 0.5s var(--ease-spring);
}
.highlight-item:hover .highlight-icon {
    transform: scale(1.2) rotate(-5deg);
}


/* ─────────────────────────────────────
   WHY-US ITEM HOVER
   ───────────────────────────────────── */
.why-item {
    transition: transform 0.4s var(--ease-out-expo),
                box-shadow 0.4s;
}
.why-item:hover {
    transform: translateX(8px);
}
.why-item-number {
    transition: transform 0.5s var(--ease-spring),
                color 0.4s;
}
.why-item:hover .why-item-number {
    transform: scale(1.15) rotate(-3deg);
}


/* ─────────────────────────────────────
   PRELOADER ANIMATIONS
   ───────────────────────────────────── */
.preloader-bar-fill {
    animation: preloaderFill 1.8s var(--ease-out-expo) forwards;
}
@keyframes preloaderFill {
    0% { width: 0; }
    100% { width: 100%; }
}

.preloader-logo-img {
    animation: preloaderLogo 1.2s var(--ease-out-expo) forwards;
}
@keyframes preloaderLogo {
    0% { opacity: 0; transform: scale(0.8) translateY(10px); filter: blur(8px); }
    100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}


/* ─────────────────────────────────────
   LINK UNDERLINE EFFECTS
   ───────────────────────────────────── */
.service-link {
    position: relative;
    overflow: hidden;
}
.service-link span {
    display: inline-block;
    transition: transform 0.3s var(--ease-out-expo);
}
.service-link:hover span {
    transform: translateX(4px);
}


/* ─────────────────────────────────────
   SECTION LABEL ANIMATION
   ───────────────────────────────────── */
.section-label {
    position: relative;
    overflow: hidden;
}
.section-label::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--brand), transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.8s var(--ease-out-expo) 0.3s;
}
.visible .section-label::after,
.section-label.visible::after {
    transform: scaleX(1);
}


/* ─────────────────────────────────────
   SMOOTH PAGE TRANSITIONS
   ───────────────────────────────────── */
body {
    animation: pageEnter 0.6s var(--ease-out-expo) forwards;
}
@keyframes pageEnter {
    from { opacity: 0; }
    to { opacity: 1; }
}


/* ─────────────────────────────────────
   REDUCED MOTION
   Respect user preferences
   ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .fade-in-up,
    .reveal-up,
    .reveal-left,
    .reveal-right,
    .reveal-scale,
    .reveal-rotate {
        opacity: 1;
        transform: none;
        filter: none;
    }

    .stagger-children > * {
        opacity: 1;
        transform: none;
    }
}
