/* ===== CSS RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Base colors */
    --color-bg: #0a0e1a;
    --color-bg-secondary: #141727;
    --color-text: #e2e8f0;
    --color-text-secondary: #94a3b8;
    --color-primary: #3b82f6;
    --color-secondary: #9333ea;
    --color-accent: #f97316;
    
    /* Semantic colors */
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #3b82f6;
    
    /* Spacing scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 4rem;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #141727, #3b82f6, #9333ea);
    --gradient-secondary: linear-gradient(135deg, #1f2937, #4f46e5, #7c3aed);
    --gradient-text-animated: linear-gradient(90deg, #3b82f6, #9333ea, #f97316, #3b82f6);
    
    /* Light mode colors (default is dark) */
    --header-blur: 10px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== 3D BACKGROUND SHAPES ===== */
.bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    perspective: 1200px;
}

.shape-cube {
    position: absolute;
    width: 100px;
    height: 100px;
    top: 15%;
    right: 10%;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    opacity: 0.05;
    animation: rotate3d 30s infinite linear;
    transform-style: preserve-3d;
}

.shape-pyramid {
    position: absolute;
    width: 0;
    height: 0;
    bottom: 25%;
    left: 8%;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-bottom: 100px solid rgba(124, 58, 237, 0.05);
    animation: rotateX3d 25s infinite linear;
    transform-style: preserve-3d;
}

.shape-sphere {
    position: absolute;
    width: 80px;
    height: 80px;
    top: 50%;
    right: 20%;
    background: radial-gradient(circle, #3b82f6, #1e3a8a);
    border-radius: 50%;
    opacity: 0.05;
    animation: rotate3d 25s infinite reverse;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(147, 51, 234, 0.8);
    border-radius: 50%;
    animation: float 15s infinite ease-in-out;
}

.particle:nth-child(4) {
    top: 20%;
    left: 15%;
    animation-delay: 0s;
}

.particle:nth-child(5) {
    top: 40%;
    left: 80%;
    animation-delay: 3s;
}

.particle:nth-child(6) {
    top: 60%;
    left: 10%;
    animation-delay: 6s;
}

.particle:nth-child(7) {
    top: 80%;
    left: 70%;
    animation-delay: 9s;
}

.particle:nth-child(8) {
    top: 30%;
    left: 50%;
    animation-delay: 12s;
}

@keyframes rotate3d {
    from {
        transform: rotateX(0deg) rotateY(0deg);
    }
    to {
        transform: rotateX(360deg) rotateY(360deg);
    }
}

@keyframes rotateX3d {
    from {
        transform: rotateX(0deg);
    }
    to {
        transform: rotateX(360deg);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-30px) translateX(20px);
    }
    50% {
        transform: translateY(-60px) translateX(-20px);
    }
    75% {
        transform: translateY(-30px) translateX(20px);
    }
}

/* ===== HEADER & NAVIGATION ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 14, 26, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    perspective: 500px;
}

/* 3D Brand Cube */
.brand-cube {
    width: 40px;
    height: 40px;
    position: relative;
    transform-style: preserve-3d;
    animation: cubeSpin 8s infinite linear;
    transition: transform 0.3s ease;
}

.brand-cube::before,
.brand-cube::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    border: 2px solid rgba(59, 130, 246, 0.3);
}

.brand-cube::before {
    transform: translateZ(20px);
}

.brand-cube::after {
    transform: rotateY(90deg) translateZ(20px);
}

.brand:hover .brand-cube {
    animation-play-state: paused;
    transform: rotateX(15deg) rotateY(15deg);
}

@keyframes cubeSpin {
    from {
        transform: rotateX(0deg) rotateY(0deg);
    }
    to {
        transform: rotateX(360deg) rotateY(360deg);
    }
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--color-text-secondary);
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
}

