:root {
    --bg-color: #050505;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --accent: #ffffff;
    --easing: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-speed: 1.0s; 
    --header-height: 80px; 
    --header-padding: 2rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    cursor: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar { height: 4px; width: 4px; background: #000; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #fff; }

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Manrope', sans-serif;
    overflow-x: hidden;
    width: 100vw;
    opacity: 0; 
    transition: opacity 0.6s ease;
}
body.loaded { opacity: 1; }

@media (pointer: coarse) {
    * { cursor: default !important; }
    #cursor { display: none !important; }
}

/* --- CURSOR --- */
#cursor {
    position: fixed; top: 0; left: 0; width: 20px; height: 20px;
    border: 1px solid white; border-radius: 50%; pointer-events: none;
    transform: translate(-50%, -50%); z-index: 11000;
    transition: width 0.3s, height 0.3s, background-color 0.3s;
    mix-blend-mode: difference;
}
#cursor.hover-active {
    width: 60px; height: 60px; background-color: rgba(255, 255, 255, 0.1);
    border-color: transparent; backdrop-filter: blur(2px);
}

/* --- HEADER --- */
.site-header { position: fixed; top: 0; left: 0; width: 100%; height: var(--header-height); z-index: 1000; pointer-events: none; }
.logo { position: absolute; left: var(--header-padding); top: 50%; transform: translateY(-50%); font-family: 'Syncopate', sans-serif; font-weight: 700; font-size: 1.5rem; text-transform: uppercase; text-decoration: none; color: white; mix-blend-mode: difference; pointer-events: auto; }
.menu-btn { position: absolute; right: var(--header-padding); top: 50%; transform: translateY(-50%); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.1em; cursor: pointer; font-family: 'Syncopate', sans-serif; color: white; pointer-events: auto; mix-blend-mode: difference; }
.menu-btn::after { content: ''; position: absolute; bottom: -4px; right: 0; width: 100%; height: 1px; background: white; transform: scaleX(0); transform-origin: right; transition: transform 0.3s var(--easing); }
.menu-btn:hover::after { transform: scaleX(1); transform-origin: left; }
.back-btn { position: absolute; right: calc(var(--header-padding) + 80px); top: 50%; transform: translateY(-50%); font-family: 'Syncopate', sans-serif; font-size: 0.7rem; text-transform: uppercase; text-decoration: none; color: white; border: 1px solid rgba(255,255,255,0.4); padding: 0.6rem 1.5rem; transition: all 0.3s; letter-spacing: 0.1em; pointer-events: auto; background: rgba(0,0,0,0.5); }
.back-btn:hover { background: white; color: black; border-color: white; }

/* --- MENU --- */
#menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 2000; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2rem; transform: translateY(-100%); transition: transform 0.8s var(--easing); }
#menu-overlay.active { transform: translateY(0); }
.menu-item { font-family: 'Syncopate', sans-serif; font-size: clamp(2rem, 5vw, 4rem); color: white; text-decoration: none; opacity: 0.4; transition: 0.3s; cursor: pointer; }
.menu-item:hover { opacity: 1; letter-spacing: 0.05em; }
.close-menu { position: absolute; top: calc(var(--header-height) / 2); right: var(--header-padding); transform: translateY(-50%); font-family: 'Syncopate', sans-serif; cursor: pointer; font-size: 0.9rem; color: white; letter-spacing: 0.1em; }

