:root {
    /* Premium Dark Theme Tokens */
    --color-bg: #0a0a0c;
    --color-surface: #141416;
    --color-surface-hover: #1c1c1f;
    --color-text-primary: #f2f2f3;
    --color-text-secondary: #a1a1aa;
    --color-accent: #e2e2e5;
    
    /* Typography */
    --font-sans: 'Outfit', sans-serif;
    --font-serif: 'Playfair Display', serif;
    
    /* Spacing & Layout */
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;
    --max-width: 1400px;

    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.light-theme {
    background-color: #fdfdfd !important;
    color: #111111 !important;
}

.light-theme .nav-links {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.light-theme .nav-link {
    color: #666666;
}

.light-theme .nav-link:hover, 
.light-theme .nav-link.active {
    color: #111111;
}

.light-theme .studio-statement,
.light-theme .studio-intro p,
.light-theme .studio-section-title,
.light-theme .service-item h3,
.light-theme .service-item p {
    color: #111111 !important;
}

.light-theme .studio-intro p {
    color: #444444 !important;
}

.light-theme .studio-section-title {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.light-theme .subpage-divider {
    background: #111111;
}

.light-theme footer p {
    color: #666666;
}

.light-theme .client-logo {
    filter: invert(0) brightness(0.2);
    opacity: 0.6;
}

.light-theme .client-logo:hover {
    filter: invert(0) brightness(0);
    opacity: 1;
}

/* Intro Split Layout */
.intro-split-container {
    display: flex;
    gap: 4rem;
    align-items: flex-start;
    margin-bottom: 6rem;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.intro-video-wrapper, .info-visual-wrapper {
    flex: 1;
    min-width: 0;
    border-radius: 4px;
    overflow: hidden;
}

.studio-intro, .subpage-section-text {
    flex: 1.5;
}

.intro-video-wrapper video, .info-visual-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.light-theme .gallery-tabs {
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.1);
}

.light-theme .gallery-tab {
    color: #444;
}

.light-theme .gallery-tab.active {
    background: #111;
    color: white;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.mobile-only {
    display: none;
}

@media (max-width: 1024px) {
    .mobile-only {
        display: block;
    }
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1500; /* Lowered to allow Lightbox UI to overlap */
    padding: 2rem 4rem;
    pointer-events: none;
    display: flex;
    justify-content: flex-end;
}

.nav-links {
    pointer-events: auto;
    display: flex;
    gap: 2.5rem;
    background: rgba(10, 10, 12, 0.4);
    backdrop-filter: blur(20px);
    padding: 0.75rem 2rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-link {
    text-decoration: none;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.2rem;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--color-text-primary);
}

@media (max-width: 768px) {
    .main-nav {
        padding: 1.5rem 1rem;
    }
    .nav-links {
        gap: 1.5rem;
        padding: 0.5rem 1.5rem;
        width: 100%;
        justify-content: center;
    }
    .nav-link {
        font-size: 0.7rem;
    }
}

/* ==========================================================================
   Subpage Layout
   ========================================================================== */
.subpage-hero {
    min-height: 40vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8rem 2rem 4rem;
}

.subpage-title {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 10vw, 6rem);
    text-align: center;
    margin: 0;
    animation: fadeUp 1s ease forwards;
}

.subpage-divider {
    width: 60px;
    height: 1px;
    background: white;
    margin: 2rem auto 1rem auto;
    animation: fadeUp 1.2s ease forwards;
}

/* Info Page Feature Visual */
.info-visual {
    display: flex;
    justify-content: center;
    padding: 0 0 2rem 0;
}

.info-hero-gif {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    animation: fadeUp 1.4s ease forwards;
}

.subpage-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem 8rem;
    animation: fadeUp 1.4s ease forwards;
}

.subpage-section {
    margin-bottom: 6rem;
    text-align: center;
}

.subpage-section h2 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--color-text-primary);
    margin-bottom: 2rem;
    opacity: 0.6;
}

.subpage-content {
    font-size: 1.15rem;
    line-height: 2;
    color: var(--color-text-secondary);
}

/* Contact Form */
.contact-form {
    display: grid;
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-group label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-secondary);
}

.form-group input, .form-group textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 1.25rem;
    color: white;
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: white;
    background: rgba(255, 255, 255, 0.08);
}

.submit-btn {
    background: white;
    color: black;
    border: none;
    padding: 1.25rem 3rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    width: fit-content;
    margin: 2rem auto 0;
}

.submit-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

.social-links {
    margin-top: 4rem;
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.social-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
}

.social-link:hover {
    color: white;
}

/* ==========================================================================
   Hero Section Carousel
   ========================================================================== */
.hero {
    position: relative;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.hero-media-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #000;
}

