/* ===== PAGE LAYOUT FIX FOR SIDE SPACE ===== */
html, body {
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
    max-width: 100%;
}

.hero-gradient,
.snap-section {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: 100%;
    box-sizing: border-box;
}

.max-w-6xl {
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    box-sizing: border-box;
}
/* ===== BASE STYLES ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
    /* scroll-snap-type: y mandatory; */ /* COMMENTED OUT - SCROLL SNAP */
}

html {
    scroll-behavior: smooth;
}
/* ===== BASE STYLES ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
    /* scroll-snap-type: y mandatory; */ /* COMMENTED OUT - SCROLL SNAP */
}

h1 {
	font-size: 16px;
	margin-top: 0;
}

p {
	color: rgb(255, 255, 255);
	font-size: 15px;
	margin-bottom: 10px;
	margin-top: 5px;
}


/* ===== CARD COMPONENTS ===== */
.card {
    max-width: 620px;
    margin: 0 auto;
    padding: 16px;
    border: 1px solid lightgray;
    border-radius: 16px;
}

.card p:last-child {
	margin-bottom: 0;
}

/* Remove fixed/min-height from card container */
.bg-white.rounded-xl.overflow-hidden.shadow-md {
    min-height: unset;
}

/* Show 2 lines and fade out bottom with gradient for card body */
.card-body {
    position: relative;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 2.5em;
    transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1), padding 0.4s cubic-bezier(0.4,0,0.2,1);
    margin-bottom: 0.1em;
}

.card-body::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1.2em;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0.85) 80%);
}

.card-body.expanded {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    max-height: 1000px;
    padding-bottom: 1em;
}

.card-body.expanded::after {
    display: none;
}

/* Utility classes for card content */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.more-link {
    margin-top: 0;
    margin-bottom: 0.4em;
    display: inline-block;
}

.view-link {
    margin-top: 0;
    margin-bottom: 0em;
    display: inline-block;
}

.p-8.flex.flex-col.flex-1 {
    justify-content: flex-start;
}

.flex.flex-col.items-start > span {
    margin-bottom: 0.2em;
}

h3.text-2xl.font-semibold, h3.text-xl.font-semibold {
    font-size: 1.5rem;
    line-height: 1.5rem;
}

/* ===== NAVIGATION STYLES ===== */
.nav-link {
    position: relative;
    padding: 0.5rem 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: translateX(-50%);
    transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 2px;
}

.nav-link:hover::before {
    width: 100%;
}

.nav-link:hover {
    transform: translateY(-2px);
    color: #667eea !important;
    animation: gentleBounce 0.6s ease-in-out;
}

.nav-link:active {
    transform: translateY(-1px);
}

/* Frozen hover state for active page */
.nav-link.active-page {
    transform: translateY(-2px);
    color: #667eea !important;
}

.nav-link.active-page::before {
    width: 100%;
}

nav .flex {
    align-items: center;
}

/* ===== ANIMATIONS ===== */
@keyframes gentleBounce {
    0%, 100% { transform: translateY(-2px); }
    50% { transform: translateY(-4px); }
}

@keyframes bounceRightTwicePoke {
    0%   { transform: scale(1) translateX(0); }
    10%  { transform: scale(1.05) translateX(20px); }
    25%  { transform: scale(1.05) translateX(0); }
    40%  { transform: scale(1.05) translateX(14px); }
    55%  { transform: scale(1.05) translateX(0); }
    100% { transform: scale(1.05) translateX(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ===== BUTTON STYLES ===== */
.animated-btn,
.contact-btn {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.animated-btn:hover,
.contact-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.animated-btn:active,
.contact-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.bounce-right-twice {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bounce-right-twice:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    animation: bounceRightTwicePoke 1s ease-in-out;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin-right: 2rem;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    animation: pulse 0.6s ease-in-out;
}

.back-to-top:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.back-to-top:active {
    transform: translateY(-1px) scale(1.05);
}

/* ===== SECTION STYLES ===== */
.section-title-underline {
    width: 24px;
    height: 5px;
    margin: 0 auto;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.section-title-underline.active {
    width: 80px;
}

.sticky-section-title {
    position: sticky;
    top: 64px;
    z-index: 20;
    background: white;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    margin-bottom: 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.07);
    transition: box-shadow 0.3s;
}

/* ===== MOBILE MENU BASE STYLES ===== */
.mobile-menu {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    pointer-events: none;
    z-index: 50; /* ensure above page content */
}

.peer:checked ~ .mobile-menu {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    pointer-events: auto;
}

/* No JS fallback needed when using pure CSS */

.hamburger-icon {
    width: 2rem;
    height: 2rem;
    justify-content: center;
    align-items: center;
}

.hamburger-icon span {
    transition: all 0.3s;
}

#menu-toggle:checked + label .hamburger-icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

#menu-toggle:checked + label .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

#menu-toggle:checked + label .hamburger-icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

#mobile-menu-button {
    display: none;
}

/* ===== PROJECTS CAROUSEL - PROPER BODY ALIGNMENT ===== */

/* Carousel container - ensure proper boundaries */
.carousel-container {
    position: relative;
    width: 100%;
    overflow: visible;
    padding: 2rem 0;
    margin: 0;
    box-sizing: border-box;
}

/* Ensure carousel track has proper boundaries */
#projectsCarousel {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    overflow-y: visible;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 1rem 0;
    min-height: 600px;
    align-items: stretch;
    position: relative;
    transition: scroll-behavior 0.3s ease;
    margin: 0;
    box-sizing: border-box;
}

/* Project cards - horizontal layout for carousel */
.project-card {
    flex: 0 0 auto;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    width: 340px;
    min-width: 340px;
    max-width: 340px;
    height: 540px;
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column; /* Vertical stack: image on top, content below */
}

.project-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Card image - full width at top */
.project-card img {
    width: 100%;
    height: 192px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

/* Update the project-card-content layout */
.project-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    color: #1f2937;
}

.project-card p {
    color: #6b7280;
    margin-bottom: 1rem; /* Space between text and tags */
    font-size: 0.875rem;
    line-height: 1.4;
    flex: 0 0 auto; /* Don't let text expand to fill space */
}

/* Position tags directly below text */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: auto; /* Push View Project link to bottom */
}

.project-tag {
    padding: 0.25rem 0.5rem;
    background: #f3f4f6;
    border-radius: 9999px;
    font-size: 0.75rem;
    color: #374151;
}

/* Keep View Project link at the bottom */
.project-link {
    margin-top: auto;
    padding-top: 1.5rem; /* More space above View Project link */
    display: flex;
    justify-content: flex-end;
}

/* Navigation arrows - positioned close to carousel edges */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease, opacity 0.3s ease;
    user-select: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.carousel-nav:hover {
    background: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(1.05);
}

.carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-nav svg {
    width: 20px;
    height: 20px;
    color: #374151;
}

/* Position arrows just outside carousel content area */
.carousel-nav-left {
    left: -15px; /* Close to carousel but outside content */
}

.carousel-nav-right {
    right: -15px; /* Close to carousel but outside content */
}

/* Desktop styles */
@media (min-width: 1024px) {
    .carousel-container {
        padding: 2rem 2.5rem;
        margin: 0;
    }
    
    .carousel-nav-left {
        left: -15px;
    }
    
    .carousel-nav-right {
        right: -15px;
    }
    
    .carousel-nav {
        width: 52px;
        height: 52px;
    }
    
    .carousel-nav svg {
        width: 22px;
        height: 22px;
    }
    
    #projectsCarousel {
        gap: 1rem;
        padding: 1rem 0;
        padding-right: 2rem; /* Slightly less padding for better arrow overlap */
    }
    .back-to-top {
        margin-right: 0.5rem;
    }
}