.nav-link:hover {
    color: var(--color-text);
    transform: translateY(-2px) translateZ(5px);
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::before {
    width: 100%;
}

.nav-link-cta {
    text-decoration: none;
    color: var(--color-text);
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    background: var(--gradient-primary);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
}

.nav-link-cta:hover {
    transform: translateY(-4px) translateZ(10px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

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

.hero-content {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3rem;
    align-items: center;
}

/* DENVIL Rotating Cube */
.denvil-cube {
    width: 140px;
    height: 140px;
    position: relative;
    transform-style: preserve-3d;
    animation: denvilRotate 16s infinite linear;
    perspective: 1200px;
}

.denvil-cube:hover {
    animation-duration: 4s;
}

.cube-face {
    position: absolute;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: bold;
    background: var(--gradient-primary);
    border: 2px solid rgba(59, 130, 246, 0.3);
    color: white;
    opacity: 0.9;
}

.cube-front {
    transform: translateZ(70px);
}

.cube-back {
    transform: rotateY(180deg) translateZ(70px);
}

.cube-right {
    transform: rotateY(90deg) translateZ(70px);
}

.cube-left {
    transform: rotateY(-90deg) translateZ(70px);
}

.cube-top {
    transform: rotateX(90deg) translateZ(70px);
}

.cube-bottom {
    transform: rotateX(-90deg) translateZ(70px);
}

@keyframes denvilRotate {
    from {
        transform: rotateY(0deg);
    }
    to {
        transform: rotateY(360deg);
    }
}

.hero-right {
    padding: 2rem 0;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 1rem;
}

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

.subtitle {
    font-size: 2.5rem;
    color: var(--color-text-secondary);
}

.hero-description {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.badge {
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 2rem;
    font-size: 0.875rem;
    color: var(--color-primary);
    font-weight: 500;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn-primary {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
}

.btn-primary:hover {
    transform: translateY(-4px) translateZ(10px);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    display: inline-block;
    padding: 1rem 2rem;
    background: transparent;
    color: white;
    text-decoration: none;
    border: 2px solid rgba(59, 130, 246, 0.5);
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
}

.btn-secondary:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--color-primary);
    transform: translateY(-4px) translateZ(10px);
}

.btn-outline {
    display: inline-block;
    padding: 1rem 2rem;
    background: transparent;
    color: white;
    text-decoration: none;
    border: 2px solid rgba(147, 51, 234, 0.5);
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
}

.btn-outline:hover {
    background: rgba(147, 51, 234, 0.1);
    border-color: var(--color-secondary);
    transform: translateY(-4px) translateZ(10px);
}

/* ===== ABOUT SECTION ===== */
.about {
    padding: 6rem 0;
    background: var(--color-bg-secondary);
}

.section-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 3rem;
    text-align: center;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4rem;
    align-items: center;
}

.about-intro {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--color-text);
}

.about-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 3rem;
}

.detail-item {
    padding: 1rem;
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid var(--color-primary);
    border-radius: 0.5rem;
}

.detail-item strong {
    color: var(--color-primary);
    margin-right: 0.5rem;
}

.skills-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.skills-grid {
    display: grid;
    gap: 1.5rem;
}

.skill-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.skill-name {
    font-weight: 600;
    color: var(--color-text);
}

.skill-percent {
    color: var(--color-text-secondary);
}

.skill-progress {
    height: 8px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    transform-style: preserve-3d;
}

.skill-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 1rem;
    transition: width 1s ease;
    position: relative;
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        box-shadow: 0 0 0 rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
    }
    100% {
        box-shadow: 0 0 0 rgba(59, 130, 246, 0.5);
    }
}

/* HARSH Letter Tower */
.harsh-tower {
    display: flex;
    flex-direction: column;
    gap: 0;
    perspective: 1200px;
    transform-style: preserve-3d;
}

