/* ==========================================================================
   Project Modal
   Individual project detail as modal overlay
   ========================================================================== */

/* Project Page Container */
.project-page {
    display: none;
    background-color: var(--color-bg);
    transition: background-color 0.3s ease;
    min-height: 100vh;
}

/* Project entrance — staggered content blocks */
@keyframes project-content-enter {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.project-page.view-enter {
    animation: none;
    overflow: visible;
}

.project-page.view-enter > * {
    animation: none;
}

.project-page.view-enter .project-content-container > * {
    animation: project-content-enter 450ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.project-page.view-enter .project-content-container > *:nth-child(1) { animation-delay: 0ms; }
.project-page.view-enter .project-content-container > *:nth-child(2) { animation-delay: 60ms; }
.project-page.view-enter .project-content-container > *:nth-child(3) { animation-delay: 120ms; }
.project-page.view-enter .project-content-container > *:nth-child(n+4) { animation-delay: 160ms; }

.project-page.view-enter .next-project {
    animation: project-content-enter 400ms cubic-bezier(0.16, 1, 0.3, 1) 200ms both;
}

@media (prefers-reduced-motion: reduce) {
    .project-page.view-enter .project-content-container > *,
    .project-page.view-enter .next-project {
        animation: none !important;
    }
}

/* Close button icon visibility */
.view-toggle-btn .icon-close {
    display: none;
}

.view-toggle-btn[data-view="project"] .icon-list,
.view-toggle-btn[data-view="project"] .icon-grid {
    display: none;
}

.view-toggle-btn[data-view="project"] .icon-close {
    display: block;
}

.view-toggle-btn .icon-close path {
    stroke: var(--color-text-secondary);
    transition: stroke 0.3s ease;
}

/* Content Container
   ========================================================================== */

.project-content-container {
    position: relative;
    max-width: 930px;
    margin: 0 auto;
    padding: 0 65px;
    padding-top: 134px;
    z-index: 1;
}

/* Hero Image
   ========================================================================== */

.project-hero {
    position: relative;
    width: calc(100% + 150px);
    margin-left: -75px;
    margin-right: -75px;
    margin-bottom: 28px;
    background-color: var(--color-thumbnail-bg);
    border-radius: 14px;
    transition: background-color 0.3s ease;
}

.project-hero-image {
    position: relative;
    width: 100%;
    height: auto;
    border-radius: 14px;
    display: block;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project-hero-image.loaded {
    opacity: 1;
}

.project-hero-glow {
    position: fixed;
    top: -600px;
    left: 50%;
    transform: translateX(-50%) translateZ(0);
    width: 2200px;
    height: 900px;
    border-radius: 14px;
    opacity: 0;
    filter: blur(150px);
    pointer-events: none;
    z-index: 0;
    background-size: cover;
    background-position: center;
    transition: opacity 0.3s ease;
    /* Performance optimization */
    will-change: filter;
}

/* Glow opacity is controlled by JS for scroll-based fade */

/* Dark overlay on glow for better blending */
.project-hero-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 14px;
}

/* Content Blocks
   ========================================================================== */

/* Text Block Container */
.content-text-block {
    max-width: 610px;
    margin: 80px auto;
}

/* Text Block */
.content-text-block .content-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 18px;
    font-weight: 450;
    line-height: 1.5;
    color: var(--color-text-secondary);
    letter-spacing: -0.09px;
    margin: 0 0 20px;
    transition: color 0.3s ease;
}

.content-text-block .content-text:last-child {
    margin-bottom: 0;
}

.content-text .highlight {
    color: var(--color-text-primary);
    transition: color 0.3s ease;
}

/* Heading Style */
.content-text-block .content-heading {
    margin: 0 0 20px;
    text-align: left;
}

.content-text-block .content-heading:last-child {
    margin-bottom: 0;
}

.content-heading p {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 38px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--color-text-primary);
    letter-spacing: -0.57px;
    margin: 0;
    transition: color 0.3s ease;
}

.content-heading p .highlight {
    color: var(--color-text-secondary);
    transition: color 0.3s ease;
}

/* Subheading Style */
.content-text-block .content-subheading {
    margin: 0 0 20px;
    text-align: left;
}

.content-text-block .content-subheading:last-child {
    margin-bottom: 0;
}

.content-subheading p {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 28px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--color-text-primary);
    letter-spacing: -0.42px;
    margin: 0;
    transition: color 0.3s ease;
}

.content-subheading p .highlight {
    color: var(--color-text-secondary);
    transition: color 0.3s ease;
}

/* Image Block */
.content-image {
    margin: 0 auto 28px;
    background-color: var(--color-thumbnail-bg);
    border-radius: 14px;
    transition: background-color 0.3s ease;
}

.content-image img,
.content-image video {
    width: 100%;
    height: auto;
    border-radius: 14px;
    display: block;
}

.content-image img {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.content-image img.loaded {
    opacity: 1;
}

.content-image.size-large {
    max-width: 900px;
}

.content-image.size-medium {
    max-width: 580px;
}

.content-image.size-small {
    max-width: 460px;
}

/* Image Pair Block */
.content-image-pair {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    max-width: 895px;
    margin: 0 auto 28px;
}

.content-image-pair-item {
    flex: 1;
    width: calc(50% - 14px);
    background-color: var(--color-thumbnail-bg);
    border-radius: 14px;
    overflow: hidden;
}

.content-image-pair img,
.content-image-pair video {
    width: 100%;
    height: auto;
    display: block;
}

.content-image-pair img {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.content-image-pair img.loaded {
    opacity: 1;
}

/* ==========================================================================
   Responsive - Project Page
   ========================================================================== */

@media (max-width: 1060px) {
    .project-hero {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .project-content-container {
        padding: 0 30px;
        padding-top: 120px;
    }

    .project-hero {
        margin-bottom: 16px;
    }

    .project-hero-glow {
        width: 1200px;
        height: 600px;
        top: -400px;
        filter: blur(100px);
    }

    .content-text-block {
        margin-top: 60px;
        margin-bottom: 60px;
    }

    .content-heading p {
        font-size: 28px;
    }

    .content-subheading p {
        font-size: 22px;
    }

    .content-image {
        margin-bottom: 16px;
    }

    .content-image-pair {
        gap: 16px;
        margin-bottom: 16px;
    }

}

@media (max-width: 480px) {
    .project-content-container {
        padding: 0 20px;
        padding-top: 100px;
    }

    .project-hero {
        margin-bottom: 12px;
    }

    .project-hero-glow {
        width: 800px;
        height: 400px;
        top: -280px;
        filter: blur(80px);
    }

    .project-hero-image {
        border-radius: 10px;
    }

    .content-text-block {
        margin-top: 40px;
        margin-bottom: 40px;
    }

    .content-text-block .content-text {
        font-size: 16px;
    }

    .content-heading p {
        font-size: 22px;
    }

    .content-subheading p {
        font-size: 18px;
    }

    .content-image {
        margin-bottom: 12px;
    }

    .content-image img,
    .content-image video {
        border-radius: 10px;
    }

    .content-image-pair {
        gap: 12px;
        margin-bottom: 12px;
    }

    .content-image-pair-item {
        border-radius: 10px;
    }

}