.hero-gif.fullscreen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: 1;
    filter: brightness(0.9); 
    transition: opacity 1.5s ease-in-out; /* Crossfade duration */
    opacity: 0;
}

.hero-gif.fullscreen.active {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none; /* Allows pressing the carousel underneath */
}

.brand-logo {
    max-width: 50vw;
    max-height: 30vh;
    object-fit: contain;
    /* SPEED: Shortened from 1.2s to 0.6s to record LCP faster */
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    filter: drop-shadow(0px 4px 8px rgba(0,0,0,0.5));
    transition: all 0.5s ease;
}

/* Styling Option 1: White Glow */
.brand-logo.style-glow {
    filter: drop-shadow(0px 0px 20px rgba(255, 255, 255, 0.9));
}

/* Styling Option 3: Mix Blend Mode (Inverts black to white and actively adapts to background) */
.brand-logo.style-blend {
    filter: invert(1); 
    mix-blend-mode: difference;
    opacity: 0.85;
}

/* Styling Option 4: Frosted Glass UI Pill */
.hero-glass-pill {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 2rem 4rem;
    border-radius: 100px;
    z-index: 20;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.hero-glass-pill .brand-logo {
    position: relative; /* override absolute */
    top: auto; left: auto;
    transform: none;
    max-width: 50vw;
}

.hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: rgba(0, 0, 0, 0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
}

.hero-nav:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: translateY(-50%) scale(1.1);
}

.hero-nav.prev { left: var(--space-md); }
.hero-nav.next { right: var(--space-md); }

/* Hiding hero paddles as requested */
.hero-nav {
    display: none !important;
}

.swipe-indicator {
    position: absolute;
    bottom: var(--space-md);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 60px;
    height: 1px;
    background-color: rgba(255,255,255,0.1);
    overflow: hidden;
}

.swipe-line {
    width: 30px;
    height: 100%;
    background-color: white;
    filter: drop-shadow(0 0 5px white);
    animation: swipePulse 2.5s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}

@keyframes swipePulse {
    0% { transform: translateX(-150%); opacity: 0; }
    50% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(150%); opacity: 0; }
}

.scroll-indicator {
    position: absolute;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.scroll-line {
    width: 1px;
    height: 60px;
    background-color: rgba(255,255,255,0.3);
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-text-primary);
    animation: scrollLine 2s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}

/* ==========================================================================
   Secondary Feature Section
   ========================================================================== */
.secondary-feature {
    padding: var(--space-xl) 0;
    background-color: var(--color-bg);
}

.feature-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--space-lg);
    align-items: center;
}

.feature-text h2 {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 400;
    margin-bottom: var(--space-sm);
}

.feature-text p {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    max-width: 400px;
}

.feature-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