.tower-layer {
    width: 160px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    background: var(--gradient-secondary);
    border: 2px solid rgba(79, 70, 229, 0.3);
    color: white;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.layer-h {
    transform: translateZ(100px);
}

.layer-a {
    transform: translateZ(80px);
}

.layer-r {
    transform: translateZ(60px);
}

.layer-s {
    transform: translateZ(40px);
}

.layer-h2 {
    transform: translateZ(20px);
}

.tower-layer:hover {
    animation: layerShimmer 1s ease;
}

@keyframes layerShimmer {
    0%, 100% {
        box-shadow: 0 0 0 rgba(79, 70, 229, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(79, 70, 229, 1);
    }
}

/* ===== PROJECTS SECTION ===== */
.projects {
    padding: 6rem 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* 3D Project Cards */
.project-card {
    height: 280px;
    perspective: 1000px;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

a.project-card {
    color: inherit;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.project-card:hover .card-inner {
    transform: rotateY(180deg) rotateX(5deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 1rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.card-front {
    background: linear-gradient(135deg, #1e3a8a, #7c3aed);
}

.card-back {
    background: linear-gradient(135deg, #1f2937, #4f46e5);
    transform: rotateY(180deg);
}

.card-icon {
    font-size: 4rem;
}

.card-title {
    font-size: 1.75rem;
    font-weight: bold;
    color: white;
}

.card-description {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.card-status {
    padding: 0.25rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.card-status.completed {
    background: rgba(34, 197, 94, 0.3);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    font-size: 0.75rem;
}

.card-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.card-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.projects-cta {
    text-align: center;
}

/* Featured Project Badge */
.featured-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1f2937;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 1;
    animation: pulseBadge 2s ease-in-out infinite;
}

@keyframes pulseBadge {
    0%, 100% {
        box-shadow: 0 0 5px rgba(251, 191, 36, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.9);
    }
}

.project-card.featured .card-front {
    position: relative;
    border: 2px solid rgba(251, 191, 36, 0.5);
}

.project-card.featured:hover .card-inner {
    transform: rotateY(180deg) rotateX(5deg) scale(1.02);
}

.project-card.featured .card-front::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #fbbf24, transparent, #f59e0b);
    border-radius: 1rem;
    z-index: -1;
    opacity: 0.6;
    animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.8;
    }
}

/* ===== CONTACT SECTION ===== */
.contact {
    padding: 6rem 0;
    background: var(--color-bg-secondary);
}

.contact-intro {
    text-align: center;
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    margin-bottom: 3rem;
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    background: rgba(59, 130, 246, 0.05);
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-radius: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    transform-style: preserve-3d;
}

.contact-card:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--color-primary);
    transform: translateY(-8px) translateZ(10px);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.2);
}

.contact-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: 50%;
    animation: float3s 3s ease-in-out infinite;
}

.contact-icon svg {
    width: 30px;
    height: 30px;
    color: white;
}

@keyframes float3s {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.contact-card:hover .contact-icon {
    animation: rotate360 1s ease;
}

@keyframes rotate360 {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.contact-info h3 {
    font-size: 1.25rem;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.contact-info p {
    color: var(--color-text-secondary);
}

.telegram {
    border-color: rgba(34, 139, 230, 0.3);
}

.telegram:hover {
    border-color: #229BE6;
}

.email {
    border-color: rgba(234, 88, 12, 0.3);
}

.email:hover {
    border-color: #ea580c;
}

/* ===== FOOTER ===== */
.footer {
    padding: 2rem 0;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left p {
    color: var(--color-text-secondary);
}

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

.footer-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-left {
        display: flex;
        justify-content: center;
    }
    
    .denvil-cube {
        width: 100px;
        height: 100px;
    }
    
    .cube-face {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.75rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .about-details {
        grid-template-columns: 1fr;
    }
    
    .harsh-tower {
        margin: 0 auto;
    }
    
    .tower-layer {
        width: 120px;
        height: 50px;
        font-size: 2rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
    border-radius: 0.25rem;
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
    --color-bg: #f8fafc;
    --color-bg-secondary: #e2e8f0;
    --color-text: #1e293b;
    --color-text-secondary: #475569;
}

[data-theme="light"] .header {
    background: rgba(248, 250, 252, 0.9);
}

[data-theme="light"] .cube-face,
[data-theme="light"] .brand-cube::before,
[data-theme="light"] .brand-cube::after {
    background: var(--gradient-primary);
    color: white;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-normal);
    font-size: 1.25rem;
    margin-left: var(--space-md);
}

.theme-toggle:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: scale(1.1);
}

/* ===== SCROLL PROGRESS INDICATOR ===== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-primary);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
    z-index: 1001;
    transition: width 0.1s ease-out;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ===== MOBILE HAMBURGER MENU ===== */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: var(--transition-normal);
    transform-origin: center;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--color-bg-secondary);
    backdrop-filter: blur(20px);
    padding: 80px var(--space-lg) var(--space-lg);
    transition: right var(--transition-slow);
    z-index: 1001;
    border-left: 1px solid rgba(148, 163, 184, 0.1);
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.mobile-nav-links a {
    display: block;
    padding: var(--space-md);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: var(--transition-normal);
}

.mobile-nav-links a:hover {
    background: rgba(59, 130, 246, 0.1);
    padding-left: var(--space-lg);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ===== HEADER SCROLL STATES ===== */
.header {
    transition: transform var(--transition-normal), background var(--transition-normal), box-shadow var(--transition-normal);
}

.header.scrolled {
    background: rgba(10, 14, 26, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header.hidden {
    transform: translateY(-100%);
}

/* ===== TYPING EFFECT ===== */
.typing-container {
    display: inline-block;
    position: relative;
}

.typing-text {
    display: inline-block;
    min-width: 180px;
}

.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    background: var(--color-primary);
    margin-left: 2px;
    animation: blink 0.8s infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ===== GRADIENT TEXT ANIMATION ===== */
.gradient-text-animated {
    background: var(--gradient-text-animated);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientTextShift 4s ease infinite;
}

@keyframes gradientTextShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ===== FLOATING BADGE ANIMATION ===== */
.badge {
    animation: floatBadge 3s ease-in-out infinite;
}

.badge:nth-child(1) { animation-delay: 0s; }
.badge:nth-child(2) { animation-delay: 0.2s; }
.badge:nth-child(3) { animation-delay: 0.4s; }
.badge:nth-child(4) { animation-delay: 0.6s; }

@keyframes floatBadge {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* ===== INTERACTIVE PARTICLES ===== */
.particle {
    transition: transform 0.3s ease-out;
    pointer-events: none;
}

/* ===== SCROLL ANIMATIONS ===== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-on-scroll.slide-left {
    transform: translateX(-30px);
}

.animate-on-scroll.slide-left.visible {
    transform: translateX(0);
}

.animate-on-scroll.slide-right {
    transform: translateX(30px);
}

.animate-on-scroll.slide-right.visible {
    transform: translateX(0);
}

.animate-on-scroll.scale-up {
    transform: scale(0.9);
}

.animate-on-scroll.scale-up.visible {
    transform: scale(1);
}

/* Stagger animation for multiple items */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ===== CUSTOM CURSOR ===== */
.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease, width 0.2s ease, height 0.2s ease, background 0.2s ease;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
}

.custom-cursor.hovering {
    width: 40px;
    height: 40px;
    background: rgba(59, 130, 246, 0.3);
}

.cursor-trail {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.5;
    transition: transform 0.3s ease;
    transform: translate(-50%, -50%);
}

/* ===== GRADIENT BORDERS ===== */
.gradient-border {
    position: relative;
    background: var(--color-bg-secondary);
}

.gradient-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-primary);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.gradient-border:hover::before {
    opacity: 1;
}

/* ===== NOISE TEXTURE OVERLAY ===== */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ===== GLASSMORPHISM CARDS ===== */
.glass-card {
    background: rgba(20, 23, 39, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

/* ===== COPY TO CLIPBOARD BUTTON ===== */
.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: var(--transition-normal);
    margin-left: var(--space-sm);
}

.copy-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: scale(1.1);
}

/* Contact card with copy button wrapper */
.contact-card-wrapper {
    position: relative;
}

.contact-card-link {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.copy-btn svg {
    width: 18px;
    height: 18px;
    fill: var(--color-primary);
}

.copy-btn.copied {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.3);
}

.copy-btn.copied svg {
    fill: var(--color-success);
}

.copy-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-bg-secondary);
    color: var(--color-text);
    font-size: 0.75rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
}

.copy-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

/* ===== TOUCH FEEDBACK ===== */
@media (hover: none) {
    .btn-primary:active,
    .btn-secondary:active,
    .btn-outline:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    .project-card:active,
    .contact-card:active,
    .nav-link:active {
        opacity: 0.8;
    }
}

/* ===== MOBILE RESPONSIVE IMPROVEMENTS ===== */
@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }
    
    .mobile-nav,
    .mobile-overlay {
        display: block;
    }
    
    .nav-links {
        display: none;
    }
    
    .theme-toggle {
        margin-left: auto;
        margin-right: var(--space-md);
    }
    
    .custom-cursor,
    .cursor-trail {
        display: none;
    }
    
    /* Reduce animation complexity on mobile */
    .particle {
        animation-duration: 30s;
    }
    
    .shape-cube,
    .shape-pyramid,
    .shape-sphere {
        opacity: 0.02;
    }
}

/* ===== PROJECT FILTER ANIMATIONS ===== */
.project-item {
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.project-item.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

/* ===== SEARCH INPUT ===== */
.search-container {
    max-width: 400px;
    margin: 0 auto var(--space-lg);
    position: relative;
}

.search-input {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    padding-left: 3rem;
    background: rgba(59, 130, 246, 0.1);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 2rem;
    color: var(--color-text);
    font-size: 1rem;
    transition: var(--transition-normal);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.15);
}

.search-input::placeholder {
    color: var(--color-text-secondary);
}

.search-icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    fill: var(--color-text-secondary);
    pointer-events: none;
}

/* ===== DISABLE ANIMATIONS FOR REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .scroll-progress,
    .typing-cursor,
    .badge,
    .gradient-text-animated,
    .animate-on-scroll,
    .custom-cursor,
    .cursor-trail {
        animation: none !important;
        transition: none !important;
    }
    
    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
}

/* ===== PROJECTS PAGE STYLES (moved from inline) ===== */
.projects-page {
    padding-top: 120px;
    min-height: 100vh;
}

.page-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.page-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: var(--space-md);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-description {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.project-filters {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(59, 130, 246, 0.1);
    border: 2px solid rgba(59, 130, 246, 0.3);
    color: var(--color-text);
    border-radius: 2rem;
    cursor: pointer;
    transition: var(--transition-normal);
    font-weight: 600;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    transform: translateY(-2px);
}

.all-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.project-item {
    background: var(--color-bg-secondary);
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-radius: 1rem;
    overflow: hidden;
    transition: var(--transition-normal);
    transform-style: preserve-3d;
    text-decoration: none;
    display: block;
    color: inherit;
}

.project-item:hover {
    border-color: var(--color-primary);
    transform: translateY(-8px) rotateX(2deg);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.2);
}

.project-preview {
    height: 200px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    transform: rotateX(0deg) rotateZ(0deg);
    transition: transform var(--transition-normal);
}

.project-item:hover .project-preview {
    transform: rotateX(5deg) rotateZ(-2deg);
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: var(--space-sm);
    color: var(--color-text);
}

.project-desc {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
    line-height: 1.6;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.project-status {
    padding: var(--space-xs) 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-completed {
    background: rgba(34, 197, 94, 0.2);
    color: var(--color-success);
}

.status-development {
    background: rgba(59, 130, 246, 0.2);
    color: var(--color-info);
}

.status-planned {
    background: rgba(249, 115, 22, 0.2);
    color: var(--color-accent);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.tech-badge {
    padding: var(--space-xs) 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 1rem;
    font-size: 0.75rem;
    color: var(--color-primary);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-normal);
}

.project-link:hover {
    gap: 0.75rem;
}

/* Featured Project Styles */
.featured-project {
    border: 2px solid rgba(251, 191, 36, 0.5);
    position: relative;
    overflow: visible;
}

.featured-project::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #fbbf24, transparent, #f59e0b);
    border-radius: 1rem;
    z-index: -1;
    opacity: 0.4;
    animation: featuredGlow 3s ease-in-out infinite;
}

@keyframes featuredGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.featured-project:hover {
    border-color: #fbbf24;
    box-shadow: 0 15px 35px rgba(251, 191, 36, 0.3);
}

.featured-star {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    animation: starPulse 2s ease-in-out infinite;
}

@keyframes starPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.featured-project .project-preview {
    position: relative;
}
