/* Design Portfolio Styles */

/* ========================================
   PORTFOLIO LANDING PAGE (/design)
   ======================================== */

.portfolio-main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 120px 80px 80px 80px;
}

.portfolio-main h1 {
    font-size: 72px;
    font-weight: 500;
    margin-bottom: 16px;
    letter-spacing: -0.04em;
}

.portfolio-main h1 .word {
    display: inline-block;
    opacity: 0;
    filter: blur(10px);
    animation: blurIn 0.6s ease-out forwards;
    will-change: transform, opacity, filter;
}

.portfolio-main h1 .word:nth-child(1) { animation-delay: 0.0s; }
.portfolio-main h1 .word:nth-child(2) { animation-delay: 0.1s; }
.portfolio-main h1 .word:nth-child(3) { animation-delay: 0.2s; }

@keyframes blurIn {
    from {
        opacity: 0;
        filter: blur(10px);
        transform: translateY(0%);
    }
    to {
        opacity: 1;
        filter: blur(0px);
        transform: translateY(0%);
    }
}

.portfolio-subtitle {
    font-size: 18px;
    color: #999;
    margin-bottom: 80px;
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 60px;
}

.project-card {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: scale(1.02);
}

.project-card:hover .project-thumbnail img {
    filter: blur(8px);
}

.project-card:hover .project-thumbnail::after {
    opacity: 1;
}

.project-thumbnail {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 24px;
    position: relative;
}

.project-thumbnail::after {
    content: 'View project';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #FFFFFF;
    font-size: 20px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease;
}

.project-info {
    padding: 0 8px;
}

.project-title {
    font-size: 32px;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
    color: #f5f5f5;
}

.project-role {
    font-size: 16px;
    color: #999;
    font-weight: 400;
}

/* ========================================
   CASE STUDY PAGES
   ======================================== */

.case-study-main {
    background: #0a0a0a;
    color: #FFFFFF;
}

/* Hero Section */
.hero-section {
    width: 100%;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-bottom: 80px;
    position: relative;
    background-color: #0a0a0a;
}

.hero-image {
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
}

.hero-overlay {
    position: absolute;
    bottom: 80px;
    left: 80px;
    z-index: 10;
}

.hero-title {
    font-size: 80px;
    font-weight: 600;
    color: #FFFFFF;
}

.hero-title .word {
    display: inline-block;
    opacity: 0;
    filter: blur(10px);
    animation: blurIn 0.6s ease-out forwards;
    will-change: transform, opacity, filter;
}

.hero-title .word:nth-child(1) { animation-delay: 0.0s; }
.hero-title .word:nth-child(2) { animation-delay: 0.1s; }
.hero-title .word:nth-child(3) { animation-delay: 0.2s; }
.hero-title .word:nth-child(4) { animation-delay: 0.3s; }
.hero-title .word:nth-child(5) { animation-delay: 0.4s; }

.hero-title p {
    display: inline;
}

/* Case Study Content Wrapper */
.case-study-content {
    width: 100%;
    padding: 0;
}

/* Project Meta Section */
.project-meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto 60px;
    padding: 0 80px 60px;
    border-bottom: 1px solid #333;
}

.meta-item h3 {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 500;
}

.meta-item p {
    font-size: 16px;
    line-height: 1.6;
    color: #f5f5f5;
}

/* Project Description */
.project-description {
    max-width: 900px;
    margin: 0 0 100px 0;
    padding: 0 80px;
    text-align: left;
}

.project-description p {
    font-size: 16px;
    line-height: 30px;
    letter-spacing: -0.04em;
    margin-bottom: 2rem;
    color: #ADADAD;
    font-weight: 400;
}

/* ========================================
   IMAGE GALLERY SECTIONS
   ======================================== */

.image-gallery {
    width: 100%;
    margin: 100px 0;
}

.gallery-section {
    margin-bottom: 80px;
}

/* Full-Width Images */
.gallery-image.full-width {
    width: 100%;
    margin-bottom: 20px;

}

.gallery-image.full-width img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

/* Centered/Contained Images */
.gallery-image.centered-image {
    max-width: 1200px;
    margin: 0 auto 20px;
    padding: 0 80px;
}

.gallery-image.centered-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

/* 2-Column Grid */
.gallery-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 1600px;
    margin: 0 auto 20px;
    padding: 0 80px;
}

.gallery-row img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

/* 3-Column Grid */
.gallery-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1600px;
    margin: 0 auto 20px;
    padding: 0 80px;
}

.gallery-grid-3col img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

/* Infinite Scroll Gallery */
.infinite-scroll-gallery {
    width: 100%;
    overflow: hidden;
    margin: 0 auto 20px;
    position: relative;
}

.scroll-track {
    display: flex;
    gap: 30px;
    animation: scroll 30s linear infinite;
    width: fit-content;
}

.scroll-track img {
    height: 400px;
    width: auto;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
}

