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

body {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    background: #0d0d1f;
    color: #e0e0ff;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0d0d1f;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.6s ease;
}

#preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    width: 80px;
    height: 80px;
    perspective: 800px; /* Enables 3D effect */
}

.cube {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: cubeSpin 2s infinite ease-in-out;
}

.face {
    position: absolute;
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, #7b5cff, #ff4d7d); /* Electric violet to neon pink */
    opacity: 0.8;
    border: 2px solid #e0e0ff; /* Icy white border */
    box-shadow: 0 0 15px rgba(123, 92, 255, 0.5); /* Glow effect */
}

.front  { transform: rotateY(0deg) translateZ(40px); }
.back   { transform: rotateY(180deg) translateZ(40px); }
.right  { transform: rotateY(90deg) translateZ(40px); }
.left   { transform: rotateY(-90deg) translateZ(40px); }
.top    { transform: rotateX(90deg) translateZ(40px); }
.bottom { transform: rotateX(-90deg) translateZ(40px); }

/* Cube Animation */
@keyframes cubeSpin {
    0% {
        transform: rotateX(0deg) rotateY(0deg) scale(1);
    }
    50% {
        transform: rotateX(180deg) rotateY(180deg) scale(1.1); /* Slight pulse */
    }
    100% {
        transform: rotateX(360deg) rotateY(360deg) scale(1);
    }
}

/* Navbar */
.navbar {
    background: rgba(13, 13, 31, 0.9);
    backdrop-filter: blur(12px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: #ff4d7d;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 40px;
}

.nav-links li a {
    color: #99a3ff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links li a:hover {
    color: #ff4d7d;
}

.nav-toggle {
    display: none;
    font-size: 28px;
    cursor: pointer;
    color: #99a3ff;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 100px auto 0;
    padding: 40px;
    display: flex;
    gap: 60px;
}

/* Sidebar */
.sidebar {
    width: 340px;
    background: rgba(26, 26, 59, 0.95);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 120px;
    height: fit-content;
    backdrop-filter: blur(12px);
}

.sidebar-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: #e0e0ff;
    margin-bottom: 25px;
}

#project-search {
    width: 100%;
    padding: 14px 20px;
    border: 1px solid rgba(224, 224, 255, 0.15);
    border-radius: 10px;
    font-size: 16px;
    background: rgba(224, 224, 255, 0.05);
    color: #e0e0ff;
    outline: none;
    transition: all 0.3s ease;
}

#project-search:focus {
    border-color: #7b5cff;
    background: rgba(224, 224, 255, 0.1);
}

#project-search::placeholder {
    color: #99a3ff;
}

.sidebar ul {
    list-style: none;
    margin-top: 30px;
}

.sidebar li {
    margin-bottom: 15px;
    opacity: 0;
    transform: translateX(-30px);
    animation: slideIn 0.6s ease forwards;
    animation-delay: calc(var(--index) * 0.1s);
}

.sidebar a {
    color: #99a3ff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    display: block;
    padding: 12px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar a:hover {
    color: #e0e0ff;
    background: rgba(224, 224, 255, 0.1);
}

.sidebar a.active {
    background: #7b5cff;
    color: #e0e0ff;
    box-shadow: 0 4px 20px rgba(123, 92, 255, 0.4);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
}

.hero {
    position: relative;
    text-align: center;
    margin-bottom: 80px;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 16px;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    opacity: 0.7;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 40px;
}

.hero h1 {
    font-size: 72px;
    font-weight: 700;
    color: #e0e0ff;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(40px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.subtitle {
    font-size: 22px;
    color: #99a3ff;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
}

.project-section {
    margin-bottom: 100px;
}

.project-viewer {
    background: #1a1a3b;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease;
}

.project-viewer.visible {
    opacity: 1;
    transform: translateY(0);
}

#project-iframe {
    width: 100%;
    height: 750px;
    border: none;
    transition: opacity 0.5s ease;
}

.about-section, .contact-section {
    background: rgba(26, 26, 59, 0.95);
    border-radius: 16px;
    padding: 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 80px;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease;
}

.about-section.visible, .contact-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.about-section h2, .contact-section h2 {
    font-size: 36px;
    font-weight: 700;
    color: #e0e0ff;
    margin-bottom: 25px;
}

.about-section p {
    font-size: 18px;
    color: #99a3ff;
}

#contact-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

#contact-form input,
#contact-form textarea {
    padding: 16px;
    border: 1px solid rgba(224, 224, 255, 0.15);
    border-radius: 10px;
    background: rgba(224, 224, 255, 0.05);
    color: #e0e0ff;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

#contact-form input:focus,
#contact-form textarea:focus {
    border-color: #7b5cff;
    background: rgba(224, 224, 255, 0.1);
}

#contact-form textarea {
    min-height: 160px;
    resize: vertical;
}

#contact-form button {
    padding: 16px;
    border: none;
    border-radius: 10px;
    background: #7b5cff;
    color: #e0e0ff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#contact-form button:hover {
    background: #b388ff;
    box-shadow: 0 4px 20px rgba(123, 92, 255, 0.5);
}

/* Animations */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 0;
    }

    .nav-container {
        padding: 0 20px;
        flex-wrap: wrap;
    }

    .nav-links {
        display: none;
        width: 100%;
        padding: 20px 0;
        flex-direction: column;
        gap: 20px;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .container {
        flex-direction: column;
        padding: 20px;
        margin-top: 80px;
    }

    .sidebar {
        width: 100%;
        position: static;
        margin-bottom: 40px;
    }

    .hero {
        min-height: 60vh;
    }

    .hero h1 {
        font-size: 48px;
    }

    .subtitle {
        font-size: 18px;
    }

    #project-iframe {
        height: 500px;
    }

    .about-section, .contact-section {
        padding: 30px;
    }
}
