:root {
    --bg: #030712;
    --card-bg: rgba(17, 24, 39, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary: #818cf8;
    --secondary: #c084fc;
    --accent: #22d3ee;
    --text: #f9fafb;
    --text-muted: #9ca3af;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius-lg: 1.25rem;
    --radius-xl: 2rem;
    --glass-blur: 12px;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

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

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    border-radius: 10px;
    border: 3px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    cursor: none; /* Hide default cursor */
    /* Remove overflow-x: hidden to prevent mobile scroll issues */
}

/* --- Custom Cursor --- */
.cursor-dot, .cursor-outline {
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    will-change: left, top; /* Hardware acceleration */
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(129, 140, 248, 0.5);
    transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease; /* Smoother transition */
}

/* Floating Spotlight */
.mouse-spotlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: -1;
    filter: blur(40px);
    will-change: left, top; /* Hardware acceleration */
}

/* --- Animated Mesh Gradient Background --- */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(60px); /* Reduced from 100px for performance */
}

.mesh-blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
    animation: drift 20s infinite alternate ease-in-out;
    will-change: transform; /* Hardware acceleration */
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary), transparent);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--secondary), transparent);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent), transparent);
    top: 40%;
    left: 60%;
    animation-delay: -10s;
}

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Layout --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

section {
    padding: 60px 0; /* Reduced from 80px */
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem; /* Reduced from 3rem */
    text-align: center;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Glassmorphic Components --- */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-family: var(--font-heading);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(129, 140, 248, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(129, 140, 248, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* --- Scroll Progress Bar --- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    z-index: 2000;
    transition: width 0.1s ease-out;
}

/* --- Navigation --- */
nav {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 90%;
    max-width: 600px;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text);
}

.logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    body {
        cursor: auto !important;
    }
    
    .cursor-dot, .cursor-outline, .mouse-spotlight {
        display: none !important;
    }
    
    nav {
        width: 100%;
        top: 0;
        border-radius: 0;
        padding: 1rem;
        backdrop-filter: blur(10px); /* Lighter blur for mobile performance */
    }
    
    .nav-links {
        display: none;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    section {
        padding: 40px 0;
    }
    
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .hero-title {
        font-size: 2.5rem !important;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
    }
}

/* --- Animations --- */
.reveal {
    opacity: 0;
    will-change: transform, opacity;
}

.reveal-active {
    opacity: 1;
}

/* --- Parallax Floating Elements --- */
.floating-element {
    position: absolute;
    pointer-events: none;
    z-index: -1;
    opacity: 0.15;
    background: white;
    border-radius: 50%;
}

.spotlight-card {
    position: relative;
    overflow: hidden;
}

.spotlight-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at var(--mouse-x, 0) var(--mouse-y, 0),
        rgba(255, 255, 255, 0.1) 0%,
        transparent 80%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
    will-change: background; /* Hardware acceleration for dynamic gradient */
}

/* --- Project Grid --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: rgba(129, 140, 248, 0.1);
    color: var(--primary);
    border-radius: 999px;
    border: 1px solid rgba(129, 140, 248, 0.2);
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(129, 140, 248, 0.3);
}

/* --- Skills Grid --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.skill-category {
    padding: 1.5rem;
}

.skill-category h3 {
    font-family: var(--font-heading);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-item {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 0.5rem;
}

/* --- Timeline --- */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.timeline-item {
    padding: 2rem;
    position: relative;
}

.timeline-item h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* --- Forms --- */
form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

input, textarea {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem;
    border-radius: 1rem;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

input::placeholder, textarea::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

input:focus, textarea:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(129, 140, 248, 0.2), inset 0 2px 10px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

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

/* --- Footer --- */
footer {
    position: relative;
    padding: 4rem 0 2rem; /* Reduced from 8rem 0 4rem */
    margin-top: 2rem; /* Reduced from 5rem */
    background: linear-gradient(to top, rgba(129, 140, 248, 0.05), transparent);
    border-top: 1px solid var(--card-border);
    overflow: hidden;
}

.footer-bg-text {
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-heading);
    font-size: clamp(4rem, 15vw, 8rem); /* Reduced size */
    font-weight: 900;
    color: rgba(255, 255, 255, 0.03);
    white-space: nowrap;
    pointer-events: none;
    z-index: -1;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    text-align: center;
}

.footer-socials {
    display: flex;
    gap: 2rem;
}

.footer-social-link {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
}

.footer-social-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-10px) rotate(8deg);
    box-shadow: 0 10px 25px rgba(129, 140, 248, 0.4);
}

.footer-links {
    display: flex;
    gap: 3rem;
    list-style: none;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-bottom {
    margin-top: 4rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    opacity: 0.6;
}