.scroll-track img.clickable-image {
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.scroll-track img.clickable-image:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Image Captions */
.image-caption {
    text-align: center;
    font-size: 14px;
    color: #999;
    font-style: italic;
    margin-top: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 80px;
    line-height: 1.4em;
}

/* ========================================
   VIDEO EMBEDS
   ======================================== */

.video-section {
    max-width: 1600px;
    margin: 0 auto 80px;
    padding: 0 80px;
}

.video-embed {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.video-embed iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

/* ========================================
   INTERACTIVE GALLERY OVERLAY
   ======================================== */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-overflow-scrolling: touch;
}

.lightbox-content {
    max-width: 70vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 40px;
    right: 40px;
    background: transparent;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    z-index: 10002;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.lightbox-close:hover {
    opacity: 0.7;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
    font-size: 20px;
    user-select: none;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 40px;
}

.lightbox-next {
    right: 40px;
}

.lightbox-counter {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
}

/* Clickable Images */
.clickable-image {
    cursor: pointer;
    transition: opacity 0.3s ease;
    -webkit-tap-highlight-color: rgba(227, 87, 0, 0.3);
    touch-action: manipulation;
}

.clickable-image:hover,
.clickable-image:active {
    opacity: 0.8;
}

/* ========================================
   IMPACT/RESULTS SECTION
   ======================================== */

.impact-section {
    max-width: 800px;
    margin: 100px auto;
    padding: 0 80px;
}

.impact-section h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 32px;
    text-align: center;
}

.impact-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.impact-section li {
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 20px;
    padding-left: 32px;
    position: relative;
    color: #f5f5f5;
}

.impact-section li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #fff;
    font-weight: bold;
}

/* ========================================
   BOTTOM NAVIGATION
   ======================================== */

.case-study-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 120px 0 80px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-case-study {
    color: #f5f5f5;
    text-decoration: none;
    font-size: 16px;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-case-study:hover {
    opacity: 0.7;
}

.back-to-work {
    color: #999;
}

/* ========================================
   LOADING STATES & TRANSITIONS
   ======================================== */

img {
    transition: opacity 0.4s ease-in;
}

html {
    scroll-behavior: smooth;
}

a:focus,
button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 4px;
}

/* ========================================
   RESPONSIVE: TABLET (768px - 1200px)
   ======================================== */

@media (max-width: 1200px) {
    /* Landing Page */
    .portfolio-main {
        padding: 100px 40px 60px 40px;
    }

    .portfolio-main h1 {
        font-size: 56px;
    }

    .project-grid {
        gap: 40px;
    }

    /* Case Study */
    .hero-section {
        margin-bottom: 60px;
    }

    .hero-overlay {
        left: 40px;
        bottom: 40px;
    }

    .hero-title {
        font-size: 60px;
    }

    .case-study-content {
        padding: 60px 0;
    }

    .project-meta {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 40px 60px;
    }

    .project-description {
        padding: 0 40px;
    }

    .gallery-image.centered-image {
        padding: 0 40px;
    }

    .gallery-row {
        padding: 0 40px;
        gap: 24px;
    }

    .gallery-grid-3col {
        grid-template-columns: repeat(3, 1fr);
        padding: 0 40px;
        gap: 16px;
    }

    .image-caption {
        padding: 0 40px;
    }

    .video-section {
        padding: 0 40px;
    }

    .impact-section {
        padding: 0 40px;
    }

    .case-study-navigation {
        padding: 40px 40px 40px;
    }
}

/* ========================================
   RESPONSIVE: MOBILE (<768px)
   ======================================== */

@media (max-width: 768px) {
    /* Landing Page */
    .portfolio-main {
        padding: 40px 20px 40px 20px;
    }

    .portfolio-main h1 {
        font-size: 48px;
        margin-bottom: 40px;
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .project-title {
        font-size: 24px;
    }

    /* Case Study */
    .hero-section {
        min-height: 50vh;
        margin-bottom: 60px;
    }

    .hero-overlay {
        left: 20px;
        bottom: 20px;
    }

    .hero-title {
        font-size: 40px;
    }

    .case-study-content {
        padding: 40px 0;
    }

    .project-meta {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 20px 60px;
    }

    .project-description {
        padding: 0 20px;
    }

    .project-description p {
        font-size: 16px;
    }

    .gallery-section {
        margin-bottom: 60px;
    }

    .image-gallery {
        margin: 60px 0;
    }

    .gallery-image.centered-image {
        padding: 0 20px;
    }

    .gallery-row {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 0 20px;
    }

    .gallery-grid-3col {
        grid-template-columns: repeat(1, 1fr);
        gap: 16px;
        padding: 0 20px;
    }

    .image-caption {
        font-size: 13px;
        padding: 0 20px;
    }

    .video-section {
        padding: 0 20px;
        margin-bottom: 60px;
    }

    .impact-section {
        margin: 80px auto;
        padding: 0 20px;
    }

    .impact-section h2 {
        font-size: 24px;
    }

    .impact-section li {
        font-size: 16px;
        padding-left: 24px;
    }

    .case-study-navigation {
  
        gap: 24px;
        margin: 80px auto 60px;

    }

    .nav-case-study {
        font-size: 14px;
    }

    /* Lightbox Mobile */
    .lightbox-content {
        max-width: 90vw;
        max-height: 70vh;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
    }

    .lightbox-prev {
        left: 20px;
    }

    .lightbox-next {
        right: 20px;
    }

    .lightbox-close {
        top: 20px;
        right: 20px;
        font-size: 28px;
    }

    .lightbox-counter {
        bottom: 20px;
    }
}
