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

:root {
    --bg: #fafafa;
    --text: #1a1a1a;
    --text-secondary: #666;
    --border: #e5e5e5;
    --gap: 8px;
    --radius: 4px;
    --transition: 0.2s ease;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a0a0a;
        --text: #f5f5f5;
        --text-secondary: #999;
        --border: #222;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

/* Header */
.header {
    text-align: center;
    padding: 3rem 1rem 2rem;
}

.title {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    letter-spacing: 0.05em;
}

/* Gallery Grid - Masonry Layout */
.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--gap);
}

.gallery {
    columns: 4;
    column-gap: var(--gap);
}

@media (max-width: 1024px) {
    .gallery { columns: 3; }
}

@media (max-width: 640px) {
    .gallery { columns: 2; }
}

@media (max-width: 360px) {
    .gallery { columns: 1; }
}

/* Gallery Item */
.gallery-item {
    position: relative;
    break-inside: avoid;
    margin-bottom: var(--gap);
    overflow: hidden;
    border-radius: var(--radius);
    cursor: pointer;
    background: #111;
}

.gallery-item img {
    width: 100%;
    display: block;
    filter: grayscale(100%);
    transition: filter var(--transition), transform var(--transition);
}

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

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

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

/* Loading */
.loading {
    display: flex;
    justify-content: center;
    padding: 4rem 0;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--text);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 6rem 1rem;
    color: var(--text-secondary);
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

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

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

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius);
    filter: none;
    transition: opacity 0.2s ease;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition);
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.1);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition);
    user-select: none;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255,255,255,0.1);
}

.lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
}

/* Mobile Lightbox */
@media (max-width: 640px) {
    .lightbox-prev,
    .lightbox-next {
        font-size: 2rem;
        width: 44px;
        height: 44px;
    }

    .lightbox-prev { left: 0.5rem; }
    .lightbox-next { right: 0.5rem; }
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Fade in animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.gallery-item {
    animation: fadeIn 0.4s ease forwards;
}
