/* Custom styles to complement Tailwind CSS */

/* Base styles */
html {
    scroll-behavior: smooth; /* Enable smooth scrolling site-wide */
}

body {
    font-family: 'Inter', sans-serif;
    color: white;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* Add font-display: swap for performance if using @font-face */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: local('Inter'), url('https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTcviYw.ttf') format('truetype');
}

/* Typography scale adjustments */
h1 {
    font-weight: 400;
    letter-spacing: -0.01em;
}

.text-8xl {
    font-size: 7rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* Background styling */
.bg-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    min-height: 100%;
    height: 100%;
    background-image: url('WebP/assets/bg.webp');
    background-repeat: repeat-y;
    background-position: top center;
    background-size: 100% auto;
    background-attachment: scroll;
    z-index: -1;
    opacity: 0;
    animation: backgroundFadeIn 1s ease-out 2s forwards;
}

@keyframes backgroundFadeIn {
    from {
        opacity: 0;
        transform: scale(1.02);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .bg-wrapper {
        background-size: cover;
        height: 100%;
    }
}

/* Glassmorphic elements */
.glass-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glassmorphic-nav {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.glass-button {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.glass-button:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glass-panel-mobile {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

/* Navigation */
.nav-link {
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0);
}

.nav-link:hover {
    color: rgba(255, 255, 255, 1);
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Project cards */
.project-card {
    background: rgba(30, 32, 40, 0.32); /* more transparent, lets background show through */
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    border: 1.5px solid rgba(255,255,255,0.13);
    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.18);
    border-radius: 1.25rem;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: box-shadow 0.32s cubic-bezier(.4,0,.2,1), transform 0.32s cubic-bezier(.4,0,.2,1), opacity 0.7s cubic-bezier(.4,0,.2,1), filter 0.7s cubic-bezier(.4,0,.2,1);
    opacity: 0;
    transform: translateY(48px);
    filter: blur(16px);
}

.project-card.visible-animate {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.project-card:hover, .project-card:focus {
    box-shadow: 0 12px 48px 0 rgba(0,0,0,0.22), 0 0 8px 2px rgba(59,130,246,0.35);
    transform: scale(1.025);
    transition: box-shadow 0.44s cubic-bezier(.4,0,.2,1), transform 0.44s cubic-bezier(.4,0,.2,1);
}

.project-card .card-img {
    width: 100%;
    display: block;
    object-fit: cover;
    border-top-left-radius: 1.25rem;
    border-top-right-radius: 1.25rem;
    margin: 0;
    padding: 0;
    height: auto;
    max-height: none;
}

.project-card .card-body {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 1.25rem 1.5rem;
    background: rgba(255,255,255,0.05); /* glassmorphic background, matches .glass-panel */
    backdrop-filter: blur(10px);
    border-bottom-left-radius: 1.25rem;
    border-bottom-right-radius: 1.25rem;
    margin: 0;
    width: 100%;
    min-height: 0;
    flex: 0 0 auto;
    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.13);
    border-top: 1px solid rgba(255,255,255,0.07);
}

.project-card .card-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    flex: 1 1 auto;
    min-width: 0;
}

.project-card .card-title {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.2;
    text-align: left;
    white-space: normal;
}

.project-card .card-langs {
    font-size: 0.92rem;
    color: #e5e7eb;
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 400;
    text-align: left;
    white-space: normal;
}

.project-card .card-link {
    align-self: center;
    margin-left: 1.25rem;
    margin-top: 0;
    flex-shrink: 0;
}

.project-card .card-link span {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(36,37,40,0.85);
    padding: 0.7rem;
    box-shadow: 0 2px 8px 0 rgba(0,0,0,0.13);
    transition: background 0.18s, box-shadow 0.18s;
    cursor: pointer;
}

.project-card .card-link span:hover {
    background: rgba(36,37,40,1);
    box-shadow: 0 0 8px 2px rgba(59,130,246,0.35), 0 2px 8px 0 rgba(0,0,0,0.13);
}

.project-card .card-link svg {
    height: 1.25rem;
    width: 1.25rem;
    color: #b0b3b8;
    opacity: 1;
    transition: color 0.18s;
}

.project-card .card-link span:hover svg {
    color: #fff;
}

.hover\:shadow-blue-glow:hover {
    box-shadow: 0 0 8px 2px rgba(59,130,246,0.35);
}

.gradient-overlay {
    transition: opacity 0.3s ease;
}

.project-card:hover .gradient-overlay {
    opacity: 0.8;
}

/* Aspect ratio 3:4 for project card images (3/4 = 75% of card height) */
.aspect-ratio-3\/4 {
    position: relative;
    padding-top: 75%; /* 3:4 aspect ratio */
    overflow: hidden;
}

.aspect-ratio-3\/4 img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Social links */
.social-link {
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.social-link:hover {
    color: white;
    transform: translateY(-3px);
    background-color: rgba(255, 255, 255, 0.15);
}

/* Logo */
.logo-container {
    transition: all 0.3s ease;
}

.logo-container:hover {
    transform: rotate(10deg);
}

/* Carousel label transitions */
#carousel-label {
    transition: opacity 0.2s ease-in-out;
}

/* Email button */
#email-button {
    transition: all 0.3s ease;
    width: 100%;
    max-width: 400px;
}

#email-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#email-button.copied-state {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile responsiveness */
@media (max-width: 640px) {
    #email-text {
        font-size: 0.875rem;
    }
    
    .hero-section {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    .project-card {
        min-height: 0;
    }
    .project-card .card-img {
        width: 100%;
        height: auto;
        max-height: none;
        min-height: 0;
        aspect-ratio: unset;
        display: block;
        object-fit: cover;
        margin: 0;
        padding: 0;
    }
    .project-card .card-body {
        padding: 1rem 1rem 0.9rem 1rem;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        min-height: 0;
    }
    .project-card .card-link {
        margin-top: 0;
    }
}

/* Desktop/Mobile Navigation Visibility */
@media (max-width: 767px) {
    /* Hide desktop navigation on mobile */
    header nav {
        display: none !important;
    }
    
    /* Show mobile menu button on mobile */
    #mobile-menu-button {
        display: block !important;
    }
}

