/* 헤더 관련 CSS --------------------------------------------------- */

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  padding-top: 24px;
  background-color: transparent;
  overflow: hidden;
  z-index: 1000;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1.1);
  /* 자석 효과 */
}

header.hidden {
  top: -70px;
}

.header-textarea {
  display: grid;
  /* Grid로 설정 */
  grid-template-columns: repeat(4, 1fr);
  /* 4열로 균등하게 나눔 */
  gap: 20px;
  /* 요소 간 간격 */
  padding: 0 40px;
  /* 양쪽 여백 */
  color: #101010;
  font-size: 1.6em;
  font-weight: 600;
  letter-spacing: 0em;
  text-align: left;
  justify-content: space-between;
  /* 균형 잡힌 정렬 */
}

.level {
  text-align: left;
  /* 텍스트를 왼쪽 정렬 */
}

.level a {
  color: inherit;
  /* 링크 색상을 부모 요소와 동일하게 설정 */
  text-decoration: none;
  /* 밑줄 제거 */
  display: block;
  /* 추가된 부분 */
  text-align: left;
  /* 추가된 부분 */
}

.level a:visited {
  color: inherit;
  /* 방문한 링크 색상도 동일하게 설정 */
  text-decoration: none;
}

.header-link {
  text-decoration: none;
  /* 밑줄 제거 */
  color: inherit;
  /* 부모 요소의 색상을 상속받음 */
  text-align: right;
  /* 링크도 오른쪽에 정렬 */
  /*border: 2px solid #000;
  border-radius: 50%;
  padding: 0px 40px 0px 40px; */
}

.header-link:hover {
  color: none;
  /* 마우스 호버 시 색상 변경 */
}

.level:nth-child(4) {
  text-align: right;
  /* 오른쪽 정렬 */
  margin-left: auto;
  /* 왼쪽 여백을 자동으로 설정 */
}


@media only screen and (min-width: 768px) and (max-width: 1024px) {

  .header-textarea {
    display: grid;
    /* Grid로 설정 */
    grid-template-columns: repeat(3, 1fr);
    /* 4열로 균등하게 나눔 */
    gap: 20px;
    /* 요소 간 간격 */
    padding: 0 40px;
    /* 양쪽 여백 */
  }


  .level:nth-child(2) {
    display: none;

  }

  .level:nth-child(4) {
    text-align: right;
  }

}


@media only screen and (max-width: 767px) {

  .header-textarea {
    display: grid;
    /* Grid로 설정 */
    grid-template-columns: repeat(1, 1fr);
    /* 4열로 균등하게 나눔 */
    gap: 20px;
    /* 요소 간 간격 */
    padding: 0 25px;
    /* 양쪽 여백 */
    font-size: 1.6rem;
    letter-spacing: 0em;
  }

  .level {
    display: none;
    /* 기본적으로 모든 단 숨김 */
  }

  .level:nth-child(4) {
    display: block;
    text-align: right;
    /* 오른쪽 정렬 */
    padding: 0px;
    /* 여백 조정 */
    font-size: 1.6rem;
    /* 텍스트 크기 변경 */
  }
}


/* 헤더 gnb 관련 --------------------------------------------------- */

header .menu {
  position: absolute;
  top: 27px;
  left: 40px;
  color: #fff;
  font-size: 2em;
  font-weight: 500;
  letter-spacing: 0.02em;
  display: block;
  /* 기본적으로 보이도록 설정 */
  text-decoration: none;
  z-index: 101;
  /* 다른 요소 위에 보이도록 설정 */
}


header .menu-back {
  position: absolute;
  top: 27px;
  left: 40px;
  color: #fff;
  font-size: 2em;
  font-weight: 500;
  letter-spacing: 0.02em;
  display: none;
  /* 기본적으로 숨김 */
  text-decoration: none;
  z-index: 101;
  /* 다른 요소 위에 보이도록 설정 */
}

/* active 상태일 때 메뉴 버튼과 닫기 버튼 보여주기 */
header.active .menu {
  display: none;
  /* NAV. 버튼 숨김 */
}

header.active .menu-back {
  display: block;
  /* CLOSE 버튼 보이기 */
}

.menu img,
.menu-back img {
  width: auto;
  /* 원하는 크기로 조정 */
  height: 26px;
}

.menu:hover,
.menu:focus,
.menu:active,
.menu-back:hover,
.menu-back:focus,
.menu-back:active {
  background: none;
  color: inherit;
  outline: none;
  box-shadow: none;
  filter: none;
}


/* gnb 메뉴 */
header #gnb {
  position: fixed;
  top: 0;
  left: -500px;
  bottom: 0;
  width: 500px;
  background: #101010;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  /* Safari 호환용 */
  z-index: 100;
  overflow-y: auto;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.4, 1);
}


header #gnb nav {
  margin-top: 300px;
  /* 내비게이션 여백 */
}

header #gnb nav li a {
  display: flex;
  /* 플렉스 박스 사용 */
  align-items: center;
  /* 수직 가운데 정렬 */
  justify-content: left;
  /* 수평 가운데 정렬 */
  color: #fff;
  font-size: 3.5em;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
  padding: 0 40px;
  position: relative;
  /* 상대 위치 지정 */
}


header #gnb nav li a:hover {}

header #gnb nav ul li.e-mail {}

header #gnb nav li a::after {
  display: none !important;
}

header #gnb nav li a::before {
  content: "";
  position: absolute;
  right: 40px;
  /* GNB 오른쪽 끝에 위치 */
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  /* 화살표 크기 조정 */
  height: 30px;
  background-image: url('/icon/arrow.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  /* 기본적으로 숨김 */
  transition: opacity 0.3s ease;
}

