@font-face {
  font-family: "Pretendard";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local("Pretendard Regular"),
       url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/woff2/Pretendard-Regular.woff2") format("woff2");
}

:root {
  --bg: #fff;
  --fg: #000;
  --muted: #8a8a8a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Pretendard", sans-serif;
  font-weight: 400;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

header h1 {
  position: fixed;
  top: 16px;
  left: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  color: #fff;
  font-size: 15pt;
  font-weight: 400;
  line-height: 1;
  text-align: center;
  pointer-events: auto;
}

header h1 button {
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}

.grid {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin: 0 0 33vh;
  padding: 0;
  font-size: 0;
  line-height: 0;
}

.grid::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  height: 33vh;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.18) 28%,
    rgba(255, 255, 255, 0.68) 72%,
    #fff 100%
  );
  pointer-events: none;
}

.grid figure {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: visible;
  filter: blur(24px) saturate(1.7) brightness(1.2);
  transform: scale(1.06);
  transform-origin: center;
  mix-blend-mode: multiply;
  opacity: 0.94;
  transition: filter 1s ease, transform 1s ease, opacity 1s ease;
  cursor: zoom-in;
}

.grid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.grid figure:hover {
  z-index: 1;
  filter: blur(0) saturate(1) brightness(1);
  transform: scale(1);
  mix-blend-mode: normal;
  opacity: 1;
}

footer {
  position: fixed;
  right: 16px;
  left: 16px;
  bottom: 16px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1;
  transition: color 0.2s ease;
  pointer-events: auto;
}

footer.over-gallery {
  color: #fff;
}

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

.footer-mail {
  text-align: left;
}

.footer-copyright {
  text-align: right;
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px 24px 64px;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: calc(100% - 40px);
  object-fit: contain;
}

.lightbox-caption {
  position: absolute;
  right: 24px;
  bottom: 16px;
  left: 24px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.35;
  text-align: center;
}

.lightbox .close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.lightbox .close::before,
.lightbox .close::after {
  content: "";
  position: absolute;
  top: 15.5px;
  left: 5px;
  width: 22px;
  height: 1px;
  background: #000;
}

.lightbox .close::before {
  transform: rotate(45deg);
}

.lightbox .close::after {
  transform: rotate(-45deg);
}


@media (max-width: 768px) and (hover: none),
       (max-width: 768px) and (pointer: coarse) {
  footer {
    right: 16px;
    left: 16px;
    bottom: 14px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
  }

  .footer-mail,
  .footer-copyright {
    text-align: center;
  }

  .grid figure:hover {
    z-index: auto;
    filter: blur(24px) saturate(1.7) brightness(1.2);
    transform: scale(1.06);
    mix-blend-mode: multiply;
    opacity: 0.94;
  }

  body.mobile-sequence .grid figure {
    transition:
      filter 0.5s ease,
      transform 0.5s ease,
      opacity 0.5s ease;
  }

  body.mobile-sequence .grid figure.mobile-clear {
    z-index: 1;
    filter: blur(0) saturate(1) brightness(1);
    transform: scale(1);
    mix-blend-mode: normal;
    opacity: 1;
  }

  body.mobile-complete .grid figure,
  body.mobile-complete .grid figure:hover {
    z-index: auto;
    filter: none;
    transform: scale(1);
    mix-blend-mode: normal;
    opacity: 1;
    transition:
      filter 0.5s ease,
      transform 0.5s ease,
      opacity 0.5s ease;
  }

  body.effects-disabled .grid figure,
  body.effects-disabled .grid figure:hover {
    filter: none;
    transform: none;
    mix-blend-mode: normal;
    opacity: 1;
    transition: none;
  }
}
