:root {
  --bg: #000000;
  --white: #ffffff;
  --muted: #666;
  --border: #222;
  --font: 'General Sans', -apple-system, sans-serif;
}

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

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--white);
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Back button */
.back-to-zlab {
  position: fixed;
  bottom: 48px;
  left: 24px;
  z-index: 9999;
  padding: 10px 20px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  color: #fff;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 100px;
  text-decoration: none;
  transition: background 0.3s;
}

.back-to-zlab:hover {
  background: rgba(255,255,255,0.15);
}

/* ========================================
   Sidebar
   ======================================== */

.sidebar {
  width: 50%;
  height: 100vh;
  background: var(--bg);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: fixed;
  left: 0;
  top: 0;
  border-right: 3px solid #ffffff;
}

.sidebar::-webkit-scrollbar { display: none; }

.sidebar-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0;
  padding: 40px 48px 20px;
  border-bottom: 3px solid #ffffff;
}

.logo {
  font-size: clamp(3rem, 5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.04em;
}

.nav-btns {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.pill-btn {
  display: inline-block;
  padding: 14px 32px;
  border: 3px solid #ffffff;
  border-radius: 100px;
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--white);
  transition: background 0.3s, border-color 0.3s;
}

.pill-btn:hover {
  background: rgba(255,255,255,0.06);
  border-color: #444;
}

.pill-btn.small {
  padding: 14px 32px;
  font-size: 1.75rem;
}

/* Sections */
.sidebar-sections {
  margin-top: 8px;
}

.section-block {
  border-bottom: 3px solid #ffffff;
  padding: 20px 48px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.section-title a {
  transition: opacity 0.3s;
}

.section-title a:hover {
  opacity: 0.6;
}

.toggle-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  color: var(--white);
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle-btn:hover {
  background: rgba(255,255,255,0.06);
}

/* Filter Tags */
.section-content {
  margin-top: 20px;
  max-height: 200px;
  overflow-y: auto;
  transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-content::-webkit-scrollbar {
  width: 4px;
}

.section-content::-webkit-scrollbar-track {
  background: transparent;
}

.section-content::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

.section-content::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.section-content.collapsed {
  max-height: 0 !important;
  margin-top: 0;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-block;
  padding: 14px 32px;
  border: 3px solid #ffffff;
  border-radius: 100px;
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--white);
  transition: background 0.3s, border-color 0.3s;
  white-space: nowrap;
}

.tag:hover {
  background: rgba(255,255,255,0.06);
  border-color: #ffffff;
}

.tag.active {
  background: var(--white);
  color: var(--bg);
  border-color: var(--white);
}

/* ========================================
   Gallery
   ======================================== */

.gallery {
  width: 50%;
  margin-left: 50%;
  height: 100vh;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.gallery::-webkit-scrollbar {
  width: 0;
}

.gallery-item {
  position: relative;
  cursor: pointer;
  border-bottom: 3px solid #ffffff;
}

.gallery-img {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.4s;
  background-size: cover;
  background-position: center;
}

.gallery-item:hover .gallery-img {
  filter: brightness(0.7);
}

/* Slideshow */
.slideshow {
  position: relative;
  overflow: hidden;
}

.slideshow .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  opacity: 0;
  transition: opacity 0.15s;
}

.slideshow .slide.active {
  opacity: 1;
}

.gallery-label {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 8px 18px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 100px;
  font-size: 0.813rem;
  font-weight: 400;
  color: var(--white);
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.gallery-item:hover .gallery-label {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Ticker
   ======================================== */

.ticker {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  overflow: hidden;
  z-index: 100;
}

.ticker-track {
  display: flex;
  gap: 0;
  animation: tickerScroll 30s linear infinite;
  white-space: nowrap;
}

.ticker-track span {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0 12px;
}

.ticker-track .sep {
  color: #333;
  padding: 0 4px;
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 900px) {
  body {
    flex-direction: column;
    overflow: auto;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 24px 20px;
  }

  .gallery {
    width: 100%;
    margin-left: 0;
    height: auto;
    overflow: visible;
  }

  .logo {
    font-size: 2.5rem;
  }

  .section-title {
    font-size: 2rem;
  }
}
