/* =========================================
   PROJECT PAGE - KUME DESIGN ASIA
   Optimized for performance
   ========================================= */

/* === GOOGLE FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@100;300;400;600;700&display=swap');

/* === VARIABLES === */
:root {
    --primary-color: #b30000;
    --text-dark: #1a1a1a;
    --text-light: #666;
    --bg-color: #fff;
    --gray-light: #f5f5f5;
}

/* === RESET === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    color: var(--text-dark);
}

/* === HEADER === */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 92%;
    max-width: 1920px;
    padding: 30px 0;
    z-index: 1000;
    pointer-events: none;
}

.header-logo {
    height: 40px;
    pointer-events: auto;
    filter: drop-shadow(0 0 5px rgba(255,255,255,1)); 
}

/* === PAGE CONTENT === */
.main-container {
    max-width: 1920px;
    width: 92%;
    margin: 0 auto;
    padding-top: 150px;
    padding-bottom: 100px;
}

/* === PAGE HEADER & FILTER === */
.page-header {
    margin-bottom: 80px;
    padding-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    position: relative;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #000 50%, transparent 100%);
    opacity: 0.2;
}

.page-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 2.5rem;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

/* === FILTER NAVIGATION === */
.filter-nav ul {
    display: flex;
    gap: 30px;
    list-style: none;
    flex-wrap: wrap;
}

.filter-nav a {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #888;
    padding: 8px 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
    border-radius: 50px;
}

.filter-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #333;
    transition: width 0.3s ease;
}

.filter-nav a:hover,
.filter-nav a.active {
    color: #000;
}

.filter-nav a:hover::after,
.filter-nav a.active::after {
    width: 80%;
}

/* === PROJECT GRID === */
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 50px;
}

/* === PROJECT CARD === */
.project-item {
    position: relative;
    height: 75vh;
    min-height: 500px;
    overflow: hidden;
    cursor: pointer;
    background: #000;
    border-radius: 4px;
    /* Fade up animation - initial state */
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Visible when in viewport */
.project-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-item:hover {
    transform: translateY(-15px) scale(1.02);
    z-index: 10;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4);
}

/* === IMAGE === */
.project-thumb {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(1) contrast(1.05);
    transition: all 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.project-item:hover .project-thumb img {
    transform: scale(1.12) rotate(2deg);
    filter: brightness(0.7) contrast(1.15);
}

/* === OVERLAY === */
.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(134, 134, 134, 0.3) 30%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.8s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 50px;
    text-align: center;
    pointer-events: none;
}

.project-item:hover .project-overlay {
    opacity: 1;
}

/* === PROJECT INFO === */
.project-info {
    transform: translateY(50px) scale(0.95);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.project-item:hover .project-info {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.project-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: #fff;
    font-size: 2rem;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    /* FIX: Allow text wrap */
    display: block;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
    line-height: 1.3;
}

.project-meta {
    font-family: 'Montserrat', sans-serif;
    font-weight: 100;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: block;
    margin-top: 12px;
    line-height: 1.5;
}

/* View indicator - arrow */
.project-item::after {
    content: '→';
    position: absolute;
    bottom: 30px;
    right: 30px;
    font-size: 2rem;
    color: #fff;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 3;
}

.project-item:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* === SCROLL TO TOP BUTTON === */
.scroll-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: #000;
    transform: translateY(-5px);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
}

.scroll-to-top:active {
    transform: translateY(-2px);
}

/* Arrow icon */
.scroll-to-top::before {
    content: '↑';
    font-size: 1.5rem;
    line-height: 1;
}

/* === LOADING INDICATOR === */
.loading-indicator {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none;
}

.loading-indicator.visible {
    opacity: 1;
    display: block;
}

.loading-indicator .spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-more-message {
    font-family: 'Montserrat', sans-serif;
    font-weight: 100;
    color: #999;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* === FOOTER === */
.site-footer {
    margin-top: 100px;
    background: #fff;
    border-top: 1px solid #eee;
}

.footer-top {
    max-width: 1920px;
    width: 92%;
    margin: 0 auto;
    padding: 40px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-nav ul {
    display: flex;
    gap: 60px;
    list-style: none;
}

.footer-nav a {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 0.8rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-nav a:hover {
    color: #000;
}

.footer-logo-wrap {
    display: flex;
    align-items: center;
    height: 50px;
}

.footer-logo-line {
    width: 1px;
    height: 40px;
    background-color: #333;
    margin-right: 20px;
}

.footer-logo img {
    height: 40px;
    display: block;
}

.footer-bottom {
    background-color: #2b2b2b;
    color: #fff;
    padding: 20px 0;
}

.footer-bottom-content {
    max-width: 1920px;
    width: 92%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copyright {
    font-family: 'Montserrat', sans-serif;
    font-weight: 100;
    font-size: 0.75rem;
}

.footer-links {
    display: flex;
    gap: 15px;
    opacity: 0.8;
}

.footer-links a {
    font-family: 'Montserrat', sans-serif;
    font-weight: 100;
    color: #fff;
    text-decoration: none;
    font-size: 0.75rem;
}

.footer-links a:hover {
    color: #ccc;
}

.footer-links span {
    opacity: 0.3;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .project-item {
        height: 50vh;
    }
    
    .footer-top {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 30px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .header {
        width: 90%;
    }
    
    .main-container {
        width: 90%;
        padding-top: 100px;
    }
    
    .project-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-nav ul {
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    /* === MOBILE FILTER - HORIZONTAL SCROLL === */
    .page-header {
        margin-bottom: 40px;
        padding-bottom: 20px;
    }
    
    .filter-nav {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .filter-nav::-webkit-scrollbar {
        display: none;
    }
    
    .filter-nav ul {
        gap: 12px;
        padding-bottom: 5px;
        flex-wrap: nowrap;
    }
    
    .filter-nav a {
        font-size: 0.75rem;
        padding: 6px 16px;
        white-space: nowrap;
        background: var(--gray-light);
        border-radius: 20px;
    }
    
    .filter-nav a.active {
        background: #333;
        color: #fff;
    }
    
    .filter-nav a::after {
        display: none;
    }
    
    .project-name {
        font-size: 1.3rem;
    }
    
    /* Mobile: Always show overlay */
    .project-overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 50%);
    }
    
    .project-info {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    
    .project-item:hover {
        transform: translateY(0) scale(1);
    }
    
    /* Scroll to top button - mobile */
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}

/* === PAGE LOAD ANIMATION === */
@keyframes pageLoad {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.l-wrapper {
    animation: pageLoad 0.6s ease forwards;
}
