:root {
  color-scheme: dark;
  font: 100%/1.5 system-ui, sans-serif;
  color: #f3f2ef;
  background: #111316;
  --muted: #aaaeb5;
  --line: #2c3036;
  --accent: #f2bd9f;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.container { width: min(100% - 3rem, 88rem); margin-inline: auto; }
.header { border-bottom: 1px solid var(--line); }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 4.5rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 750; letter-spacing: -.02em; font-size: 1.12rem; }
.brand-icon { font-size: 1.5rem; color: var(--accent); line-height: 1; }
.nav-link { color: #c6c8cb; font-weight: 550; }
.nav-link:hover { color: white; }

.hero {
  position: relative;
  display: grid;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  min-height: clamp(27rem, 40vw, 34rem);
  margin-top: 1.5rem;
  border: 1px solid #343a41;
  border-radius: 1.25rem;
  background: linear-gradient(90deg, #0d1721ed 0%, #0d1721b8 33%, #0d172133 67%, #0d17210f 100%),
    #233648 url('/previews/hero.jpg') center 54% / cover no-repeat;
}
.hero-content { padding: clamp(1.6rem, 5.2vw, 5rem); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.8rem, 6vw, 6rem); font-weight: 680; letter-spacing: -.06em; line-height: 1; }
.hero p { max-width: 25rem; margin-top: 1.25rem; color: #e2e5e8; font-size: clamp(1rem, 1.5vw, 1.2rem); }
.primary-button { display: inline-flex; align-items: center; justify-content: center; border-radius: .55rem; padding: .8rem 1.15rem; background: var(--accent); color: #261b17; font-weight: 720; white-space: nowrap; }
.primary-button:hover { background: #ffd2b8; }
.hero .primary-button { margin-top: 1.65rem; }
.hero-caption { position: absolute; right: 1.15rem; bottom: 1.15rem; border: 1px solid #ffffff4d; border-radius: .45rem; padding: .5rem .7rem; background: #10151cc9; color: #f6f4ef; font-size: .875rem; }
.hero-caption:hover { background: #10151c; }

.catalog { padding-block: clamp(2.1rem, 4.2vw, 4.25rem); scroll-margin-top: 1rem; }
.catalog-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .6rem; }
.catalog-heading h2 { font-size: clamp(1.75rem, 4vw, 2.65rem); letter-spacing: -.045em; }
.catalog-heading p { color: var(--muted); }
.controls { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: .85rem; margin-block: 1.25rem 1.45rem; }
.filters { display: flex; gap: .45rem; flex-wrap: wrap; }
.filters button, .search { border: 1px solid var(--line); color: #dddfe1; border-radius: .55rem; background: #1a1d22; padding: .55rem .8rem; }
.filters button[aria-pressed="true"] { background: #f0e7df; border-color: #f0e7df; color: #232025; }
.filters button:hover:not([aria-pressed="true"]) { border-color: #71747a; }
.search { width: min(100%, 17rem); }
.search::placeholder { color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.card { min-width: 0; border-radius: .9rem; overflow: hidden; border: 1px solid var(--line); background: #191c21; }
.card button { display: block; width: 100%; border: 0; background: transparent; color: inherit; text-align: left; padding: 0; }
.card button:focus-visible { outline-offset: -3px; }
.card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #242a32; }
.card:hover { border-color: #8d7569; }
.card-info { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem .5rem; padding: .8rem .9rem; }
.card-title { font-weight: 680; }
.resolution { color: var(--muted); font-size: .875rem; white-space: nowrap; }
.empty { color: var(--muted); padding-block: 1.75rem; }
.footer { color: var(--muted); padding-block: 1.25rem; border-top: 1px solid var(--line); }

dialog { width: min(calc(100% - 2rem), 58rem); max-height: calc(100% - 2rem); padding: 0; border: 1px solid #41444c; border-radius: .9rem; background: #191c21; color: inherit; }
dialog::backdrop { background: #07090ed9; }
dialog img { display: block; width: 100%; max-height: 65vh; object-fit: contain; background: #0c0f12; }
.dialog-close { position: absolute; right: .75rem; top: .75rem; }
.dialog-close button { line-height: 1; padding: 0; border: 1px solid #ffffff6e; border-radius: 50%; background: #10151ce8; color: white; font-size: 1.6rem; width: 2.75rem; height: 2.75rem; }
.preview-details { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: .75rem; padding: 1rem; }
.preview-details h2 { font-size: 1.35rem; }
.preview-details p { color: var(--muted); margin-top: .2rem; }

@media (max-width: 56rem) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 34rem) {
  .container { width: calc(100% - 1.5rem); }
  .hero { margin-top: .75rem; min-height: 27rem; background-position: 62% center; }
  .hero-content { padding-bottom: 4.5rem; }
  .hero-caption { right: .75rem; bottom: .75rem; }
  .gallery { grid-template-columns: 1fr; }
  .search { width: 100%; }
}
