/* --- BRAND DNA --- */
:root {
    /* Inherits defaults */
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--white);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* --- HERO SECTION --- */
.hero-container {
    position: relative;
    height: 70vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #111;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    z-index: 0;
    transform: translateX(-50%) translateY(-50%);
    object-fit: cover;
    opacity: 0.5;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: white;
    padding: 0 20px;
}

.hero-title {
    font-family: var(--font-head);
    font-size: 80px;
    font-weight: 800;
    line-height: 1;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    /* Animation properties */
    opacity: 0;
    transform: translateY(30px);
    animation: heroReveal 1.2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    animation-delay: 0.2s;
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 24px;
    color: #e0e0e0;
    /* Animation properties */
    opacity: 0;
    transform: translateY(20px);
    animation: heroReveal 1.2s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    animation-delay: 0.4s;
}

@keyframes heroReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- PORTFOLIO FILTER --- */
.filter-bar {
    background: var(--bg-body);
    padding: 40px 0;
    text-align: center;
    position: flex;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    /* Frosted glass effect */
    background: rgba(245, 245, 247, 0.9);
    border-bottom: 1px solid var(--border);
}

.filter-btn {
    border: none;
    background: transparent;
    font-family: var(--font-head);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #888;
    margin: 0 15px;
    cursor: pointer;
    transition: 0.3s;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}

.filter-btn:hover,
.filter-btn.active {
    color: var(--primary);
    border-bottom-color: var(--accent);
}

/* --- GALLERY GRID --- */
/* --- UNIFORM GRID LAYOUT --- */
.gallery-container {
    max-width: 1400px;
    margin: 40px auto 100px;
    padding: 0 20px;
    display: grid;
    /* This creates 3 equal columns */
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.gallery-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 4px;
    background: #000;
    /* This forces the CARD to a specific shape (Square/Rectangle) */
    aspect-ratio: 4 / 3;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    /* Force height to fill the aspect-ratio */
    display: block;
    /* CRITICAL: This crops the image to fill the space without stretching */
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    filter: grayscale(20%);
}

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

@media (max-width: 600px) {
    .gallery-container {
        grid-template-columns: 1fr;
    }
}

/* Hover Overlay */
.item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: 0.4s;
    text-align: center;
    padding: 20px;
}

.gallery-item:hover img {
    transform: scale(1.05);
    filter: grayscale(0%);
}

.gallery-item:hover .item-overlay {
    opacity: 1;
}

/* Overlay Text */
.project-cat {
    font-family: var(--font-head);
    font-size: 10px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    transform: translateY(20px);
    transition: 0.4s;
}

.project-title {
    font-family: var(--font-head);
    font-size: 24px;
    color: #fff;
    margin: 0;
    transform: translateY(20px);
    transition: 0.4s 0.1s;
}

/* --- NEW BUTTON STYLE --- */
.case-btn {
    display: inline-block;
    margin-top: 20px;
    font-family: var(--font-head);
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    border: 1px solid #fff;
    padding: 12px 25px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    transform: translateY(20px);
    transition: 0.4s 0.2s;
    /* Delays slightly after title */
    opacity: 0;
}

.case-btn:hover {
    background: #fff;
    color: var(--primary);
}

.gallery-item:hover .project-cat,
.gallery-item:hover .project-title,
.gallery-item:hover .case-btn {
    transform: translateY(0);
    opacity: 1;
}

/* --- YOUTUBE FEED SECTION --- */
.recent-works-video {
    background-color: #fbfbfd;
    padding: 100px 20px;
    text-align: center;
    border-top: 1px solid var(--border);
}

.video-container {
    max-width: 1000px;
    margin: 30px auto 0;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio for YouTube */
    height: 0;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-section-title {
    font-family: var(--font-head);
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 10px;
    text-transform: uppercase;
    color: var(--primary);
}

/* --- SCROLL REVEAL ANIMATIONS --- */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- CTA --- */
.cta-section {
    background: #fff;
    text-align: center;
    padding: 100px 20px;
    border-top: 1px solid var(--border);
}

.cta-btn {
    background: var(--primary);
    color: white;
    padding: 20px 50px;
    text-decoration: none;
    font-family: var(--font-head);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: 0.3s;
    display: inline-block;
}

.cta-btn:hover {
    background: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

@media (max-width: 1024px) {
    .hero-title {
        font-size: 56px;
    }
}

/* --- MOBILE OPTIMIZATION OVERRIDES --- */
@media (max-width: 768px) {
    .hero-container {
        height: 60vh;
        min-height: 400px;
    }

    .hero-content {
        padding: 0 15px;
        margin-top: 40px !important; /* Push down to avoid navbar */
        width: 100%;
        box-sizing: border-box;
    }

    .hero-title {
        font-size: clamp(24px, 8vw, 36px) !important;
        white-space: pre-wrap; /* allow normal wrapping between words but not inside */
    }
    
    .hero-subtitle {
        font-size: 16px !important;
        padding: 0 10px;
    }
    
    .filter-bar {
        padding: 20px 10px !important;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .filter-btn {
        margin: 0 !important;
        padding: 5px 10px !important;
        font-size: 10px !important;
    }
    
    .gallery-container {
        margin-top: 20px !important;
    }
    
    .video-container {
        padding-bottom: 56.25% !important; /* Switch to 16:9 for better mobile visibility */
    }
    
    .video-section-title {
        font-size: 26px !important;
    }
    
    .cta-section h2 {
        font-size: 32px !important;
    }

    .project-cat {
        margin-bottom: 20px !important;
    }
    
    .project-title {
        line-height: 1.3 !important;
        font-size: 20px !important;
    }
}