/* ============================================
   VARIABLES & RESET
   ============================================ */
:root {
    --primary: #6C63FF;
    --primary-dark: #5A52D5;
    --secondary: #00D9FF;
    --accent: #FF6B6B;
    --dark: #0F172A;
    --darker: #0B1120;
    --light: #F8FAFC;
    --gray: #64748B;
    --gray-light: #94A3B8;
    --gradient-1: linear-gradient(135deg, #6C63FF 0%, #00D9FF 100%);
    --gradient-2: linear-gradient(135deg, #FF6B6B 0%, #6C63FF 100%);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.15);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.2);
    --shadow-glow: 0 0 30px rgba(108, 99, 255, 0.3);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--darker);
    color: var(--light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   LOADING SCREEN
   ============================================ */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--darker);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    text-align: center;
}

.loader-circle {
    width: 50px;
    height: 50px;
    border: 3px solid var(--gray);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader p {
    color: var(--gray-light);
    font-size: 14px;
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(15, 23, 42, 0.95);
    box-shadow: var(--shadow-lg);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--light);
    font-weight: 700;
    font-size: 20px;
}

.brand-logo {
    font-size: 28px;
}

.brand-name {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-link {
    color: var(--gray-light);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    color: var(--light);
    background: rgba(108, 99, 255, 0.1);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
}

.hamburger .bar {
    width: 25px;
    height: 2px;
    background: var(--light);
    transition: var(--transition);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.gradient-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
}

.sphere-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -200px;
    right: -200px;
    animation: float 8s ease-in-out infinite;
}

.sphere-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    bottom: -100px;
    left: -100px;
    animation: float 6s ease-in-out infinite reverse;
}

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

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.badge {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(108, 99, 255, 0.1);
    border: 1px solid rgba(108, 99, 255, 0.3);
    border-radius: var(--radius-full);
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 24px;
}

.badge.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(108, 99, 255, 0.4); }
    50% { box-shadow: 0 0 20px 10px rgba(108, 99, 255, 0.2); }
}

.hero-title {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 18px;
    color: var(--gray-light);
    margin-bottom: 32px;
    max-width: 600px;
    line-height: 1.8;
}

.hero-cta {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(108, 99, 255, 0.4);
}

.btn-outline {
    border: 2px solid rgba(255,255,255,0.2);
    color: var(--light);
    background: transparent;
}

.btn-outline:hover {
    border-color: var(--primary);
    background: rgba(108, 99, 255, 0.1);
}

/* Stats Container */
.stats-container {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.stat-card:hover {
    background: rgba(255,255,255,0.05);
    transform: translateY(-4px);
}

.stat-icon {
    font-size: 28px;
    color: var(--primary);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(108, 99, 255, 0.1);
    border-radius: var(--radius-sm);
}

.stat-number {
    font-size: 32px;
    font-weight: 800;
    display: block;
    line-height: 1;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 14px;
    color: var(--gray-light);
}

/* ============================================
   PORTFOLIO SECTION
   ============================================ */
.portfolio-section {
    padding: 100px 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    margin-bottom: 12px;
}

.section-header p {
    color: var(--gray-light);
    font-size: 18px;
}

/* Filter Buttons */
.filter-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--gray-light);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Portfolio Slider Wrapper */
.slider-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
}

.slider-nav {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
    font-size: 18px;
}

.slider-nav:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.slider-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Portfolio Grid */
.portfolio-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0;
    scrollbar-width: none;
}

.portfolio-grid::-webkit-scrollbar {
    display: none;
}

.portfolio-item {
    min-width: 350px;
    flex-shrink: 0;
    scroll-snap-align: start;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.portfolio-item:hover {
    transform: translateY(-8px);
    border-color: rgba(108, 99, 255, 0.3);
    box-shadow: var(--shadow-lg);
}

.portfolio-thumbnail {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s;
}

.portfolio-item:hover .portfolio-thumbnail {
    transform: scale(1.05);
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
    display: flex;
    align-items: flex-end;
    padding: 24px;
    opacity: 0;
    transition: var(--transition);
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-info {
    color: white;
}

.portfolio-info h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.portfolio-category {
    font-size: 13px;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: white;
    opacity: 0;
    transition: var(--transition);
}

.portfolio-item:hover .play-icon {
    opacity: 1;
}

/* Slider Dots */
.slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background: var(--primary);
    width: 24px;
    border-radius: 5px;
}

/* ============================================
   SERVICES SECTION
   ============================================ */
.services-section {
    padding: 100px 0;
    background: rgba(108, 99, 255, 0.02);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.service-card {
    padding: 40px 32px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    text-align: center;
}

.service-card:hover {
    border-color: rgba(108, 99, 255, 0.3);
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 20px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(108, 99, 255, 0.1);
    border-radius: 50%;
    margin: 0 auto 20px;
}

.service-card h3 {
    font-size: 22px;
    margin-bottom: 12px;
}

.service-card p {
    color: var(--gray-light);
    margin-bottom: 20px;
}

.service-features {
    list-style: none;
    text-align: left;
}

.service-features li {
    padding: 8px 0;
    color: var(--gray-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.service-features li i {
    color: #10B981;
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about-section {
    padding: 100px 0;
}

.about-section .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-content h2 {
    font-size: clamp(28px, 4vw, 40px);
    margin-bottom: 20px;
}

.about-content p {
    color: var(--gray-light);
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 32px;
}

.image-frame {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 2px solid rgba(108, 99, 255, 0.2);
}

.image-frame img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact-section {
    padding: 100px 0;
    background: rgba(108, 99, 255, 0.02);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.contact-card {
    padding: 32px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius-lg);
    text-align: center;
    text-decoration: none;
    color: var(--light);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.contact-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.contact-icon {
    font-size: 36px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(108, 99, 255, 0.1);
    color: var(--primary);
}

.contact-card h3 {
    font-size: 20px;
}

.contact-card p {
    color: var(--gray-light);
    font-size: 14px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    padding: 40px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-light);
    text-decoration: none;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-4px);
}

/* ============================================
   BACK TO TOP
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--dark);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 20px;
        transition: 0.4s;
    }

    .nav-menu.active {
        left: 0;
    }

    .about-section .container {
        grid-template-columns: 1fr;
    }

    .stats-container {
        flex-direction: column;
    }

    .hero-cta {
        flex-direction: column;
    }

    .portfolio-item {
        min-width: 280px;
    }
}

/* Popup Preview */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.popup-content img,
.popup-content video {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-md);
}

.popup-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
}