/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0f0f0f 100%);
    color: #fff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    position: relative;
    overflow-x: hidden;
    background-attachment: fixed;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 40px);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(15px);
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00d4ff, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    transition: all 0.3s ease;
}

.nav-menu a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-menu a:hover {
    color: #00d4ff;
    transform: translateY(-2px);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #00d4ff, #ff6b6b);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    background: none;
    border: none;
    z-index: 1001;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #fff;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 900px;
    z-index: 1;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #00d4ff, #ff6b6b, #4ecdc4, #45b7d1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 300% 300%;
    animation: gradient-flow 4s ease infinite;
    line-height: 1.1;
}

@keyframes gradient-flow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-subtitle {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    color: #00d4ff;
    margin-bottom: 1.5rem;
    font-weight: 600;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.hero-description {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: #e0e0e0;
    margin-bottom: 2.5rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-block;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #00d4ff, #ff6b6b);
    color: #fff;
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 212, 255, 0.4);
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 2px solid rgba(0, 212, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: #00d4ff;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
}

/* Section Styles */
section {
    padding: clamp(60px, 10vw, 120px) 0;
}

.section-title {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: clamp(2rem, 5vw, 4rem);
    background: linear-gradient(135deg, #00d4ff, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #00d4ff, #ff6b6b);
    border-radius: 2px;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: clamp(2rem, 6vw, 4rem);
    align-items: center;
}

.about-text p {
    font-size: 1.1rem;
    color: #ccc;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.stat {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(255, 107, 107, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.3);
}

.stat:hover::before {
    opacity: 1;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #888;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(1.5rem, 4vw, 2.5rem);
}

.skill-category {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.skill-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(78, 205, 196, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(0, 212, 255, 0.2);
}

.skill-category:hover::before {
    opacity: 1;
}

.skill-category h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #fff;
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.skill-item:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(78, 205, 196, 0.2));
    color: #fff;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
    border-color: rgba(0, 212, 255, 0.5);
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: clamp(1.5rem, 4vw, 2.5rem);
}

.project-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(15px);
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(255, 107, 107, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.3);
}

.project-card:hover::before {
    opacity: 1;
}

.project-content {
    position: relative;
    z-index: 2;
}

/* Project Preview Styles */
.project-preview {
    height: 250px;
    position: relative;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(78, 205, 196, 0.05));
    /* Ensure clean edges */
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.project-preview iframe {
    width: 125%; /* Wider to account for scaling */
    height: 140%; /* Extra height to account for Y-offset */
    border: none;
    transform: scale(0.8);
    transform-origin: top left;
    transition: transform 0.3s ease;
    pointer-events: none; /* Prevent interaction by default */
    position: absolute;
    top: 0;
    left: 0;
    /* Hide scrollbars completely */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

/* Hide scrollbars for WebKit browsers */
.project-preview iframe::-webkit-scrollbar {
    display: none;
}

/* Y-offset positioning with adjusted scaling */
.project-preview iframe[data-y-offset] {
    transform: scale(0.8) translateY(var(--y-offset, 0px));
}

/* Special handling for iframes with negative offsets */
.project-preview iframe[data-y-offset^="-"] {
    height: 160%; /* Even more height for negative offsets */
    top: calc(var(--y-offset, 0px) * 0.2); /* Adjust container position */
}

.project-card:hover .project-preview iframe {
    transform: scale(0.85) translateY(var(--y-offset, 0px));
}

.project-card:hover .project-preview iframe[data-y-offset^="-"] {
    transform: scale(0.85) translateY(var(--y-offset, 0px));
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .preview-overlay {
    opacity: 1;
}

.preview-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.preview-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: rgba(0, 212, 255, 0.9);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.preview-btn:hover {
    background: rgba(255, 107, 107, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.preview-btn span {
    font-size: 1.1rem;
}

/* Fallback for iframes that don't load */
.project-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(78, 205, 196, 0.05));
    z-index: -1;
}

/* Loading and error states */
.project-preview.loading::after {
    content: 'Loading preview...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #888;
    font-size: 0.9rem;
    z-index: 1;
    background: rgba(18, 18, 18, 0.8);
    padding: 1rem 2rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.project-preview.loading iframe {
    opacity: 0.3;
}

.project-preview.loaded iframe {
    opacity: 1;
}

.project-preview.error iframe,
.project-preview.timeout iframe {
    display: none;
}

.iframe-fallback {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(78, 205, 196, 0.05));
}

.fallback-content {
    text-align: center;
    color: #888;
}

.fallback-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.fallback-content p {
    margin: 0.5rem 0;
    font-weight: 500;
}

.fallback-content small {
    color: #666;
    font-size: 0.8rem;
}

/* Enhanced hover effects for previews */
.project-preview:hover {
    cursor: pointer;
}

.project-preview.loaded:hover iframe {
    transform: scale(0.9) translateY(var(--y-offset, 0px));
}

.project-placeholder {
    color: #888;
    font-size: 1.2rem;
    font-weight: 500;
}

.project-content {
    padding: 1.5rem;
    position: relative;
    z-index: 2;
}

.project-content h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #fff;
}

.project-content p {
    color: #ccc;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.project-tech span {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    color: #888;
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
}

.project-tech span.illuminated {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--glow-color), 0 0 40px var(--glow-color);
    color: #fff;
    background: var(--glow-color);
    z-index: 2;
}

.project-tech span.illuminated::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 0.5s ease-in-out;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes illuminate {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: #888;
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 6vw, 4rem);
    align-items: start;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #fff;
}

