.toonz-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    width: 100%;
}


.toonz-portfolio-intro {
    padding-right: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.toonz-portfolio-intro-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 20px;
    color: #fff;
    line-height: 1.1;
}

.toonz-portfolio-intro-desc {
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* Shape Presets - Refined for Perfect Interlocking */
.shape-none { clip-path: none; }
.shape-cut-tl { clip-path: polygon(20% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 20%); }
.shape-cut-tr { clip-path: polygon(0% 0%, 80% 0%, 100% 20%, 100% 100%, 0% 100%); }
.shape-cut-bl { clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 20% 100%, 0% 80%); }
.shape-cut-br { clip-path: polygon(0% 0%, 100% 0%, 100% 80%, 80% 100%, 0% 100%); }

/* Special Interlocking Shape for Intro/Animation */
.shape-intro-special {
    clip-path: polygon(0% 0%, 100% 0%, 100% 75%, 85% 100%, 0% 100%);
}
.shape-anim-special {
    clip-path: polygon(15% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 25%);
}


.toonz-portfolio-item {
    position: relative;
    border-radius: 12px;
    /* Fallback for browsers that don't support clip-path well */
    overflow: hidden;
    min-height: 300px; /* Base height for tiles */
    cursor: pointer;
    background: #111;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

/* Grid spans are now handled via dynamic styles in PHP */


.toonz-portfolio-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
}

.toonz-portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.1) 100%);
    transition: background 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px;
    z-index: 2;
}

.toonz-portfolio-content {
    color: #fff;
}

.toonz-portfolio-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.toonz-portfolio-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
    opacity: 0.8;
}

.toonz-portfolio-cta {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #E87722;
    transition: all 0.3s ease;
}

.toonz-portfolio-cta span {
    transition: transform 0.3s ease;
    display: inline-block;
    margin-left: 5px;
}

/* Hover Interactions */
.toonz-portfolio-item:hover .toonz-portfolio-image {
    transform: scale(1.05);
}

.toonz-portfolio-item:hover .toonz-portfolio-overlay {
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0.2) 100%);
}

.toonz-portfolio-item:hover .toonz-portfolio-cta span {
    transform: translateX(5px);
}

/* Mobile Behaviour */
@media (max-width: 1024px) {
    .toonz-portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .toonz-portfolio-grid {
        grid-template-columns: 1fr;
    }

    .toonz-portfolio-item {
        aspect-ratio: 4 / 3;
    }

    .toonz-portfolio-title {
        font-size: 1.25rem;
    }
}