/* basic style */
*{margin: 0; padding: 0; box-sizing: border-box;}
a{color: #020202; text-decoration: none;}
ul,li{list-style: none;}
#section1, #project-detail{font-family: "Source Sans 3", sans-serif;}
body{
  background: url(./image/bg-tv.jpg) no-repeat center center fixed;
  background-size: cover;
}

/* 스크롤바 스타일 */
::-webkit-scrollbar{width: 8px;}
::-webkit-scrollbar-track{background: #f5f5f5;}
::-webkit-scrollbar-thumb{
  background: #cacaca ;
  border-radius: 4px;
}

/* parallax_cont */
#parallax_cont{width: 100%;}
.parallax_item{
  width: 100%;
  height: 100vh;
  text-align: left;
  margin-top: 100px;
}

/* nav */
#parallax_nav{
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 1000;
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s ease;
}
#parallax_nav ul{display: flex;}
#parallax_nav li a{
  position: relative;
  display: block;
  padding: 10px 20px;
  border: 1px solid #000;
  text-decoration: none;
  color: #000;
  font-weight: 600;
  background: #fff;
  overflow: hidden; 
}
#parallax_nav li:not(:first-child) a{border-left: none;}
#parallax_nav li a span{
  position: relative;
  z-index: 2;
}

/* nav hover용 ::after (밑에서 위로 주황 올라옴) */
#parallax_nav li a::after{
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  height: 0%;
  background: #ff6308;
  transition: height 0.3s ease;
  z-index: 1;
}
#parallax_nav li a:hover::after{height: 100%;}
#parallax_nav li a:hover{color: #fff;}

/* nav active용 ::before (위에서 아래로 검정 내려옴) */
#parallax_nav li a::before{
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 0%;
  background: #000;
  transition: height 0.3s ease;
  z-index: 1;
}
#parallax_nav li a.active::before{height: 100%;}
#parallax_nav li a.active{
  color: #000;
  transition: color 0.3s ease;
}
#parallax_nav li a.active:not(:hover){color: #fff;}

/* section1 */
.project{
  display: block;
  color: #fff;
  line-height: 1;
  overflow: hidden;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
  cursor: pointer;
  width: 100%;
  padding: 0 20px;
  position: relative;
}
.project:hover{
  border-top: 1px solid #fff;
  border-bottom: 1px solid #fff;
}
.project-title{
  position: relative;
  overflow: hidden;
  height: 90px;
}

