* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #000;
    color: #fff;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header - Fixed */
header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1002;
    background: rgba(60, 60, 60, 0.95);
    backdrop-filter: blur(15px);
    padding: 8px 0;
    border-radius: 25px;
    width: 320px;
    max-width: 90vw;
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
}

/* Header hidden state */
header.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-20px);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-left,
.nav-right {
    flex: 0 0 auto;
    display: flex;
}

.nav-left {
    justify-content: flex-start;
}

.nav-right {
    justify-content: flex-end;
}

.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.logo {
    font-size: 22px;
    font-weight: 900;
    color: #fff;
    text-decoration: none;
    letter-spacing: -1px;
    background: linear-gradient(45deg, #fff, #ccc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.1);
}

/* Menu Toggle Button */
.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    transition: transform 0.3s ease;
}

.menu-toggle:hover {
    transform: scale(1.1);
}

.hamburger-line {
    width: 16px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Email Button */
.email-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #fff;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.email-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.email-btn svg {
    width: 18px;
    height: 18px;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    max-width: 90vw;
    background: rgba(40, 40, 40, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
    padding: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    text-align: center;
    width: 100%;
    padding: 0 20px;
}

/* Navigation Links */
.mobile-nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-links li {
    margin: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.mobile-menu.active .mobile-nav-links li {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu.active .mobile-nav-links li:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.active .mobile-nav-links li:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.active .mobile-nav-links li:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.active .mobile-nav-links li:nth-child(4) { transition-delay: 0.25s; }
.mobile-menu.active .mobile-nav-links li:nth-child(5) { transition-delay: 0.3s; }

.mobile-nav-link {
    display: block;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 12px 20px;
    margin: 2px 0;
    transition: all 0.3s ease;
    border-radius: 15px;
    position: relative;
}

.mobile-nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(5px);
}

/* ========== HERO SECTION - ADVANCED ANIMATIONS ========== */

.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 0 20px;
    overflow: hidden;
    background: linear-gradient(135deg, #000 0%, #111 50%, #000 100%);
}

/* Animated Background Particles */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.08) 0%, transparent 50%);
    animation: backgroundFloat 20s ease-in-out infinite;
    z-index: 1;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 48%, rgba(255, 255, 255, 0.02) 49%, rgba(255, 255, 255, 0.02) 51%, transparent 52%),
        linear-gradient(-45deg, transparent 48%, rgba(255, 255, 255, 0.01) 49%, rgba(255, 255, 255, 0.01) 51%, transparent 52%);
    background-size: 100px 100px;
    animation: gridMove 30s linear infinite;
    z-index: 1;
}

/* Floating Geometric Shapes */
.hero-shapes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(120, 119, 198, 0.1), rgba(255, 255, 255, 0.05));
    animation: floatShape 15s ease-in-out infinite;
}

.shape:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 20s;
}

.shape:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 60%;
    right: 15%;
    animation-delay: -5s;
    animation-duration: 25s;
    border-radius: 20%;
}

.shape:nth-child(3) {
    width: 40px;
    height: 40px;
    top: 30%;
    right: 25%;
    animation-delay: -10s;
    animation-duration: 18s;
    border-radius: 0;
    transform: rotate(45deg);
}

.shape:nth-child(4) {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 20%;
    animation-delay: -8s;
    animation-duration: 22s;
}

.shape:nth-child(5) {
    width: 50px;
    height: 50px;
    top: 10%;
    right: 40%;
    animation-delay: -15s;
    animation-duration: 16s;
    border-radius: 30%;
}

/* Hero Content Container */
.hero-content {
    max-width: 100%;
    overflow: visible;
    position: relative;
    z-index: 10;
    animation: heroContentFadeIn 2s ease-out;
}

