/* =========================================
   CNTRLM — WACUS-INSPIRED DESIGN SYSTEM
   Dark, Kinetic, GSAP-Driven
   ========================================= */

/* --- Smooth Scroll & Base --- */
html {
    scroll-behavior: smooth;
}

/* Global custom cursor override for pointer devices */
@media (pointer: fine) {
    body, a, button, details, summary {
        cursor: none !important;
    }
}

@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}
.animate-floatY {
    animation: floatY 6s ease-in-out infinite;
}

::selection {
    background: #DAFF01;
    color: #000;
}

/* --- Navbar Scroll State --- */
#navbar.scrolled {
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* --- Marquee Animation --- */
.marquee-container {
    overflow: hidden;
    width: 100%;
}

.marquee-content {
    display: flex;
    animation: marquee 25s linear infinite;
    flex-shrink: 0;
    min-width: 200%;
}

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

/* --- Flip Card System --- */
.flip-card {
    perspective: 1200px;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: z-index 0s 0s;
}

.flip-card:hover {
    z-index: 50;
    transition: z-index 0s 0s;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: scale(1.1) rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* --- Feature Cards Subtle Hover Glow --- */
.feature-card {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-card:hover {
    border-color: rgba(218, 255, 1, 0.2) !important;
    box-shadow: 0 0 40px rgba(218, 255, 1, 0.05);
    transform: translateY(-4px);
}

/* --- FAQ Details/Summary --- */
details summary::-webkit-details-marker {
    display: none;
}

details summary {
    list-style: none;
}

details[open] summary {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 0;
}

/* --- Contact Form Inputs --- */
input[type='text']:focus,
input[type='tel']:focus,
input[type='email']:focus {
    border-color: #DAFF01 !important;
    caret-color: #DAFF01;
}

/* --- Textarea Accent Focus --- */
textarea:focus {
    border-color: rgba(218, 255, 1, 0.5) !important;
    box-shadow: 0 0 0 1px rgba(218, 255, 1, 0.12);
    outline: none;
    caret-color: #DAFF01;
}

/* --- Send Button Glow --- */
.send-btn {
    box-shadow: 0 0 0 rgba(218, 255, 1, 0);
    transition: box-shadow 0.4s ease, transform 0.25s ease;
}

.send-btn:hover {
    box-shadow: 0 0 28px rgba(218, 255, 1, 0.5), 0 0 60px rgba(218, 255, 1, 0.15);
}

.send-btn:active {
    transform: scale(0.98) !important;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #050505;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: #DAFF01;
}

/* --- High-End SaaS Service Cards --- */
.noise-overlay {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.service-card {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
    will-change: transform;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 40px 60px -15px rgba(99, 102, 241, 0.2); 
}

/* Inner Background Spotlight Gradient */
.spotlight-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.08), transparent 40%);
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 0;
    pointer-events: none;
}

/* Masked Gradient Border Effect */
.spotlight-card::after {
    content: "";    
    position: absolute;
    inset: 0; 
    border-radius: inherit;
    padding: 1px;
    background: radial-gradient(300px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.4), transparent 40%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 10;
}

.service-card:hover .spotlight-card::before,
.service-card:hover .spotlight-card::after {
    opacity: 1;
}

/* Intelligent Icon Micro-interactions */
.service-icon-wrapper {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.5s;
}

.service-card:hover .service-icon-wrapper {
    transform: scale(1.15);
    border-color: rgba(99, 102, 241, 0.5); 
}

.service-card:hover .service-icon-wrapper i {
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

.service-card:hover .icon-glow {
    background-color: rgba(99, 102, 241, 0.5);
}

/* --- Case Study Interactive Cards --- */
.case-card {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.5s ease,
                box-shadow 0.5s ease;
    will-change: transform, opacity;
}

/* Active state — expands + glows */
.case-card.is-active {
    transform: scale(1.025);
    opacity: 1;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.case-card.is-active .case-glow {
    opacity: 1;
}

.case-card.is-active .case-arrow {
    opacity: 1;
}

.case-card.is-active .case-arrow i {
    transform: translateX(4px);
}

/* Sibling dimming */
.case-card.is-dimmed {
    transform: scale(0.97);
    opacity: 0.45;
}

/* Slide-up reveal */
.case-reveal {
    transition: max-height 0.55s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.45s ease,
                margin-top 0.4s ease;
}

.case-card.is-active .case-reveal {
    max-height: 200px;
    opacity: 1;
    margin-top: 1rem;
}

/* --- Responsive Polish --- */
@media (max-width: 768px) {
    .marquee-content {
        font-size: 1.5rem !important;
    }
    
    .flip-card:hover .flip-card-inner {
        /* Disable flip on touch — handle with mobile carousel instead */
        transform: none;
    }
    .flip-card.flipped .flip-card-inner {
        transform: rotateY(180deg);
    }

    /* Archive carousel scrollbar hide */
    #archive-carousel {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    #archive-carousel::-webkit-scrollbar {
        display: none;
    }

    /* Archive slide entrance animation */
    .archive-slide {
        opacity: 0;
        transform: translateX(30px);
        transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
                    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .archive-slide.in-view {
        opacity: 1;
        transform: translateX(0);
    }
    .archive-slide:nth-child(2) { transition-delay: 0.08s; }
    .archive-slide:nth-child(3) { transition-delay: 0.16s; }

    /* Section spacing reduction on mobile */
    #about {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
    #services {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
    #faq {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
    #contact {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    /* Stat cards: single column on very small screens */
    #about .grid.grid-cols-1.sm\:grid-cols-2 {
        grid-template-columns: 1fr 1fr;
    }

    /* Services cards full width on mobile */
    .service-card {
        margin-top: 0 !important;
    }
}

/* --- Confirmation Modal --- */
#confirmation-modal.active {
    opacity: 1;
    pointer-events: auto;
}

#confirmation-modal.active #modal-content {
    transform: scale(1);
}
