:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-light: #666;
  --color-border: #e0e0e0;
  --color-overlay: rgba(12, 12, 12, 0.95);
  --font-heading: 'Jost', sans-serif;
  --font-mono: 'Inconsolata', monospace;
  --grid-gap: 24px;
  --grid-columns: 3;
  --page-padding: 48px;
}

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

body {
  font-family: var(--font-mono);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Header --- */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 32px var(--page-padding);
  max-width: 1400px;
  margin: 0 auto;
}

.site-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-text);
}

.site-nav {
  display: flex;
  gap: 32px;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--color-text-light);
  letter-spacing: 0.03em;
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link--active {
  color: var(--color-text);
}

/* --- Carousel --- */

.carousel {
  padding: 0 var(--page-padding) 48px;
  max-width: 1400px;
  margin: 0 auto;
}

.carousel-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.carousel-image-wrap {
  flex: 1;
  max-width: 900px;
  display: flex;
  justify-content: center;
}

.carousel-img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.carousel-nav {
  background: none;
  border: none;
  color: var(--color-text-light);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 16px;
  transition: color 0.2s;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.carousel-nav:hover {
  color: var(--color-text);
}

.carousel-info {
  text-align: center;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text-light);
  letter-spacing: 0.02em;
}

/* --- Browse Section --- */

.browse-section {
  padding: 0 var(--page-padding) 64px;
  max-width: 1400px;
  margin: 0 auto;
}

/* --- Breadcrumb --- */

.breadcrumb {
  margin-bottom: 24px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-light);
}

.breadcrumb-link {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-light);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumb-link:hover {
  color: var(--color-text);
}

.breadcrumb-sep {
  margin: 0 4px;
}

.breadcrumb-current {
  color: var(--color-text);
}

/* --- Browse Tiles (Ebene 1 + 2) --- */

.browse-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}

.browse-tile {
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s;
}

.browse-tile:hover {
  transform: scale(1.01);
}

.browse-tile:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

.browse-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e0e0e0;
}

.browse-tile-info {
  padding: 12px 0;
}

.browse-tile-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-text);
}

.browse-tile-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-text-light);
  margin-top: 2px;
}

/* --- Browse Grid (Ebene 3) --- */

.browse-grid {
  columns: var(--grid-columns);
  column-gap: var(--grid-gap);
}

.grid-item {
  break-inside: avoid;
  margin-bottom: var(--grid-gap);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s;
}

.grid-item img {
  display: block;
  width: 100%;
  height: auto;
  background: #e0e0e0;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.3s;
}

.grid-item:hover .grid-overlay {
  opacity: 1;
}

.grid-item:hover {
  transform: scale(1.02);
}

.grid-overlay-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #fff;
}

.grid-empty {
  column-span: all;
  text-align: center;
  padding: 80px 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--color-text-light);
}

/* --- Lightbox --- */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--color-overlay);
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox.open {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s;
  font-family: var(--font-mono);
  z-index: 10;
}

.lightbox-close:hover {
  color: #fff;
}

.lightbox-zoom-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  max-height: 75vh;
  max-width: 85vw;
}

.lightbox-img {
  max-height: 75vh;
  max-width: 85vw;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

.lightbox-img.zoomed {
  max-height: none;
  max-width: none;
  transform: scale(2);
  cursor: zoom-out;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 2rem;
  cursor: pointer;
  padding: 16px;
  transition: color 0.2s;
  font-family: var(--font-mono);
  z-index: 10;
}

.lightbox-nav:hover {
  color: #fff;
}

.lightbox-nav:disabled {
  opacity: 0.2;
  cursor: default;
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

.lightbox-meta {
  text-align: center;
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
}

.lightbox-counter {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 8px;
}

/* --- Footer --- */

.site-footer {
  text-align: center;
  padding: 48px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-text-light);
}

/* --- About --- */

.about {
  padding: 48px;
  max-width: 700px;
  margin: 0 auto;
}

.about h1 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  margin-bottom: 32px;
}

.about p {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--color-text-light);
  margin-bottom: 16px;
}

/* --- Responsive --- */

@media (max-width: 1024px) {
  :root {
    --grid-columns: 3;
    --grid-gap: 16px;
    --page-padding: 24px;
  }

  .browse-tiles {
    grid-template-columns: repeat(3, 1fr);
  }

  .about {
    padding: 32px 24px;
  }

  .site-footer {
    padding: 32px 24px;
  }
}

@media (max-width: 600px) {
  :root {
    --grid-columns: 2;
    --page-padding: 16px;
  }

  .site-name {
    font-size: 1rem;
  }

  .site-nav {
    gap: 20px;
  }

  .browse-tiles {
    grid-template-columns: repeat(2, 1fr);
  }

  .carousel-nav {
    font-size: 1.2rem;
    padding: 8px;
  }

  .lightbox-nav {
    font-size: 1.5rem;
    padding: 12px;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }
}