/* 제목(기본 상태) */
.title-original{
  font-weight: 500;
  font-size: 90px;
  line-height: 1;
  margin: 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transform: translateY(0);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
/* 제목(호버 상태) */
.title-hover{
  font-family: "Source Serif 4", serif;
  font-weight: 600;
  font-size: 90px;
  line-height: 1;
  margin: 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.project:hover .title-original{transform: translateY(-100%);}
.project:hover .title-hover{transform: translateY(0);}

/* hover 효과 비활성화 */
.project.clicked:hover .title-original{transform: translateY(0);}
.project.clicked:hover .title-hover{transform: translateY(100%);}
.project.clicked:hover{
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
}
.project.clicked:hover p{
  opacity: 0;
  transform: translateY(20px);
}

/* 제목 작은 글자 */
.project p{
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 30px;
  font-weight: 500;
  color: #fff;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
}
.project:hover p{
  opacity: 1;
  transform: translateY(0);
}
.project a{display: none;}

/* 프로젝트 상세 페이지 */
.project-detail{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: transparent;
  z-index: 2000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.project-detail.show{
  display: block;
  opacity: 1;
}

/* 애니메이션 - 초기 상태 */
.project-detail .project-detail-left{
  transform: translateX(-100%);
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.project-detail .project-detail-header,
.project-detail .close-button{
  transform: translateY(-100%);
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.project-detail .project-detail-navigation{
  transform: translateY(270%);
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.project-detail .launch-button{
  transform: translateY(50px);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 나타날 때 */
.project-detail.show .project-detail-left{
  transform: translateX(0);
}
.project-detail.show .project-detail-header,
.project-detail.show .close-button{
  transform: translateY(0);
}
.project-detail.show .project-detail-navigation{
  transform: translateY(0);
}
.project-detail.show .launch-button{
  transform: translateY(0);
  opacity: 1;
}

/* 사라질 때 */
.project-detail.closing .project-detail-left{
  transform: translateX(-100%);
  transition: transform 0.6s ease-in;
}
.project-detail.closing .project-detail-header,
.project-detail.closing .close-button{
  transform: translateY(-100%);
  transition: transform 0.6s ease-in;
}
.project-detail.closing .project-detail-navigation{
  transform: translateY(270%);
  transition: transform 0.6s ease-in;
}
.project-detail.closing .launch-button{
  transform: translateY(50px);
  opacity: 0;
  transition: all 0.6s ease-in;
}
.project-detail.closing #parallax_nav{
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.1s ease;
}
.project-detail.show #parallax_nav,
.project-detail-open #parallax_nav{
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.6s ease;
}

/* 상세페이지가 열렸을 때 프로젝트 제목들 숨기기 (웹에서만) */
.project-detail.show #section1 .project,
.project-detail-open #section1 .project{
  opacity: 0;
  transition: opacity 0.6s ease;
}
.project-detail-content{
  display: flex;
  height: 100vh;
  width: 100vw;
  margin: 0;
}
.project-detail-left{
  flex: 1.5;
  background: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  height: 100%;
}
.project-image-placeholder{
  width: 100%;
  min-height: 100%;
  background: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  font-size: 24px;
  color: #ccc;
}

/* 상세페이지 */
.project-image-placeholder img {
  width: 100%;
  height: auto;
  display: block;
}
.project-detail-right{
  flex: 1;
  background: transparent;
  color: #fff;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.project-detail-header h3{
  font-size: 80px;
  font-weight: 600;
  line-height: 1;
  margin: 0 0 30px 0;
}
.project-info{
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 40px 0;
}
.info-year{
  font-size: 18px;
  font-weight: 400;
  color: #fff;
}
.info-category{
  font-size: 18px;
  font-weight: 400;
  color: #fff;
}
.launch-button{
  display: inline-block;
  padding: 15px 30px;
  border: none;
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.7s ease;
  background: transparent;
}
.launch-button:hover{
  background: #fff;
  color: #000;
  border-radius: 50px;
}
.project-detail-navigation{
  display: flex;
  gap: 20px;
  align-items: center;
}
.nav-button{
  background: transparent;
  border: none;
  color: #fff;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.7s ease;
}
.nav-button:hover{
  background: #fff;
  color: #000;
  border-radius: 50px;
}
.close-button{
  position: absolute;
  top: 30px;
  right: 30px;
  background: none;
  border: none;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.close-button:hover{
  background: #fff;
  color: #000;
  border-radius: 50%;
}

/* 모바일 */
@media (max-width: 768px){
  .project-detail.closing{
    transform: translateX(-100vw) !important;
    pointer-events: none !important;
    transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
  }
  .project-detail{
    display: block !important;
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: #fff;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-100vw);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.5s ease;
  }
  .project-detail.show{
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }
  .project-detail,
  .project-detail-content,
  .project-detail-right{
    background: #fff !important;
  }
  .project-detail .project-detail-left,
  .project-detail .project-detail-header,
  .project-detail .close-button,
  .project-detail .project-detail-navigation,
  .project-detail .launch-button{
    transform: none !important;
    transition: none !important;
    opacity: 1 !important;
  }
  .project-detail-left{
    flex: 1 !important;
    width: 100vw !important;
    height: calc(100vh - 130px) !important;
    position: fixed !important;
    top: 130px !important;
    left: 0 !important;
    z-index: 2001 !important;
  }
  .project-image-placeholder{
    width: 100vw !important;
    height: calc(100vh - 130px) !important;
    min-height: calc(100vh - 130px) !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }  
  .project-image-placeholder img{
    width: 100vw !important;
    height: auto !important;
    min-height: calc(100vh - 130px) !important;
    object-fit: contain !important;
    display: block !important;
    max-width: 100vw !important;
  }  
  .project-title{height: 12vw;}
  .title-original, .title-hover{
    font-size: 10vw;
    line-height: 1.1;
  }  
  .project.clicked:hover .title-original{transform: translateY(-100%);}
  .project.clicked:hover .title-hover{transform: translateY(0);}
  .project.clicked:hover{
    border-top: 1px solid #fff;
    border-bottom: 1px solid #fff;
  }  
  .project p{display: none;}
  .close-button{
    font-size: 8vw;
    width: 10vw;
    height: 10vw;
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 3200;
    color: #fff;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
  }
  .close-button:hover{
    background: #fff;
    color: #000;
  }
  .project-detail-navigation{
    position: fixed;
    left: 0;
    right: 0;
    bottom: 20px;
    z-index: 3100;
    display: flex;
    justify-content: center;
    gap: 12px;
    background: none;
    pointer-events: auto;
  }
  .project-detail-navigation .nav-button{
    background-color: #111 !important;
    color: #fff !important;
    padding: 14px 22px;
    border-radius: 999px;
    font-size: 3vw;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    border: none;
    z-index: 3200;
    opacity: 1;
    display: inline-block;
    transition: background 0.2s, color 0.2s;
  }
  .project-detail-navigation .nav-button:active,
  .project-detail-navigation .nav-button:focus{
    background: #fff !important;
    color: #111 !important;
    outline: none;
  }
  .project-detail-header{
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    background: #111;
    color: #fff;
    z-index: 3100;
    padding: 16px 20px 10px 20px;
    box-sizing: border-box;
    border-bottom: 1px solid #222;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  }
  .project-detail-header h3{
    font-size: 7vw;
    margin-bottom: 8px;
  }
  .project-info{
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 0;
    font-size: 3.5vw;
  }
  .info-year, .info-category{
    font-size: 3.5vw;
    color: #fff;
    background: #222;
    border-radius: 8px;
    padding: 2px 8px;
  }
  .launch-button{
    font-size: 3.5vw;
    padding: 8px 16px;
    margin-top: 8px;
    border-radius: 20px;
    background: #222;
    color: #fff;
    display: inline-block;
  }
  .project-detail .project-detail-right{
    padding-top: 90px;
    padding-bottom: 110px;
  }
  #parallax_nav{
    transform: translateY(0);
    opacity: 1;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s ease;
  }
  .project-detail.show #parallax_nav,
  .project-detail-open #parallax_nav,
  .project-detail.closing #parallax_nav{
    transform: translateY(0) !important;
    opacity: 1 !important;
    transition: none !important;
  }
  .project-detail-open {
    overflow: hidden !important;
    height: 100vh !important;
    position: fixed !important;
    width: 100% !important;
  }  
  .project-detail-open #parallax_cont {
    overflow: hidden !important;
    height: 100vh !important;
  }
}