@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
    color-scheme: dark;
    --background: #000;
    --foreground: #f5f5f5;
    --muted: #aaa;
    --font: Montserrat, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--foreground); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
.landscape-background { position: fixed; z-index: 0; inset: -2%; overflow: hidden; opacity: .44; pointer-events: none; }
.landscape-background img { display: block; width: 104%; height: 104%; object-fit: cover; filter: brightness(.65) saturate(.82); animation: landscape-pan 52s cubic-bezier(.45, 0, .55, 1) infinite alternate; }
.storm-background { position: fixed; z-index: 1; inset: 0; width: 100%; height: 100%; opacity: .8; pointer-events: none; }
.topbar, main, .footer { position: relative; z-index: 2; }
@keyframes landscape-pan { from { transform: translateX(-1.5%); } to { transform: translateX(1.5%); } }
.topbar { min-height: 100px; padding: 12px max(calc((100vw - 1200px) / 2), 5.8%); display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.site-brand { display: flex; min-width: 0; align-items: center; gap: 15px; }
.site-brand-logo { display: block; width: 145px; height: auto; flex: 0 0 auto; }
.site-brand-copy { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.site-brand-title { font-size: 15px; font-weight: 700; line-height: 1.3; }
.site-brand-slogan { color: #d0d0d0; font-size: 10px; letter-spacing: .035em; line-height: 1.4; }
.book-link { flex: 0 0 auto; padding: 10px 14px; border: 1px solid #888; color: #fff; font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; transition: background .2s, color .2s; }
.book-link:hover { background: #fff; color: #000; }
.footer-brand { display: block; flex: 0 0 auto; }
.footer-brand img { display: block; width: 88px; height: auto; }
.menu-toggle { width: 30px; height: 30px; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 5px; padding: 4px; border: 0; background: transparent; cursor: pointer; }
.menu-toggle span { display: block; width: 16px; height: 1px; background: #eee; transition: width .2s; }
.menu-toggle span:last-child { width: 11px; }
.menu-toggle:hover span:last-child { width: 16px; }
.collection { width: min(1200px, 100%); margin: 24px auto 0; padding: 0 15px 70px; }
.toolbar { min-height: 74px; margin-bottom: 17px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.filters { display: flex; align-items: center; gap: 27px; }
.filters[hidden] { display: none; }
.filter-button { position: relative; padding: 10px 0; border: 0; background: transparent; color: #eee; cursor: pointer; font-size: 11px; font-weight: 500; text-transform: uppercase; transition: color .2s; }
.filter-button:hover, .filter-button.is-active { color: #fff; }
.filter-button.is-active::before { position: absolute; inset: 0 -12px; border: 1px solid #888; content: ""; pointer-events: none; }
.search-box { display: flex; align-items: center; gap: 8px; color: #aaa; opacity: 0; transition: opacity .2s; }
.toolbar:hover .search-box, .search-box:focus-within { opacity: 1; }
.search-box svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.search-box input { width: 150px; padding: 8px 0; border: 0; outline: 0; background: transparent; color: #fff; font-size: 11px; }
.search-box input::placeholder { color: #888; }
.gallery { columns: 4; column-gap: 30px; }
.media-card { display: block; width: 100%; margin: 0 0 30px; padding: 0; overflow: hidden; break-inside: avoid; border: 0; background: transparent; color: #fff; text-align: left; cursor: pointer; }
.media-card[hidden] { display: none; }
.media-visual { position: relative; display: block; width: 100%; overflow: hidden; background: #111; }
.media-visual img, .video-thumbnail { display: block; width: 100%; height: auto; min-height: 90px; object-fit: cover; transition: transform .45s ease, opacity .3s ease; }
.media-card:hover .media-visual img, .media-card:hover .video-thumbnail { transform: scale(1.025); }
.media-visual::after { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.78), transparent 58%); content: ""; opacity: 0; transition: opacity .25s; pointer-events: none; }
.media-card:hover .media-visual::after, .media-card:focus-visible .media-visual::after { opacity: 1; }
.media-caption { position: absolute; z-index: 1; right: 15px; bottom: 14px; left: 15px; display: block; opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; pointer-events: none; }
.media-card:hover .media-caption, .media-card:focus-visible .media-caption { opacity: 1; transform: none; }
.media-caption-main { display: flex; flex-direction: column; gap: 5px; }
.media-title { overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.media-category { color: #ddd; font-size: 9px; font-weight: 400; letter-spacing: .03em; text-transform: uppercase; }
.media-location { color: #fff; font-size: 9px; }
.media-location > span { padding-right: 3px; font-size: 12px; }
.video-thumbnail { aspect-ratio: 16 / 9; background: #171717; }
.video-play { position: absolute; z-index: 1; top: 16px; left: 16px; color: white; font-size: 15px; text-shadow: 0 1px 5px #000; }
.video-art { display: grid; min-height: 180px; aspect-ratio: 4 / 3; place-items: center; background: #161616; }
.video-art-ring { display: grid; width: 54px; height: 54px; place-items: center; border: 1px solid #777; border-radius: 50%; }
.video-art-ring svg { width: 20px; fill: #fff; }
.media-card.is-audio .video-art-ring svg { fill: none; stroke: #fff; stroke-linecap: round; stroke-width: 1.4; }
.video-art-label { position: absolute; bottom: 12px; left: 13px; color: #ddd; font-size: 9px; text-transform: uppercase; }
.load-more { display: block; margin: 30px auto 0; padding: 13px 23px; border: 1px solid #777; background: transparent; color: #fff; cursor: pointer; font-size: 11px; text-transform: uppercase; transition: background .2s, color .2s; }
.load-more:hover { background: #fff; color: #000; }
.load-more[hidden] { display: none; }
.load-more span { padding-left: 9px; }
.empty-state { padding: 45px 0; color: var(--muted); text-align: center; font-size: 13px; }
.empty-state[hidden] { display: none; }
.empty-library { max-width: 460px; margin: 70px auto 20px; padding: 35px; border: 1px solid #333; text-align: center; }
.empty-library-mark { color: #fff; font: italic 55px Georgia, serif; }
.empty-library h3 { margin: 14px 0 8px; font: 24px Georgia, serif; }
.empty-library p { margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.empty-library code { color: #fff; }
.footer { min-height: 80px; padding: 20px max(calc((100vw - 1200px) / 2), 5.8%); display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #1d1d1d; }
.footer > span, .footer > a:last-child { color: #888; font-size: 9px; letter-spacing: .08em; }
.footer > a:last-child { color: #ddd; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.viewer { position: relative; width: min(1000px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 32px); padding: 22px; border: 1px solid #444; background: #090909; color: #fff; }
.viewer::backdrop { background: rgba(0,0,0,.9); }
.viewer-close { position: absolute; z-index: 2; top: 10px; right: 10px; width: 38px; height: 38px; border: 1px solid #444; border-radius: 50%; background: rgba(0,0,0,.8); color: #fff; cursor: pointer; font-size: 25px; line-height: 1; }
.viewer-navigation { position: absolute; z-index: 2; top: 50%; width: 42px; height: 54px; transform: translateY(-50%); border: 1px solid #555; background: rgba(0,0,0,.75); color: #fff; cursor: pointer; font-size: 34px; line-height: 1; }
.viewer-previous { left: 10px; }
.viewer-next { right: 10px; }
.viewer-navigation[hidden] { display: none; }
.viewer-content { display: grid; min-height: 180px; max-height: calc(100vh - 120px); place-items: center; }
.viewer-content img, .viewer-content video, .viewer-content audio { display: block; max-width: 100%; max-height: calc(100vh - 170px); object-fit: contain; }
.viewer-content audio { width: min(560px, 100%); }
.viewer-caption { display: flex; justify-content: space-between; gap: 20px; padding: 14px 1px 0; color: #ddd; font-size: 12px; }
.viewer-details { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 16px; }
.viewer-category { color: #aaa; font-size: 10px; text-transform: uppercase; }
.viewer-location { color: #fff; font-size: 10px; }
.viewer-location[hidden] { display: none; }
.viewer-location:hover { text-decoration: underline; }
:focus-visible { outline: 1px solid #fff; outline-offset: 4px; }

@media (max-width: 900px) {
    .gallery { columns: 3; column-gap: 22px; }
    .collection { padding-right: 20px; padding-left: 20px; }
    .filters { gap: 23px; }
}
@media (max-width: 600px) {
    .topbar { min-height: 76px; padding: 10px 14px; gap: 10px; }
    .site-brand { gap: 8px; }
    .site-brand-logo { width: 88px; }
    .site-brand-title { font-size: 11px; }
    .site-brand-slogan { font-size: 8px; }
    .book-link { padding: 8px 9px; font-size: 8px; }
    .collection { margin-top: 8px; padding: 0 12px 55px; }
    .toolbar { min-height: 70px; margin-bottom: 12px; gap: 10px; }
    .filters { max-width: calc(100% - 35px); gap: 17px; overflow-x: auto; scrollbar-width: none; }
    .filters::-webkit-scrollbar { display: none; }
    .filter-button { flex: 0 0 auto; font-size: 9px; }
    .search-box { position: absolute; right: 14px; }
    .search-box input { width: 0; padding: 8px 0; }
    .search-box:focus-within input { width: 120px; }
    .gallery { columns: 2; column-gap: 12px; }
    .media-card { margin-bottom: 12px; }
    .media-caption { right: 8px; bottom: 8px; left: 8px; }
    .media-title { font-size: 11px; }
    .media-category { font-size: 8px; }
    .media-location { font-size: 8px; }
    .footer { min-height: 70px; padding: 15px 20px; }
    .footer-brand img { width: 72px; }
    .footer > span { display: none; }
    .viewer { padding: 12px; }
    .viewer-content { max-height: calc(100vh - 110px); }
    .viewer-previous { left: 5px; }
    .viewer-next { right: 5px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
    .landscape-background img { animation: none; }
}
