:root {
    --ink: #151413;
    --muted: #6d6760;
    --paper: #f5f1ea;
    --panel: #fffdfa;
    --line: #ded6cc;
    --accent: #245b4a;
    --accent-dark: #16372d;
    --danger: #a13a32;
    --shadow: 0 18px 48px rgba(27, 24, 20, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    height: auto;
    max-width: 100%;
}

.site-header {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: 18px clamp(18px, 4vw, 56px);
}

.brand,
.nav {
    align-items: center;
    display: flex;
}

.brand {
    gap: 12px;
}

.brand-mark {
    background: var(--ink);
    border-radius: 50%;
    color: var(--paper);
    display: grid;
    font-weight: 800;
    height: 40px;
    place-items: center;
    width: 40px;
}

.brand small {
    color: var(--muted);
    display: block;
    font-size: 0.78rem;
    margin-top: 2px;
}

.nav {
    flex-wrap: wrap;
    gap: 14px;
    justify-content: flex-end;
}

.nav a,
.nav-button {
    color: var(--muted);
    font: inherit;
}

.nav-button {
    background: none;
    border: 0;
    cursor: pointer;
    min-height: auto;
    padding: 0;
}

main {
    margin: 0 auto;
    max-width: 1240px;
    padding: clamp(24px, 5vw, 64px);
}

.hero,
.login-panel,
.admin-layout {
    display: grid;
    gap: 28px;
    margin-bottom: 42px;
}

.hero {
    max-width: 820px;
}

.login-panel,
.admin-layout {
    align-items: end;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
}

.eyebrow {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    margin: 0 0 12px;
    text-transform: uppercase;
}

h1,
h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
    margin: 0;
}

h1 {
    font-size: clamp(2.8rem, 8vw, 6.8rem);
    line-height: 0.94;
    max-width: 900px;
}

h2 {
    font-size: 2rem;
    line-height: 1.1;
    margin-bottom: 8px;
}

.hero p:not(.eyebrow),
.login-panel p:not(.eyebrow),
.admin-intro p:not(.eyebrow),
.empty-state p {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 620px;
}

.gallery {
    column-count: 3;
    column-gap: 22px;
}

.artwork-card {
    background: var(--panel);
    border: 1px solid var(--line);
    break-inside: avoid;
    margin: 0 0 22px;
    overflow: hidden;
}

.artwork-card img {
    height: auto;
    width: 100%;
}

.artwork-link {
    cursor: zoom-in;
    display: block;
}

.artwork-link:focus {
    outline: 3px solid rgba(36, 91, 74, 0.28);
    outline-offset: -3px;
}

.artwork-card p {
    color: var(--muted);
    line-height: 1.5;
    margin: 0;
    padding: 14px 16px 16px;
}

.lightbox {
    align-items: center;
    display: none;
    inset: 0;
    justify-content: center;
    padding: clamp(16px, 4vw, 48px);
    position: fixed;
    z-index: 20;
}

.lightbox:target {
    display: flex;
}

.lightbox-backdrop {
    background: rgba(18, 17, 15, 0.86);
    inset: 0;
    position: absolute;
}

.lightbox-panel {
    color: white;
    display: grid;
    gap: 14px;
    max-height: 92vh;
    max-width: min(1100px, 94vw);
    position: relative;
    width: 100%;
    z-index: 1;
}

.lightbox-panel img {
    background: #050505;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
    height: auto;
    justify-self: center;
    max-height: 78vh;
    max-width: 94vw;
    object-fit: contain;
    width: auto;
}

.lightbox-panel p {
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.5;
    margin: 0;
}

.lightbox-close {
    background: white;
    border-radius: 2px;
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 800;
    justify-self: end;
    padding: 9px 12px;
}

.empty-state,
.form-card,
.upload-panel,
.manage-card {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 24px;
}

.form-card,
.upload-panel,
.manage-card form {
    display: grid;
    gap: 14px;
}

label {
    color: var(--muted);
    display: grid;
    font-size: 0.85rem;
    font-weight: 700;
    gap: 7px;
}

input {
    background: #fbfaf7;
    border: 1px solid var(--line);
    border-radius: 2px;
    color: var(--ink);
    font: inherit;
    min-height: 44px;
    padding: 10px 12px;
    width: 100%;
}

input:focus {
    border-color: var(--accent);
    outline: 3px solid rgba(36, 91, 74, 0.16);
}

button {
    background: var(--accent);
    border: 0;
    border-radius: 2px;
    color: white;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    min-height: 44px;
    padding: 11px 16px;
}

button:hover {
    background: var(--accent-dark);
}

button.danger {
    background: var(--danger);
}

.hint {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.45;
    margin: 0;
}

.notice,
.error {
    border: 1px solid var(--line);
    margin: 0 0 22px;
    padding: 12px 14px;
}

.notice {
    background: #edf7f1;
    color: var(--accent-dark);
}

.error {
    background: #fff0ee;
    color: var(--danger);
}

.error p {
    margin: 0;
}

.admin-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.manage-card {
    display: grid;
    gap: 16px;
}

.manage-card img {
    height: auto;
    object-fit: contain;
    width: 100%;
}

@media (max-width: 860px) {
    .site-header,
    .login-panel,
    .admin-layout {
        align-items: start;
        grid-template-columns: 1fr;
    }

    .gallery {
        column-count: 2;
    }
}

@media (max-width: 560px) {
    .site-header {
        gap: 18px;
    }

    .gallery {
        column-count: 1;
    }

    h1 {
        font-size: 3rem;
    }
}
