:root {
  --bg: #dfe6eb;
  --bg-soft: #eaeff2;
  --mat: #ece8df;
  --ink: #062b30;
  --ink-soft: #454e57;
  --ink-faint: #66707a;
  --line: #c1cad1;
  --accent: #3e5c76;
  --accent-ink: #f4f6f8;
  --overlay-bg: rgba(28, 32, 36, 0.92);
  font-family: 'Inter', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #232a30; --bg-soft: #2a323a; --mat: #30363d; --ink: #e8ebed;
    --ink-soft: #a7b0b8; --ink-faint: #8b95a0; --line: #3c454d;
    --accent: #8fb2cf; --accent-ink: #1c2226; --overlay-bg: rgba(10,12,14,.94);
  }
}
:root[data-theme="dark"] {
  --bg: #232a30; --bg-soft: #2a323a; --mat: #30363d; --ink: #e8ebed;
  --ink-soft: #a7b0b8; --ink-faint: #8b95a0; --line: #3c454d;
  --accent: #8fb2cf; --accent-ink: #1c2226; --overlay-bg: rgba(10,12,14,.94);
}
* { box-sizing: border-box; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--bg); border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
}
.site-title {
  font-family: 'Fraunces', serif; font-weight: 500; font-size: 1.4rem;
  letter-spacing: -0.01em; white-space: nowrap;
}
.header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn {
  font-family: inherit; font-size: 0.82rem; color: var(--ink-soft);
  background: transparent; border: 1px solid var(--line); border-radius: 3px;
  padding: 6px 11px; cursor: pointer; line-height: 1;
}
.btn:hover { border-color: var(--ink-faint); color: var(--ink); }
.btn.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.view-toggle { display: flex; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.view-toggle button {
  font-family: inherit; font-size: 0.78rem; color: var(--ink-soft); background: var(--bg-soft);
  border: none; padding: 6px 12px; cursor: pointer;
}
.view-toggle button.active { background: var(--accent); color: var(--accent-ink); }

nav.categories {
  display: flex; gap: 4px; padding: 10px 20px; overflow-x: auto;
  border-bottom: 1px solid var(--line); background: var(--bg-soft);
}
nav.categories button {
  font-family: 'Fraunces', serif; font-size: 0.95rem; white-space: nowrap;
  background: none; border: none; color: var(--ink-faint); cursor: pointer;
  padding: 4px 10px; border-radius: 3px;
}
nav.categories button.active { color: var(--ink); background: var(--mat); }

main { max-width: 1100px; margin: 0 auto; padding: 24px 20px 40px; }
.empty-msg { color: var(--ink-faint); font-size: 0.9rem; }

.band-stage {
  background: var(--mat); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  min-height: 260px; max-height: 62vh; overflow: hidden; padding: 16px;
}
.band-stage img { max-width: 100%; max-height: 58vh; width: auto; height: auto; object-fit: contain; display: block; }
.band-strip {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px; margin-top: 12px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.band-thumb {
  flex: 0 0 auto; width: 68px; height: 68px; border-radius: 3px; overflow: hidden;
  cursor: pointer; border: 2px solid transparent; background: var(--mat);
  scroll-snap-align: start; opacity: 0.6;
}
.band-thumb.active { border-color: var(--accent); opacity: 1; }
.band-thumb img, .grid-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.grid-wrap {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.grid-thumb {
  aspect-ratio: 1 / 1; border-radius: 3px; overflow: hidden; cursor: pointer;
  background: var(--mat); position: relative;
}
.grid-thumb::after {
  content: ""; position: absolute; inset: 0; background: rgba(0,0,0,0.06); opacity: 0;
  transition: opacity .15s;
}
.grid-thumb:hover::after { opacity: 1; }

.caption-zone {
  margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line);
  min-height: 1.4em; font-size: 0.9rem; color: var(--ink-soft); line-height: 1.5;
  max-width: 62ch;
}
.caption-zone .date { color: var(--ink-faint); font-size: 0.78rem; margin-right: 8px; }
.caption-zone.empty { color: var(--ink-faint); font-style: italic; }

.overlay {
  position: fixed; inset: 0; background: var(--overlay-bg); z-index: 50;
  display: none; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; padding-top: calc(24px + env(safe-area-inset-top,0px));
  padding-bottom: calc(24px + env(safe-area-inset-bottom,0px));
}
.overlay.open { display: flex; }
.overlay img { max-width: 100%; max-height: 70vh; object-fit: contain; cursor: zoom-out; }
.overlay .caption-zone {
  color: #d6dbdf; border-top-color: rgba(255,255,255,0.18); margin-top: 18px;
  text-align: center; max-width: 60ch;
}
.overlay .caption-zone .date { color: #93a0aa; }
.overlay-close {
  position: absolute; top: calc(16px + env(safe-area-inset-top,0px)); right: 18px;
  background: none; border: none; color: #d6dbdf; font-size: 1.6rem; cursor: pointer;
  width: 36px; height: 36px; line-height: 1;
}

.info-panel {
  position: fixed; inset: 0; background: var(--bg); z-index: 60;
  display: none; overflow-y: auto;
  padding: env(safe-area-inset-top,0px) 0 env(safe-area-inset-bottom,0px);
}
.info-panel.open { display: block; }
.info-inner { max-width: 62ch; margin: 0 auto; padding: 60px 24px; }
.info-inner h1 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 2rem; margin: 0 0 20px; }
.info-inner p { line-height: 1.7; color: var(--ink-soft); }
.info-close {
  position: fixed; top: calc(16px + env(safe-area-inset-top,0px)); right: 20px;
  background: none; border: 1px solid var(--line); border-radius: 3px;
  padding: 6px 12px; font-family: inherit; font-size: 0.82rem; color: var(--ink-soft); cursor: pointer;
}

@media (max-width: 560px) {
  .site-title { font-size: 1.2rem; }
  .band-stage { min-height: 200px; padding: 10px; }
  .grid-wrap { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
}