* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    font-family: "Plus Jakarta Sans", sans-serif;
    background: #f3f3f1;
    color: #111;
}

body {
    overflow-x: hidden;
}

img {
    max-width: 100%;
}

/* ============================================
   HEADER
   ============================================ */
.project-header {
    width: 100%;
    padding: 24px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.back-link {
    text-decoration: none;
    color: #111;
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.25s ease;
}

.back-link:hover {
    color: #4c5eff;
}

.project-logo {
    width: 52px;
    height: auto;
}

/* ============================================
   PAGE WRAPPER
   ============================================ */
.project-page {
    width: 100%;
    padding: 10px 40px 120px;
}

/* ============================================
   HERO
   ============================================ */
.project-hero {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 80px;
}

.project-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.project-hero-image video {
    width: 100%;
    height: 590px;
    object-fit: cover;
    border-radius: 20px;
}

.project-hero-content {
    padding-top: 10px;
}

.project-kicker {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 16px;
    font-weight: 700;
}

.project-hero-content h1 {
    font-size: clamp(2.2rem, 4vw, 4.8rem);
    line-height: normal;
    letter-spacing: 0px;
    margin-bottom: 24px;
}

.project-description {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #555;
    max-width: 700px;
    margin-bottom: 30px;
}

.project-meta {
    display: flex;
    gap: 18px;
    margin-bottom: 34px;
}

.project-meta div span {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.project-meta div strong {
    font-size: 1rem;
    font-weight: 700;
    color: #111;
}

.project-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    height: 54px;
    padding: 0 24px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    transition: 0.3s ease;
}

.primary-btn {
    background: #111;
    color: #fff;
}

.primary-btn:hover {
    background: #4c5eff;
}

.secondary-btn {
    border: 1px solid rgba(0, 0, 0, 0.18);
    color: #111;
    background: transparent;
}

.secondary-btn:hover {
    border-color: #4c5eff;
    color: #4c5eff;
}

/* ============================================
   GALLERY — 3-COLUMN SPOTLIGHT
   ============================================ */
.project-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 64px;
}

.gallery-item {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    background: #e8e8e6;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: box-shadow 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-item:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.16);
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    display: block;
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-item:hover img {
    transform: scale(1.04);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.35s ease;
}

.gallery-overlay span {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(17,17,17,0.7);
    padding: 10px 22px;
    border-radius: 999px;
    opacity: 0;
    transform: scale(0.85) translateY(6px);
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.22,1,0.36,1);
    backdrop-filter: blur(4px);
}

.gallery-item:hover .gallery-overlay {
    background: rgba(17, 17, 17, 0.18);
}

.gallery-item:hover .gallery-overlay span {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* ============================================
   SECTION LABEL
   ============================================ */
.section-label {
    margin-bottom: 32px;
}

/* ============================================
   MASONRY IMAGE GRID
   ============================================ */
.project-pdf-section {
    margin-top: 0;
}

.masonry-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

.masonry-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.masonry-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    background: #e8e8e6;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition:
        box-shadow 0.4s ease,
        transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.masonry-item:hover {
    box-shadow: 0 14px 44px rgba(0,0,0,0.15);
    transform: translateY(-4px);
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.masonry-item:hover img {
    transform: scale(1.03);
}

.masonry-item .gallery-overlay span {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(17,17,17,0.7);
    padding: 9px 20px;
    border-radius: 999px;
    opacity: 0;
    transform: scale(0.85) translateY(6px);
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.22,1,0.36,1);
    backdrop-filter: blur(4px);
}

.masonry-item:hover .gallery-overlay {
    background: rgba(17, 17, 17, 0.15);
}

.masonry-item:hover .gallery-overlay span {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(10, 10, 10, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    backdrop-filter: blur(8px);
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lb-img-wrap {
    max-width: 90vw;
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb-img-wrap img {
    max-width: 90vw;
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    transition: opacity 0.2s ease;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

.lb-img-wrap img.lb-swap {
    opacity: 0;
}

.lb-close {
    position: fixed;
    top: 24px;
    right: 28px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.lb-close:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.4);
    transform: rotate(90deg);
}

.lb-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.lb-prev { left: 24px; }
.lb-next { right: 24px; }

.lb-prev:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-50%) scale(1.08);
}
.lb-next:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-50%) scale(1.08);
}