/* --- HOME SLIDER --- */
#carousel-stage { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; perspective: 1000px; }
.slide { position: absolute; top: 0; height: 100%; width: 80vw; transition: all var(--transition-speed) var(--easing); will-change: transform, width, opacity, filter; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.slide.active { z-index: 10; transform: translateX(0) scale(1); width: 80vw; left: 10vw; opacity: 1; filter: brightness(1) grayscale(0); }
@media (max-width: 768px) { .slide.active { width: 90vw; left: 5vw; } }
.slide.prev { z-index: 5; transform: translateX(-15%); width: 10vw; left: 1vw; opacity: 0.6; filter: brightness(0.4) grayscale(1); cursor: pointer; }
.slide.next { z-index: 5; transform: translateX(15%); width: 10vw; left: 89vw; opacity: 0.6; filter: brightness(0.4) grayscale(1); cursor: pointer; }
.slide.off-left { transform: translateX(-50%); width: 0; left: -10vw; opacity: 0; }
.slide.off-right { transform: translateX(50%); width: 0; left: 110vw; opacity: 0; }
.img-container { position: relative; width: 100%; height: 100%; overflow: hidden; }
.img-base { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.1); transition: transform 1.2s ease-out; }

/* Ken Burns Effect */
@keyframes slowZoom { 0% { transform: scale(1.1); } 100% { transform: scale(1.25); } }
.slide.active .img-base { animation: slowZoom 15s linear infinite alternate; }

.blur-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; background-size: cover; background-position: center; filter: blur(25px) contrast(1.1); mask-image: linear-gradient(90deg, transparent 0%, transparent 20%, rgba(0,0,0,1) 57%, transparent 0%, transparent 100%); -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 20%, rgba(0,0,0,1) 57%, transparent 0%, transparent 100%); mask-size: 200% 100%; -webkit-mask-size: 200% 100%; transform: scale(1.1); transition: opacity 0.5s ease; }
.slide.active .blur-layer { opacity: 1; animation: blurDrift 5s 1 forwards cubic-bezier(0.45, 0, 0.55, 1); animation-delay: 0.5s; }
@keyframes blurDrift { 0% { opacity: 0; -webkit-mask-position: 150% 0; mask-position: 150% 0; transform: scale(1.2) translateX(-20px); } 10% { opacity: 1; } 100% { opacity: 1; -webkit-mask-position: 20% 0; mask-position: 20% 0; transform: scale(1.1) translateX(20px); } }
.overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.6) 100%); z-index: 2; }
.text-content { position: absolute; bottom: 10%; left: 5%; z-index: 20; color: white; display: flex; flex-direction: column; gap: 0.5rem; max-width: 60%; mix-blend-mode: hard-light; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.slide.active .text-content { opacity: 1; pointer-events: auto; }
.project-number { font-family: 'Syncopate', sans-serif; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 1rem; }
.project-title { font-family: 'Syncopate', sans-serif; font-weight: 700; font-size: clamp(2rem, 5vw, 5rem); text-transform: uppercase; line-height: 0.9; clip-path: inset(0 0 100% 0); transition: clip-path 0.8s var(--easing); }
.project-meta, .project-collab { display: flex; gap: 2rem; font-size: 0.9rem; margin-top: 1rem; color: var(--text-secondary); opacity: 0; transform: translateY(20px); transition: all 0.8s var(--easing); }
.slide.active .project-title { clip-path: inset(0 0 0 0); transition-delay: 0.4s; }
.slide.active .project-meta { opacity: 1; transform: translateY(0); transition-delay: 0.6s; }
.slide.active .project-collab { opacity: 1; transform: translateY(0); transition-delay: 0.7s; }
.view-project-btn { position: absolute; bottom: 10%; right: 10%; z-index: 25; background: transparent; border: 1px solid rgba(255,255,255,0.4); color: white; padding: 1.2rem 2.4rem; font-family: 'Syncopate', sans-serif; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.2em; cursor: pointer; overflow: hidden; clip-path: inset(0 0 100% 0); transition: clip-path 0.5s var(--easing); pointer-events: auto; text-decoration: none; display: flex; align-items: center; justify-content: center; opacity: 0; }
.view-project-btn:hover { background: white; color: black; border-color: white; }
.slide.active .view-project-btn { clip-path: inset(0 0 0 0); transition-delay: 0.1s; opacity: 1; }

/* --- PROJECT PAGE (Single) --- */
.hero { position: relative; height: 85vh; width: 100%; overflow: hidden; display: flex; align-items: flex-end; padding: 4rem 2rem; }
.hero-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.6; z-index: 1; filter: grayscale(20%); }
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, #050505 0%, transparent 60%); z-index: 2; }
.hero-content { position: relative; z-index: 10; width: 100%; max-width: 1400px; margin: 0 auto; }
.hero-title { font-family: 'Syncopate', sans-serif; font-size: clamp(3rem, 7vw, 7rem); font-weight: 700; text-transform: uppercase; line-height: 0.9; margin-bottom: 2rem; opacity: 0; transform: translateY(50px); animation: slideUp 1s var(--easing) 0.5s forwards; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 2rem; border-top: 1px solid rgba(255,255,255,0.2); padding-top: 2rem; opacity: 0; animation: fadeIn 1s var(--easing) 1s forwards; }
.info-item h4 { font-family: 'Syncopate', sans-serif; font-size: 0.7rem; color: rgba(255,255,255,0.6); margin-bottom: 0.5rem; letter-spacing: 0.1em; }

