/* Resets and basic setup */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Defines color variables and custom mouse properties */
:root {
    --mouse-x: 50%;
    --mouse-y: 50%;
    --primary: #00d4ff;
    --secondary: #ff00ff;
    --accent: #ffff00;
    --dark: #0a0a0a;
    --light: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dark);
    color: var(--light);
    overflow-x: hidden;
    cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><circle cx="10" cy="10" r="8" fill="none" stroke="white" stroke-width="2"/><circle cx="10" cy="10" r="3" fill="white"/></svg>'), auto;
}

/* Animated background canvas */
.bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Floating orbs for background visual effect */
.orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    mix-blend-mode: screen;
    filter: blur(40px);
    opacity: 0.5;
    animation: float 20s infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary), transparent);
    top: -200px;
    left: -200px;
    animation-duration: 25s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--secondary), transparent);
    bottom: -150px;
    right: -150px;
    animation-duration: 30s;
    animation-delay: -10s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--accent), transparent);
    top: 50%;
    left: 50%;
    animation-duration: 20s;
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(100px, -100px) scale(1.1);
    }
    66% {
        transform: translate(-100px, 100px) scale(0.9);
    }
}

/* Navigation bar styling */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 2rem 4rem;
    z-index: 1000;
    backdrop-filter: blur(20px) saturate(180%);
    background: rgba(10, 10, 10, 0.7);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

nav.scrolled {
    padding: 1rem 4rem;
    background: rgba(10, 10, 10, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.3s;
}

.logo:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.nav-links {
    display: flex;
    gap: 3rem;
    list-style: none;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    position: relative;
    transition: color 0.3s;
    font-weight: 500;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    color: var(--light);
}

.nav-link:hover::after {
    width: 100%;
}

/* Hero section styles */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 2rem;
}

.hero-content {
    text-align: center;
    z-index: 2;
    max-width: 1000px;
}

.hero-title {
    font-size: clamp(3rem, 12vw, 10rem);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
    position: relative;
}

.hero-title span {
    display: inline-block;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-title span:hover {
    transform: translateY(-10px) rotate(-5deg) scale(1.1);
    color: var(--primary);
    filter: drop-shadow(0 10px 20px rgba(0, 212, 255, 0.5));
}

/* Glitch effect for text */
.glitch {
    position: relative;
    color: var(--light);
    animation: glitch-skew 4s infinite;
}

@keyframes glitch-skew {
    0%, 100% { transform: skew(0deg); }
    20% { transform: skew(1deg); }
    40% { transform: skew(-1deg); }
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 0.5s infinite;
    color: var(--primary);
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.5s infinite;
    color: var(--secondary);
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 100% { clip-path: inset(0); transform: translate(0); }
    20% { clip-path: inset(10% 0 40% 0); transform: translate(-2px, 2px); }
}

@keyframes glitch-2 {
    0%, 100% { clip-path: inset(0); transform: translate(0); }
    20% { clip-path: inset(50% 0 20% 0); transform: translate(2px, -2px); }
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 3rem;
    font-weight: 300;
    opacity: 0;
    animation: fadeInUp 1s 0.5s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
    from {
        opacity: 0;
        transform: translateY(30px);
    }
}

.hero-cta {
    display: inline-flex;
    gap: 2rem;
    opacity: 0;
    animation: fadeInUp 1s 0.8s forwards;
}

/* Button styles */
.btn {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--light);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 212, 255, 0.5);
}

.btn-outline {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--dark);
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 212, 255, 0.5);
}

/* Interactive particle effect */
.particle {
    position: fixed;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8), transparent);
    border-radius: 50%;
    animation: particle-float 4s linear;
}

@keyframes particle-float {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    10% {
        opacity: 1;
        transform: translateY(-20px) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateY(-150px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-180px) scale(0);
    }
}

/* Skills section styles */
.skills {
    padding: 8rem 2rem;
    position: relative;
    background: linear-gradient(180deg, transparent, rgba(0, 212, 255, 0.05), transparent);
}

.section-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    text-align: center;
    margin-bottom: 4rem;
    background: linear-gradient(135deg, var(--light), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.skills-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center; 
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.skill-card:hover::before {
    transform: translateX(100%);
}

.skill-card:hover {
    transform: translateY(-10px) scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 212, 255, 0.3);
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
    transition: all 0.3s;
}

.skill-card:hover .skill-icon {
    transform: rotateY(360deg);
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.8));
}

.skill-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.skill-level {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Projects section styles */
.projects {
    padding: 8rem 2rem;
    position: relative;
}

.projects-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
}

.project-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    group: true;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 30px 60px rgba(0, 212, 255, 0.4);
}

.project-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    position: relative;
    overflow: hidden;
}

.project-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(0, 212, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.project-card:hover .project-image::after {
    transform: translateX(100%);
}

.project-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    opacity: 0.3;
    transition: all 0.3s;
}

.project-card:hover .project-icon {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1.2);
    filter: drop-shadow(0 0 30px rgba(0, 212, 255, 0.8));
}

.project-content {
    padding: 2rem;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--light), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.project-description {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    padding: 0.8rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.project-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.project-link:hover {
    color: var(--dark);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.project-link:hover::before {
    width: 200%;
    height: 200%;
}

/* Contact section styles */
.contact {
    padding: 8rem 2rem;
    text-align: center;
    background: linear-gradient(180deg, transparent, rgba(255, 0, 255, 0.05), transparent);
}

.contact-content {
    max-width: 800px;
    margin: 0 auto;
}

.contact-text {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 3rem;
    line-height: 1.8;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.social-link {
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--light);
    font-size: 1.5rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
    z-index: -1;
}

.social-link:hover {
    transform: translateY(-5px) rotate(360deg);
    border-color: transparent;
}

.social-link:hover::before {
    width: 100%;
    height: 100%;
}

/* Footer styles */
footer {
    padding: 2rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
}

/* Scroll progress bar styles */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    transform-origin: left;
    transform: scaleX(0);
    z-index: 10000;
    transition: transform 0.1s;
}

/* Responsive design adjustments */
@media (max-width: 768px) {
    nav {
        padding: 1.5rem 2rem;
    }

    .nav-links {
        gap: 1.5rem;
    }

    .hero-title {
        font-size: clamp(3rem, 15vw, 6rem);
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .social-links {
        gap: 1rem;
    }
}

/* Loading animation styles */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s, visibility 0.5s;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-text {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}