.main-area{
    padding: 5.41vw 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100vh);
    transition: height 600ms ease;

}
.main-area h3{
    font-size: 2.08vw;
    font-weight: 700;
    margin-bottom: 1.25vw;
}

.main-area .filters{
  width: 100%;
  border-top: 1px solid rgba(0, 0, 0, 0.10);
  border-bottom: 1px solid rgba(0, 0, 0, 0.10);
  margin-bottom: 1.25vw;
  z-index: 1;
}

.main-area .filters__desktop{
  width: 100%;
  display: flex;
  gap: 0.83vw;
  padding: 1.25vw 2.08vw;
}

.main-area .filters__desktop .filter{
  font-size: 0.833vw;
  line-height: 100%;
  color: rgba(0, 0, 0, 0.60);
  transition: color 0.6s;
  cursor: pointer;
}
.main-area .filters__desktop .filter:hover{
  color: rgba(0, 0, 0, 1);
}
.main-area .filters__desktop .filter.active{
  font-weight: 700;
  color: #000;
}

.main-area .filters__mobile{ display:none; }

@media (max-width: 1201px){
  .main-area{
    padding: 0 0 5.36vw;
  }
  .main-area h3{
    font-size: 5.36vw;
    line-height: 1.2;
    margin-top: 13.95vw;
    margin-bottom: 5.36vw;
    transition:
      margin 280ms ease,
      opacity 220ms ease,
      transform 280ms ease;
  }
   .main-area:has(.filters__dd[open]) h3{
    margin-top: 0;
    margin-bottom: 0;
    opacity: 0;
    transform: translateY(-1.6vw);
    pointer-events: none;
  }
  .main-area .filters{
    margin-bottom: 5.36vw;
  }

  .main-area .filters__desktop{ display:none; }
  .main-area .filters__mobile{
    display: block;

    opacity: 0;
    transform: translateY(-1.2vw);
    transition: opacity 260ms ease, transform 260ms ease;
  }
  body.is-ready .main-area .filters__mobile{
    opacity: 1;
    transform: translateY(0);
  }

  .main-area .filters__dd{
    position: relative;
    padding: 0 2.14vw;
  }

  .main-area .filters__summary{
    list-style: none;
    display:flex;
    align-items:center;
    justify-content: space-between;
    height: 6.44vw;      
    cursor: pointer;
    user-select: none;
  }
  .main-area .filters__summary::-webkit-details-marker{ display:none; }

  .main-area .filters__summaryText{
    font-size: 2.14vw;
    font-weight: 700;
    color: #000;
  }

  .main-area .filters__chev{
    width: 2.8vw;
    height: 2.8vw;
    background-color: #000;
    -webkit-mask: url('/img/icn_arrow.svg') no-repeat center;
    mask: url('/img/icn_arrow.svg') no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
    transform: rotate(180deg);
    transition: transform 0.2s ease;
  }
  .main-area details[open] .filters__chev{
    transform: rotate(0deg);
  }

  .main-area .filters__panel{
    position: fixed;
    left: 0;
    right: 0;
    top: 6.44vw;   
    background: #fff;
    padding: 0 2.14vw 2.14vw;
    display: flex;
    flex-direction: column;
    gap: 2.14vw;
    z-index: 10000; 
  }

  .main-area .filters__opt{
    text-align: left;
    padding: 0 0;
    border: 0;
    background: transparent;
    cursor: pointer;

    font-size: 2.14vw;
    color: rgba(0,0,0,0.60);
  }
  .main-area .filters__opt.active{
    color: #E06E64;
    font-weight: 700;
  }
}

@media (max-width: 744px){
  .main-area{
    padding: 0 0 21.33vw;
  }
  .main-area h3{
    font-size: 10.66vw;
    margin-top: 27.73vw;
    margin-bottom: 10.66vw;
  }

  .main-area .filters{
    margin-bottom: 6.4vw;
  }

  .main-area .filters__dd{
    padding: 0 4.26vw;
  }

  .main-area .filters__summary{
    height: 12.8vw;      
  }

  .main-area .filters__summaryText{
    font-size: 4.26vw;
  }

  .main-area .filters__chev{
    width: 4.26vw;
    height:  4.26vw;
  }

  .main-area .filters__panel{
    top: 17.06vw;   
    padding: 0 4.26vw 4.26vw;
    gap: 4.26vw;
  }

  .main-area .filters__opt{
    font-size: 4.26vw;
  }
}


.portfolio-grid {
  width: 100%;
  padding: 0 2.08vw;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));

  column-gap: 0.83vw;
  row-gap: calc(0.83vw / 2);

  grid-auto-rows: 8px;
  grid-auto-flow: row dense;
  transition: opacity 600ms ease, transform 600ms ease;
}

