:root {
    --bg-color: #0a0a0c;
    --surface-color: #121214;
    --text-main: #f0f0f5;
    --text-muted: #8e8e99;
    --accent: #d4af37;
    /* Subtle gold/bronze for wildlife vibe */
    --hover-overlay: rgba(255, 255, 255, 0.05);

    --sidebar-width: 260px;
    --font-stack: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;

    --transition-snappy: 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-stack);
    -webkit-font-smoothing: antialiased;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font: inherit;
}

/* Typography */
h1 {
    font-weight: 600;
    letter-spacing: 0.15em;
    font-size: 1.25rem;
}

h2 {
    font-weight: 400;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-main);
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--bg-color);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: 2.5rem 2rem;
    z-index: 100;
    transition: transform var(--transition-snappy);
}

.logo {
    margin-bottom: 3rem;
    user-select: none;
}

.logo p {
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    margin-top: 0.25rem;
    text-transform: uppercase;
}

.nav-links {
    list-style: none;
    flex: 1;
    overflow-y: auto;
}

.nav-links li {
    margin-bottom: 0.5rem;
}

.nav-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: all var(--transition-snappy);
    position: relative;
}

.nav-item:hover {
    color: var(--text-main);
    background-color: var(--hover-overlay);
}

.nav-item.active {
    color: var(--text-main);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 1rem;
    background-color: var(--accent);
    border-radius: 0 4px 4px 0;
}

.footer-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* Mobile Header */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background-color: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 90;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Main Content Area */
.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 3rem;
    min-height: 100vh;
}

/* Standard Grid - 1:1 Aspect Ratio */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.grid-item {
    break-inside: avoid;
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transform: translateY(20px);
    opacity: 0;
    animation: fadeUp 0.6s var(--transition-smooth) forwards;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid-item img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.grid-item:hover img {
    transform: scale(1.05);
}

.grid-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, transparent 40%);
    opacity: 0;
    transition: opacity var(--transition-snappy);
}

.grid-item:hover::after {
    opacity: 1;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background-color: rgba(5, 5, 5, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-snappy);
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-controls {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    gap: 1rem;
    z-index: 1010;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-snappy);
}

.icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 64px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: rgba(255, 255, 255, 0.5);
    transition: color var(--transition-snappy);
    z-index: 1005;
}

.nav-btn:hover {
    color: white;
}

.nav-btn.prev {
    left: 1rem;
}

.nav-btn.next {
    right: 1rem;
}

/* Image Area in Lightbox */
.lightbox-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    user-select: none;
}

.image-wrapper {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: inline-block;
    /* Required for clip path calculation */
}

.lightbox-img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    cursor: grab;
    transition: transform 0.1s ease-out, opacity 0.3s ease-out;
    /* For smooth wheel zooming and appearance */
}

.image-wrapper.zoomed .lightbox-img {
    cursor: grabbing;
}

.image-wrapper.zoomed:active .lightbox-img {
    cursor: grabbing;
}

.lb-copyright-year {
    position: absolute;
    bottom: 24px;
    left: 24px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    pointer-events: none;
    z-index: 5;
    user-select: none;
    display: flex;
    align-items: center;
}

.has-slider .raw-img {
    opacity: 1;
}

/* Info Panel (Sidebar inside Lightbox) */
.info-panel {
    width: 320px;
    background-color: var(--surface-color);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-smooth);
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 1020;
}

.info-panel.show {
    transform: translateX(0);
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.info-header h3 {
    font-size: 1.25rem;
    margin-bottom: 0;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}


.exif-data {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-bottom: 3rem;
    flex: 1;
}

.exif-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.exif-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.exif-value {
    font-size: 1.1rem;
    color: var(--text-main);
}

.action-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--text-main);
    color: var(--bg-color);
    font-weight: 600;
    border-radius: 6px;
    transition: all var(--transition-snappy);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
}

.action-btn:hover {
    background-color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

/* Loader */
.loader {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
    position: absolute;
    display: none;
}

.loader.show {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .masonry-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .mobile-header {
        display: flex;
    }

    .content {
        margin-left: 0;
        padding: 1.5rem;
    }

    .info-panel {
        width: 100%;
        max-width: 320px;
    }

    .nav-btn {
        display: none;
    }

    /* Better swipe on mobile instead of buttons if needed, or keep smaller */
}