/* Main Title with Better Readability and Clean Style */
.hero-content h1 {
     font-size: clamp(3rem, 8vw, 12rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 30px;
    letter-spacing: -2px;

    color: #ffffff;
    background: none;
    /*-webkit-background-clip: unset;*/
    -webkit-text-fill-color: unset;

    text-shadow:
        0 2px 5px rgba(0, 0, 0, 0.4),
        0 0 10px rgba(255, 255, 255, 0.2);

    padding-bottom: 20px;
    overflow: visible;
    position: relative;

    animation: titleFloat 8s ease-in-out infinite;
}

/* Subtitle with Typewriter Effect */
.hero-content p {
    font-size: 18px;
    opacity: 0;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    animation: typeWriter 3s steps(100) 1s forwards;
    border-right: 2px solid #667eea;
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 40px;
}

/* Improved glowing border effect - more subtle */
.hero-content h1::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    background: linear-gradient(45deg, #667eea, #764ba2, #8a7ca8, #667eea);
    background-size: 300% 300%;
    border-radius: 25px;
    z-index: -1;
    opacity: 0.08; /* Reduced opacity */
    animation: borderGlow 8s ease-in-out infinite;
    filter: blur(15px); /* Reduced blur */
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    animation: scrollBounce 2s ease-in-out infinite;
    opacity: 0;
    animation-delay: 4s;
    animation-fill-mode: forwards;
}

.scroll-indicator::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 40px;
    background: linear-gradient(to bottom, transparent, #667eea, transparent);
    animation: scrollLine 2s ease-in-out infinite;
}

.scroll-indicator::after {
    content: '↓';
    display: block;
    color: #667eea;
    font-size: 24px;
    font-weight: bold;
}

/* Interactive Cursor Trail (requires JS) */
.cursor-trail {
    position: fixed;
    width: 6px;
    height: 6px;
    background: #667eea;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    animation: cursorPulse 1s ease-in-out infinite;
}

/* Floating Action Button */
.hero-cta {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    animation: ctaFadeIn 1s ease-out 5s forwards;
    transition: all 0.3s ease;
    z-index: 10;
}

.hero-cta:hover {
    transform: translateX(-50%) translateY(-5px) scale(1.05);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.4);
}

/* ========== KEYFRAME ANIMATIONS ========== */

@keyframes backgroundFloat {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
        opacity: 1;
    }
    50% { 
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.8;
    }
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(100px, 100px); }
}

@keyframes floatShape {
    0%, 100% { 
        transform: translateY(0px) translateX(0px) rotate(0deg);
        opacity: 0.3;
    }
    25% { 
        transform: translateY(-30px) translateX(10px) rotate(90deg);
        opacity: 0.6;
    }
    50% { 
        transform: translateY(-20px) translateX(-10px) rotate(180deg);
        opacity: 0.4;
    }
    75% { 
        transform: translateY(-40px) translateX(5px) rotate(270deg);
        opacity: 0.7;
    }
}

@keyframes heroContentFadeIn {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Improved keyframe animations */
@keyframes titleGradientMove {
    0%, 100% { 
        background-position: 0% 50%;
        filter: hue-rotate(0deg) brightness(1);
    }
    50% { 
        background-position: 100% 50%;
        filter: hue-rotate(15deg) brightness(1.1); /* Reduced hue rotation */
    }
}

@keyframes titleFloat {
    0%, 100% { 
        transform: translateY(0px) scale(1);
    }
    50% { 
        transform: translateY(-5px) scale(1.01); /* Reduced movement */
    }
}

/* Removed the original titleGlow animation that was causing blur */

@keyframes typeWriter {
    0% { 
        width: 0;
        opacity: 1;
    }
    99% { 
        opacity: 1;
        border-right: 2px solid #667eea;
    }
    100% { 
        width: 100%;
        opacity: 1;
        border-right: none;
        white-space: normal;
    }
}

@keyframes borderGlow {
    0%, 100% { 
        background-position: 0% 50%;
        opacity: 0.06;
    }
    50% { 
        background-position: 100% 50%;
        opacity: 0.12; /* More subtle glow */
    }
}

@keyframes scrollBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
        opacity: 0.8;
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
        opacity: 0.9;
    }
}

@keyframes scrollLine {
    0%, 100% { 
        opacity: 0;
        height: 20px;
    }
    50% { 
        opacity: 1;
        height: 40px;
    }
}

@keyframes cursorPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.5);
        opacity: 0.7;
    }
}

