:root {
  --bg: #0b0b0b;
  --fg: #f2f2f2;
  --muted: #666;
  --gap: 8px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;

  background: var(--bg);
  color: var(--fg);

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Helvetica Neue",
    Arial,
    sans-serif;

  -webkit-font-smoothing: antialiased;
}


/* Header */

.header {
  padding: 38px 4vw 42px;
}

.logo {
  color: var(--fg);

  text-decoration: none;

  font-size: 12px;
  font-weight: 500;

  letter-spacing: .25em;
}

.albums {
  display: flex;

  gap: 24px;

  margin-top: 32px;

  overflow-x: auto;

  scrollbar-width: none;
}

.albums::-webkit-scrollbar {
  display: none;
}

.album {
  padding: 0;

  border: 0;

  background: none;

  color: var(--muted);

  font: inherit;
  font-size: 11px;

  letter-spacing: .08em;

  white-space: nowrap;

  cursor: pointer;

  transition: color .25s ease;
}

.album:hover,
.album.active {
  color: var(--fg);
}


/* Gallery */

.gallery {
  display: grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: var(--gap);

  align-items: start;

  padding:
    0
    2vw
    5vw;
}


/*
   Masonry column
*/

.gallery-column {
  display: flex;

  flex-direction: column;

  gap: var(--gap);

  min-width: 0;
}


/*
   Photo

   The image keeps its original
   aspect ratio.
*/

.photo {
  display: block;

  width: 100%;

  overflow: hidden;

  background: #111;

  cursor: zoom-in;

  text-decoration: none;
}

.photo img {
  display: block;

  width: 100%;
  height: auto;

  opacity: 0;

  transition:
    opacity .6s ease,
    transform .7s cubic-bezier(.2,.7,.2,1);
}

.photo.loaded img {
  opacity: 1;
}

.photo:hover img {
  transform: scale(1.015);
}


/* Loading */

.loading {
  position: fixed;

  inset: 0;

  z-index: 50;

  display: flex;

  align-items: center;
  justify-content: center;

  pointer-events: none;

  opacity: 1;

  transition: opacity .3s ease;
}

.loading.hidden {
  opacity: 0;
}

.loading-dot {
  width: 16px;
  height: 16px;

  border:
    1px solid #444;

  border-top-color:
    #fff;

  border-radius: 50%;

  animation:
    spin .8s linear infinite;
}

@keyframes spin {

  to {
    transform: rotate(360deg);
  }

}


/* Lightbox */

.lightbox {
  position: fixed;

  inset: 0;

  z-index: 100;

  display: flex;

  align-items: center;
  justify-content: center;

  background:
    rgba(0,0,0,.96);

  opacity: 0;
  visibility: hidden;

  transition:
    opacity .3s ease,
    visibility .3s ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-image {
  max-width: 92vw;
  max-height: 92vh;

  object-fit: contain;

  user-select: none;

  -webkit-user-drag: none;
}

.lightbox button {
  position: fixed;

  z-index: 2;

  border: 0;

  background: transparent;

  color: white;

  cursor: pointer;

  opacity: .6;

  transition: opacity .2s ease;
}

.lightbox button:hover {
  opacity: 1;
}

.lightbox-close {
  top: 22px;
  right: 28px;

  font-size: 34px;
}

.lightbox-nav {
  top: 50%;

  transform:
    translateY(-50%);

  padding: 24px;

  font-size: 58px;
}

.lightbox-nav.previous {
  left: 8px;
}

.lightbox-nav.next {
  right: 8px;
}


/* Tablet */

@media (max-width: 1100px) {

  .gallery {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }

}


/* Mobile */

@media (max-width: 700px) {

  .header {
    padding:
      28px
      20px
      30px;
  }

  .albums {
    margin-top: 28px;

    gap: 18px;
  }

  .gallery {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 4px;

    padding:
      0
      6px
      30px;
  }

  .gallery-column {
    gap: 4px;
  }

  .lightbox-nav {
    display: none;
  }

  .lightbox-image {
    max-width: 96vw;
    max-height: 90vh;
  }

}


/* Small mobile */

@media (max-width: 480px) {

  .gallery {
    grid-template-columns:
      1fr;
  }

}
