/* --- Modern Typography & Color Variables --- */

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

:root {
    --bg-base: #0d0d11;          /* Deep ink obsidian */
    --bg-surface: #14141a;       /* Rich charcoal canvas */
    --border-subtle: #22222e;    /* Deep cosmic slate border */
    --text-primary: #f4f4f6;     /* Soft ivory milk white */
    --text-muted: #9594a3;       /* Cool muted lavender gray */
    --accent-warm: #d9c3b0;      /* Soft champagne gold accent */
    
    --card-overlay: rgba(13, 13, 17, 0.45);
    --transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --gap: 24px;
    
    /* Font families */
    --font-heading: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Light mode colors */
body.light-mode {
    --bg-base: #fafafa;          /* Light off-white */
    --bg-surface: #f5f5f5;       /* Light surface */
    --border-subtle: #e5e5e5;    /* Light border */
    --text-primary: #1a1a1a;     /* Dark text */
    --text-muted: #666666;       /* Medium gray */
    --accent-warm: #c17a4a;      /* Warmer copper tone */
    --card-overlay: rgba(255, 255, 255, 0.3);
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    background-image: radial-gradient(circle at 50% -20%, #1e1b2b 0%, var(--bg-base) 60%);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s ease, background-image 0.4s ease, color 0.4s ease;
}

body.light-mode {
    background-image: radial-gradient(circle at 50% -20%, #f0f0f5 0%, var(--bg-base) 60%);
}

/* --- Editorial Layout Header --- */
header {
    max-width: 1600px;
    margin: 0 auto;
    padding: 80px 40px 40px 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.header-title h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;           
    font-weight: 500;
    letter-spacing: -0.02em;     
    line-height: 1.1;
}

.header-title h1 span {
    font-weight: 600;
    color: var(--accent-warm);
}

.header-meta {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* --- Flexible Filter Bar Container --- */
.filter-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px 30px 40px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.filter-bar {
    display: flex;
    gap: 30px;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
    flex-grow: 1;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    background: none;
    border: none;
    color: var(--text-primary); 
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    padding-bottom: 8px;
    position: relative;
    white-space: nowrap;
    opacity: 0.4;             
    transition: opacity 0.4s ease, color 0.4s ease;
}

.filter-btn:hover {
    opacity: 0.85;            
}

.filter-btn.active {
    opacity: 1;               
    color: var(--accent-warm);
}

.filter-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--accent-warm);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-btn.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* --- Control Layout Wrapper --- */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 12px;                  
    flex-shrink: 0;
}

/* --- Unified Button Style (About, Pause, Theme) --- */
.about-toggle-btn,
.control-btn,
.theme-toggle-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    padding: 0;
}

.about-toggle-btn:hover,
.control-btn:hover,
.theme-toggle-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-warm);
    background-color: var(--bg-base);
}

.about-toggle-btn.active,
.control-btn.locked {
    color: var(--accent-warm);
    border-color: rgba(217, 195, 176, 0.4);
    background-color: rgba(20, 20, 26, 0.8);
}

body.light-mode .about-toggle-btn.active,
body.light-mode .control-btn.locked {
    background-color: rgba(193, 122, 74, 0.15);
    border-color: rgba(193, 122, 74, 0.5);
}

.about-toggle-btn svg,
.control-btn svg,
.theme-toggle-btn svg {
    width: 16px;
    height: 16px;
    display: block;
    transition: transform 0.3s ease;
}

.about-toggle-btn .hidden,
.control-btn .hidden,
.theme-toggle-btn .hidden {
    display: none;
}

/* --- Premium Inline About Container Layout --- */
.about-section-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 60px 40px 40px 40px; 
    border-bottom: 1px solid var(--border-subtle); 
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-section-container.hidden {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
}

.about-section-content {
    max-width: 750px;
    margin: 0 left;
}

