@import url('https://fonts.googleapis.com/css2?family=Special+Elite&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f5f3;
  --fg: #1a1a1a;
  --muted: #888;
  --font: 'Special Elite', 'Courier New', monospace;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-base: 13px;
  --fs-title: 13px;
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--fs-base);
  overflow: hidden;
}

/* PAGES */
.page {
  position: fixed;
  inset: 0;
  visibility: hidden;
  opacity: 0;
  background: var(--bg);
  pointer-events: auto;
  transition: opacity .3s ease, visibility .3s ease;
  display: flex;
}
.page.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

/* SHELL */
.shell {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* LOGO */
.logo {
  position: absolute;
  top: 24px; left: 28px;
  font-size: var(--fs-title);
  line-height: 1.35;
  letter-spacing: 0.01em;
  cursor: pointer;
  z-index: 10;
}

/* NAV */
.nav {
  position: absolute;
  top: 100px; left: 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  z-index: 10;
  width: fit-content;
}
.nav a {
  font-size: var(--fs-sm);
  color: var(--fg);
  text-decoration: none;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: filter 0.3s ease;
  display: inline;
  width: fit-content;
  border-bottom: none;
}
.nav a:hover { filter: blur(1.5px); }
.nav a.active {
  border-bottom: 1px solid var(--fg);
  padding-bottom: 1px;
}
.nav .sub {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-left: 28px;
}

/* TAGLINE / YEAR */
.tagline {
  position: absolute;
  bottom: 28px; left: 28px;
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: var(--fg);
  letter-spacing: 0.01em;
}
.year-stamp {
  position: absolute;
  bottom: 28px; right: 28px;
  font-size: var(--fs-xs);
  color: var(--fg);
  letter-spacing: 0.02em;
}

/* INTRO */
#page-intro {
  overflow: hidden;
  cursor: pointer;
}
#page-intro .intro-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 140%;
  top: -20%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(100%);
  will-change: transform;
}
#page-intro .intro-title {
  position: absolute;
  right: 12%;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--fs-sm);
  letter-spacing: 0.06em;
  color: #1a1a1a;
  z-index: 2;
  pointer-events: auto;
  filter: blur(2.5px);
  transition: filter 0.4s ease;
}
#page-intro .intro-title:hover {
  filter: blur(0px);
}
@keyframes blink { 0%,100%{ opacity:.3 } 50%{ opacity:.9 } }

/* ABOUT */
#page-about .about-content {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 60px;
  align-items: flex-start;
  max-width: 780px;
  width: calc(100% - 200px);
}
#page-about .about-photo {
  width: 240px;
  min-width: 240px;
  aspect-ratio: 3/4;
  object-fit: cover;
  filter: grayscale(100%);
}
#page-about .about-photo-placeholder {
  width: 240px;
  min-width: 240px;
  aspect-ratio: 3/4;
  background: #d8d8d6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  color: var(--muted);
}
#page-about .about-text { flex: 1; padding-top: 4px; }
#page-about .about-text h2 {
  font-size: var(--fs-sm);
  font-weight: 400;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}
#page-about .about-text p {
  font-size: var(--fs-xs);
  line-height: 1.9;
  color: #444;
  margin-bottom: 14px;
}

/* GALLERY */
.gallery-area {
  position: fixed;
  top: 0; left: 160px; right: 0; bottom: 0;
  overflow-y: auto;
  padding: 80px 40px 60px 20px;
  scrollbar-width: none;
}
.gallery-area::-webkit-scrollbar { display: none; }

.masonry { column-count: 4; column-gap: 10px; }
@media (max-width: 1100px) { .masonry { column-count: 3; } }
@media (max-width: 800px)  { .masonry { column-count: 2; } }

.masonry-item {
  break-inside: avoid;
  margin-bottom: 10px;
  cursor: pointer;
  overflow: hidden;
  background: #ddd;
}
.masonry-item img {
  display: block;
  width: 100%;
  height: auto;
  filter: grayscale(100%);
  transition: filter .4s ease, transform .4s ease;
}
.masonry-item:hover img {
  filter: grayscale(0%);
  transform: scale(1.02);
}
.img-placeholder { display: block; width: 100%; }

