/*
  ========================================
  MARU & CO — Enhanced Animations
  Inspired by Elementor premium effects
  ========================================
*/

/* --- 1. Noise/Grain Overlay --- */
.noise-overlay {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: 9998;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    animation: noiseMove 0.5s steps(3) infinite;
}

@keyframes noiseMove {
    0% { transform: translate(0, 0); }
    33% { transform: translate(-5px, 5px); }
    66% { transform: translate(5px, -5px); }
    100% { transform: translate(0, 0); }
}

/* --- 2. Gradient Blob Backgrounds --- */
.gradient-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

.gradient-blob--1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #C2F912 0%, transparent 70%);
    top: -200px;
    right: -100px;
    animation: blobFloat1 20s ease-in-out infinite;
}

.gradient-blob--2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #6D28D9 0%, transparent 70%);
    bottom: -150px;
    left: -100px;
    animation: blobFloat2 25s ease-in-out infinite;
}

.gradient-blob--3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #00BCD4 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: blobFloat3 18s ease-in-out infinite;
}

@keyframes blobFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -80px) scale(1.1); }
    50% { transform: translate(-30px, 40px) scale(0.9); }
    75% { transform: translate(70px, 20px) scale(1.05); }
}

@keyframes blobFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-60px, 50px) scale(1.15); }
    66% { transform: translate(40px, -30px) scale(0.85); }
}

@keyframes blobFloat3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.3); }
}

/* --- 3. Magnetic Button Effect --- */
.magnetic-btn {
    position: relative;
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.magnetic-btn .btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
    pointer-events: none;
}

.magnetic-btn:hover .btn-shine {
    left: 150%;
}

/* --- 4. Text Reveal Animation --- */
.reveal-text {
    overflow: hidden;
    display: inline-block;
}

.reveal-text span {
    display: inline-block;
    transform: translateY(110%);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
}

.reveal-text.revealed span {
    transform: translateY(0);
    opacity: 1;
}

/* Word-by-word reveal */
.word-reveal .word {
    display: inline-block;
    overflow: hidden;
    margin-right: 0.25em;
}

.word-reveal .word .inner {
    display: inline-block;
    transform: translateY(105%);
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.word-reveal.revealed .word .inner {
    transform: translateY(0);
}

/* --- 5. Parallax Elements --- */
.parallax-slow {
    will-change: transform;
}

.parallax-medium {
    will-change: transform;
}

.parallax-fast {
    will-change: transform;
}

/* --- 6. Counter/Number Animation --- */
.counter-number {
    font-variant-numeric: tabular-nums;
    display: inline-block;
}

/* --- 7. Horizontal Scroll Section --- */
.horizontal-scroll-section {
    overflow: hidden;
    position: relative;
}

.horizontal-track {
    display: flex;
    gap: 30px;
    will-change: transform;
}

.horizontal-card {
    flex-shrink: 0;
    width: 350px;
    height: 450px;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    background: #1a1a1a;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.horizontal-card:hover {
    transform: scale(1.03);
}

.horizontal-card img {
    width: 100%;
    height: 60%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.horizontal-card:hover img {
    transform: scale(1.08);
}

.horizontal-card .card-info {
    padding: 20px;
    color: #fff;
}

.horizontal-card .card-info h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: #C2F912;
}

.horizontal-card .card-info p {
    font-size: 0.85rem;
    color: #999;
    line-height: 1.4;
}

/* --- 8. Improved Preloader --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-logo {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 8px;
    overflow: hidden;
}

.preloader-logo .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(40px) rotateX(90deg);
    animation: letterIn 0.6s forwards;
}

@keyframes letterIn {
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
    }
}

.preloader-bar {
    width: 200px;
    height: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin-top: 30px;
    overflow: hidden;
}

.preloader-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #C2F912, #6D28D9);
    border-radius: 2px;
    animation: barFill 2.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes barFill {
    to { width: 100%; }
}

.preloader-percent {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
    margin-top: 15px;
    letter-spacing: 3px;
}

/* --- 9. Scroll Progress Indicator --- */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #C2F912, #6D28D9, #00BCD4);
    z-index: 10000;
    transition: width 0.1s linear;
}

