@font-face {
  font-family: 'KotraHandwritingFont';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_20-10-21@1.0/KOTRA_SONGEULSSI.woff') format('woff');
  font-weight: normal;
  font-display: swap;
}

/* ----------------- 초기화 ----------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  overflow-x: hidden;
  font-family: 'KotraHandwritingFont', sans-serif;
  background: linear-gradient(to bottom, #fe52b0, #ffffff);
}

/* ----------------- 헤더 ----------------- */
header {
  width: 100%;
  height: 80px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 2em;
  backdrop-filter: blur(4px);
  background: rgba(255,255,255,0.2);
}

/* 글씨 애니메이션 */
@keyframes colorGlow {
  0%, 100% {
    color: #fe52b0;
    text-shadow: 0 0 2px #fff, 0 0 6px #fe52b0;
  }
  50% {
    color: black;
    text-shadow: 0 0 2px #fff;
  }
}

.color-change {
  animation: colorGlow 2s infinite;
  padding: 6px;
  cursor: pointer;
}

.spacer {
  margin: 0.5em;
}

/* ----------------- 헤더 hover 팝업 ----------------- */
#headerPopup {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  z-index: 1500;
  pointer-events: none;
}

#headerPopup img {
  max-width: 70vw;
  max-height: 85vh;
  border: 2px solid black;
  background: white;
}

/* ----------------- 헤더 아이콘 ----------------- */
.header-icons {
  position: absolute;
  right: 50px;
  top: 60%;
  transform: translateY(-50%);
}

.icon-wrapper {
  position: relative;
  display: inline-block;
}

.header-icons img {
  width: 70px;
  height: 70px;
  cursor: pointer;
}

.icon-caption {
  position: absolute;
  bottom: -55%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.5em;
  padding: 4px 8px;
  background: rgba(254,57,165,0.95);
  border: 1.5px solid black;
  opacity: 0;
  white-space: nowrap;
}

.icon-wrapper:hover .icon-caption {
  opacity: 1;
}

/* ----------------- 이미지 그리드 ----------------- */
.container {
  padding: 100px 20px 40px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  row-gap: 30px;
}

.container img {
  width: 70%;
  margin: 0 auto;
  display: block;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.container img:hover {
  transform: scale(1.05);
}

/* ----------------- 호버 캡션 ----------------- */
#captionBox {
  position: fixed;
  display: none;
  z-index: 2000;
  pointer-events: none;

  background: rgba(254,57,165,0.95);
  color: black;
  padding: 8px 12px;
  font-size: 1em;
  border: 1.5px solid black;
  max-width: 160px;
  white-space: pre-wrap;
}

/* ----------------- 팝업 ----------------- */
#popupOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  z-index: 3000;

  justify-content: center;
  align-items: center;
}

#popupContent {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#popupImage {
  max-width: 90vw;
  max-height: 85vh;
  border: 3px solid white;
}

/* ----------------- 팝업 밑 캡션 ----------------- */
#popupCaption {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

/* 팝업 태그 기본 */
.popup-tag {
  font-family: -apple-system, BlinkMacSystemFont,
               "Apple SD Gothic Neo",
               "Noto Sans KR",
               "Malgun Gothic",
               Arial, sans-serif;

  font-size: 0.9em;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid black;
  white-space: nowrap;
}

/* 색상 규칙 */
.tag-pink {
  background: rgba(254,57,165,0.95);
}

.tag-yellow {
  background: rgba(255,230,150,0.95);
}

.tag-cyan {
  background: rgba(150,240,240,0.95);
}

.tag-gray {
  background: rgba(220,220,220,0.95);
}

/* 헤더 왼쪽 아이콘 */
.header-icons.left {
  left: 50px;
  right: auto;
  top: 60%;
}
