*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: "Inter", sans-serif;
}

body {
  -webkit-font-smoothing: antialiased;
  background: #000;
}

.gallery {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 100svh;
  overflow: hidden;
  background: #000;
}

.slides {
  position: absolute;
  inset: 0;
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(70px, 9vh, 110px) 24px clamp(35px, 6vh, 70px);
  visibility: hidden;
  pointer-events: none;
}

.slide.active {
  visibility: visible;
  pointer-events: auto;
}

.counter {
  position: fixed;
  top: 28px;
  right: 34px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.55);
}

.counter #current {
  color: #fff;
}

.separator {
  opacity: 0.35;
}

.title-wrap {
  position: relative;
  z-index: 5;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: clamp(18px, 3vh, 32px);
  overflow: visible;
  flex-shrink: 0;
  perspective: 700px;
  text-align: center;
}

.title-wrap .number {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.38);
}

.title-wrap h1 {
  font-size: clamp(26px, 4vw, 52px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.045em;
  white-space: nowrap;
  text-align: center;
}

.title-wrap .char {
  display: inline-block;
  will-change: transform, opacity;
}

.image-wrapper {
  position: relative;
  width: min(1200px, 100%);
  height: min(68dvh, 720px);
  min-height: 240px;
  overflow: visible;
  background: transparent;
  cursor: zoom-in;
  flex-shrink: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-wrapper img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  transform-origin: center center;
  will-change: transform, opacity;
  user-select: none;
  -webkit-user-drag: none;
}

.image-shine {
  display: none;
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
}

.viewer.open {
  visibility: visible;
  pointer-events: auto;
}

.viewer-backdrop {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  backdrop-filter: blur(18px);
}

.viewer-content {
  position: relative;
  z-index: 2;
  width: min(94vw, 1500px);
  height: min(88vh, 900px);
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform, opacity;
}

.viewer-content img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
}

.viewer-close {
  position: absolute;
  top: 28px;
  right: 32px;
  z-index: 5;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.viewer-close span {
  position: absolute;
  left: 8px;
  top: 20px;
  width: 26px;
  height: 1px;
  background: #fff;
}

.viewer-close span:first-child {
  transform: rotate(45deg);
}

.viewer-close span:last-child {
  transform: rotate(-45deg);
}

.viewer-counter {
  position: absolute;
  bottom: 28px;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.6);
}

.viewer-counter span:first-child {
  color: #fff;
}

@media (max-width: 700px) {
  .counter {
    top: 20px;
    right: 20px;
  }

  .slide {
    padding: 68px 16px 28px;
  }

  .title-wrap {
    gap: 9px;
    margin-bottom: 16px;
  }

  .title-wrap h1 {
    font-size: clamp(24px, 8vw, 38px);
  }

  .image-wrapper {
    width: 100%;
    height: min(65dvh, 600px);
  }

  .viewer-close {
    top: 18px;
    right: 18px;
  }

  .viewer-content {
    width: 94vw;
    height: 82vh;
  }
}

@media (max-height: 600px) and (orientation: landscape) {
  .slide {
    padding-top: 48px;
    padding-bottom: 18px;
  }

  .title-wrap {
    margin-bottom: 10px;
  }

  .title-wrap h1 {
    font-size: 25px;
  }

  .image-wrapper {
    height: 72dvh;
  }
}

@media (max-width: 380px) {
  .slide {
    padding-left: 12px;
    padding-right: 12px;
  }

  .title-wrap h1 {
    font-size: 23px;
  }

  .title-wrap .number {
    font-size: 9px;
  }
}