.lb-counter {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
[data-anim] {
    transition-property: opacity, transform;
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    transition-duration: 0.75s;
    transition-delay: var(--delay, 0s);
}

[data-anim="fade-up"] {
    opacity: 0;
    transform: translateY(36px);
}
[data-anim="fade-in"] {
    opacity: 0;
}
[data-anim="slide-left"] {
    opacity: 0;
    transform: translateX(-28px);
}
[data-anim="scale-up"] {
    opacity: 0;
    transform: scale(0.93) translateY(20px);
}
[data-anim="pop"] {
    opacity: 0;
    transform: scale(0.8) translateY(10px);
}

[data-anim].is-visible {
    opacity: 1;
    transform: none;
}

/* ── Hero entrance animations (CSS, fires on load) ── */
.hero-anim-kicker  { opacity: 0; transform: translateY(18px); animation: heroIn 0.6s cubic-bezier(0.22,1,0.36,1) 0.10s forwards; }
.hero-anim-h1      { opacity: 0; transform: translateY(24px); animation: heroIn 0.7s cubic-bezier(0.22,1,0.36,1) 0.22s forwards; }
.hero-anim-desc    { opacity: 0; transform: translateY(20px); animation: heroIn 0.7s cubic-bezier(0.22,1,0.36,1) 0.36s forwards; }
.hero-anim-meta    { opacity: 0; transform: translateY(16px); animation: heroIn 0.6s cubic-bezier(0.22,1,0.36,1) var(--delay, 0.50s) forwards; }
.hero-anim-img     { opacity: 0; transform: scale(0.97) translateY(16px); animation: heroIn 0.85s cubic-bezier(0.22,1,0.36,1) 0.05s forwards; }

@keyframes heroIn {
    to { opacity: 1; transform: none; }
}

/* ============================================
   SECTION HEAD (standalone use)
   ============================================ */
.section-head {
    margin-bottom: 24px;
}

.section-head p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.section-head h2 {
    font-size: clamp(1.8rem, 3vw, 3rem);
    line-height: 1.05;
    letter-spacing: -1px;
}

/* ============================================
   CASE STUDY (Markdown-rendered content)
   ============================================ */
.case-study {
    max-width: 900px;
    margin: 60px auto;
    padding: 0 24px;
}

.case-study h1 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #111;
    margin: 56px 0 12px;
    padding-top: 40px;
    border-top: 1px solid #e0dedd;
}

.case-study h1:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.case-study h2 {
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    font-weight: 700;
    color: #333;
    margin: 0 0 20px;
}

.case-study p {
    font-size: 1rem;
    line-height: 1.85;
    color: #555;
    margin-bottom: 18px;
}

.case-study strong {
    color: #111;
    font-weight: 700;
}

.case-study blockquote {
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    font-weight: 700;
    line-height: 1.45;
    color: #111;
    padding: 8px 0 8px 28px;
    margin: 36px 0;
    border-left: 3px solid #111;
}

.case-study ul,
.case-study ol {
    margin: 0 0 22px 22px;
    color: #555;
    line-height: 1.9;
}

.case-study li {
    margin-bottom: 6px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
    .project-hero {
        grid-template-columns: 1fr;
    }

    .project-hero-image img {
        height: 480px;
    }

    .project-gallery {
        grid-template-columns: 1fr;
    }

    .gallery-item img {
        height: 280px;
    }

    .masonry-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .project-header,
    .project-page {
        padding-left: 20px;
        padding-right: 20px;
    }

    .project-hero-image img {
        height: 320px;
        border-radius: 16px;
    }

    .project-description {
        font-size: 0.98rem;
    }

    .project-meta {
        flex-wrap: wrap;
        gap: 20px;
    }

    .lb-prev { left: 12px; }
    .lb-next { right: 12px; }

    .lb-nav {
        width: 42px;
        height: 42px;
        font-size: 1.4rem;
    }

    .lb-img-wrap img {
        max-width: 94vw;
        max-height: 80vh;
    }
}

/* ============================================
   FEATURED VIDEO SECTION
   ============================================ */
.project-video-section {
    max-width: 900px;
    margin: 0 auto 80px;
    padding: 0 40px;
}

.project-video-label {
    margin-bottom: 18px;
}

.project-video-frame {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 20px;
    background: #111;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.10),
        0 24px 64px rgba(0, 0, 0, 0.12);
}

.project-video-frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 20px;
}

@media (max-width: 700px) {
    .project-video-section {
        padding: 0 20px;
        margin-bottom: 56px;
    }

    .project-video-frame {
        border-radius: 14px;
    }
}

/* ============================================
   DUAL FEATURED VIDEOS (e.g. Abyat style)
   ============================================ */
.project-videos-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.project-videos-dual .project-video-frame {
    margin: 0;
}

.project-video-caption {
    margin-top: 0.85rem;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-align: center;
    opacity: 0.85;
}

@media (max-width: 900px) {
    .project-videos-dual {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

/* ============================================
   VERTICAL SLIDER LAYOUT (e.g. Cavallo style)
   ============================================ */
.slider {
    position: relative;
    height: 100vh;
    width: 100%;
}

.slide {
    position: absolute;
    width: 400px;
    height: 500px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    transition: all 0.6s ease;
    border-radius: 20px;
    overflow: hidden;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    z-index: 3;
}

.slide.prev {
    transform: translate(-50%, -120%) scale(0.7);
    opacity: 0.4;
    z-index: 2;
}

.slide.next {
    transform: translate(-50%, 20%) scale(0.7);
    opacity: 0.4;
    z-index: 1;
}

.slider-nav-btn {
    position: absolute;
    right: 20px;
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.slider-nav-btn:hover {
    background: #fff;
}

.slider-nav-up { top: calc(50% - 56px); }
.slider-nav-down { top: calc(50% + 12px); }


.case-study h1 {
    position: relative;
}

.case-study h1:not(:first-child)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 1px;
    width: 100%;
    background: #e0dedd;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: 0.1s;
}

.case-study h1:not(:first-child).is-visible::before {
    transform: scaleX(1);
}

.project-videos-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.project-videos-dual.single {
    grid-template-columns: 1fr;
    max-width: 700px;
    margin: 0 auto;
}

.project-videos-dual .project-video-frame {
    margin: 0;
}