:root {
    --bg-color: #050505;
    --text-color: #e0e0e0;
    --accent-color: #00f3ff;
    --secondary-accent: #bc13fe;
    --font-primary: 'Outfit', sans-serif;
    --font-display: 'Space Grotesk', sans-serif;
    --cursor-size: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
    /* Hide default cursor */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* 3D Canvas Background */
#webgl {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* Custom Cursor */
.cursor {
    position: fixed;
    width: var(--cursor-size);
    height: var(--cursor-size);
    background: #fff;
    border-radius: 50%;
    pointer-events: none;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
}

.cursor-follower {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transition: width 0.3s, height 0.3s, background 0.3s;
}

.cursor.active {
    opacity: 0;
}

.cursor-follower.active {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
}

/* Typography & Global */
h1,
h2,
h3,
.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Navbar */
.navbar {
    position: absolute;
    /* Changed from fixed to absolute */
    top: 0;
    width: 100%;
    padding: 2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    mix-blend-mode: difference;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 5%;
    position: relative;
}

.hero-title {
    font-size: 5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-title span {
    display: block;
}

.hero-subtitle {
    font-size: 1.5rem;
    opacity: 0.8;
    margin-bottom: 2rem;
    min-height: 1.5em;
    /* Reserve space */
}

.typewriter {
    display: inline-block;
    /* Hugs the text */
    border-right: 2px solid var(--accent-color);
    white-space: nowrap;
    overflow: hidden;
    animation: blink-caret 0.75s step-end infinite;
    opacity: 0;
    /* Hidden initially, revealed by JS */
    max-width: 100%;
    /* Safety for mobile */
    vertical-align: bottom;
    /* Fix alignment issues */
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: var(--accent-color)
    }
}


/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 2rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.btn:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
}

/* Sections */
.section {
    padding: 6rem 5%;
    /* Reduced from 8rem */
    position: relative;
    /* Removed min-height: 100vh to reduce gaps, kept for Hero only */
}

.hero {
    min-height: 100vh;
    /* Hero still needs full height */
}

.section-title {
    font-size: 3rem;
    margin-bottom: 3rem;
    /* Reduced from 4rem */
    border-left: 5px solid var(--accent-color);
    padding-left: 1.5rem;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    height: 350px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
    display: flex;
    flex-direction: column;
}

.project-image {
    flex: 1;
    width: 100%;
    transition: transform 0.5s ease;
}

.project-info {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.project-tag {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-top: 0.5rem;
    border: 1px solid rgba(0, 243, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 243, 255, 0.3);
}

.project-card:hover .project-image {
    transform: scale(1.05);
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 12px;
    transition: 0.3s;
    backdrop-filter: blur(5px);
}

.service-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-color);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    display: block;
}

.service-card h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.service-card p {
    font-size: 0.95rem;
    opacity: 0.8;
    line-height: 1.6;
}

/* Social Icons */
.social-icon {
    font-size: 2rem;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.social-icon:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
}

.email-link {
    font-size: 2rem;
    font-weight: 700;
    transition: 0.3s;
}

.email-link:hover {
    color: var(--accent-color);
}

/* Skills Tags */
.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.skill-tag {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.skill-tag:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
}


/* Utilities */
.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Mobile Responsiveness --- */

/* Default state: Hide mobile nav */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {

    /* Cursor: Hide custom cursor on touch devices */
    .cursor,
    .cursor-follower {
        display: none;
    }

    * {
        cursor: auto;
        /* Restore default cursor */
    }

    /* Navbar: Hide desktop links */
    .nav-links {
        display: none;
    }

    .navbar {
        padding: 1.5rem 5%;
    }

    /* Mobile Bottom Nav */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: rgba(5, 5, 5, 0.9);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        justify-content: space-around;
        padding: 0.8rem 0;
        z-index: 1000;
        padding-bottom: max(0.8rem, env(safe-area-inset-bottom));
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: var(--text-color);
        font-size: 0.8rem;
        opacity: 0.7;
        transition: 0.3s;
    }

    .mobile-nav-item i {
        font-size: 1.5rem;
        margin-bottom: 0.2rem;
    }

    .mobile-nav-item.active,
    .mobile-nav-item:hover {
        opacity: 1;
        color: var(--accent-color);
    }

    /* Hero adjustments */
    .hero-title {
        font-size: 2.5rem;
        /* Slightly smaller */
    }

    .hero-subtitle {
        font-size: 1rem;
        min-height: auto;
    }

    /* Handle Typewriter on Mobile */
    .typewriter {
        white-space: normal;
        /* Allow wrapping */
        border-right: none;
        /* remove cursor if wrapping looks bad, or keep it */
        animation: none;
        /* static text on mobile to prevent layout jumps */
        opacity: 1;
        /* Force visible */
        display: block;
    }

    /* Hide Scroll Indicator on Mobile */
    .scroll-indicator {
        display: none;
    }

    /* Section adjustments */
    .section {
        padding: 3rem 5%;
        /* Tighter padding */
        padding-bottom: 6rem;
        /* Space for bottom nav */
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    /* Project Cards Mobile */
    .project-card {
        height: 300px;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }
}