:root {
  color-scheme: dark;
  --bg: #f9f9f9;
  --text: #111111;
  --muted: rgba(17, 17, 17, 0.65);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.font-serif {
  font-family: 'Cormorant Garamond', serif;
}

.slider-labels {
  justify-content: center;
  gap: clamp(0.75rem, 2vw, 2.4rem);
}

.category-trigger {
  position: relative;
  z-index: 2;
  padding: 0.55rem 0.95rem;
  white-space: nowrap;
  min-height: 2.75rem;
  font-size: clamp(0.7rem, 0.95vw, 0.85rem);
  color: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.category-trigger:hover,
.category-trigger:focus-visible {
  color: white;
  background: rgba(18, 18, 18, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.category-trigger.is-active {
  color: white;
  background: rgba(24, 24, 24, 0.32);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

#slider-track {
  position: relative;
  height: 2.5rem;
  width: min(100%, 34rem);
  margin: 0 auto;
}

#slider-handle {
  left: 50%;
  z-index: 3;
  touch-action: none;
  transition: left 0.45s var(--ease), transform 0.2s ease;
}

#slider-handle:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(0.96);
}

.transition-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.transition-overlay.is-active {
  opacity: 1;
  pointer-events: all;
}

.transition-panel {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: #111111;
  transition: transform 0.8s var(--ease);
}

.transition-panel-left {
  left: 0;
  transform: translateX(-100%);
}

.transition-panel-right {
  right: 0;
  transform: translateX(100%);
}

.transition-overlay.is-active .transition-panel-left,
.transition-overlay.is-active .transition-panel-right {
  transform: translateX(0);
}

.gallery-panels {
  position: relative;
}

.gallery-panel {
  display: none;
  animation: fadeUp 0.55s var(--ease);
}

.gallery-panel.is-active {
  display: block;
}

.gallery-grid {
  columns: 1;
  column-gap: 1rem;
}

.gallery-card {
  display: block;
  margin-bottom: 1rem;
  overflow: hidden;
  border-radius: 1.2rem;
  background: #f2f2f2;
  break-inside: avoid;
  transform: translateY(0);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 45px rgba(17, 17, 17, 0.12);
}

.gallery-card img {
  aspect-ratio: 4 / 5;
  transition: transform 0.6s var(--ease);
}

.gallery-card:hover img {
  transform: scale(1.03);
}

.gallery-card.tall img {
  aspect-ratio: 3 / 5;
}

.gallery-card.wide img {
  aspect-ratio: 5 / 3;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.album-section {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 1.4rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(247, 247, 247, 0.75));
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 72rem;
  margin-inline: auto;
  justify-content: center;
}

.album-grid-cars {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.album-grid-portraits {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.album-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.album-cover {
  position: relative;
  overflow: hidden;
  border-radius: 1.1rem;
  aspect-ratio: 4 / 5;
  background: #ececec;
  box-shadow: 0 12px 30px rgba(17, 17, 17, 0.08);
}

.album-cover img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  filter: grayscale(1);
  transform: scale(1);
  transition: transform 0.55s var(--ease), filter 0.55s var(--ease);
}

.album-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0.72) 100%);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.album-overlay span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #ffffff;
}

.album-card:hover .album-cover img,
.album-card:focus-visible .album-cover img {
  transform: scale(1.04);
  filter: grayscale(0);
}

.album-card:hover .album-overlay,
.album-card:focus-visible .album-overlay {
  opacity: 1;
}

.album-label {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(17, 17, 17, 0.8);
  transition: color 0.25s ease;
}

.album-card:hover .album-label,
.album-card:focus-visible .album-label {
  color: #111111;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(8, 8, 8, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: min(90vw, 1100px);
  max-height: 82vh;
  object-fit: contain;
  border-radius: 1.25rem;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.35);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: none;
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 999px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.lightbox-close {
  top: 1.5rem;
  right: 1.5rem;
}

.lightbox-prev {
  left: 1.5rem;
}

.lightbox-next {
  right: 1.5rem;
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .slider-labels {
    align-items: stretch;
  }

  #slider-track {
    display: none;
  }

  .category-trigger {
    justify-content: center;
    text-align: center;
  }

  .lightbox-close {
    top: 0.75rem;
    right: 0.75rem;
  }

  .lightbox-prev {
    left: 0.75rem;
  }

  .lightbox-next {
    right: 0.75rem;
  }
}

@media (min-width: 640px) {
  .gallery-grid {
    columns: 2;
  }

  .album-grid-cars {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .album-grid-cars .album-card:nth-child(9) {
    grid-column: 2;
  }

  .album-grid-cars .album-card:nth-child(10) {
    grid-column: 3;
  }

  .album-grid-portraits {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    columns: 3;
  }

  .album-grid-cars {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .album-grid-portraits {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