.portfolio-grid.is-filtering {
  opacity: 0;
  transform: translateY(8px);
}

.portfolio-grid > *{
  margin: 0;
  display: block;
}

/* 이미지가 있으면 폭 맞추기 */
.portfolio-grid img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 0; 
}

.portfolio-item a{
  display: block;
  text-decoration: none;
  color: inherit;
}

.portfolio-item img{
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 10px;

  opacity: 0;
  transition: opacity 600ms ease;
}

.portfolio-item.is-loading{
  background: #f3f4f6;
}


.portfolio-item.is-loading::before{
  content: "";
  position: absolute;
  inset: 0;

  background: linear-gradient(
    90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.55) 30%,
    rgba(255,255,255,0.95) 50%,
    rgba(255,255,255,0.55) 70%,
    rgba(255,255,255,0) 100%
  );
  background-size: 220% 100%;
  animation: portfolioShimmer 1.15s ease-in-out infinite;

  opacity: 0.9;
}

.portfolio-item.is-loaded > img {
  opacity: 1;
}

.portfolio-item.is-loaded::before {
  /* animation: none; */
  opacity: 0;
  transition: opacity 600ms ease;

  transition: opacity 700ms ease;
  transition-delay: 300ms;
}

@keyframes portfolioShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.portfolio-meta{
  padding: 0.83vw 0 1.25vw;
}

.portfolio-title{
  font-size: 1.04vw;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.31vw;
}

.portfolio-sub{
  font-size: 0.83vw;
  color: #777;
  line-height: 1.4;
}


/* Masonry 아이템 애니메이션 기본 상태 */
.portfolio-item {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 600ms ease,
    transform 600ms ease,
    background-color 600ms ease;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
}

/* 필터링으로 숨길 때: 부드럽게 페이드아웃 + 살짝 아래로 */
.portfolio-item.is-filtered-out {
  opacity: 0;
  transform: translateY(10px);
}

/* 진짜로 레이아웃에서 제거할 때 */
.portfolio-item[hidden] {
  display: none;
}




@media (max-width: 1201px){

    .portfolio-grid {
      padding: 0 2.14vw;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    
      column-gap: 2.14vw;
      row-gap: 1.07vw;
    
      grid-auto-rows: 2px;
    }
}

@media (max-width: 744px){

    .portfolio-grid {
      padding: 0 4.26vw;
      grid-template-columns: repeat(1, minmax(0, 1fr));
    
      column-gap: 4.26vw;
      row-gap: 2.13vw;
    
      grid-auto-rows: 2px;
    }
}










body.is-layer-open {
  overflow: hidden;
}

.portfolio-layer {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;

  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms ease;
  z-index: 100000;
  background: white;
  overflow-y: auto;
  align-items: flex-start
}

.portfolio-layer .close{
  position: absolute;
  left: 1.25vw;
  top: 4.58vw;
  width: 1.25vw;
  height: 1.25vw;
  z-index: 100001;
  cursor: pointer;
}
.portfolio-layer .close img{
  width: 100%;
  height: 100%;
} 

.portfolio-layer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.portfolio-layer__dialog {
  width: 100%;
  position: relative;
  max-width: 100vw;
  background: #fff;

  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 600ms ease, transform 600ms ease;
}

.portfolio-layer.is-open .portfolio-layer__dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.portfolio-layer__content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh);
  transition: opacity 600ms ease;
  opacity: 1;
}

.portfolio-layer__content.is-switching{
  opacity: 0;
}

.portfolio-layer .prev{
  font-size: 0.833vw;
  font-weight: bold;
  line-height: 140%;
  position: absolute;
  left: 4.16vw;
  top: 26.66vw;
  display: flex;
  align-items: center;
}
.portfolio-layer .prev::before{
  content: ""; 
  display: inline-block;
  width: 1.25vw;
  height: 1.25vw;
  background-color: black;       
  -webkit-mask: url('/img/icn_arrow_prev.svg') no-repeat center;
  mask: url('/img/icn_arrow_prev.svg') no-repeat center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: background-color 0.25s ease-in-out;
  margin-right: 0.41vw;
  opacity: 1 !important;
}

.portfolio-layer .next{
  font-size: 0.833vw;
  font-weight: bold;
  line-height: 140%;
  position: absolute;
  right: 4.16vw;
  top: 26.66vw;
  display: flex;
  align-items: center;
}

.portfolio-layer .next::after{
  content: ""; 
  display: inline-block;
  width: 1.25vw;
  height: 1.25vw;
  background-color: black;       
  -webkit-mask: url('/img/icn_arrow_next.svg') no-repeat center;
  mask: url('/img/icn_arrow_next.svg') no-repeat center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: background-color 0.25s ease-in-out;
  margin-left: 0.41vw;
  opacity: 1 !important;
}


