:root {
  --bg: #111111;
  --surface: #ffffff;
  --text: #211922;
  --muted: #62625b;
  --soft: #91918c;
  --border: rgba(33, 25, 34, 0.08);
  --red: #e60023;
  --shadow: 0 12px 50px rgba(33, 25, 34, 0.08);
}
* { box-sizing: border-box; }
html, body {
  width: 100%;
  min-height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
}
.search-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 30;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  color: #111;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,0.28);
  backdrop-filter: blur(12px);
}
.search-panel {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 72px;
  z-index: 29;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 20px;
  background: rgba(16,16,16,0.86);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.32);
}
.search-panel[hidden] {
  display: none;
}
.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
}
.search-input,
.search-submit,
.search-clear {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  font: inherit;
}
.search-input {
  padding: 0 16px;
  background: rgba(255,255,255,0.96);
  color: #111;
}
.search-submit,
.search-clear {
  padding: 0 14px;
  cursor: pointer;
}
.search-submit {
  background: #ffffff;
  color: #111;
  font-weight: 700;
}
.search-clear {
  background: rgba(255,255,255,0.14);
  color: #fff;
}
.search-meta {
  min-height: 18px;
  color: rgba(255,255,255,0.78);
  font-size: 13px;
  line-height: 1.4;
}
main {
  width: 100%;
}
.cover-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 0;
  width: 100vw;
}
.cover-tile {
  position: relative;
  display: grid;
  place-items: stretch;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  contain: layout paint style;
  content-visibility: auto;
  transform: translateZ(0);
  transition: transform 180ms ease, z-index 180ms ease;
}
.cover-tile:hover {
  transform: scale(1.08);
  z-index: 8;
}
.cover-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  background: #1a1a1a;
}
.dialog-layout--loading {
  align-items: start;
}
.album-dialog {
  width: min(980px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 32px 80px rgba(33, 25, 34, 0.24);
}
.album-dialog::backdrop { background: rgba(33, 25, 34, 0.45); }
.dialog-close {
  position: sticky;
  top: 14px;
  margin: 14px 14px 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.95);
  cursor: pointer;
  font-size: 24px;
}
.dialog-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  padding: 0 24px 24px;
}
.dialog-cover-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.dialog-layout img {
  width: 100%;
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.image-zoom-overlay {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  border: 0;
  position: fixed;
  inset: 0;
  z-index: 10000;
  place-items: center;
  padding: 56px 24px 24px;
  background: rgba(0, 0, 0, 0.88);
}
.image-zoom-overlay[open] {
  display: grid;
}
.image-zoom-overlay:not([open]) {
  display: none;
}
.image-zoom-overlay::backdrop {
  background: rgba(0, 0, 0, 0.88);
}
.zoom-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}
.zoomed-cover-image {
  display: block;
  width: auto;
  max-width: min(96vw, 1400px);
  max-height: calc(96vh - 88px);
  margin: 0 auto;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.45);
}
.dialog-copy h2 {
  margin: 0 0 8px;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.05em;
}
.dialog-copy > p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 16px;
}
.dialog-meta {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 14px;
}
.dialog-intro {
  color: var(--text);
  line-height: 1.75;
  font-size: 15px;
}
.dialog-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.dialog-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  color: white;
  background: var(--red);
}
.dialog-link:hover { filter: brightness(1.04); }
@media (max-width: 980px) {
  .search-panel {
    right: 64px;
  }
  .cover-wall { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .dialog-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .search-toggle {
    top: 10px;
    right: 10px;
  }
  .search-panel {
    top: 10px;
    left: 10px;
    right: 62px;
    padding: 10px;
    border-radius: 16px;
  }
  .search-form {
    grid-template-columns: 1fr;
  }
  .cover-wall { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .dialog-layout { padding: 0 16px 16px; }
  .dialog-copy h2 { font-size: 30px; }
  .image-zoom-overlay {
    padding: 56px 12px 12px;
  }
  .zoomed-cover-image {
    max-height: calc(100vh - 76px);
  }
}