/* --- NEW: CREDITS SECTION --- */
.credits-section {
    max-width: 1400px; margin: 0 auto; padding: 0 2rem 4rem;
    display: none; /* Hidden by default */
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.credits-section.visible { display: block; }
.credits-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem; padding-top: 2rem;
}
.credit-item h5 {
    font-family: 'Syncopate', sans-serif; font-size: 0.7rem; color: rgba(255,255,255,0.4);
    margin-bottom: 0.3rem; letter-spacing: 0.1em; text-transform: uppercase;
}
.credit-item p { font-size: 1rem; color: white; }

.description-section { max-width: 1400px; margin: 0 auto; padding: 6rem 2rem 2rem; display: grid; grid-template-columns: 1fr 2fr; gap: 4rem; }
.desc-label { font-family: 'Syncopate', sans-serif; font-size: 0.9rem; color: rgba(255,255,255,0.5); letter-spacing: 0.1em; }
.desc-text { font-size: 1.1rem; line-height: 1.8; color: #ddd; max-width: 800px; opacity: 0; transform: translateY(20px); transition: 1s ease; }
.desc-text.visible { opacity: 1; transform: translateY(0); }
.gallery { max-width: 1400px; margin: 0 auto; padding: 4rem 2rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; min-height: 50vh; }
.gallery-item { width: 100%; aspect-ratio: 4/3; overflow: hidden; position: relative; opacity: 0; transform: translateY(30px); transition: all 0.8s var(--easing); cursor: none; }
.gallery-item.loaded { opacity: 1; transform: translateY(0); }
.gallery-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--easing); }
.gallery-item:hover .gallery-img { transform: scale(1.1); }
.hover-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0); width: 40px; height: 40px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: black; font-weight: bold; pointer-events: none; transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.gallery-item:hover .hover-icon { transform: translate(-50%, -50%) scale(1); }
.footer-nav { max-width: 1400px; margin: 0 auto; padding: 6rem 2rem; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,0.1); }
.nav-block { text-decoration: none; color: white; display: flex; flex-direction: column; max-width: 45%; }
.nav-block.prev { align-items: flex-start; }
.nav-block.next { align-items: flex-end; text-align: right; }
.nav-label { font-family: 'Syncopate', sans-serif; font-size: 0.7rem; color: rgba(255,255,255,0.4); margin-bottom: 0.5rem; }
.nav-title { font-family: 'Syncopate', sans-serif; font-size: clamp(1rem, 2vw, 1.8rem); transition: 0.3s; }
.nav-block:hover .nav-title { color: rgba(255,255,255,0.8); letter-spacing: 0.05em; }

