:root {
    --bg: #f8f5f0;
    --text: #2c2420;
    --border: #d4c8b8;
    --meta-bg: #faf8f5;
    --link: #8b6914;
    --muted: #666;
    --faint: #888;
    --footer-bg: white;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a1815;
        --text: #e8e2d8;
        --border: #3a3530;
        --meta-bg: #242118;
        --link: #d4a847;
        --muted: #a09080;
        --faint: #807060;
        --footer-bg: #242118;
    }

    .photo-item {
        background: var(--meta-bg);
    }

    .notes {
        color: var(--muted);
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    padding: 3rem 1rem;
    border-bottom: 1px solid var(--border);
}

h1 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--muted);
    font-size: 1.1rem;
}

main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.gallery {
    column-count: 1;
    column-gap: 20px;
}

@media (min-width: 640px) {
    .gallery {
        column-count: 2;
    }
}

@media (min-width: 960px) {
    .gallery {
        column-count: 3;
    }
}

@media (min-width: 1280px) {
    .gallery {
        column-count: 4;
    }
}

.photo-item {
    background: var(--footer-bg);
    border: 1px solid var(--border);
    break-inside: avoid;
    margin-bottom: 20px;
    display: inline-block;
    width: 100%;
}

.photo-item a {
    display: block;
    line-height: 0;
}

.photo-item img {
    width: 100%;
    height: auto;
    display: block;
}

.metadata-box {
    padding: 1rem;
    background: var(--meta-bg);
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
}

.metadata-box > * + * {
    margin-top: 0.25rem;
}

.filename,
.photo-name {
    font-weight: 600;
}

.camera,
.film,
.lens,
.location {
    color: var(--muted);
}

.location {
    font-style: italic;
}

.date {
    color: var(--faint);
    font-size: 0.813rem;
}

.notes {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    line-height: 1.4;
}

footer {
    margin-top: 4rem;
    padding: 2rem 1rem;
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--footer-bg);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.stats {
    color: var(--faint);
    font-size: 0.875rem;
    margin: 0.5rem 0;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: var(--link);
    text-decoration: none;
    margin: 0 0.75rem;
    font-size: 0.938rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

.credits {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.813rem;
    color: var(--faint);
}

.credits a {
    color: var(--muted);
    text-decoration: none;
}

.credits a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .gallery {
        column-count: 1;
    }

    main {
        padding: 1rem;
    }

    .footer-links a {
        display: inline-block;
        margin: 0.25rem 0.5rem;
    }
}
