:root {
    --bg-color: #050505;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --accent-color: #111111;
    --card-radius: 20px; /* Slightly softer corners for the bento look */
    --transition-speed: 0.4s;
    --gap-size: 1.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 32px; /* Adjust based on actual SVG dimensions for nice header balance */
    width: auto;
}

.header-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1000;
}

.mobile-menu-btn span {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Mobile Menu Animation */
.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.header-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color var(--transition-speed) ease;
}

.header-nav a:hover {
    color: var(--text-primary);
}

/* Portfolio Sections */
.portfolio-container {
    padding: 4rem 0 6rem 0;
}

.section-header {
    margin-bottom: 3rem;
    border-left: 3px solid var(--text-primary);
    padding-left: 1.5rem;
}

.section-title {
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: -0.04em;
    margin-bottom: 0.5rem;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* --- THE BENTO GRID --- */
.bento-grid {
    display: grid;
    /* 4 equal columns */
    grid-template-columns: repeat(4, 1fr);
    /* Base row height */
    grid-auto-rows: 280px; 
    gap: var(--gap-size);
}

/* Modifiers for different sizes */
.bento-large {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-wide {
    grid-column: span 2;
    grid-row: span 1;
}

.bento-tall {
    grid-column: span 1;
    grid-row: span 2;
}

.bento-square {
    grid-column: span 1;
    grid-row: span 1;
}

/* Custom Video Bento */
.video-bento .bento-large {
    grid-column: span 3;
    grid-row: span 2;
}
.video-bento .bento-wide {
    grid-column: span 2;
    grid-row: span 1;
}

/* Cards Base */
.card {
    position: relative;
    border-radius: var(--card-radius);
    overflow: hidden;
    background-color: var(--accent-color);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05); /* Subtle border gives definition */
    transition: transform var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow var(--transition-speed) ease;
}

.card:hover {
    transform: translateY(-4px) scale(0.99);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    z-index: 10;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover img {
    transform: scale(1.08);
}

/* Video specific tweaks */
.video-card {
    cursor: default;
}
.video-card:hover {
    transform: none;
    box-shadow: none;
}
.video-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    outline: none;
    display: block;
}

/* Hover Overlay */
.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 40%, rgba(0,0,0,0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2.5rem;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
    pointer-events: none; /* Let clicks pass through to the card */
}

.card:hover .card-overlay {
    opacity: 1;
}

.card-overlay h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transform: translateY(15px);
    transition: transform var(--transition-speed) ease;
}

.card-overlay p {
    color: #cccccc;
    font-size: 1rem;
    transform: translateY(15px);
    transition: transform var(--transition-speed) ease;
    transition-delay: 0.05s;
}

.card:hover .card-overlay h3,
.card:hover .card-overlay p {
    transform: translateY(0);
}

/* --- INSTAGRAM REELS SECTION --- */
.ig-reels-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1rem 0;
}

.mobile-swipe-hint {
    display: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: -1rem; /* Pull it closer to the reels */
    text-align: right;
    font-weight: 500;
}

.reels-grid-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

.ig-reel-card {
    background-color: var(--accent-color);
    border-radius: var(--card-radius);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    aspect-ratio: 9/16;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    /* subtle hover effect for cards */
    transition: transform var(--transition-speed) ease;
    cursor: pointer;
}

.ig-reel-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    /* Invisible glass shield blocks right-clicks on the iframe */
}

.ig-reel-card iframe {
    width: 100%;
    height: 100%;
    border: none;
    background-color: #111;
}

/* --- LANDING PAGES SECTION --- */
.landing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
}

.landing-card-wrapper {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: transform var(--transition-speed) ease;
}

.landing-card-wrapper:hover {
    transform: translateY(-8px);
}

.landing-image-container {
    border-radius: var(--card-radius);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background-color: #111;
}

.landing-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.landing-card-wrapper:hover .landing-image-container img {
    transform: scale(1.03);
}

.landing-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%);
    opacity: 0;
    display: flex;
    align-items: flex-end;
    padding: 2rem;
    transition: opacity 0.3s ease;
}

.landing-card-wrapper:hover .landing-overlay {
    opacity: 1;
}

.view-project-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    color: white;
    font-weight: 500;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.landing-card-wrapper:hover .view-project-btn {
    transform: translateY(0);
}

.landing-info {
    padding-left: 0.25rem;
}

.landing-info h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text-color);
}

.landing-info p {
    color: var(--text-color-muted);
    font-size: 0.95rem;
}

/* Footer */
.footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 4rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 250px;
    }
    
    /* Re-flow items for 3 columns */
    .bento-large { grid-column: span 2; grid-row: span 2; }
    .bento-wide { grid-column: span 2; grid-row: span 1; }
    .bento-tall { grid-column: span 1; grid-row: span 2; }
    .bento-square { grid-column: span 1; grid-row: span 1; }
    
    .video-bento .bento-large { grid-column: span 3; }
}

@media (max-width: 768px) {
    .landing-grid {
        grid-template-columns: 1fr;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .header-nav {
        position: fixed;
        top: 0;
        right: -100%; /* Hide off-screen */
        width: 100%;
        height: 100vh;
        background-color: var(--bg-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3rem;
        transition: right 0.4s ease;
        z-index: 999;
    }

    .header-nav.active {
        right: 0;
    }
    
    .header-nav a {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 2.2rem;
    }
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 220px;
    }
    
    /* Re-flow items for 2 columns */
    .bento-large { grid-column: span 2; grid-row: span 2; }
    .bento-wide { grid-column: span 2; grid-row: span 1; }
    .bento-tall { grid-column: span 1; grid-row: span 2; }
    .bento-square { grid-column: span 1; grid-row: span 1; }

    .video-bento .bento-large { grid-column: span 2; }
    .video-bento .bento-wide { grid-column: span 2; }
    
    .landing-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile Swipe for Instagram Reels */
    .reels-grid-row {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 1rem;
        -ms-overflow-style: none;
        scrollbar-width: none;
        /* Force 5 columns, allowing them to overflow screen width */
        grid-template-columns: repeat(5, 75vw); 
        gap: 1rem;
    }
    .reels-grid-row::-webkit-scrollbar {
        display: none;
    }
    .ig-reel-card {
        scroll-snap-align: center;
    }
    .mobile-swipe-hint {
        display: block; /* Show the swipe hint on mobile */
    }
}

@media (max-width: 480px) {
    .bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 300px; /* Make everything tall on mobile */
    }
    
    /* Everything takes full width on very small screens */
    .bento-large, .bento-wide, .bento-tall, .bento-square {
        grid-column: span 1;
        grid-row: span 1;
    }
    .video-bento .bento-large { grid-column: span 1; }
}

/* --- LIGHTBOX GALLERY --- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: transparent;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 2010;
    opacity: 0.7;
    transition: opacity 0.2s;
    line-height: 1;
}

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

.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 1rem;
    border-radius: 50%;
    z-index: 2010;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
}

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

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

@media (max-width: 768px) {
    .lightbox-btn {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
    }
    .lightbox-prev {
        left: 1rem;
    }
    .lightbox-next {
        right: 1rem;
    }
}
