:root {
  color-scheme: dark;
  --bg: #141615;
  --paper: #f5f0e7;
  --muted: #bbb9b0;
  --line: #ffffff2b;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--paper);
  scroll-behavior: smooth;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a[href], input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #fff4bf; outline-offset: 4px; }
.top {
  position: absolute; z-index: 1; inset: 0 0 auto; display: flex; justify-content: space-between;
  align-items: center; padding: 1.4rem clamp(1.15rem, 5vw, 5rem); border-bottom: 1px solid var(--line);
  background: #10121038;
}
.brand { font-size: .88rem; font-weight: 650; letter-spacing: .16em; }
.mark { margin-right: .55rem; color: #e6c47b; }
.nav-link { font-size: .95rem; }
.cover {
  margin: 0; position: relative; min-height: min(81vh, 830px); display: grid; align-items: end;
  overflow: hidden; background: #282520; isolation: isolate;
}
.cover-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 55% 61%; z-index: -2; }
.cover::after {
  content: ""; z-index: -1; position: absolute; inset: 0;
  background: linear-gradient(0deg,#101211 0%,#10121187 42%,#1012110d 78%),linear-gradient(90deg,#10121183,transparent 67%);
}
.cover-content { padding: clamp(8.5rem, 20vh, 15rem) clamp(1.15rem, 5vw, 5rem) clamp(2.4rem, 7vw, 5.2rem); }
.kicker { font-size: .78rem; font-weight: 650; letter-spacing: .2em; color: #edd4a1; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
h1 { margin: .05em 0; font-size: clamp(4rem, 11vw, 10.1rem); line-height: .96; letter-spacing: -.055em; }
.cover-details { color: #e3e1d8; margin: 1.25rem 0 1.65rem; }
.cover-details span, .catalog-heading span { padding: 0 .45rem; }
.cover-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.button {
  display: inline-flex; cursor: pointer; justify-content: center; align-items: center; padding: .72rem 1.12rem;
  border: 1px solid var(--line); border-radius: .3rem; font-weight: 590; font-size: .94rem;
  transition: background .17s ease, color .17s ease;
}
.primary { background: var(--paper); color: #191b18; border-color: var(--paper); }
.primary:hover { background: #e8d3ad; }
.ghost { background: #1115124d; color: var(--paper); }
.ghost:hover { background: #ffffff20; }
main { padding: 3.8rem clamp(1.15rem, 5vw, 5rem); }
.catalog-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: .35rem 1.6rem; }
.catalog-heading h2 { margin: 0; font-size: clamp(2.8rem, 6vw, 4.7rem); letter-spacing: -.045em; }
.catalog-heading p { color: var(--muted); margin: 0; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .7rem; margin: 1.5rem 0 1.2rem; }
.filters { display: flex; gap: .42rem; flex-wrap: wrap; }
.filters button, input {
  border-radius: .28rem; border: 1px solid #ffffff36; padding: .55rem .68rem; background: transparent;
  color: var(--paper); font-size: .91rem;
}
.filters button { cursor: pointer; }
.filters button:hover { border-color: var(--paper); }
.filters button[aria-pressed=true] { border-color: var(--paper); background: var(--paper); color: #191b18; }
input { width: min(100%, 12rem); }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 237px),1fr)); gap: .54rem; }
.tile {
  position: relative; border: 0; padding: 0; overflow: hidden; border-radius: .15rem; display: block;
  background: #242824; color: white; cursor: zoom-in; aspect-ratio: 6032/4032;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .24s ease; }
.tile span { position: absolute; inset: auto auto .6rem .65rem; font-size: .82rem; padding: .24rem .4rem; border-radius: .17rem; background: #111d; opacity: 0; }
.tile:hover img, .tile:focus-visible img { transform: scale(1.035); }
.tile:hover span, .tile:focus-visible span { opacity: 1; }
footer { margin: 0 clamp(1.15rem, 5vw, 5rem); border-top: 1px solid var(--line); color: var(--muted); display: flex; justify-content: space-between; padding: 1.25rem 0 2.2rem; }
.viewer { border: 0; padding: 0; margin: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; background: #0c0e0d; color: var(--paper); }
.viewer[open] { display: grid; grid-template-rows: auto minmax(0,1fr); }
.viewer-header { display: flex; justify-content: space-between; align-items: center; gap: .7rem; padding: .8rem 1.2rem; }
.viewer-header span { display: inline-block; margin-right: .75rem; }
#viewer-name { color: var(--muted); font-size: .9rem; }
.viewer-actions { display: flex; gap: .7rem; align-items: center; }
.stage { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .7rem; padding: .5rem 1rem 1.2rem; align-items: center; min-height: 0; }
.frame { width: 100%; height: 100%; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.frame img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.icon { color: var(--paper); background: #171a18; border: 1px solid var(--line); border-radius: .3rem; width: 2.75rem; height: 2.75rem; cursor: pointer; font-size: 1.75rem; line-height: 1; }
.icon:hover { background: #2e322e; }
.zip-dialog { padding: 1.5rem; border: 1px solid var(--line); border-radius: .45rem; background: #191c1a; color: var(--paper); max-width: min(27rem, 92vw); width: 100%; }
.zip-dialog::backdrop { background: #000a; }
.zip-dialog h2 { margin: 0; font-size: 1.8rem; }
.zip-dialog progress { display: block; width: 100%; margin-bottom: 1rem; accent-color: #e6c47b; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 590px) {
  .cover { min-height: 69svh; }
  .cover-image { object-position: 55% 60%; }
  .top { padding-block: 1.05rem; }
  main { padding-block: 2.2rem; }
  .grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .32rem; }
  .viewer-header { padding: .65rem; }
  #viewer-name { display: block; font-size: .76rem; }
  .stage { position: relative; display: flex; padding: .3rem 0; }
  .stage > .icon { position: absolute; z-index: 1; top: 50%; translate: 0 -50%; background: #111b; }
  .previous { left: .35rem; } .next { right: .35rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
