/* ========================================
   PORTFOLIO SECTION - PREMIUM UPGRADE
   ======================================== */

/* Portfolio Background */
.portfolio-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg-primary);
    transition: background 1s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

/* Floating Text */
.floating-text {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(80px, 12vw, 180px);
    font-weight: 900;
    color: rgba(255, 255, 255, 0.02);
    font-family: 'Playfair Display', serif;
    pointer-events: none;
    z-index: 1;
    animation: floatText 20s ease-in-out infinite;
}

@keyframes floatText {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-30px); }
}

/* Work Header */
.work-header {
    text-align: center;
    margin-bottom: 80px;
    position: relative;
    z-index: 2;
}

.work-tagline {
    font-size: 18px;
    color: #a0a0a0;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 20px;
    opacity: 0.7;
}

/* Enhanced Filter Buttons */
.filter-btn {
    background: rgba(26, 26, 46, 0.5) !important;
    border: 1px solid rgba(99, 102, 241, 0.2) !important;
    backdrop-filter: blur(10px);
    font-size: 13px !important;
}

.filter-btn:hover,
.filter-btn.active {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

/* Masonry Grid */
.masonry-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)) !important;
    grid-auto-flow: dense;
}

/* Enhanced Gallery Items */
.gallery-item {
    opacity: 0 !important;
    transform: translateY(50px) scale(0.95) !important;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.gallery-item.show {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
}

.gallery-item.hide {
    display: none !important;
}

/* Enhanced Gallery Image */
.gallery-image {
    background: var(--color-bg-secondary);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border-radius: 12px !important;
}

.gallery-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    opacity: 0;
    z-index: 1;
    transition: opacity 0.5s;
    pointer-events: none;
}

.gallery-image:hover::before {
    opacity: 0.1;
}

.gallery-image:hover {
    transform: translateY(-10px) !important;
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.4) !important;
}

/* Enhanced Overlay */
.gallery-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 50%, transparent 100%) !important;
    align-items: flex-end !important;
    padding: 40px !important;
}

.project-category {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #6366f1;
    margin-bottom: 10px;
    font-weight: 600;
}

.project-title {
    font-size: 28px !important;
    font-weight: 700 !important;
    margin-bottom: 20px !important;
    color: white !important;
    font-family: 'Playfair Display', serif !important;
}

.view-project-btn {
    padding: 12px 30px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.view-project-btn:hover {
    background: white;
    color: #0a0a0a;
    border-color: white;
}

.gallery-image:hover .project-image {
    transform: scale(1.08) !important;
    filter: blur(3px) brightness(0.7) !important;
}

/* Project Metrics */
.project-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px;
    margin-top: 120px;
    padding: 80px 0;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.metric-item {
    text-align: center;
}

.metric-number {
    font-size: clamp(60px, 8vw, 100px);
    font-weight: 900;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    font-family: 'Playfair Display', serif;
}

.metric-plus,
.metric-percent {
    font-size: clamp(40px, 6vw, 70px);
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    margin-left: 5px;
}

.metric-label {
    margin-top: 15px;
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #a0a0a0;
}

/* Conceptual Quote */
.conceptual-quote {
    text-align: center;
    padding: 100px 0;
}

.quote-text {
    font-size: clamp(18px, 3vw, 36px);
    font-weight: 300;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: #ffffff;
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.4;
    position: relative;
    opacity: 0.9;
}

.quote-text::before,
.quote-text::after {
    content: '"';
    font-size: 1.5em;
    color: #6366f1;
    opacity: 0.5;
}

/* Project Fullscreen Overlay */
.project-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s;
    overflow: hidden;
}

.project-fullscreen.active {
    opacity: 1;
    visibility: visible;
}

.close-project {
    position: absolute;
    top: 40px;
    right: 50px;
    width: 50px;
    height: 50px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 30px;
    cursor: pointer;
    z-index: 10002;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-project:hover {
    background: white;
    color: #0a0a0a;
    border-color: white;
    transform: rotate(90deg);
}

.fullscreen-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 10001;
    pointer-events: none;
}

.nav-prev,
.nav-next {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
    pointer-events: all;
    backdrop-filter: blur(10px);
}

.nav-prev:hover,
.nav-next:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #6366f1;
    transform: scale(1.1);
}

.fullscreen-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 100px 50px;
    gap: 80px;
}

