/* ===========================================
   Za7Za8 Lab - Custom Styles
   Laboratory-inspired Marketing Agency Design
   =========================================== */

/* ===========================
   CSS Variables & Animations
   =========================== */
/* Google Fonts moved to HTML <link> for better performance */

:root {
    /* Lab Color Palette */
    --lab-blue: #3B82F6;
    --lab-purple: #8B5CF6;
    --lab-pink: #EC4899;
    --lab-cyan: #06B6D4;
    --lab-emerald: #10B981;
    --lab-amber: #F59E0B;

    /* Transitions */
    --transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===========================
   Background Patterns
   =========================== */
.bg-grid-pattern {
    background-image:
        linear-gradient(rgba(139, 92, 246, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    /* Removed infinite animation for better performance */
}

@keyframes grid-move {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

.bg-circuit-pattern {
    background-image:
        radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    /* Removed infinite animation for better performance */
}

@keyframes circuit-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.bg-dot-pattern {
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* ===========================
   Floating Particles Animation
   =========================== */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particles-container::before,
.particles-container::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    /* Removed infinite animation for better performance */
}

.particles-container::before {
    top: 10%;
    left: 10%;
    background: linear-gradient(135deg, var(--lab-purple), var(--lab-pink));
}

.particles-container::after {
    bottom: 10%;
    right: 10%;
    background: linear-gradient(135deg, var(--lab-blue), var(--lab-cyan));
}

@keyframes float-particle {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(50px, -50px) scale(1.1);
    }
    50% {
        transform: translate(-30px, 30px) scale(0.9);
    }
    75% {
        transform: translate(30px, 50px) scale(1.05);
    }
}

/* ===========================
   Navigation Styles
   =========================== */
.nav-link {
    position: relative;
    font-weight: 500;
    color: #374151;
    padding: 0.5rem 1rem;
    transition: color var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--lab-purple), var(--lab-pink));
    transform: translateX(-50%);
    transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
    color: var(--lab-purple);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #374151;
    border-radius: 2px;
    transition: all var(--transition-base);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base);
}

.mobile-menu.active {
    max-height: 400px;
}

.mobile-nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: #374151;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all var(--transition-fast);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
    color: var(--lab-purple);
}

/* ===========================
   Lab Flask Animation (Hero)
   =========================== */
.lab-flask {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.2;
    /* Removed infinite animation for better performance */
}

.lab-flask-1 {
    top: 10%;
    left: 10%;
    background: linear-gradient(135deg, var(--lab-purple), var(--lab-pink));
}

.lab-flask-2 {
    top: 50%;
    right: 10%;
    background: linear-gradient(135deg, var(--lab-blue), var(--lab-cyan));
}

.lab-flask-3 {
    bottom: 15%;
    left: 15%;
    background: linear-gradient(135deg, var(--lab-pink), var(--lab-amber));
}

@keyframes flask-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(40px, -40px) scale(1.1);
    }
    66% {
        transform: translate(-40px, 40px) scale(0.9);
    }
}

/* ===========================
   Button Styles
   =========================== */
.lab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 9999px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.lab-btn-primary {
    background: linear-gradient(135deg, var(--lab-purple), var(--lab-pink));
    color: white;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
}

.lab-btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.lab-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.5);
}

.lab-btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.lab-btn-secondary {
    background: white;
    color: var(--lab-purple);
    border: 2px solid var(--lab-purple);
}

.lab-btn-secondary:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
    transform: translateY(-2px);
}

.lab-btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 2.5rem;
    font-weight: 700;
    font-size: 1.125rem;
    border-radius: 9999px;
    background: white;
    color: var(--lab-purple);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.lab-btn-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.lab-btn-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.lab-btn-cta:hover::before {
    left: 100%;
}

.lab-btn-cta-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 2.5rem;
    font-weight: 600;
    font-size: 1.125rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all var(--transition-base);
}

.lab-btn-cta-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
}

/* ===========================
   Stats Card
   =========================== */
.lab-stat-card {
    padding: 1.5rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-base);
}

.lab-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.2);
}

/* ===========================
   Service Card
   =========================== */
.lab-service-card {
    padding: 2rem;
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
}

.lab-service-card.visible {
    animation: reveal-up 0.6s ease forwards;
    animation-delay: var(--delay, 0s);
}

.lab-service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--lab-purple), var(--lab-pink), var(--lab-blue));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-slow);
}

.lab-service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.2);
    border-color: var(--lab-purple);
}

.lab-service-card:hover::before {
    transform: scaleX(1);
}