.portfolio-layer__content h3{
  font-size: 1.875vw;
  font-weight: 700;
  text-transform: uppercase;
  padding: 5.416vw 0 2.08vw;
}

.portfolio-layer__content  .portfolio-layer__image-area{
  display: flex;
  gap: 0.833vw;
  margin-bottom: 1.04vw;
}
.portfolio-layer__content .portfolio-layer__image{
  width: 43.75vw;
  flex-shrink: 0;
  overflow: hidden;        
  border-radius: 10px;
  transition: height 600ms ease;
  height: 0px;
}

.portfolio-layer__content .portfolio-layer__image > img{
  width: 100%;
  /* height: 100%; */
  display: block;

  /* object-fit: cover;          */
  object-position: 50% 50%;  

  opacity: 1;
  transition: opacity var(--main-xfade-ms, 320ms) cubic-bezier(0.2, 0, 0, 1);
  user-select: none;
  -webkit-user-drag: none;
  cursor: grab;
  border-radius: 10px;
}
.portfolio-layer__content .portfolio-layer__image.is-fading > img{
  opacity: 0;
}

.portfolio-layer__content .portfolio-layer__image-sub-area{
  display: flex;
  flex-direction: column;
  gap: 0.833vw;

  height: 25.2vw;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;

  -ms-overflow-style: none; 
  scrollbar-width: none;   
  position: absolute;
    right: -5vw;
}

.portfolio-layer__content .portfolio-layer__image-sub-area .thumb{
  width: 4.16vw;
  height: 4.16vw;          

  padding: 0;
  border: 0;
  margin: 0;
  background: transparent;

  border-radius: 10px;
  overflow: hidden;        

  display: block;          
  line-height: 0;          
  font-size: 0;            

  flex: 0 0 auto;          

  opacity: 0.4;
  transition: opacity 600ms ease;
  cursor: pointer;
  background-color: #f3f4f6;
}

.portfolio-layer__content .portfolio-layer__image-sub-area .thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;      
  display: block;
  opacity: 0;
  transition: opacity 600ms ease;
}

.portfolio-layer__content .portfolio-layer__image-sub-area .thumb.is-loaded > img{
  opacity: 1;
}

.portfolio-layer__content .portfolio-layer__image-sub-area .thumb.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.55) 30%,
    rgba(255,255,255,0.95) 50%,
    rgba(255,255,255,0.55) 70%,
    rgba(255,255,255,0) 100%
  );
  background-size: 220% 100%;
  animation: portfolioThumbShimmer 1.15s ease-in-out infinite;
  opacity: 0.9;
  pointer-events: none;
}

.portfolio-layer__content .portfolio-layer__image-sub-area .thumb.is-loaded img {
  opacity: 1;
}

.portfolio-layer__content .portfolio-layer__image-sub-area .thumb.is-loaded::before {
  opacity: 0;
  transition: opacity 700ms ease;
  transition-delay: 200ms;
}

/* 기존 keyframes와 충돌 없게 별도 이름 */
@keyframes portfolioThumbShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.portfolio-layer__content .portfolio-layer__image-sub-area .thumb.active,
.portfolio-layer__content .portfolio-layer__image-sub-area .thumb:hover{
  opacity: 1;
}

.portfolio-layer__content .description{
  display: flex;
  flex-direction: column;
  gap: 0.416vw;
  padding-bottom: 2.08vw;
  font-size: 0.729vw;
  width: 43.75vw;
  position: unset;
}
.portfolio-layer__content .description span{
  font-weight: 700;
  margin-right: 0.416vw;
}


.portfolio-item.is-entering {
  opacity: 0;
  transform: translateY(10px);
}
.portfolio-item.is-entering.is-entered {
  opacity: 1;
  transform: translateY(0);
  cursor: pointer;
}

.portfolio-sentinel {
  width: 100%;
  height: 1px;
}

/* ✅ 하단 절반 그라데이션: hover 시 등장 */
.portfolio-item::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  height: 50%;
  pointer-events: none;

  /* 그라데이션(취향에 따라 조정) */
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.55) 0%,
    rgba(0,0,0,0.18) 55%,
    rgba(0,0,0,0) 100%
  );

  opacity: 0;
  transform: translateY(6px);
  transition: opacity 600ms ease, transform 600ms ease;

  /* 이미지 위로 */
  z-index: 2;
}