.about-section-content p {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.about-section-content .about-lead {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.about-section-content .about-contact {
    margin-top: 25px;
    font-size: 0.95rem;
    margin-bottom: 0; 
}

.about-section-content a {
    color: var(--accent-warm);
    text-decoration: none;
    border-bottom: 1px solid rgba(217, 195, 176, 0.3);
    transition: var(--transition);
}

.about-section-content a:hover {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

/* --- Asymmetric Masonry Canvas --- */
.gallery-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 60px 40px 120px 40px;
}

.gallery-grid {
    column-count: 3;
    column-gap: var(--gap);
}

.gallery-item {
    position: relative;
    background-color: var(--bg-surface);
    margin-bottom: var(--gap);
    break-inside: avoid;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    will-change: transform;
    transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1), transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.6s var(--transition), border-color 0.6s var(--transition);
    opacity: 1;
    transform: translateY(0) scale(1);
}

.gallery-item.hidden {
    display: none;
}

.gallery-item.fade-out {
    opacity: 0;
    transform: translateY(15px) scale(0.98);
}

/* Blur-up effect container */
.gallery-item-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: var(--bg-surface);
}

.gallery-item-blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.85);
    z-index: 1;
    opacity: 1;
    transition: opacity 0.6s ease;
}

.gallery-item-blur.loaded {
    opacity: 0;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(10%) brightness(0.92) contrast(1.02);
    transition: var(--transition);
    position: relative;
    z-index: 2;
    opacity: 0;
    animation: fadeInImage 0.8s ease forwards;
}

@keyframes fadeInImage {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.gallery-item img[loading="lazy"] {
    opacity: 1;
}

.gallery-item::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent 40%, var(--card-overlay));
    opacity: 0;
    transition: var(--transition);
    z-index: 3;
}

.gallery-item:hover {
    box-shadow: 0 30px 60px rgba(5, 5, 8, 0.6);
    transform: translateY(-8px);
    border-color: rgba(217, 195, 176, 0.3);
}

body.light-mode .gallery-item:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border-color: rgba(193, 122, 74, 0.3);
}

.gallery-item:hover img {
    filter: grayscale(0%) brightness(1.02) contrast(1);
    transform: scale(1.04);
}

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

/* --- Isolated Empty State System --- */
.empty-state {
    text-align: center;
    padding: 120px 20px;
    width: 100%;
    opacity: 1;
    transform: translateY(0);
    transition: var(--transition);
}

.empty-state p {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.empty-state.hidden {
    display: none;
}

.empty-state.fade-out {
    opacity: 0;
    transform: translateY(15px);
}

/* --- Modern Minimalist Footer Styles --- */
footer {
    width: 100%;
    border-top: 1px solid var(--border-subtle);
    background-color: rgba(13, 13, 17, 0.3);
    transition: background-color 0.4s ease;
}

body.light-mode footer {
    background-color: rgba(0, 0, 0, 0.02);
}

.footer-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 60px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copyright p {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 40px;
}

.footer-link {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-decoration: none;
    padding-bottom: 4px;
    position: relative;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--text-primary);
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--accent-warm);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* --- Cinematic Fixed Lightbox Core --- */
.lightbox {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(13, 13, 17, 0.65);
    backdrop-filter: blur(30px) brightness(0.6);
    -webkit-backdrop-filter: blur(30px) brightness(0.6);
    display: flex; 
    flex-direction: column;
    justify-content: center; 
    align-items: center;
    z-index: 2000; opacity: 0; pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    touch-action: none;
}

