/* Shared variables from your other pages to ensure exact color matching */
:root {
    --primary-background: #000000;
    --primary-headings: #D4DADC;
    --primary-paragraphs: #A6ABAE;
    --primary-details: #7E8284;
    --button-background: #D4DADC;
    --button-text: #323130;
    --button-background-hover: #A6ABAE;
    --button-text-hover: #000000;
    --accent-background: #3E4041;
}

body {
    background-color: var(--primary-background);
    color: var(--primary-paragraphs);
    font-family: Helvetica, Arial, sans-serif;
    font-weight: 300;
}

/* Shared Typography Classes */
.font-heading { font-family: Helvetica, Arial, sans-serif; }
.font-body { font-family: Helvetica, Arial, sans-serif; }
.text-primary-heading { color: var(--primary-headings); }
.text-primary-paragraph { color: var(--primary-paragraphs); }
.border-primary-details { border-color: var(--primary-details); }

.nav-link {
    letter-spacing: 0.2em;
    transition: color 0.3s ease;
    font-size: 0.875rem;
}
.nav-link:hover { color: #FFFFFF; }
.nav-link.active { color: #FFFFFF; border-bottom: 1px solid #fff; }

.btn-custom {
    background-color: var(--button-background);
    color: var(--button-text);
    transition: all 0.3s ease;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 0.6875rem 2.5rem;
    display: inline-block;
    border: 1px solid transparent;
}
.btn-custom:hover {
    background-color: var(--button-background-hover);
    color: var(--button-text-hover);
    transform: translateY(-2px);
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

/* Standard Cinematic Reveal for Titles */
@keyframes cinematicReveal {
    0% { opacity: 0; letter-spacing: -0.05em; filter: blur(10px); transform: scale(0.95); }
    100% { opacity: 1; letter-spacing: normal; filter: blur(0); transform: scale(1); }
}
.cinematic-text {
    animation: cinematicReveal 2.0s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    will-change: transform, opacity, filter;
}

/* Soft Cinematic Reveal for Descriptions */
@keyframes cinematicDescReveal {
    0% { opacity: 0; filter: blur(8px); transform: translateY(10px); }
    100% { opacity: 1; filter: blur(0); transform: translateY(0); }
}
.cinematic-desc {
    animation: cinematicDescReveal 2.0s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
}

/* --- Masonry Layout --- */
.portfolio-gallery {
    column-count: 3;
    column-gap: 2rem;
    margin-bottom: 4rem; 
    display: block; /* Added to fix visibility toggling */
}

@media (max-width: 1024px) { .portfolio-gallery { column-count: 2; } }
@media (max-width: 768px) { .portfolio-gallery { column-count: 1; } }

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background: #111;
    break-inside: avoid;
    margin-bottom: 2rem;
    display: inline-block;
    width: 100%;
    cursor: pointer;
    border: 1px solid var(--accent-background);
    transition: border-color 0.3s ease;
}
.portfolio-item:hover { border-color: var(--primary-headings); }

.portfolio-image {
    width: 100%;
    height: auto; 
    display: block; 
    transition: transform 0.6s ease;
}
.portfolio-item:hover .portfolio-image { transform: scale(1.05); }

.portfolio-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 2rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.portfolio-item:hover .portfolio-overlay { opacity: 1; }

.portfolio-title {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    color: var(--primary-headings);
}
.portfolio-date {
    font-size: 0.875rem;
    color: var(--primary-details);
    margin-bottom: 0.5rem;
}
.portfolio-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(212, 218, 220, 0.1);
    color: var(--primary-paragraphs);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 2px;
}

.grid-play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 60px; height: 60px;
    background: rgba(0,0,0,0.6);
    border: 2px solid white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
    transition: background 0.3s;
}
.portfolio-item:hover .grid-play-btn { background: rgba(200, 0, 0, 0.9); }

/* --- LIGHTBOX STYLES --- */
#lightbox {
    position: fixed;
    z-index: 100;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.98);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    padding: 2rem;
    overflow-y: auto;
}

#lightbox.active {
    opacity: 1;
    pointer-events: all;
}

#lightbox-img {
    max-width: 90vw;
    max-height: 70vh;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border-radius: 2px;
}

#lightbox-video-container {
    width: 90vw;
    max-width: 1100px;
    aspect-ratio: 16 / 9;
    display: none; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

#lightbox-video-frame {
    width: 100%; height: 100%;
    border: none;
}

#lightbox-info {
    text-align: center;
    margin-top: 2rem;
    max-width: 800px;
}

#lightbox-title-text {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 1.75rem;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

#lightbox-details-text {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 0.75rem;
    color: var(--primary-details);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
}

#lightbox-description-text {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 0.95rem;
    color: var(--primary-paragraphs);
    line-height: 1.6;
}

#lightbox-close {
    position: absolute;
    top: 20px; right: 30px;
    font-size: 3rem;
    color: #fff;
    cursor: pointer;
    font-family: Helvetica, Arial, sans-serif;
    line-height: 1;
    transition: color 0.3s;
    z-index: 101;
    opacity: 0; 
    transition: opacity 0.4s ease 0.1s;
}

#lightbox.active #lightbox-close { opacity: 1; }
#lightbox-close:hover { color: var(--primary-details); }

.section-separator {
    display: flex; align-items: center;
    margin-bottom: 2rem; margin-top: 1rem;
}
.section-title {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 1.5rem;
    color: var(--primary-headings);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-right: 1rem;
}
.section-line {
    flex-grow: 1; height: 1px;
    background-color: var(--primary-details);
    opacity: 0.3;
}

/* --- CATEGORY FILTER BUTTONS --- */
.filter-btn {
    background-color: transparent;
    color: var(--primary-paragraphs);
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    color: #FFFFFF;
    border-color: #FFFFFF;
}

.filter-btn.active {
    background-color: var(--primary-headings);
    color: var(--primary-background);
    border-color: var(--primary-headings);
    font-weight: bold;
}