/* YEAR TABS (archive: 본문 왼쪽 상단) */
.year-tabs {
  position: absolute;
  top: 28px; left: 180px;
  display: flex;
  gap: 14px;
  z-index: 10;
}
.year-tabs button {
  font-family: var(--font);
  font-size: var(--fs-xs);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  letter-spacing: 0.02em;
  transition: color .2s;
}
.year-tabs button:hover { color: var(--fg); }
.year-tabs button.active {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* CONTACT */
#page-contact .contact-content {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#page-contact .contact-content h2 {
  font-size: var(--fs-sm);
  font-weight: 400;
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}
#page-contact .contact-item {
  font-size: var(--fs-xs);
  color: #444;
  display: flex;
  gap: 20px;
  align-items: center;
  letter-spacing: 0.02em;
}
#page-contact .contact-item span:first-child {
  min-width: 60px;
  color: var(--muted);
}
#page-contact .contact-item a { color: var(--fg); text-decoration: none; }
#page-contact .contact-item a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* LIGHTBOX */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(245,245,243,0.96);
  visibility: hidden;
  opacity: 0;
  pointer-events: auto;
  overflow: hidden;           /* 확대된 사진은 화면 끝에서 잘림 */
  transition: opacity .3s ease, visibility .3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#lightbox.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
#lightbox .lb-close {
  position: absolute;
  top: 24px; right: 28px;
  font-size: var(--fs-xs);
  cursor: pointer;
  color: var(--muted);
  letter-spacing: 0.04em;
  transition: color .2s;
}
#lightbox .lb-close:hover { color: var(--fg); }
#lightbox .lb-image-wrap {
  position: relative;
  max-height: 72vh;
  max-width: 88vw;
  display: flex;
  align-items: center;
  justify-content: center;
}
#lightbox .lb-image-wrap img {
  max-height: 72vh;
  max-width: 88vw;
  object-fit: contain;
  filter: grayscale(10%);
  display: block;
}
.lb-arrow {
  position: fixed;            /* 사진 크기와 상관없이 화면 양쪽 끝에 고정 */
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 24px;            /* 기존 12px의 2배 */
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 24px 28px;         /* 누르기 쉽게 클릭 영역도 넓힘 */
  transition: color .2s;
  z-index: 2;
}
.lb-arrow:hover { color: var(--fg); }
.lb-arrow.prev { left: 16px; }
.lb-arrow.next { right: 16px; }
#lightbox .lb-meta {
  margin-top: 16px;
  display: flex;
  gap: 28px;
  font-size: var(--fs-xs);
  color: var(--muted);
  letter-spacing: 0.04em;
}
#lightbox .lb-meta span strong { color: var(--fg); font-weight: 400; }
#lightbox .lb-counter {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  font-size: var(--fs-xs);
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* WAYPOINTS — 나라별 목록 */
.waypoint-grid {
  column-count: 4;
  column-gap: 10px;
}
@media (max-width: 1100px) { .waypoint-grid { column-count: 3; } }
@media (max-width: 800px)  { .waypoint-grid { column-count: 2; } }
.waypoint-card {
  position: relative;
  break-inside: avoid;
  margin-bottom: 10px;
  min-height: 120px;          /* 커버 이미지가 아직 없을 때만 보이는 최소 높이 */
  overflow: hidden;
  cursor: pointer;
  background: #cfcfcd;
}
.waypoint-card img {
  display: block;
  width: 100%;
  height: auto;               /* 원본 비율 그대로 */
  filter: grayscale(100%);
  transition: filter .5s ease, transform .6s ease;
}
.waypoint-card:hover img {
  filter: grayscale(0%);
  transform: scale(1.03);
}
.waypoint-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  color: #fff;
  background: rgba(0,0,0,0.18);
  opacity: 0;
  transition: opacity .4s ease;
  pointer-events: none;
}
.waypoint-card:hover .waypoint-label { opacity: 1; }
.wp-year {
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
}
.wp-city {
  font-size: 18px;
  letter-spacing: 0.04em;
}

/* WAYPOINT DETAIL — 본문 왼쪽 상단 제목 (클릭하면 목록으로) */
.detail-head {
  position: absolute;
  top: 28px; left: 180px;
  z-index: 10;
  font-size: var(--fs-xs);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: filter .3s ease;
}
.detail-head:hover { filter: blur(1.5px); }

/* LIGHTBOX ZOOM */
#lightbox .lb-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  /* 확대된 사진이 원래 사진 틀 밖(화면 전체)으로 퍼지도록 clip 없음 */
}
#lightbox .lb-stage img {
  cursor: zoom-in;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}
#lightbox .lb-stage img.zoomed   { cursor: grab; }
#lightbox .lb-stage img.dragging { cursor: grabbing; }

/* 확대 중: 사진 위 정보는 숨기고, 닫기/화살표는 사진 위에서도 보이게 */
#lightbox .lb-meta,
#lightbox .lb-counter { transition: opacity .25s ease; }
#lightbox.zoomed .lb-meta,
#lightbox.zoomed .lb-counter { opacity: 0; }
#lightbox .lb-close { z-index: 3; }
#lightbox.zoomed .lb-close,
#lightbox.zoomed .lb-arrow {
  color: #fff;
  text-shadow: 0 0 8px rgba(0,0,0,0.55);
}