video.hero-gif.smaller,
img.hero-gif.smaller {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.feature-media:hover .hero-gif.smaller {
    transform: scale(1.05);
}

/* ==========================================================================
   Gallery Section
   ========================================================================== */
/* ==========================================================================
   Gallery Workspace (Sidebar + Grid)
   ========================================================================== */
.gallery-workspace {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: var(--space-lg);
    padding: var(--space-xl) var(--space-md);
    position: relative;
    max-width: 1800px;
    margin: 0 auto;
}

.portfolio-gallery {
    width: 100%;
}

/* Sidebar Layout */
.filter-sidebar {
    position: sticky;
    top: 2rem;
    height: calc(100vh - 4rem);
    background: rgba(15, 15, 18, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: var(--space-lg);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.sidebar-header {
    margin-bottom: var(--space-md);
}

.sidebar-header h2 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.sidebar-header p {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Global Search Bar */
/* Main Area Search & Layout */
.search-main-container {
    margin-bottom: var(--space-lg);
    width: 100%;
}

.search-box-wrapper {
    position: relative;
    max-width: 600px;
}

.global-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    padding-right: 3rem;
    color: var(--color-text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.clear-search-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.clear-search-btn:hover {
    opacity: 1;
}

.clear-search-btn.hide {
    display: none;
}

.global-search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 30px rgba(255,255,255,0.05);
}

/* Filter Groups & Checklists */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-text-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.filter-group h3:hover {
    color: var(--color-text-primary);
}

.collapse-icon {
    font-size: 1rem;
    font-weight: 300;
    opacity: 0.5;
    transition: transform 0.3s ease;
}

.filter-group.collapsed .checklist {
    display: none;
}

.filter-group.collapsed .collapse-icon {
    /* Rotation removed to keep + as + */
}

.sub-group-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-secondary);
    opacity: 0.7;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
    padding-left: 0.5rem;
}

.filter-group.collapsed .sub-group-title,
.filter-group.collapsed .checklist {
    display: none;
}

.checklist {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* Custom Checklist Item */
.check-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    transition: var(--transition-smooth);
    user-select: none;
}

.check-item:hover {
    color: var(--color-text-primary);
}

.check-box {
    width: 14px;
    height: 14px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 2px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    background: rgba(255,255,255,0.02);
}

.check-item:hover .check-box {
    border-color: rgba(255,255,255,0.6);
    box-shadow: 0 0 10px rgba(255,255,255,0.1);
}

.check-item.active .check-box {
    background: white;
    border-color: white;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Elegant minimalist checkmark */
.check-item.active .check-box::after {
    content: '';
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 4px;
    height: 8px;
    border-right: 2px solid var(--color-bg);
    border-bottom: 2px solid var(--color-bg);
}

.check-item.active .check-label {
    color: white;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

.check-label {
    transition: color 0.3s ease;
}

/* Footer & Toggles */
.filter-toggles {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.toggle-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-secondary);
    margin-bottom: 0.75rem;
}

.toggle-pair {
    display: flex;
    gap: 0.25rem;
    background: rgba(0,0,0,0.4);
    padding: 4px;
    border-radius: 8px;
}

.toggle-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    font-size: 0.7rem;
    padding: 0.4rem;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: var(--transition-smooth);
}

.toggle-btn.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.clear-filters-btn {
    text-align: left;
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    transition: var(--transition-smooth);
}

.clear-filters-btn:hover {
    color: var(--color-text-primary);
}

.clear-filters-btn.hide {
    display: none;
}

.drawer-close {
    display: none;
}

/* Mobile FAB for Filters */
.filter-fab {
    display: flex;
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 2005;
    background: white;
    color: black;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    pointer-events: none;
}

.filter-fab.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
    z-index: 1900; /* Below lightbox (2000) but above page content */
}

.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 900;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.drawer-overlay.active {
    display: block;
    opacity: 1;
}

/* Masonry Grid using CSS Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 20px;
    gap: var(--space-sm);
    grid-auto-flow: dense;
    align-items: start;
}

.gallery-item {
    position: relative;
    cursor: pointer;
    background: transparent; /* Reset to transparent to avoid mobile boxes */
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease, filter 0.4s ease;
}

@media (max-width: 768px) {
    .gallery-item {
        overflow: visible;
        /* PERFORMANCE: Defer rendering off-screen blocks */
        content-visibility: auto;
        contain-intrinsic-size: 0 350px;
    }
}

@media (min-width: 769px) {
    .gallery-item {
        background: #000;
        overflow: hidden;
        /* PERFORMANCE: Defer rendering off-screen blocks */
        content-visibility: auto;
        contain-intrinsic-size: 0 500px;
    }
}

.gallery-item.show {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item.hide {
    display: none;
}
.gallery-item .media-container,
.gallery-item video,
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--transition-smooth);
}

/* The Auto-created Keyword Layer Overlay */
.item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 12, 0.75);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--space-md);
    opacity: 0;
    transition: var(--transition-smooth);
    backdrop-filter: blur(8px);
    pointer-events: none; /* Let clicks pass through to the item itself */
}

.item-description {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 300;
    line-height: 1.6;
    color: white;
    max-width: 85%;
    transform: translateY(10px);
    transition: var(--transition-smooth);
}

@media (hover: hover) {
    .gallery-item.has-caption:hover .item-overlay {
        opacity: 1;
    }
}

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

.gallery-item.has-caption:hover .item-description,
.gallery-item.overlay-active .item-description {
    transform: translateY(0);
}

.gallery-item:hover video,
.gallery-item:hover img {
    transform: scale(1.08);
}

@media (hover: none) {
    .gallery-item:hover video,
    .gallery-item:hover img {
        transform: none;
    }
}

/* Disable default behavior on touch-only devices - handled by .overlay-active */
@media (hover: none) {
    .gallery-item:hover .item-overlay {
        opacity: 0;
    }
}
/* Keywords: mobile-only — hidden on desktop */
.gallery-item-keywords,
.keyword-tags {
    display: none;
}

@media (max-width: 768px) {
    .gallery-item-keywords,
    .keyword-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        padding: 0.75rem 1rem;
        background: transparent;
    }
}

.keyword-tags {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.25rem 0.75rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    background: rgba(0,0,0,0.3);
    position: relative;
    white-space: nowrap;
}

/* Taxonomy Indicator Adjustments (Dots Removed) */
.tag.cat-freeform {
    border-style: dashed;
    opacity: 0.8;
}