/* --- 10. Cursor Follower --- */
.cursor-follower {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(194, 249, 18, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9997;
    transition: width 0.3s, height 0.3s, border-color 0.3s, background 0.3s;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
}

.cursor-follower.expanded {
    width: 60px;
    height: 60px;
    border-color: rgba(109, 40, 217, 0.4);
    background: rgba(109, 40, 217, 0.1);
}

.cursor-follower.hidden {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
}

/* --- 11. Section Reveal with Clip-Path --- */
.clip-reveal {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

.clip-reveal.revealed {
    clip-path: inset(0 0% 0 0);
}

/* --- 12. Scale + Fade Section Reveal --- */
.scale-fade-section {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scale-fade-section.revealed {
    opacity: 1;
    transform: scale(1);
}

/* --- 13. Enhanced Card Hover Effects --- */
.enhanced-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
}

.enhanced-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, transparent 40%, rgba(194, 249, 18, 0.3), rgba(109, 40, 217, 0.3), transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.enhanced-card:hover::before {
    opacity: 1;
}

.enhanced-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
}

/* --- 14. Tilt Effect Container --- */
.tilt-container {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.tilt-container .tilt-inner {
    transform-style: preserve-3d;
    transition: transform 0.1s ease;
}

/* --- 15. Animated Underline for Links --- */
.animated-underline {
    position: relative;
    display: inline-block;
}

.animated-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #C2F912, #6D28D9);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.animated-underline:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* --- 16. Floating Particles --- */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.6;
}

.particle--lime {
    background: #C2F912;
}

.particle--purple {
    background: #6D28D9;
}

.particle--cyan {
    background: #00BCD4;
}

/* --- 17. Stats Counter Section --- */
.stats-section {
    background: #0a0a0a;
    padding: 80px 20px;
    position: relative;
    overflow: hidden;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.stat-item {
    text-align: center;
    position: relative;
}

.stat-item::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: rgba(255,255,255,0.1);
}

.stat-item:last-child::after {
    display: none;
}

.stat-value {
    font-size: 4rem;
    font-weight: 700;
    font-family: var(--font-heading);
    background: linear-gradient(135deg, #C2F912, #00BCD4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --- 18. Marquee with Variable Speed --- */
.marquee-dual {
    overflow: hidden;
    position: relative;
}

.marquee-dual .track {
    display: flex;
    gap: 40px;
    white-space: nowrap;
}

.marquee-dual .track--forward {
    animation: marqueeForward 30s linear infinite;
}

.marquee-dual .track--backward {
    animation: marqueeBackward 25s linear infinite;
}

.marquee-dual .item {
    font-size: 5rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: transparent;
    -webkit-text-stroke: 1px rgba(255,255,255,0.15);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.marquee-dual .item:hover {
    -webkit-text-stroke: 1px #C2F912;
    color: #C2F912;
}

@keyframes marqueeForward {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes marqueeBackward {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

/* --- 19. Image Reveal on Scroll --- */
.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #0a0a0a;
    transform: scaleX(1);
    transform-origin: right;
    transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1);
}

.image-reveal.revealed::after {
    transform: scaleX(0);
}

/* --- 20. Smooth Section Divider --- */
.section-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(194, 249, 18, 0.3), rgba(109, 40, 217, 0.3), transparent);
    margin: 0;
}

/* --- 21. Glow Effect on Dark Sections --- */
.glow-section {
    position: relative;
}

.glow-section::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(194, 249, 18, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* --- 22. Button Ripple Effect --- */
.ripple-btn {
    position: relative;
    overflow: hidden;
}

.ripple-btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* --- 23. Staggered List Items --- */
.stagger-list .stagger-item {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-list.revealed .stagger-item {
    opacity: 1;
    transform: translateX(0);
}

/* --- 24. Enhanced Hero Title --- */
.hero-title-word {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
}

.hero-title-word .word-inner {
    display: inline-block;
    transform: translateY(100%);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- 25. Smooth Scroll Behavior --- */
html {
    scroll-behavior: smooth;
}

/* --- 26. Contact Glass Buttons Enhanced --- */
.contact-glass-links {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 500px;
    margin: 40px auto 0;
}

.contact-glass-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    font-size: 1.1rem;
    font-weight: 600;
    color: #000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.contact-glass-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(194, 249, 18, 0.15), transparent);
    transition: left 0.6s ease;
}

.contact-glass-btn:hover::before {
    left: 100%;
}

.contact-glass-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
    border-color: rgba(194, 249, 18, 0.3);
}

/* --- 27. Partner Chip Enhanced --- */
.partner-chip {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.partner-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(194, 249, 18, 0.3);
    transform: scale(1.05);
}

.partner-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #333;
}

.partner-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #ccc;
}

/* --- 28. Approach Steps Enhanced --- */
.approach-steps {
    position: relative;
}

.approach-steps::before {
    content: '';
    position: absolute;
    top: 45px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, #C2F912, #6D28D9, #00BCD4);
    opacity: 0.2;
    z-index: 0;
}

.step-card {
    position: relative;
    z-index: 1;
}

.step-num {
    position: relative;
}

.step-num::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(194, 249, 18, 0.08);
    border: 2px solid rgba(194, 249, 18, 0.15);
    z-index: -1;
    transition: all 0.4s ease;
}

.step-card:hover .step-num::before {
    background: rgba(194, 249, 18, 0.15);
    border-color: rgba(194, 249, 18, 0.4);
    transform: translate(-50%, -50%) scale(1.1);
}

/* --- 29. Footer Enhanced --- */
footer {
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    bottom: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(194, 249, 18, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

/* --- 30. Responsive Adjustments --- */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .stat-item:nth-child(2)::after {
        display: none;
    }

    .stat-value {
        font-size: 3rem;
    }

    .horizontal-card {
        width: 300px;
        height: 380px;
    }

    .marquee-dual .item {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    /* Disable cursor follower on mobile */
    .cursor-follower {
        display: none !important;
    }

    /* Disable noise overlay on mobile for performance */
    .noise-overlay {
        display: none !important;
    }

    /* Disable gradient blobs on mobile to prevent horizontal scroll */
    .gradient-blob {
        display: none !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .stat-value {
        font-size: 2.5rem;
    }

    .stat-item::after {
        display: none;
    }

    .marquee-dual .item {
        font-size: 2rem;
    }

    .contact-glass-btn {
        padding: 16px 24px;
        font-size: 0.95rem;
    }

    /* Reduce blur on mobile for performance */
    .glass-nav {
        backdrop-filter: blur(20px) saturate(140%) !important;
        -webkit-backdrop-filter: blur(20px) saturate(140%) !important;
    }

    /* Simplify hero title animation on mobile */
    .hero-title-word .word-inner {
        transform: translateY(0);
    }

    /* Disable magnetic button transform on mobile */
    .magnetic-btn {
        transform: none !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-value {
        font-size: 2rem;
    }

    .preloader-logo {
        font-size: 2rem;
        letter-spacing: 4px;
    }
}