.contact-info p {
    color: #ccc;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #ccc;
}

.contact-icon {
    font-size: 1.2rem;
}

.contact-item a,
.contact-link {
    color: #ccc !important;
    text-decoration: none !important;
    transition: color 0.3s ease;
    font-weight: 500;
    border: none !important;
    outline: none !important;
    background: none !important;
    font-family: inherit !important;
    font-size: inherit !important;
}

.contact-item a:hover,
.contact-link:hover {
    color: #fff !important;
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
}

.contact-item a:visited,
.contact-link:visited {
    color: #ccc !important;
    text-decoration: none !important;
}

.contact-item a:active,
.contact-link:active {
    color: #fff !important;
    text-decoration: none !important;
}

.contact-item a:focus,
.contact-link:focus {
    color: #ccc !important;
    text-decoration: none !important;
    outline: none !important;
    border: none !important;
}

/* Extra browser-specific overrides for LinkedIn link */
.contact-item .contact-link {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    text-decoration-line: none !important;
    text-decoration-style: none !important;
    text-decoration-color: transparent !important;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #888;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

#form-result {
    font-size: 0.95rem;
    line-height: 1.5;
    animation: fadeInUp 0.3s ease-out;
}

#submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer p {
    color: #888;
}

/* Optimized Glow Sphere Styles */
.glow-sphere {
    position: fixed;
    width: clamp(200px, 20vw, 300px);
    height: clamp(200px, 20vw, 300px);
    border-radius: 50%;
    z-index: -1;
    animation: glow-simple 8s ease-in-out infinite alternate;
    will-change: transform, opacity;
    transform: translateZ(0); /* Force hardware acceleration */
}

.glow-sphere::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(
        circle at center,
        rgba(0, 212, 255, 0.6) 0%,
        rgba(0, 212, 255, 0.3) 30%,
        rgba(255, 107, 107, 0.2) 60%,
        rgba(78, 205, 196, 0.1) 80%,
        transparent 100%
    );
    animation: glow-inner 6s ease-in-out infinite alternate;
}

.glow-sphere::after {
    content: '';
    position: absolute;
    top: -25%;
    left: -25%;
    width: 150%;
    height: 150%;
    border-radius: 50%;
    background: radial-gradient(
        circle at center,
        rgba(0, 212, 255, 0.2) 0%,
        rgba(255, 107, 107, 0.1) 40%,
        rgba(78, 205, 196, 0.05) 70%,
        rgba(69, 183, 209, 0.03) 90%,
        transparent 100%
    );
    animation: glow-outer 6s ease-in-out infinite alternate;
}

.top-left {
    top: -15%;
    left: -15%;
}

.bottom-right {
    bottom: -15%;
    right: -15%;
    animation-delay: 3s;
}

.bottom-right::before {
    animation-delay: 3s;
    background: radial-gradient(
        circle at center,
        rgba(255, 107, 107, 0.6) 0%,
        rgba(78, 205, 196, 0.3) 30%,
        rgba(0, 212, 255, 0.2) 60%,
        rgba(69, 183, 209, 0.1) 80%,
        transparent 100%
    );
}

.bottom-right::after {
    animation-delay: 3s;
    background: radial-gradient(
        circle at center,
        rgba(255, 107, 107, 0.2) 0%,
        rgba(78, 205, 196, 0.1) 40%,
        rgba(0, 212, 255, 0.05) 70%,
        rgba(69, 183, 209, 0.03) 90%,
        transparent 100%
    );
}

/* Simplified animations for better performance */
@keyframes glow-simple {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    100% {
        transform: scale(1.1);
        opacity: 0.6;
    }
}

@keyframes glow-inner {
    0% {
        opacity: 0.3;
        transform: scale(1);
    }
    100% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

@keyframes glow-outer {
    0% {
        opacity: 0.1;
        transform: scale(1);
    }
    100% {
        opacity: 0.4;
        transform: scale(1.2);
    }
}

/* Scroll-triggered animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Optimized intersection observer animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered animations for groups */
.stagger-item {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    will-change: opacity, transform;
}

.stagger-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .about-stats {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(18, 18, 18, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3rem;
        transition: right 0.3s ease;
        z-index: 999;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu a {
        font-size: 1.5rem;
        padding: 1rem;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .hero {
        padding: 0 clamp(20px, 5vw, 40px);
        min-height: 90vh;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0.8rem 0;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 0 15px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .skill-category {
        padding: 1.5rem;
    }
    
    .stat {
        padding: 1.5rem;
    }
    
    .project-content {
        padding: 1.2rem;
    }
    
    .project-preview {
        height: 200px;
    }
    
    .project-preview iframe {
        transform: scale(0.7) translateY(var(--y-offset, 0px));
        height: 150%; /* More height on mobile */
    }
    
    .project-preview iframe[data-y-offset^="-"] {
        height: 180%; /* Even more for negative offsets on mobile */
    }
    
    .project-card:hover .project-preview iframe {
        transform: scale(0.75) translateY(var(--y-offset, 0px));
    }
    
    .preview-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }
    
    .skill-items {
        gap: 0.4rem;
    }
    
    .skill-item {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 320px) {
    .hero-buttons {
        gap: 0.8rem;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .skill-category {
        padding: 1rem;
    }
    
    .stat {
        padding: 1rem;
    }
}

/* Performance optimizations */
/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .glow-sphere {
        animation: none;
    }
    
    .glow-sphere::before,
    .glow-sphere::after {
        animation: none;
    }
}