/* Tablet styles */
@media (max-width: 1023px) and (min-width: 769px) {
    .carousel-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0;
        box-sizing: border-box;
        max-width: 100%;
    }
    #projectsCarousel {
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box;
        max-width: 100%;
    }
    .carousel-nav-left {
        left: -10px;
    }
    .carousel-nav-right {
        right: -10px;
    }
    .project-card {
        width: 300px;
        min-width: 300px;
        max-width: 300px;
    }
    .back-to-top {
        margin-right: 0.2rem;
    }
}

/* Mobile styles - arrows inside with proper spacing */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100%;
    }
    .carousel-container {
        padding: 1rem 0;
        margin: 0; /* Keep aligned with body */
        overflow: visible;
        max-width: 100%;
        box-sizing: border-box;
    }
    /* Mobile arrows positioned inside with safe margins */
    .carousel-nav-left {
        left: 0.5rem;
    }
    .carousel-nav-right {
        right: 0.5rem;
    }
    .carousel-nav {
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    }
    .carousel-nav:hover {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
        transform: translateY(-50%) scale(1.02);
    }
    .carousel-nav svg {
        width: 18px;
        height: 18px;
    }
    #projectsCarousel {
        gap: 1rem;
        padding: 1rem 0;
        /* Fix mobile centering and prevent cut-off */
        padding-left: 0;
        padding-right: 0;
        max-width: 100%;
        box-sizing: border-box;
    }
    /* Mobile adjustments for carousel cards */
    .project-card {
        width: 280px;
        min-width: 280px;
        max-width: 280px;
        height: auto;
        min-height: 480px;
    }
    .project-card img {
        height: 160px;
    }
    .project-card-content {
        padding: 1rem;
    }
    .project-card h3 {
        font-size: 1.125rem;
    }
    .project-card p {
        font-size: 0.8rem;
    }
    .back-to-top {
        margin-right: 0;
    }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
    .carousel-nav-left {
        left: 0.25rem;
    }
    .carousel-nav-right {
        right: 0.25rem;
    }
    .carousel-nav {
        width: 36px;
        height: 36px;
    }
    .carousel-nav svg {
        width: 16px;
        height: 16px;
    }
    #projectsCarousel {
        padding-left: 0;
        padding-right: 0;
    }
    .project-card {
        width: 260px;
        min-width: 260px;
        max-width: 260px;
    }
    .back-to-top {
        margin-right: 0;
    }
}

/* Focus states for accessibility */
.carousel-nav:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* Enhanced disabled states */
.carousel-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%) scale(0.9);
}

/* Smooth scrolling behavior for all browsers */
html {
    scroll-behavior: smooth;
}

/* Prevent text selection on navigation */
.carousel-nav {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ===== END OF SCROLL SNAP FEATURES ===== */

/* ===== CONTACT SECTION SOCIAL ICONS ANIMATION ===== */

/* Place at the end of the file to avoid interfering with other styles */
.contact-socials {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}
.contact-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f3f4f6;
    transition: background 0.3s, box-shadow 0.3s, transform 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.07);
    cursor: pointer;
    position: relative;
}
.contact-social-btn:hover {
    background: #e0e7ff;
    animation: contactSocialBounce 0.7s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.18);
}
.contact-social-btn:hover i {
    color: #6366f1 !important;
    transition: color 0.3s;
}
@keyframes contactSocialBounce {
    0%   { transform: scale(1) translateY(0); }
    30%  { transform: scale(1.15) translateY(-8px); }
    50%  { transform: scale(0.95) translateY(2px); }
    70%  { transform: scale(1.05) translateY(-4px); }
    100% { transform: scale(1) translateY(0); }
}