/* --- PROJECTS OVERVIEW (Horizontal) --- */
.projects-page { padding: 8rem 0 2rem; width: 100%; }
.projects-header-main { font-family: 'Syncopate', sans-serif; font-size: clamp(2rem, 5vw, 4rem); margin-bottom: 4rem; padding: 0 2rem; max-width: 1600px; margin: 0 auto 4rem; }
.category-section { margin-bottom: 2rem; max-width: 100%; }
.category-header { display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; margin-bottom: 2rem; max-width: 1600px; margin: 0 auto 2rem; }
.category-title { font-family: 'Syncopate', sans-serif; font-size: 1.2rem; color: var(--text-secondary); text-transform: uppercase; margin: 0; }
.category-divider { width: 100%; height: 1px; background: rgba(255,255,255,0.1); margin-bottom: 3rem; margin-top: 1rem; }
.horiz-scroll { display: flex; gap: 2rem; overflow-x: auto; padding: 0 2rem 2rem; scroll-behavior: smooth; cursor: grab; scrollbar-width: none; -ms-overflow-style: none; }
.horiz-scroll::-webkit-scrollbar { display: none; }
.horiz-scroll:active { cursor: grabbing; }
.p-card { text-decoration: none; color: white; display: block; position: relative; min-width: 350px; width: 350px; flex-shrink: 0; }
.p-card-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; margin-bottom: 1rem; filter: grayscale(100%); transition: all 0.5s ease; pointer-events: none; }
.p-card:hover .p-card-img { filter: grayscale(0%); transform: scale(1.02); }
.p-card-meta { font-family: 'Syncopate', sans-serif; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.p-card-title { font-family: 'Syncopate', sans-serif; font-size: 1.2rem; font-weight: 700; transition: color 0.3s; }
.p-card:hover .p-card-title { color: rgba(255,255,255,0.7); }

/* --- CONTACT PAGE --- */
.contact-page { height: 100vh; width: 100vw; overflow: hidden; padding: var(--header-height) 2rem 2rem; max-width: 1600px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.contact-left { height: 100%; display: flex; flex-direction: column; justify-content: center; }
.contact-title { font-family: 'Syncopate', sans-serif; font-size: clamp(2.5rem, 4vw, 4rem); margin-bottom: 2rem; line-height: 1; }
.contact-details { margin-bottom: 2rem; }
.contact-details p { font-size: 1rem; margin-bottom: 0.5rem; color: var(--text-secondary); }
.contact-details a { color: white; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.3); transition: 0.3s; }
.contact-details a:hover { border-color: white; }
.selfie-container { width: 200px; height: 250px; overflow: hidden; margin-top: 1rem; border: 1px solid rgba(255,255,255,0.1); }
.selfie-img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%); transition: filter 0.5s; }
.selfie-container:hover .selfie-img { filter: grayscale(0%); }
.contact-form { display: flex; flex-direction: column; gap: 1.5rem; justify-content: center; padding: 2rem; border-left: 1px solid rgba(255,255,255,0.1); }
.form-group input, .form-group textarea { width: 100%; background: transparent; border: none; border-bottom: 1px solid rgba(255,255,255,0.3); padding: 0.8rem 0; color: white; font-family: 'Manrope', sans-serif; font-size: 1rem; outline: none; transition: border-color 0.3s; }
.form-group input:focus, .form-group textarea:focus { border-color: white; }
.submit-btn { background: white; color: black; border: none; padding: 1rem 3rem; font-family: 'Syncopate', sans-serif; font-weight: 700; cursor: pointer; align-self: flex-start; text-transform: uppercase; letter-spacing: 0.1em; transition: 0.3s; margin-top: 1rem; }
.submit-btn:hover { background: #ddd; }

/* --- LIGHTBOX --- */
#lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.98); backdrop-filter: blur(5px); z-index: 10000; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.4s ease; overflow: hidden; overscroll-behavior: none; }
#lightbox.active { opacity: 1; pointer-events: auto; }
#lb-img-container { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#lb-img { max-width: 90%; max-height: 80vh; object-fit: contain; transform-origin: center center; will-change: transform; cursor: grab; transition: transform 0.1s linear; }
#lb-img.zoomed { cursor: grab; }
#lb-img.zoomed:active { cursor: grabbing; }
.lb-controls { position: absolute; bottom: 2rem; width: 100%; display: flex; justify-content: center; align-items: center; gap: 4rem; font-family: 'Syncopate', sans-serif; font-size: 1rem; color: white; pointer-events: auto; z-index: 10002; }
.lb-btn { cursor: pointer; padding: 1rem; opacity: 0.5; transition: opacity 0.3s; }
.lb-btn:hover { opacity: 1; }
/* NEW: Lightbox Counter Style */
.lb-counter { font-size: 0.8rem; letter-spacing: 0.1em; color: rgba(255,255,255,0.6); }

.lb-close { position: absolute; top: calc(var(--header-height) / 2); right: var(--header-padding); transform: translateY(-50%); z-index: 10002; font-family: 'Syncopate', sans-serif; font-size: 0.7rem; color: white; border: 1px solid rgba(255,255,255,0.4); padding: 0.6rem 1.5rem; cursor: pointer; letter-spacing: 0.1em; }
.lb-close:hover { background: white; color: black; }

/* --- HELPERS --- */
.ui-layer { position: fixed; bottom: 0; left: 0; width: 100%; padding: 2rem; pointer-events: none; z-index: 100; }
.progress-bar { position: absolute; bottom: 2rem; left: 2rem; right: 2rem; height: 2px; background: rgba(255,255,255,0.1); overflow: hidden; }
.progress-fill { height: 100%; background: white; width: 0%; transition: width 0.1s linear; }
#loader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 99999; display: flex; justify-content: center; align-items: center; transition: opacity 0.5s ease-out; }
.loader-text { font-family: 'Syncopate', sans-serif; animation: pulse 1s infinite; }
@keyframes slideUp { to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes pulse { 50% { opacity: 0.5; } }
@media (max-width: 900px) { .contact-page { height: auto; overflow-y: auto; grid-template-columns: 1fr; gap: 3rem; padding-bottom: 4rem; } .contact-form { border-left: none; padding: 0; height: auto; } .p-card { min-width: 280px; width: 280px; } }

/* =========================================
   MOBILE / RESPONSIVE OPTIMIZATIONS
   ========================================= */
@media (max-width: 768px) {
    /* 1. HEAVINESS FIX: Disable heavy blur and animation on phones */
    .blur-layer {
        display: none !important; 
    }
    .slide.active .img-base {
        animation: none !important; /* Stops the constant zoom */
        transform: scale(1.0) !important;
    }

    /* 2 & 4. LAYOUT FIX: Stop Overlap & Fix Text Truncation */
    .text-content {
        bottom: 8rem !important; /* Move text UP above the button */
        left: 1.5rem !important;
        max-width: 90% !important;
        padding-right: 0.5rem;
    }
    
    .project-title {
        font-size: 2.2rem !important; /* Smaller text so long names fit */
        margin-bottom: 0.5rem;
    }
    
    .project-meta {
        flex-wrap: wrap; 
        gap: 0.8rem;
        margin-top: 0.5rem;
        font-size: 0.8rem;
    }

    /* 3. SHOW ALL METADATA (Stacking) */
    .project-collab {
        flex-direction: column; /* Stack them vertically */
        gap: 0.3rem;
        align-items: flex-start;
        margin-top: 1rem;
        font-size: 0.75rem; 
        color: rgba(255,255,255,0.7);
    }
    
    /* Button Anchored to Bottom */
    .view-project-btn {
        bottom: 2rem !important;
        left: 1.5rem !important;
        right: auto !important;
        width: calc(100% - 3rem); /* Full width button */
        text-align: center;
        background: rgba(0,0,0,0.6); /* Darker background for readability */
        backdrop-filter: blur(4px);
    }
}