/* hover 시 화살표 표시 */
header #gnb nav li a:hover::before {
  opacity: 1;
}

header #gnb nav li a:hover::after {
  display: block;
}

/* active 상태일 때 사이드 메뉴 표시 */
header.active #gnb {
  left: 0;
  /* 메뉴 열기 */
}


/* ---------------- GNB 슬롯머신 효과 ---------------- */
.gnb-slot {
  display: inline-block;
  overflow: hidden;
  /* 텍스트 높이 제한 */
  height: 1.25em;
  /* 텍스트 라인 높이 */
  position: relative;
  cursor: pointer;
  padding: 0 40px;
}

.gnb-slot .slot-inner {
  display: block;
  position: absolute;
  top: 0;
  left: 40px;
  /* 부모 padding과 동일하게 */
  right: 40px;
  line-height: 1em;
  white-space: nowrap;
  /* 텍스트가 줄 바꿈 안 되도록 */
}

/* hover 애니메이션 - 속도 빠르고 균일하게 */
.gnb-slot:hover .slot-inner:first-child {
  animation: slotUpFastLinear 0.2s linear forwards;
}

.gnb-slot:hover .slot-inner:last-child {
  animation: slotUpNextLinear 0.2s linear forwards;
}

/* 첫 번째 텍스트: 위로 올라가기 */
@keyframes slotUpFastLinear {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-100%); }
}

/* 두 번째 텍스트: 밑에서 올라오기 */
@keyframes slotUpNextLinear {
  0%   { transform: translateY(100%); }
  100% { transform: translateY(0); }
}

/* 오디오 버튼 이미지가 있는 원형 배경 */
#playButtonWrapper {
  position: absolute;
  top: 25px;
  /* ✅ 고정 위치 유지 */
  right: 40px;
  /* ✅ 고정 위치 유지 */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  /* ✅ 회전 시 넘침 방지 */
  background-color: transparent;
  z-index: 98;
  cursor: pointer;
}

#playButton {
  width: auto;
  height: 30px;
  transform-origin: center center;
  /* ✅ 중심 회전 */
  will-change: transform;
}

/* 이미지에만 회전 애니메이션 적용 */
#playButton.rotate {
  animation: rotateAnimation 2.5s linear infinite;
}

#playButton.reverseRotate {
  animation: reverseRotateAnimation 0.2s linear;
}

/* 오디오 컨트롤러 숨기기 */
audio {
  all: unset;
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
  left: -9999px !important;
  overflow: hidden !important;
  pointer-events: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

#audioPlayer {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  position: absolute;
  left: -9999px;
  /* ✅ 보이지 않는 위치로 완전히 이동 */
}

#playButtonWrapper:hover,
#playButtonWrapper:focus,
#playButtonWrapper:active {
  background: none;
  outline: none;
  box-shadow: none;
  filter: none;
}

/* 무한 회전 애니메이션 (정방향 회전) */
@keyframes rotateAnimation {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* 뒤로 회전 애니메이션 (역방향 회전) */
@keyframes reverseRotateAnimation {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(-180deg);
  }
}

/* 회전 효과 (정방향 회전) */
.rotate {
  animation: rotateAnimation 2.5s linear infinite;
  /* 2초에 한 바퀴 회전, 무한 반복 */
}

/* 뒤로 회전 효과 (역방향 회전) */
.reverseRotate {
  animation: reverseRotateAnimation 0.2s linear;
  /* 1초 동안 역방향으로 한 바퀴 회전 */
}

@media only screen and (min-width: 768px) and (max-width: 1024px) {

  header #gnb nav {
    margin-top: 200px;
    /* 내비게이션 여백 */
  }

}

@media only screen and (max-width: 767px) {

  header #gnb {
    left: -100%;
    width: 100%;
  }

  header #gnb nav {
    margin-top: 250px;
    /* 내비게이션 여백 */
  }

  header .menu {
    left: 25px;
    letter-spacing: 0.02em;
  }

  header .menu-back {
    left: 25px;
    letter-spacing: 0.02em;
  }

  .menu img,
  .menu-back img {
    width: auto;
    /* 원하는 크기로 조정 */
    height: 26px;
  }

  header #gnb nav {
    margin-top: 150px;
    /* 내비게이션 여백 */
  }

  header #gnb nav li a {
    padding: 0 25px;
    font-size: 3em;
  }

  header #gnb nav li a::before {
    content: "";
    position: absolute;
    right: 25px;
    /* GNB 오른쪽 끝에 위치 */
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    /* 화살표 크기 조정 */
    height: 30px;
    background-image: url('/icon/arrow.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    /* 기본적으로 숨김 */
    transition: opacity 0.3s ease;
  }

  .gnb-slot {
    display: inline-block;
    overflow: hidden;
    /* 텍스트 높이 제한 */
    height: 1.2em;
    /* 텍스트 라인 높이 */
    position: relative;
    cursor: pointer;
    padding: 0 25px;
  }

  .gnb-slot .slot-inner {
    display: block;
    position: absolute;
    top: 0;
    left: 25px;
    /* 부모 padding과 동일하게 */
    right: 25px;
    line-height: 1em;
    white-space: nowrap;
    /* 텍스트가 줄 바꿈 안 되도록 */
  }

  #playButtonWrapper {
    right: 25px;
    /* ✅ 고정 위치 유지 */
  }

  #playButton {
    height: 30px;
  }

}