/* ========================================================================
   우배모 — 커스텀 스타일
   ======================================================================== */

/* 전체 부드럽게 */
html { scroll-behavior: smooth; }
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

/* 시네마틱 필름 그레인 노이즈 */
.grain {
  position: relative;
}
.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.93  0 0 0 0 0.89  0 0 0 0 0.83  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.18'/></svg>");
  opacity: 0.08;
  pointer-events: none;
  mix-blend-mode: overlay;
  z-index: 1;
}

/* 히어로 빗금 오버레이 — 아주 살짝 */
.scanlines::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0.01) 0px,
    rgba(255,255,255,0.01) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 1;
}

/* 텍스트 선택 색상 */
::selection { background: #D4A574; color: #0A0E1A; }

/* 스크롤바 (웹킷) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0A0E1A; }
::-webkit-scrollbar-thumb { background: #2A2F3E; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3A3F4E; }

/* 디스플레이 타입 — 거대 숫자/타이틀용 */
.display-hero {
  font-family: 'Space Grotesk', 'Noto Sans KR', sans-serif;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.96;
}

/* fade-up 애니메이션 (스크롤 트리거) */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* 앰버 얇은 구분선 */
.rule-accent {
  display: inline-block;
  width: 32px;
  height: 1px;
  background: #D4A574;
  vertical-align: middle;
}

/* 썸네일 호버 오버레이 */
.thumb {
  position: relative;
  overflow: hidden;
  background: #1A1F2E;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1), filter 0.6s;
  filter: brightness(0.88) saturate(0.9);
}
.thumb:hover img {
  transform: scale(1.04);
  filter: brightness(1) saturate(1);
}
.thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, transparent 45%, rgba(10,14,26,0.92) 100%);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transform: translateY(8px);
  opacity: 0;
  transition: opacity 0.5s, transform 0.5s;
}
.thumb:hover .thumb-overlay {
  opacity: 1;
  transform: none;
}
.thumb-meta {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.thumb-meta span {
  padding: 4px 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  background: rgba(10,14,26,0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(237,228,211,0.12);
  color: #EDE4D3;
  text-transform: uppercase;
  font-weight: 500;
}

/* 마스크너리 — CSS columns 방식 (진짜 Pinterest 스타일)
   Grid로 하면 가장 큰 아이템 기준으로 row 높이가 맞춰져서
   세로 긴 9:16 썸네일과 가로 16:9 썸네일이 섞일 때 여백이 생김.
   columns는 각 아이템이 자기 높이만큼 쌓이고, 다음 아이템이 이어 붙음. */
.masonry {
  column-count: 2;
  column-gap: 16px;
  /* 안전 여백 — 스크롤바 영역과 붙지 않게 */
  width: 100%;
}
@media (min-width: 768px) {
  .masonry { column-count: 3; column-gap: 20px; }
}
@media (min-width: 1280px) {
  .masonry { column-count: 4; column-gap: 24px; }
}
.masonry > * {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  display: block;
  width: 100%;
  margin-bottom: 16px;
}
@media (min-width: 768px) {
  .masonry > * { margin-bottom: 20px; }
}
@media (min-width: 1280px) {
  .masonry > * { margin-bottom: 24px; }
}
/* 마지막 아이템 여백 제거 (컬럼별) */
.masonry > *:last-child { margin-bottom: 0; }

/* thumb 자체에 aspect ratio가 적용된 경우 overflow 확실히 잘라주기 */
.masonry .thumb,
.masonry .thumb-item {
  overflow: hidden;
  position: relative;
}
.masonry .thumb img,
.masonry .thumb-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* 네비 블러 배경 */
.nav-glass {
  background: rgba(10, 14, 26, 0.72);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(237,228,211,0.06);
}

/* 장르 스트립 — 자동 스크롤 */
.genre-strip {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}
.genre-strip-track {
  display: inline-flex;
  animation: strip 40s linear infinite;
  white-space: nowrap;
}
@keyframes strip {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* 폼 요소 — 다크 테마 */
.field {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(237,228,211,0.18);
  padding: 14px 0;
  color: #EDE4D3;
  font-size: 16px;
  transition: border-color 0.3s;
}
.field:focus {
  outline: none;
  border-bottom-color: #D4A574;
}
.field::placeholder { color: rgba(237,228,211,0.35); }
.field.field-error { border-bottom-color: #f87171; }
textarea.field { resize: vertical; min-height: 120px; }

/* 버튼 — 고스트 앰버 */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border: 1px solid #D4A574;
  color: #D4A574;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all 0.3s;
}
.btn-ghost:hover {
  background: #D4A574;
  color: #0A0E1A;
}
.btn-solid {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: #D4A574;
  color: #0A0E1A;
  font-weight: 600;
  transition: all 0.3s;
}
.btn-solid:hover {
  background: #EDE4D3;
}

/* 섹션 넘버링 */
.sec-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: #D4A574;
  font-weight: 500;
}

/* 카운트업 숫자 */
.count-num {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(48px, 8vw, 96px);
  letter-spacing: -0.035em;
  line-height: 1;
}

/* 모바일 메뉴 */
#mobile-menu {
  position: fixed;
  inset: 0;
  background: #0A0E1A;
  z-index: 100;
  transform: translateY(-100%);
  transition: transform 0.5s cubic-bezier(0.76, 0, 0.24, 1);
}
#mobile-menu.open { transform: translateY(0); }

/* 워크플로우 타임라인 */
.flow-line {
  position: absolute;
  top: 36px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0, #2A2F3E 10%, #2A2F3E 90%, transparent 100%);
}

/* ========================================================================
   카카오채널 플로팅 버튼 (우하단 고정)
   ======================================================================== */
#kakao-channel-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px 14px 18px;
  background: #FEE500;
  color: #191919;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  border-radius: 999px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.25);
  transition:
    transform .35s cubic-bezier(.22,1,.36,1),
    box-shadow .35s cubic-bezier(.22,1,.36,1);
  text-decoration: none;
  overflow: visible;
}
#kakao-channel-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow:
    0 14px 40px rgba(254, 229, 0, 0.35),
    0 4px 14px rgba(0, 0, 0, 0.35);
}
#kakao-channel-btn:active {
  transform: translateY(-1px) scale(0.98);
}
#kakao-channel-btn .kakao-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
}
#kakao-channel-btn .kakao-icon svg {
  width: 22px;
  height: 22px;
}