.lab-service-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    color: white;
    margin-bottom: 1.5rem;
    transition: all var(--transition-base);
}

.lab-service-card:hover .lab-service-icon {
    transform: scale(1.1) rotate(5deg);
}

.lab-tag {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--lab-purple);
    background: rgba(139, 92, 246, 0.1);
    border-radius: 9999px;
    transition: all var(--transition-fast);
}

.lab-tag:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: scale(1.05);
}

.lab-service-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--lab-purple);
    transition: gap var(--transition-fast);
}

.lab-service-link:hover {
    gap: 0.75rem;
}

/* ===========================
   Process Card
   =========================== */
.lab-process-card {
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition-base);
    position: relative;
    opacity: 0;
    transform: translateY(30px);
}

.lab-process-card.visible {
    animation: reveal-up 0.6s ease forwards;
    animation-delay: var(--delay, 0s);
}

.lab-process-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-10px);
}

.lab-process-number {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 3rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.1);
}

.lab-process-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    color: white;
    margin-bottom: 1.5rem;
    transition: all var(--transition-base);
}

.lab-process-card:hover .lab-process-icon {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1) rotate(5deg);
}

/* ===========================
   Feature Card
   =========================== */
.lab-feature-card {
    padding: 2rem;
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    transition: all var(--transition-base);
    opacity: 0;
    transform: translateY(30px);
}

.lab-feature-card.visible {
    animation: reveal-up 0.6s ease forwards;
    animation-delay: var(--delay, 0s);
}

.lab-feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.15);
    border-color: var(--lab-purple);
}

.lab-feature-icon-wrapper {
    margin-bottom: 1.5rem;
}

.lab-feature-icon {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    color: white;
    transition: all var(--transition-base);
}

.lab-feature-card:hover .lab-feature-icon {
    transform: scale(1.1) rotate(-5deg);
}

/* ===========================
   Social Links
   =========================== */
.lab-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 0.5rem;
    color: var(--lab-purple);
    transition: all var(--transition-base);
}

.lab-social-link:hover {
    background: linear-gradient(135deg, var(--lab-purple), var(--lab-pink));
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* ===========================
   Footer Links
   =========================== */
.lab-footer-link {
    color: #9ca3af;
    transition: all var(--transition-fast);
    display: inline-block;
}

.lab-footer-link:hover {
    color: var(--lab-purple);
    transform: translateX(5px);
}

/* ===========================
   Animation Classes
   =========================== */
@keyframes fade-in-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes reveal-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-down {
    animation: fade-in-down 0.8s ease;
}

.animate-fade-in-up {
    animation: fade-in-up 0.8s ease;
}

.animation-delay-200 {
    animation-delay: 0.2s;
    animation-fill-mode: both;
}

.animation-delay-300 {
    animation-delay: 0.3s;
    animation-fill-mode: both;
}

.animation-delay-400 {
    animation-delay: 0.4s;
    animation-fill-mode: both;
}

.animation-delay-500 {
    animation-delay: 0.5s;
    animation-fill-mode: both;
}

.animation-delay-600 {
    animation-delay: 0.6s;
    animation-fill-mode: both;
}

/* Scroll Reveal */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    .lab-flask {
        width: 150px;
        height: 150px;
    }

    .lab-btn {
        padding: 0.875rem 1.5rem;
    }

    .lab-btn-cta,
    .lab-btn-cta-secondary {
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    .lab-service-card,
    .lab-feature-card,
    .lab-process-card {
        padding: 1.5rem;
    }

    .particles-container::before,
    .particles-container::after {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 640px) {
    .lab-stat-card {
        padding: 1rem;
    }

    .lab-process-number {
        font-size: 2rem;
    }

    .lab-flask {
        width: 100px;
        height: 100px;
    }
}

/* ===========================
   Smooth Scrolling
   =========================== */
html {
    scroll-behavior: smooth;
}

/* ===========================
   Selection Color
   =========================== */
::selection {
    background: rgba(139, 92, 246, 0.2);
    color: var(--lab-purple);
}

::-moz-selection {
    background: rgba(139, 92, 246, 0.2);
    color: var(--lab-purple);
}

/* ===========================
   Focus Styles (Accessibility)
   =========================== */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--lab-purple);
    outline-offset: 2px;
}

/* ===========================
   Performance Optimizations
   =========================== */
.lab-service-card,
.lab-feature-card,
.lab-process-card,
.lab-btn,
.nav-link {
    will-change: transform;
}

/* Remove will-change after animation */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
