:root {
  color-scheme: dark;
  --bg: #11100e;
  --bg-soft: #181613;
  --panel: rgba(28, 25, 21, 0.78);
  --panel-strong: rgba(28, 25, 21, 0.94);
  --text: #f6efe4;
  --muted: #c7b8a4;
  --faint: #8b7c68;
  --line: rgba(246, 239, 228, 0.13);
  --gold: #d9b66b;
  --gold-soft: rgba(217, 182, 107, 0.15);
  --danger: #ff8b82;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
  --radius: 22px;
  --radius-sm: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(217, 182, 107, 0.10), transparent 24rem),
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.045), transparent 20rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

button, input, a { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.app-shell { min-height: 100vh; }

.hero {
  position: relative;
  overflow: hidden;
  min-height: clamp(178px, 26vh, 310px);
  padding: 14px clamp(16px, 4vw, 52px) clamp(22px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
}

.hero__bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(17,16,14,0.38), rgba(17,16,14,0.93)),
    var(--hero-image, linear-gradient(135deg, rgba(217,182,107,.14), rgba(255,255,255,.035)));
  background-size: cover;
  background-position: center;
  filter: saturate(0.86) brightness(0.72);
  transform: scale(1.01);
  z-index: -2;
}

.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(17, 16, 14, 0.88), rgba(17,16,14,0.50) 52%, rgba(17,16,14,0.78));
  z-index: -1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: .02em;
  font-weight: 700;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: var(--gold);
  box-shadow: 0 8px 26px rgba(0,0,0,.18);
}
.brand__text { font-size: .96rem; }

.topbar__actions, .toolbar__buttons, .lightbox__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255,255,255,0.055);
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease;
  white-space: nowrap;
}
.button:hover { transform: translateY(-1px); border-color: rgba(217,182,107,.46); }
.button:active { transform: translateY(0); }
.button--primary { background: var(--gold); color: #19140d; border-color: transparent; font-weight: 800; }
.button--ghost { background: rgba(255,255,255,0.055); }
.button--soft { min-height: 34px; padding: 0 11px; background: rgba(255,255,255,.04); color: var(--muted); font-size: .88rem; }
.button--small { min-height: 34px; padding-inline: 12px; font-size: .9rem; }
.button.is-active { background: var(--gold-soft); color: var(--gold); border-color: rgba(217,182,107,.45); }

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding-top: clamp(34px, 5.6vw, 76px);
}

.album-kicker {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .9rem;
}
.album-kicker span {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.045);
}
.album-kicker span:first-child { color: var(--gold); }

h1 {
  margin: 0;
  max-width: 900px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.45rem, 6vw, 5.4rem);
  line-height: .94;
  letter-spacing: -.05em;
  text-wrap: balance;
}

.hero__subtitle {
  max-width: 680px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.18rem);
}

.main {
  width: min(1680px, calc(100% - clamp(18px, 4vw, 56px)));
  margin: 0 auto;
  padding: clamp(14px, 2.2vw, 26px) 0 76px;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 8px 0;
  background: linear-gradient(180deg, rgba(17,16,14,.92), rgba(17,16,14,.72));
  backdrop-filter: blur(16px);
}

.search {
  flex: 0 0 auto;
  position: relative;
  width: 172px;
  max-width: 48vw;
}
.search::before {
  content: "⌕";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  font-size: 1.05rem;
  pointer-events: none;
}
.search input {
  width: 100%;
  min-height: 36px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  background: rgba(255,255,255,.055);
  color: var(--text);
}
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: rgba(217,182,107,.55); background: rgba(255,255,255,.075); }

.status {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .9rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(178px, 100%), 1fr));
  gap: clamp(8px, 1.35vw, 15px);
}

.tile {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-soft);
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(0,0,0,.20);
  cursor: pointer;
  transform: translateZ(0);
}

.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 58%, rgba(0,0,0,.48));
  opacity: .18;
  transition: opacity .22s ease;
}
.tile:hover::before { opacity: .56; }
.tile:hover img { transform: scale(1.035); filter: saturate(1.04); }
.tile:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .45s ease, filter .45s ease;
  background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(217,182,107,.08));
}

.tile__caption {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 9px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
  text-align: left;
  font-size: .82rem;
}
.tile__caption span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile__favorite {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: var(--gold);
  background: rgba(17,16,14,.62);
  border: 1px solid rgba(255,255,255,.16);
}
.tile:not(.is-favorite) .tile__favorite { opacity: 0; }

.empty {
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  text-align: center;
}