/* 펄스 글로우 */
#kakao-channel-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #FEE500;
  z-index: -1;
  opacity: 0.35;
  animation: kakao-pulse 2.6s cubic-bezier(.4,0,.6,1) infinite;
}
@keyframes kakao-pulse {
  0%, 100% { transform: scale(1); opacity: 0.35; }
  50%      { transform: scale(1.12); opacity: 0; }
}

/* 모바일 — 원형 아이콘만 */
@media (max-width: 640px) {
  #kakao-channel-btn {
    right: 16px;
    bottom: 16px;
    padding: 0;
    width: 56px;
    height: 56px;
    justify-content: center;
  }
  #kakao-channel-btn .kakao-label {
    display: none;
  }
}

/* ========================================================================
   라이트박스 (포트폴리오 이미지 확대)
   ======================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(10, 14, 26, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s cubic-bezier(.22,1,.36,1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 120px;
}
.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox.is-open .lightbox-stage {
  transform: translateY(0) scale(1);
}
.lightbox-stage {
  position: relative;
  max-width: min(90vw, 1400px);
  max-height: calc(100vh - 220px);
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(12px) scale(0.98);
  transition: transform .6s cubic-bezier(.22,1,.36,1);
}
.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 220px);
  display: block;
  border: 1px solid rgba(237, 228, 211, 0.08);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity .4s ease;
}
.lightbox-img.is-loaded {
  opacity: 1;
}
.lightbox-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  color: rgba(212, 165, 116, 0.8);
  pointer-events: none;
}
.lightbox-img.is-loaded ~ .lightbox-spinner,
.lightbox-stage:has(.lightbox-img.is-loaded) .lightbox-spinner {
  display: none;
}

/* 닫기 버튼 */
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(237, 228, 211, 0.18);
  color: #EDE4D3;
  font-size: 18px;
  transition: all .3s;
  cursor: pointer;
  z-index: 2;
}
.lightbox-close:hover {
  background: #D4A574;
  border-color: #D4A574;
  color: #0A0E1A;
}

/* prev / next */
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(237, 228, 211, 0.18);
  color: #EDE4D3;
  font-size: 16px;
  cursor: pointer;
  transition: all .3s;
  z-index: 2;
}
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(212, 165, 116, 0.15);
  border-color: #D4A574;
  color: #D4A574;
}

/* 하단 캡션 */
.lightbox-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 24px 32px;
  background: linear-gradient(0deg, rgba(10, 14, 26, 0.95) 0%, transparent 100%);
  pointer-events: none;
}
.lightbox-caption-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  flex-wrap: wrap;
}
.lightbox-meta {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #D4A574;
  margin-bottom: 6px;
}
.lightbox-sep {
  opacity: 0.5;
  margin: 0 6px;
}
.lightbox-genre {
  font-family: 'Space Grotesk', 'Noto Sans KR', sans-serif;
  font-size: clamp(20px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #EDE4D3;
  line-height: 1.15;
}
.lightbox-counter {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: rgba(237, 228, 211, 0.55);
  white-space: nowrap;
}

/* 썸네일 버튼 초기화 (button 태그 기본 스타일 제거) */
.thumb[class*="block"] {
  border: none;
  padding: 0;
  background: #1A1F2E;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}

/* 모바일 */
@media (max-width: 768px) {
  .lightbox {
    padding: 60px 12px 140px;
  }
  .lightbox-close {
    width: 40px;
    height: 40px;
    top: 12px;
    right: 12px;
  }
  .lightbox-prev,
  .lightbox-next {
    width: 44px;
    height: 44px;
    top: auto;
    bottom: 16px;
    transform: none;
  }
  .lightbox-prev { left: 12px; }
  .lightbox-next { right: 12px; }
  .lightbox-caption {
    padding: 20px 72px 80px;
  }
  .lightbox-caption-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .lightbox-genre { font-size: 18px; }
}

/* body 스크롤 잠금 */
body.lightbox-open {
  overflow: hidden;
}

/* 링크 언더라인 */
.link-u {
  position: relative;
}
.link-u::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 1px;
  background: currentColor;
  transform-origin: right;
  transform: scaleX(0);
  transition: transform 0.4s cubic-bezier(0.76, 0, 0.24, 1);
}
.link-u:hover::after {
  transform-origin: left;
  transform: scaleX(1);
}