@media (min-width: 768px) {
    /* Show desktop navigation on larger screens */
    header nav {
        display: flex !important;
    }
    
    /* Hide mobile menu button on larger screens */
    #mobile-menu-button {
        display: none !important;
    }
}

/* Modal and overlay styles */
#resume-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#resume-modal .glass-panel {
    position: relative;
    z-index: 100000;
}

#resume-modal img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Hidden/shown elements with smooth transitions */
.hidden {
    display: none !important;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Animation Classes */
/* Fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Slide-up + blur-in animation */
@keyframes slideUpBlurIn {
    from {
        opacity: 0;
        filter: blur(10px);
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

/* Scale animation for hover */
@keyframes scaleUp {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.05);
    }
}

/* Animation utility classes */
.animate-fade-in {
    animation: fadeIn 0.8s ease forwards;
    opacity: 0;
}

.animate-slide-up-blur {
    opacity: 0;
    animation: slideUpBlurIn 0.8s ease-out forwards;
}

.animate-scale-hover:hover {
    transform: scale(1.02);
    transition: transform 0.4s ease;
}

/* Staggered animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }
.stagger-7 { animation-delay: 0.7s; }
.stagger-8 { animation-delay: 0.8s; }

/* Hidden initially for scroll-triggered animations */
.hidden-animate {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(5px);
    transition: opacity 0.6s ease, transform 0.6s ease, filter 0.6s ease;
}

/* Class added when element comes into view */
.visible-animate {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

.lightbox-blur {
    filter: blur(8px);
    transition: filter 0.3s;
    pointer-events: none;
    user-select: none;
}

/* === Animated Title Blur/Fade Animation === */
.animated-title-blur {
    display: inline-block;
    transition: filter 2s cubic-bezier(0.4,0,0.2,1), opacity 2s cubic-bezier(0.4,0,0.2,1);
}
.blur-fade-out {
    opacity: 0;
    filter: blur(16px);
    pointer-events: none;
}
.blur-fade-in {
    opacity: 1;
    filter: blur(0);
}

#animated-title {
    display: inline-block;
    text-align: center;
    white-space: normal;
}
#animated-title-main, #animated-title-secondary {
    display: block;
    margin: 0;
    line-height: 1.05;
    padding: 0;
}
#animated-title-secondary {
    margin-top: -0.1em;
}

/* === GSAP Slide Up Blur In Animation for Homepage === */
.gsap-slide-up-blur {
  opacity: 0;
  filter: blur(18px);
  transform: translateY(60px);
  will-change: opacity, filter, transform;
}
.gsap-slide-up-blur.gsap-animated {
  opacity: 1 !important;
  filter: blur(0) !important;
  transform: translateY(0) !important;
  transition: none !important;
}

/* Overlay for GSAP blur/fade animation */
#page-blur-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.13);
  backdrop-filter: blur(24px);
  pointer-events: none;
  opacity: 0;
  transition: none;
}

.carousel-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 0;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}
.carousel-slides {
    display: flex;
    align-items: center;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.carousel-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.carousel-prev, .carousel-next {
    top: 50% !important;
    transform: translateY(-50%) !important;
    /* Ensure buttons are above the slides */
    z-index: 30;
}