.lightbox[hidden], .toast[hidden], .empty[hidden] { display: none !important; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 0;
}
.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3,3,3,.92);
  backdrop-filter: blur(16px);
}
.lightbox__panel {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  background: rgba(5,5,5,.86);
  box-shadow: none;
  display: grid;
  grid-template-rows: 1fr;
  overflow: hidden;
}
.lightbox__top {
  position: absolute;
  top: max(10px, var(--safe-top));
  left: 50%;
  z-index: 6;
  transform: translateX(-50%);
  width: min(980px, calc(100% - 24px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(17,16,14,.58);
  backdrop-filter: blur(18px);
}
.lightbox__bottom {
  position: absolute;
  left: 50%;
  bottom: max(10px, var(--safe-bottom));
  z-index: 6;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 24px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(17,16,14,.54);
  backdrop-filter: blur(18px);
  color: var(--muted);
  font-size: .88rem;
}
.lightbox__caption {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.lightbox__caption strong, .lightbox__caption span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lightbox__caption strong { font-size: .94rem; }
.lightbox__caption span { color: var(--muted); font-size: .78rem; }

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.075);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-size: 1.12rem;
}
.icon-button:hover, .icon-button.is-active { border-color: rgba(217,182,107,.52); color: var(--gold); background: var(--gold-soft); }

.stage {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  display: grid;
  place-items: center;
  padding: max(68px, calc(50px + var(--safe-top))) clamp(54px, 6vw, 96px) max(54px, calc(44px + var(--safe-bottom)));
}
.stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 60px rgba(0,0,0,.28);
}

.nav-button {
  position: absolute;
  top: 50%;
  z-index: 5;
  transform: translateY(-50%);
  width: clamp(42px, 5vw, 60px);
  height: clamp(42px, 5vw, 60px);
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(17,16,14,.50);
  color: var(--text);
  cursor: pointer;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  backdrop-filter: blur(12px);
}
.nav-button:hover { color: var(--gold); border-color: rgba(217,182,107,.55); }
.nav-button--prev { left: clamp(10px, 2vw, 22px); }
.nav-button--next { right: clamp(10px, 2vw, 22px); }

.progress {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--gold);
  transition: width .2s ease;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + var(--safe-bottom));
  z-index: 200;
  transform: translateX(-50%);
  max-width: min(560px, calc(100% - 28px));
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: var(--shadow);
}

.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;
}
.noscript {
  position: fixed;
  inset: auto 16px 16px;
  padding: 16px;
  border-radius: 14px;
  background: #fff;
  color: #111;
  z-index: 300;
}
body.is-lightbox-open { overflow: hidden; }

@media (max-width: 760px) {
  .hero {
    min-height: 166px;
    padding-inline: 14px;
    padding-bottom: 18px;
  }
  .topbar { align-items: center; }
  .brand__text { display: none; }
  .button { min-height: 36px; padding-inline: 11px; font-size: .9rem; }
  .button--small { min-height: 34px; }
  .hero__content { padding-top: 28px; }
  .album-kicker { font-size: .78rem; gap: 6px; margin-bottom: 7px; }
  .album-kicker span { padding: 4px 8px; }
  h1 { font-size: clamp(2.2rem, 12vw, 3.45rem); }
  .hero__subtitle { margin-top: 4px; font-size: .96rem; }
  .main { width: calc(100% - 18px); padding-top: 10px; }
  .toolbar { gap: 8px; margin-bottom: 8px; padding: 7px 0; }
  .toolbar__buttons { gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .toolbar__buttons::-webkit-scrollbar { display: none; }
  .toolbar__buttons .button { min-width: 38px; min-height: 34px; padding-inline: 9px; font-size: .78rem; }
  .search { width: 44px; max-width: 58vw; transition: width .2s ease; }
  .search:focus-within { width: min(180px, 58vw); }
  .search input { min-height: 34px; padding-right: 8px; color: transparent; }
  .search input::placeholder { color: transparent; }
  .search input:focus { color: var(--text); }
  .search input:focus::placeholder { color: var(--faint); }
  .status { font-size: .78rem; margin-bottom: 8px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { border-radius: 14px; }
  .tile__caption { left: 8px; right: 8px; bottom: 8px; font-size: .72rem; }
  .tile__favorite { width: 26px; height: 26px; }
  .lightbox__top {
    top: max(7px, var(--safe-top));
    width: calc(100% - 14px);
    padding: 6px 7px;
  }
  .lightbox__caption strong { max-width: 34vw; font-size: .82rem; }
  .lightbox__caption span { display: none; }
  .lightbox__actions { gap: 5px; }
  .icon-button { width: 34px; height: 34px; font-size: 1rem; }
  .stage {
    padding: max(54px, calc(42px + var(--safe-top))) 8px max(16px, var(--safe-bottom));
  }
  .stage img { border-radius: 5px; box-shadow: none; }
  .nav-button {
    width: 38px;
    height: 50px;
    top: 50%;
    bottom: auto;
    border-radius: 14px;
    background: rgba(17,16,14,.34);
    opacity: .8;
  }
  .nav-button--prev { left: 6px; }
  .nav-button--next { right: 6px; }
  .lightbox__bottom { display: none; }
}

@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
