html {
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #fff;
    color: #111;
    overflow-x: hidden;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

header, footer {
    background: #fff;
    color: #111;
}

header {
    color: #111;
    text-align: center;
    padding: 24px 0 0px 0;
    position: relative;
}

.lang-switcher {
    position: absolute;
    top: 24px;
    right: 32px;
    font-family: "Fira Mono", "Consolas", monospace;
    font-size: 0.9em;
    color: #888;
}

.lang-switcher a {
    color: #888;
    text-decoration: none;
}

.lang-switcher a:hover {
    color: #111;
}

.lang-switcher .lang-active {
    color: #111;
    font-weight: bold;
}

section {
    padding: 0px;
    margin-bottom: 20px;;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    margin: 32px auto 0 auto;
    max-width: 1280px;
    width: 100%;
    justify-items: center;
    justify-content: center;
}

.works-grid figure {
    margin: 0;
    text-align: center;
    background: #fff;
    padding: 16px;
    border: 1.5px dashed #e0e0e0;
}

.works-grid img {
    width: 100%;
    max-width: 320px;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: #eee;
    border: 1px solid #ddd;
    display: block;
    margin: 0 auto 12px auto;
    box-shadow: none;
}


.works-grid figcaption {
    color: #111;
    font-size: 1em;
}

.works-grid strong {
    font-weight: bold;
    color: #111;
}

.works-grid .meta {
    font-family: "Fira Mono", "Consolas", monospace;
    color: #888;
    font-size: 0.95em;
}

.works-grid .meta dl {
    display: inline;
    margin: 0;
}

.works-grid .meta dd {
    display: inline;
    margin: 0;
}

.works-grid .meta dd:not(:last-of-type):after {
    content: " · ";
}

.format-italic {
    font-style: italic;
}

.works-grid a {
    text-decoration: none;
    color: inherit;
}

.works-grid a:hover {
    opacity: 0.8;
}

/* Opus page styles */
.opus {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 16px;
}

.opus-header h1 {
    font-size: 2.5em;
    font-weight: bold;
    color: #111;
    margin: 0 0 16px 0;
    text-align: center;
}

.opus-meta {
    text-align: center;
    font-family: "Fira Mono", "Consolas", monospace;
    color: #888;
    font-size: 1.1em;
    margin-bottom: 32px;
}

.opus-meta dl {
    display: inline;
    margin: 0;
}

.opus-meta dd {
    display: inline;
    margin: 0;
}

.opus-meta dd:not(:last-of-type):after {
    content: " · ";
}

.main-picture {
    text-align: center;
    margin: 32px 0;
}

.main-picture img {
    width: 100%;
    max-width: 800px;
    height: auto;
    border: 1px solid #ddd;
}

.description {
    margin: 32px 0;
    line-height: 1.6;
}

.description p {
    margin: 16px 0;
}

.additional-pictures {
    margin: 32px 0;
}

.additional-pictures figure {
    margin: 24px 0;
    text-align: center;
}

.additional-pictures img {
    width: 100%;
    max-width: 640px;
    height: auto;
    border: 1px solid #ddd;
}

.notes {
    margin: 32px 0;
    text-align: center;
    font-style: italic;
    color: #888;
    line-height: 1.6;
}

.references {
    margin: 32px 0;
}

.references ul {
    list-style: none;
    padding: 0;
}

.references li {
    margin: 8px 0;
}

.references a {
    color: #111;
    text-decoration: underline;
    font-family: "Fira Mono", "Consolas", monospace;
    font-size: 0.95em;
}

.references a:hover {
    color: #888;
}

.opus-navigation {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1.5px dashed #e0e0e0;
    text-align: center;
}

.back-link {
    color: #111;
    text-decoration: none;
    font-family: "Fira Mono", "Consolas", monospace;
    font-size: 0.95em;
}

.back-link:hover {
    color: #888;
}

@media (max-width: 700px) {
    .opus {
        padding: 16px 8px;
    }
    
    .opus-header h1 {
        font-size: 2em;
    }
}

footer {
    background: #fff;
    color: #888;
    text-align: center;
    padding: 10px 0;
    position: relative;
    bottom: 0;
    width: 100%;
    border-top: 1.5px dashed #e0e0e0;
    font-family: "Fira Mono", "Consolas", monospace;
    font-size: 0.95em;
}

.gallery img {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
}

.about {
    line-height: 1.6;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.site-logo {
    width: 160px;
    height: 160px;
    object-fit: contain;
    display: block;
    filter: grayscale(100%) brightness(0.6);
}

@media (max-width: 1100px) {
    .works-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 680px;
        width: 100%;
    }
}

@media (max-width: 700px) {
    .works-grid {
        grid-template-columns: 1fr;
        max-width: 95vw;
        width: 100%;
        gap: 20px;
    }
    .works-grid img {
        max-width: 100vw;
    }
    .site-logo {
        width: 100px;
        height: 100px;
    }
    .lang-switcher {
        top: 16px;
        right: 12px;
        font-size: 0.85em;
    }
}

/* 404 page styles */
.not-found {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.not-found h1 {
    font-size: 3em;
    font-weight: bold;
    color: #111;
    margin: 0;
    text-align: center;
}

.not-found h1 a {
    color: #111;
    text-decoration: none;
}

.not-found h1 a:hover {
    color: #888;
}