/* ✅ 제목 텍스트 */
.portfolio-item .portfolio-hover-title{
  position: absolute;
  left: 1.04vw;
  bottom: 1.04vw;

  font-size: 0.83vw;
  line-height: 1.2;
  font-weight: 600;
  color: #fff;

  opacity: 0;
  transform: translateY(6px);
  transition: opacity 600ms ease, transform 600ms ease;

  z-index: 3;             /* 오버레이 위 */
  pointer-events: none;   /* 클릭 방해 X */
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

/* hover 시 표시 */
.portfolio-item:hover::after{
  opacity: 1;
  transform: translateY(0);
}
.portfolio-item:hover .portfolio-hover-title{
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1201px){
  .portfolio-item .portfolio-hover-title{
    display: none;
  }

    .portfolio-layer .close{
      left: 2.14vw;
      top: 10.73vw;
      width: 2.14vw;
      height: 2.14vw;
    }

    .portfolio-layer__content {
      min-height: unset;
    }

    .portfolio-layer__content.is-switching{
      opacity: 0;
    }

    .portfolio-layer .prev{
      font-size: 2.14vw;
      left: 2.14vw;
      top: unset;
      bottom: 10.73vw;
    }
    .portfolio-layer .prev::before{
      width: 3.22vw;
      height: 3.22vw;
      margin-right: 1.07vw;
    }

    .portfolio-layer .next{
      font-size: 2.14vw;
      right: 2.14vw;
      top: unset;
      bottom: 10.73vw;
    }

    .portfolio-layer .next::after{
      width: 3.22vw;
      height: 3.22vw;
      margin-left: 1.07vw;
    }

    .portfolio-layer__content h3{
      font-size: 3.22vw;
      line-height: 1.4;
      padding: 15.03vw 0 2.14vw;
    }

    .portfolio-layer__content  .portfolio-layer__image-area{
      flex-direction: column;
      gap: 2.14vw;
      margin-bottom: 5.36vw;
      width: 100%;
    }
    .portfolio-layer__content .portfolio-layer__image{
      width: 100%;
      padding: 0 2.14vw;
    }

    .portfolio-layer__content .portfolio-layer__image-sub-area{
      flex-direction: row;
      gap: 0.8vw;
      height: 7.516vw;
      overflow-y: hidden;
      overflow-x: auto;
      min-height: unset;
      position: unset;
      padding: 0 2.14vw;
    }

    .portfolio-layer__content .portfolio-layer__image-sub-area .thumb{
      width: 7.516vw;
      height: 7.516vw;         
    }

    .portfolio-layer__content .portfolio-layer__image-sub-area .thumb.is-loaded > img{
      opacity: 1;
    }

    .portfolio-layer__content .description{
      gap: 2.14vw;
      font-size: 2.14vw;
      padding: 0 2.14vw 24.69vw;
      width: 100%;
      position: relative;
    }
    .portfolio-layer__content .description span{
      margin-right: unset;
      display: block;
      margin-bottom: 1.07vw
    }
}
@media (max-width: 744px){

    .portfolio-layer .close{
      left: 4.26vw;
      top: 21.33vw;
      width: 4.26vw;
      height: 4.26vw;
    }

    .portfolio-layer .prev{
      font-size: 4.26vw;
      left: 4.26vw;
      bottom: 21.33vw;
    }
    .portfolio-layer .prev::before{
      width: 6.4vw;
      height: 6.4vw;
      margin-right: 2.13vw;
    }

    .portfolio-layer .next{
      font-size: 4.26vw;
      right: 4.26vw;
      bottom: 21.33vw;
    }

    .portfolio-layer .next::after{
      width: 6.4vw;
      height: 6.4vw;
      margin-left: 2.13vw;
    }

    .portfolio-layer__content h3{
      font-size: 6.4vw;
      padding: 29.86vw 4.26vw 4.26vw;
      text-align: center;
    }

    .portfolio-layer__content  .portfolio-layer__image-area{
      gap: 4.26vw;
      margin-bottom: 10.66vw;
    }
    .portfolio-layer__content .portfolio-layer__image{
      padding: 0 4.26vw;
    }

    .portfolio-layer__content .portfolio-layer__image-sub-area{
      gap: 1.6vw;
      height: 14.93vw;
      padding: 0 4.26vw;
    }

    .portfolio-layer__content .portfolio-layer__image-sub-area .thumb{
      width: 14.93vw;
      height: 14.93vw;   
    }

    .portfolio-layer__content .description{
      gap: 4.26vw;
      font-size: 4.26vw;
      padding: 0 4.26vw 49.06vw;
    }
    .portfolio-layer__content .description span{
      margin-bottom: 2.13vw
    }
}

/* 
html[data-page="portfolio"] img {
  opacity: 1 !important;
  transition: none !important;
} */