body.light-mode .lightbox {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

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

.lightbox-nav-controls {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 2100;
}

.lightbox-nav-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.lightbox-nav-arrow {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    opacity: 0.4;
    padding: 8px;
    transition: opacity 0.3s ease, color 0.3s ease;
    display: flex;
    align-items: center;
    touch-action: none;
}

.lightbox-nav-arrow:hover {
    opacity: 1;
    color: var(--accent-warm);
}

.lightbox-counter {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.5;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Enhanced EXIF metadata display */
.lightbox-exif-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 24px;
}

.lightbox-exif-text {
    font-family: var(--font-body);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90vw;
}

/* Keyboard hints */
.lightbox-hints {
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.lightbox:hover .lightbox-hints {
    opacity: 0.7;
}

.hint-item {
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

kbd {
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.6rem;
    font-weight: 500;
    white-space: nowrap;
}

body.light-mode kbd {
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
}

/* Image containment boundaries mapping static breathing margins */
.lightbox-img-wrapper {
    width: 85%;
    height: 70vh;
    margin-top: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; 
    border-radius: 12px; 
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
    transform: translateY(30px) scale(0.98); 
    
    /* UPGRADE FIXED: Unified transition speed scales for a silky smooth fade curve */
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease-in-out;
}

body.light-mode .lightbox-content {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* UPGRADE ADDED: Transitions opacity smoothly down to zero during source shuffling swaps */
.lightbox-content.lightbox-changing {
    opacity: 0;
    transform: scale(0.99);
}

.lightbox.active .lightbox-content { transform: translateY(0) scale(1); }

.lightbox-close {
    font-family: var(--font-body);
    position: absolute; top: 40px; right: 40px; color: var(--text-primary);
    font-size: 0.9rem; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase;
    cursor: pointer; opacity: 0.5; transition: var(--transition);
    z-index: 2100;
}

.lightbox-close:hover { opacity: 1; color: var(--accent-warm); }

/* --- Responsive Adjustments --- */
@media (max-width: 1100px) {
    .gallery-grid { column-count: 2; column-gap: 20px; }
    .gallery-item { margin-bottom: 20px; }
    header { padding: 60px 30px 30px 30px; }
    .filter-container { padding: 0 30px 30px 30px; }
    .gallery-container { padding: 40px 30px 80px 30px; }
    .lightbox-hints { gap: 16px; font-size: 0.6rem; }
}

@media (max-width: 700px) {
    .filter-container { flex-direction: column; align-items: stretch; gap: 15px; }
    .filter-controls { justify-content: flex-end; width: 100%; gap: 8px; }
    .about-section-container { padding: 30px 20px 30px 20px; }
    .gallery-grid { column-count: 1; column-gap: 0; }
    header { flex-direction: column; align-items: flex-start; gap: 20px; padding: 40px 20px 30px 20px; }
    .footer-content { flex-direction: column-reverse; align-items: flex-start; gap: 30px; padding: 30px 20px; }
    .footer-links { flex-direction: column; gap: 15px; }
    .gallery-container { padding: 30px 20px 60px 20px; }

    /* Mobile lightbox improvements */
    .lightbox-nav-controls { top: 20px; gap: 12px; }
    .lightbox-nav-row { gap: 16px; }
    .lightbox-close { top: auto; bottom: 20px; right: 50%; transform: translateX(50%); font-size: 0.8rem; }
    .lightbox-img-wrapper { height: 50vh; margin-top: 30px; width: 90%; }
    .lightbox-exif-text { font-size: 0.65rem; max-width: 85vw; }
    .lightbox-hints { gap: 12px; font-size: 0.55rem; }
    .hint-item { gap: 4px; }
    kbd { padding: 2px 4px; font-size: 0.55rem; }

    .header-title h1 { font-size: 1.6rem; }
    .filter-bar { gap: 20px; }
}

@media (max-width: 480px) {
    header { padding: 30px 16px 20px 16px; }
    .gallery-container { padding: 20px 16px 40px 16px; }
    .filter-container { padding: 0 16px 20px 16px; gap: 10px; }
    .gallery-item { border-radius: 8px; }
    .lightbox-img-wrapper { height: 45vh; margin-top: 20px; }
    .lightbox-nav-controls { top: 16px; }
    .lightbox-close { bottom: 16px; right: 50%; font-size: 0.75rem; }
    .filter-btn { font-size: 0.8rem; padding-bottom: 6px; }
    .about-toggle-btn,
    .control-btn,
    .theme-toggle-btn { width: 36px; height: 36px; }
}