.fullscreen-image-container {
    flex: 1;
    max-width: 800px;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

.project-fullscreen.active .fullscreen-image-container {
    opacity: 1;
    transform: scale(1);
}

.fullscreen-image {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.fullscreen-info {
    flex: 0 0 400px;
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.4s;
}

.project-fullscreen.active .fullscreen-info {
    opacity: 1;
    transform: translateX(0);
}

.project-full-info h2 {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 30px;
    font-family: 'Playfair Display', serif;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.project-meta {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
    padding: 30px 0;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meta-label {
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #a0a0a0;
}

.meta-value {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.project-description {
    font-size: 18px;
    line-height: 1.8;
    color: #a0a0a0;
}

/* Responsive */
@media (max-width: 1024px) {
    .fullscreen-content {
        flex-direction: column;
        padding: 80px 30px;
        gap: 40px;
    }
    
    .fullscreen-info {
        flex: 1;
        max-width: 100%;
    }
    
    .project-metrics {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .floating-text {
        font-size: 60px;
    }
    
    .masonry-grid {
        grid-template-columns: 1fr !important;
    }
    
    .close-project {
        top: 20px;
        right: 20px;
    }
    
    .quote-text {
        font-size: 16px;
    }
}

/* ========================================
   CASE STUDIES SECTION - PROFESSIONAL
   ======================================== */

.case-studies {
    position: relative;
    background: var(--color-bg-primary);
    padding: 60px 0;
    z-index: 10;
}

.cases-header {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    z-index: 2;
}

.cases-subtitle {
    font-size: 18px;
    color: #a0a0a0;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 20px;
    font-weight: 300;
}

/* Case Study Container */
.case-study {
    margin-bottom: 50px;
    opacity: 0;
    animation: fadeInUp 1s ease var(--animation-delay, 0s) forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.case-study:nth-child(1) { --animation-delay: 0.2s; }
.case-study:nth-child(2) { --animation-delay: 0.4s; }
.case-study:nth-child(3) { --animation-delay: 0.6s; }
.case-study:nth-child(4) { --animation-delay: 0.8s; }

/* Case Grid - 2 Columns */
.case-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
    align-items: flex-start;
}

/* Case Sections */
.case-problem {
    opacity: 0;
    transform: translateX(-40px);
    animation: slideInLeft 0.8s ease-out 0.3s forwards;
}

.case-idea {
    opacity: 0;
    transform: translateX(40px);
    animation: slideInRight 0.8s ease-out 0.3s forwards;
}

.case-solution {
    opacity: 0;
    transform: translateX(-40px);
    animation: slideInLeft 0.8s ease-out 0.5s forwards;
}

.case-result {
    opacity: 0;
    transform: translateX(40px);
    animation: slideInRight 0.8s ease-out 0.5s forwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Case Headers */
.case-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    font-family: 'Playfair Display', serif;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
}

.case-section-title::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #ec4899);
    border-radius: 2px;
}

.case-content {
    margin-top: 12px;
}

/* Case Text */
.case-text {
    font-size: 13px;
    line-height: 1.5;
    color: #d0d0d0;
    font-weight: 300;
    margin-bottom: 10px;
}

.case-text strong {
    color: #ffffff;
    font-weight: 600;
}

.case-emphasis {
    font-size: 12px;
    font-style: italic;
    color: #6366f1;
    margin-top: 10px;
    padding-left: 15px;
    border-left: 3px solid #6366f1;
    opacity: 0.9;
}

/* Case List */
.case-list {
    list-style: none;
    margin-top: 20px;
    padding-left: 0;
}

.case-list li {
    font-size: 12px;
    color: #b0b0b0;
    margin-bottom: 6px;
    padding-left: 20px;
    position: relative;
    line-height: 1.4;
}

.case-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #6366f1;
    font-weight: 600;
}

/* Subtitle Small */
.case-subtitle-small {
    font-size: 11px;
    font-weight: 700;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 12px;
    margin-bottom: 6px;
    display: block;
}

.case-subtitle-small:first-child {
    margin-top: 0;
}

/* Result Metrics */
.result-metric {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
    opacity: 0;
    animation: fadeIn 0.6s ease-out 0.7s forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.result-metric:nth-child(1) { animation-delay: 0.7s; }
.result-metric:nth-child(2) { animation-delay: 0.8s; }
.result-metric:nth-child(3) { animation-delay: 0.9s; }

.result-number {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Outfit', sans-serif;
}

.result-label {
    font-size: 12px;
    color: #a0a0a0;
    font-weight: 400;
}

.case-result-text {
    margin-top: 15px;
    color: #ffffff;
    font-weight: 400;
}

/* Case Images */
.case-images {
    margin-top: 60px;
    position: relative;
    z-index: 3;
}

.case-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.15);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.case-image-wrapper:hover {
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.3);
    transform: translateY(-5px);
}

.case-image {
    width: 100%;
    height: auto;
    display: block;
    opacity: 1;
    animation: imageReveal 1s ease-out 0s forwards;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

@keyframes imageReveal {
    from {
        opacity: 0.8;
        transform: scale(0.98) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.case-image-wrapper figcaption {
    font-size: 13px;
    color: #808080;
    margin-top: 12px;
    text-align: center;
    font-style: italic;
    letter-spacing: 0.5px;
}

/* Responsive Cases */
@media (max-width: 1024px) {
    .case-grid {
        grid-template-columns: 1fr;
        gap: 60px;
        margin-bottom: 60px;
    }

    .case-section-title {
        font-size: 24px;
    }

    .result-number {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .case-studies {
        padding: 100px 0;
    }

    .cases-header {
        margin-bottom: 80px;
    }

    .case-study {
        margin-bottom: 120px;
    }

    .case-section-title {
        font-size: 20px;
    }

    .case-text {
        font-size: 15px;
        line-height: 1.7;
    }

    .case-list li {
        font-size: 14px;
    }

    .result-number {
        font-size: 24px;
    }

    .result-label {
        font-size: 13px;
    }
}