@keyframes ctaFadeIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes mobileTypeWriter {
    0% { 
        opacity: 0;
        transform: translateY(20px);
    }
    100% { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== RESPONSIVE ADJUSTMENTS ========== */

/* Improved responsive adjustments */
@media (max-width: 768px) {
    .hero-content h1 {
        line-height: 1.0;
        padding-bottom: 25px;
        font-size: clamp(2.5rem, 10vw, 8rem);
        /* Simplified effects on mobile for better performance and readability */
        background: #ffffff;
        background-clip: text;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        color: #ffffff;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .hero-content h1::before {
        opacity: 0.05; /* Even more subtle on mobile */
        filter: blur(10px);
    }
    
    .hero-content p {
        font-size: 16px;
        white-space: normal;
        border-right: none;
        animation: mobileTypeWriter 2s ease-out 1s forwards;
    }
    
    .shape {
        display: none; /* Hide shapes on mobile for performance */
    }
    
    .hero-cta {
        bottom: 60px;
        padding: 12px 24px;
        font-size: 14px;
    }
    
    header {
        top: 15px;
        width: 280px;
        padding: 6px 0;
    }
    
    nav {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .hamburger-line {
        width: 14px;
    }
    
    .email-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        line-height: 0.95;
        padding-bottom: 30px;
        font-size: clamp(2rem, 12vw, 6rem);
        /* Maximum legibility on small screens */
        background: none;
        -webkit-text-fill-color: #ffffff;
        color: #ffffff;
        text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    }
    
    .hero-content h1::before {
        display: none; /* Remove glow effect on very small screens */
    }
    
    .hero-content p {
        font-size: 14px;
    }
    
    header {
        top: 10px;
        width: 250px;
        padding: 5px 0;
    }
    
    nav {
        padding: 0 12px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .hamburger-line {
        width: 12px;
    }
    
    .email-btn svg {
        width: 14px;
        height: 14px;
    }
}

/* Alternative solid color version for maximum legibility (optional) */
.hero-content h1.solid-text {
    background: none;
    -webkit-text-fill-color: #ffffff;
    color: #ffffff;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(120, 119, 198, 0.3);
}

/* ========== DARK MODE ENHANCEMENTS ========== */

@media (prefers-color-scheme: dark) {
    .hero {
        background: linear-gradient(135deg, #000 0%, #0a0a0a 50%, #000 100%);
    }
    
    .hero::before {
        background: 
            radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.15) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
            radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.12) 0%, transparent 50%);
    }
}

/* High contrast mode for accessibility */
@media (prefers-contrast: high) {
    .hero-content h1 {
        background: none;
        -webkit-text-fill-color: #ffffff;
        color: #ffffff;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
        animation: none; /* Remove animations for high contrast mode */
    }
    
    .hero-content h1::before {
        display: none;
    }
}

/* ========== ACCESSIBILITY ========== */

@media (prefers-reduced-motion: reduce) {
    .hero-content h1 {
        animation: none;
        background: none;
        -webkit-text-fill-color: #ffffff;
        color: #ffffff;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }
    
    .hero-content h1::before {
        animation: none;
        opacity: 0.05;
    }
    
    .hero::before,
    .hero::after,
    .shape,
    .scroll-indicator,
    .cursor-trail {
        animation: none;
    }
    
    .hero-content p {
        opacity: 1;
        white-space: normal;
        border-right: none;
        animation: none;
    }
    
    .hero-cta {
        opacity: 1;
        animation: none;
    }
}

/* Projects Grid */
.projects {
    padding: 100px 0;
    background: linear-gradient(180deg, #000 0%, #111 100%);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 60px;
    margin-top: 80px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.project-card {
    background: #111;
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    position: relative;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 30px 60px rgba(255, 255, 255, 0.1);
}

.project-image {
    width: 100%;
    height: 300px;
    position: relative;
    overflow: hidden;
    background: #222;
}

.project-image iframe {
    width: 100%;
    height: 100%;
    transform: scale(0.5);
    transform-origin: top left;
    width: 200%;
    height: 200%;
    pointer-events: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-image iframe {
    opacity: 1;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-info {
    padding: 30px;
}

.project-info h3 {
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: bold;
}

.project-info p {
    opacity: 0.8;
    line-height: 1.5;
    font-size: 14px;
}

/* About Section */
.about {
    padding: 120px 0;
    background: #000;
    text-align: center;
}

.about h2 {
    font-size: clamp(3rem, 6vw, 8rem);
    font-weight: 900;
    margin-bottom: 40px;
    background: linear-gradient(45deg, #fff, #888);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 18px;
    line-height: 1.8;
    opacity: 0.9;
}

/* Contact Section */
.contact {
    padding: 100px 0;
    background: linear-gradient(180deg, #000 0%, #111 100%);
    text-align: center;
}

.contact h2 {
    font-size: 48px;
    margin-bottom: 30px;
    font-weight: bold;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.contact-links a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    padding: 15px 30px;
    border: 1px solid #333;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.contact-links a:hover {
    background: #fff;
    color: #000;
    transform: translateY(-2px);
}

/* Footer */
footer {
    padding: 60px 0;
    background: #000;
    text-align: center;
    border-top: 1px solid #222;
}

footer p {
    opacity: 0.6;
    font-size: 14px;
}

/* Scroll animations */
.fade-in {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}