@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* Base styles - optimized */
body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: #111827;
    background-color: #f9fafb;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
}

/* Typography - reduced sizes */
h1 {
    font-weight: 700;
    font-size: 2.5rem;
    line-height: 1.1;
    margin-bottom: 1rem;
}

h2 {
    font-weight: 600;
    font-size: 1.875rem;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

h3 {
    font-weight: 600;
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

p {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    color: #6b7280;
}

/* Initial state for animations */
.fade-in-element {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in-element.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Home section animations - immediate load */
#home .grid>div:nth-child(1) {
    animation: fadeInUp 0.8s ease-out;
}

#home .grid>div:nth-child(2) {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile menu animations */
.mobile-menu {
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Hamburger menu animation */
.hamburger span {
    transition: all 0.3s ease;
    transform-origin: center;
}

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

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

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

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Sticky navbar */
nav {
    position: fixed !important;
    top: 0 !important;
    transform: translateY(0) !important;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar-scrolled {
    background-color: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Skills hover effects */
.skills-badge {
    transition: all 0.2s ease;
}

.skills-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Section animation delays */
#about {
    animation: fadeInSection 0.8s ease-out;
}

#skills {
    animation: fadeInSection 0.8s ease-out;
}

@keyframes fadeInSection {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Project Cards */
.project-card {
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.project-image {
    transition: transform 0.3s ease;
}

.project-card:hover .project-image {
    transform: scale(1.05);
}

/* Performance optimizations for button hover effects */
.will-change-transform {
    will-change: transform;
}

/* Optimize all buttons and interactive elements for FASTER hover */
button,
a[class*="hover:"],
.project-card,
[class*="transition"] {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* FAST transitions - reduce duration globally for snappier feel */
.transition-all {
    transition-duration: 0.15s !important;
    transition-timing-function: ease-out !important;
}

/* Remove slow translate-y animations and replace with scale for INSTANT feedback */
.hover\:-translate-y-0\.5:hover,
.hover\:-translate-y-1:hover {
    transform: scale(1.05) !important;
}

/* Additional performance optimizations */
button:hover,
a:hover,
.project-card:hover {
    will-change: auto;
}

/* GPU acceleration for smoother animations */
.transform,
.bg-white,
.rounded-xl,
.rounded-2xl,
.rounded-3xl,
.shadow-lg,
.shadow-xl {
    transform: translateZ(0);
}

/* Optimize specific hover states for immediate response */
button {
    transition-property: transform, background-color, color, border-color;
    transition-duration: 0.15s;
    transition-timing-function: ease-out;
}

a {
    transition-property: transform, color, border-color;
    transition-duration: 0.15s;
    transition-timing-function: ease-out;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .mobile-menu {
        background-color: #fff;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    p {
        font-size: 0.8rem;
    }

    .mobile-menu.active {
        position: fixed;
        z-index: 40;
    }

    body.menu-open {
        overflow: hidden;
    }
}

@media (max-width: 640px) {
    h1 {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.125rem;
    }

    p {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    h2 {
        font-size: 1.125rem;
    }

    h3 {
        font-size: 1rem;
    }

    p {
        font-size: 0.7rem;
    }
}

/* Section spacing */
section {
    scroll-margin-top: 5rem;
}

/* Respect user preferences for reduced motion */
@media (prefers-reduced-motion: reduce) {

    .transition-all,
    button,
    a[class*="hover:"],
    .project-card {
        transition: none !important;
    }

    .hover\:-translate-y-0\.5:hover,
    .hover\:-translate-y-1:hover {
        transform: none !important;
    }
}

.no-border-transition {
    transition-property: transform, color !important;
}

/* Experience section wider cards and smaller fonts */
#experience {
    max-width: 100vw;
}

#experience .max-w-7xl {
    max-width: 1440px;
}

/* Escape the slash in Tailwind class names */
@media (min-width: 1024px) {
    #experience .w-5\/12 {
        width: 45%;
    }
}

/* Smaller fonts for more content */
#experience h3 {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

#experience h4 {
    font-size: 0.75rem;
    line-height: 1rem;
}

#experience p,
#experience li {
    font-size: 0.75rem;
    line-height: 1.125rem;
}

#experience .text-xs {
    font-size: 0.6875rem;
    line-height: 1rem;
}

/* Better bullet spacing */
#experience ul li {
    margin-left: 0.5rem;
}

/* Compact Contact Section Styling */
#contact {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

#contact .max-w-2xl {
    max-width: 32rem;
}

#contact .max-w-lg {
    max-width: 28rem;
}

#contact h2 {
    font-size: 1.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

#contact p {
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 2rem;
}

#contact h3 {
    font-size: 1rem;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

#contact a,
#contact span {
    font-size: 0.875rem;
    line-height: 1.3;
}

#contact .w-12 {
    width: 3rem;
    height: 3rem;
}

#contact .space-y-4>*+* {
    margin-top: 1rem;
}

/* Mobile adjustments */
@media (max-width: 640px) {
    #contact {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }

    #contact h2 {
        font-size: 1.25rem;
    }

    #contact p {
        font-size: 0.8rem;
    }

    #contact h3 {
        font-size: 0.9rem;
    }

    #contact a,
    #contact span {
        font-size: 0.8rem;
    }

    #contact .w-12 {
        width: 2.5rem;
        height: 2.5rem;
    }

    #contact .gap-4 {
        gap: 0.75rem;
    }
}

/* Align Contact section with Footer text positioning */
#contact {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

#contact .max-w-6xl {
    max-width: 1152px;
    padding-left: 1rem;
    padding-right: 1rem;
}

#contact h2 {
    font-size: 1.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

#contact p {
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 2rem;
}

#contact h3 {
    font-size: 1rem;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

#contact a,
#contact span {
    font-size: 0.875rem;
    line-height: 1.3;
}

/* Mobile adjustments */
@media (max-width: 640px) {
    #contact h2 {
        font-size: 1.25rem;
    }

    #contact p {
        font-size: 0.8rem;
    }

    #contact h3 {
        font-size: 0.9rem;
    }

    #contact a,
    #contact span {
        font-size: 0.8rem;
    }
}