footer {
    text-align: center;
    padding: var(--space-lg);
    border-top: 1px solid rgba(255,255,255,0.05);
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scrollLine {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* Responsive Transformations */
@media (max-width: 1024px) {
    .gallery-workspace {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 85vw;
        max-width: 400px;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        border-radius: 0;
        border: none;
        border-right: 1px solid rgba(255,255,255,0.1);
    }

    .filter-sidebar.active {
        transform: translateX(0);
    }

    .drawer-close {
        display: block;
        align-self: flex-end;
        background: transparent;
        border: none;
        color: white;
        font-size: 2.5rem;
        cursor: pointer;
    }

    .filter-fab {
        display: flex;
    }
}

@media (max-width: 900px) {
    .feature-layout {
        grid-template-columns: 1fr;
    }
    .feature-text {
        text-align: center;
        margin-bottom: var(--space-md);
    }
    .brand-logo { 
        max-width: 80vw; 
        max-height: 25vh;
    }
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    opacity: 1;
    transition: opacity 0.4s ease;
}

.lightbox.hide {
    opacity: 0;
    pointer-events: none;
}

/* On mobile, stack the UI below the image */
@media (max-width: 768px) {
    .lightbox {
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 8rem;
        overflow-y: auto;
    }
}

/* Lightbox body: image + side panel */
.lightbox-body {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 2rem;
    width: 95vw;
    height: 90vh;
    padding: 1rem;
}

.lightbox-body .lightbox-content {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: 4px;
    height: 100%; /* Fill the body height, adapts to browser size */
}

.lightbox-body .lightbox-content img,
.lightbox-body .lightbox-content video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    border-radius: 4px;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content video,
.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain; /* Ensures it is uncropped and fully visible */
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    border-radius: 4px;
}

.lightbox-close {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 2100;
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
    .lightbox-close {
        top: 7rem; /* Clear the nav bar */
        right: 1rem;
    }
}

.lightbox-close:hover {
    transform: scale(1.2);
}

/* New UI Elements */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 1rem;
    font-size: 2rem;
    cursor: pointer;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-smooth);
    backdrop-filter: blur(10px);
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev { left: var(--space-md); }
.lightbox-nav.next { right: var(--space-md); }

@media (max-width: 768px) {
    .lightbox-nav {
        display: none !important;
    }
}

.lightbox-ui {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 1.5rem;
    align-self: stretch;
    justify-content: flex-start;
    overflow-y: auto;
    z-index: 5;
    transition: opacity 0.4s ease;
}

.lightbox-ui.hide-ui {
    opacity: 0;
    pointer-events: none;
}

/* Lightbox UI section heading */
.lightbox-ui::before {
    content: 'Tags';
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-text-secondary);
    opacity: 0.6;
}

@media (max-width: 768px) {
    .lightbox-ui {
        width: 90vw;
        padding: 0.75rem 1rem;
        border-radius: 20px;
        bottom: 1rem;
    }
    .lightbox-nav {
        display: none; /* Swipe for Lightbox on mobile */
    }
}

/* Position underneath controls */
.lightbox-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.lightbox-caption {
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 1.6;
    max-width: 600px;
    margin: 1.5rem auto;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    font-style: italic;
    letter-spacing: 0.02em;
}

.lightbox-alt-text {
    font-size: 0.85rem;
    font-weight: 300;
    line-height: 1.5;
    max-width: 500px;
    margin: 0.5rem auto 1rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    font-style: normal;
}

.lightbox-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--color-text-primary);
    font-size: 0.9rem;
    font-family: var(--font-sans);
}

.zoom-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-smooth);
}

.zoom-btn:hover {
    background: white;
    color: black;
}

.zoom-btn.text-btn {
    width: auto;
    padding: 0 1rem;
    border-radius: 20px;
}
/* Image Protection */
img, video {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-select: none;
}

.gallery-item .media-container {
    pointer-events: none; /* Prevents right-click and drag on container */
}

/* AI Disclaimer Styling */
.ai-disclaimer {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-top: 1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    opacity: 0.8;
}

/* Results Pool UI */
.results-pool {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.results-pool.hide {
    display: none;
}

.pool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.pool-count {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-secondary);
}

.clear-all-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary);
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-all-btn:hover {
    background: white;
    color: black;
}

.pool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Filter FAB - Mobile Only */
@media (min-width: 769px) {
    .filter-fab {
        display: none !important;
    }
}

/* Navigation Utilities */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: white;
    color: black;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
    cursor: pointer;
    z-index: 2100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: scale(1.1) translateY(-5px);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 50px;
        height: 50px;
    }
}

/* Fix masonry overlapping captions on mobile */
@media (max-width: 768px) {
    .gallery-item {
        margin-bottom: 2rem !important;
    }
}

/* Smooth Reveal Animation for Gallery */
.grid-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.grid-item.revealed {
    opacity: 1;
    transform: translateY(0);
}


