*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:        #141412;
  --surface:   #1e1d1a;
  --surface2:  #272522;
  --border:    #333129;
  --tab-text:  #8a8377;
  --tab-active-text: #d4c9bc;
  --accent:    #7a6a58;
  --accent-hi: #a08870;
  --text-dim:  #5a5550;
  --tab-h:     48px;
  --scroll-btn-w: 48px;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--tab-active-text);
  font-family: 'Georgia', serif;
}

/* ── Tab bar ── */

.tabs-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: var(--tab-h);
  z-index: 10;
  display: flex;
  align-items: flex-end;
  padding: 0 4px;
  pointer-events: none;
}

.tabs {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  pointer-events: all;
}

.tab {
  height: 38px;
  padding: 0 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  color: var(--tab-text);
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  position: relative;
  bottom: 0;
}

.tab:hover {
  background: var(--surface2);
  color: var(--tab-active-text);
}

.tab.active {
  background: var(--surface2);
  color: var(--tab-active-text);
  border-color: var(--accent);
  height: 42px;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--surface2);
}

/* ── Gallery viewport ── */

.gallery-viewport {
  position: fixed;
  top: var(--tab-h);
  left: 0;
  right: 0;
  bottom: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  background: var(--bg);
  scroll-snap-type: x mandatory;
}

.gallery-viewport::-webkit-scrollbar {
  height: 6px;
}
.gallery-viewport::-webkit-scrollbar-track {
  background: transparent;
}
.gallery-viewport::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.gallery-track {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 24px 32px;
  gap: 20px;
  width: max-content;
  min-width: 100%;
}

/* ── Images ── */

.gallery-item {
  flex: 0 0 auto;
  height: calc(100% - 16px);
  max-height: 100%;
  display: flex;
  align-items: center;
  scroll-snap-align: start;
}

.gallery-item img {
  height: 100%;
  width: auto;
  max-width: 90vw;
  object-fit: contain;
  border-radius: 3px;
  border: 1px solid var(--border);
  display: block;
  cursor: zoom-in;
  transition: border-color 0.2s, transform 0.2s;
}

.gallery-item img:hover {
  border-color: var(--accent-hi);
  transform: scale(1.01);
}

/* ── Empty state ── */

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 14px;
  letter-spacing: 0.03em;
}

.empty-state code {
  background: var(--surface2);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 13px;
}

/* ── Scroll buttons ── */

.scroll-btn {
  position: fixed;
  top: calc(var(--tab-h) + 50%);
  transform: translateY(-50%);
  width: var(--scroll-btn-w);
  height: 72px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--tab-text);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  transition: background 0.15s, color 0.15s, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-btn:hover {
  background: var(--surface);
  color: var(--tab-active-text);
}

.scroll-btn.hidden {
  opacity: 0;
  pointer-events: none;
}

.scroll-left {
  left: 8px;
}

.scroll-right {
  right: 8px;
}

/* ── Lightbox ── */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 9, 8, 0.92);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox img {
  max-width: 94vw;
  max-height: 94vh;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.7);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: var(--tab-text);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}
.lightbox-close:hover {
  color: var(--tab-active-text);
}
