﻿/* ================================================================
   G_JUNEMON — style.css
   순수 CSS3. 폰트는 기존 프로젝트에서 사용하던 폰트를 그대로 유지.
   ================================================================ */

/* 1. 모든 @import 구문은 파일 최상단에 모아야 합니다 */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,900;1,900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Black+Han+Sans&family=Bodoni+Moda:ital,opsz,wght@0,6..96,400..900;1,6..96,400..900&family=Cinzel:wght@400..900&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,400&family=DM+Serif+Display:ital@0;1&family=Gowun+Batang&family=Inter:wght@300;400;500;600&family=Noto+Sans+KR:wght@100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Sniglet:wght@400;800&display=swap');

/* Maplestory Light — 폰트 파일이므로 @import가 아니라 @font-face 로 로드.
   (잘못된 @import는 index.html 콘솔 MIME 오류의 원인이었음) */
@font-face {
  font-family: 'MaplestoryOTFLight';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_20-04@2.1/MaplestoryOTFLight.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* 2. @font-face 정의 구역 */
/* Freesentation 3 Light */
@font-face {
  font-family: 'Freesentation';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2404@1.0/Freesentation-3Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
}

/* Freesentation 4 Regular */
@font-face {
  font-family: 'Freesentation';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2404@1.0/Freesentation-4Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}

/* 3. 테마 변수 및 리셋 */
:root {
  --font-display: 'DM Serif Display', serif;
  --font-body: 'Freesentation', sans-serif;

  --color-ink: #0d0d0d;
  --color-paper: #f5f3ef;
  --color-paper-dark: #edeae4;
  --color-muted: #8a8680;
  --color-accent: #c8a96e;
  --color-border: #d4cfc7;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  background-color: var(--color-paper);
  color: var(--color-ink);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

img,
video,
iframe,
svg {
  max-width: 100%;
}

/* Scrollbar 4px */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

/* 앵커 이동 시 고정 헤더(64px)에 가려지지 않도록 */
section[id] {
  scroll-margin-top: 64px;
}

/* 4. 페이드인 / 키프레임 */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scrollLine {
  0%   { height: 0; top: 0; }
  50%  { height: 100%; top: 0; }
  100% { height: 0; top: 100%; }
}

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease var(--fade-delay, 0ms), transform 0.7s ease var(--fade-delay, 0ms);
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 5. 헤더 / 내비게이션 */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0 2.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #121212;
  border-bottom: 1px solid transparent;
  transition: all 0.4s ease;
}

#site-header.scrolled {
  background-color: rgba(18, 18, 18, 0.92);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--color-border);
}

.logo {
  font-family: 'Freesentation', sans-serif;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.desktop-nav {
  display: none;
  gap: 2.5rem;
  align-items: center;
}

.desktop-nav a {
  font-family: 'Freesentation', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  transition: color 0.2s;
}

.desktop-nav a:hover {
  color: var(--color-ink);
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 1px;
  background-color: var(--color-ink);
  transition: all 0.3s ease;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  transform: scaleX(0);
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background-color: var(--color-paper);
  border-bottom: 1px solid var(--color-border);
  padding: 1.5rem 2.5rem;
  display: none;
  flex-direction: column;
  gap: 1.5rem;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  font-size: 1.2rem;
  font-family: 'Freesentation', sans-serif;
  color: var(--color-ink);
}

@media (min-width: 768px) {
  .desktop-nav {
    display: flex;
  }
  .hamburger {
    display: none;
  }
  .mobile-menu {
    display: none !important;
  }
}

/* 인트로 진행 중 상단 고정 헤더 숨김 */
html.intro-active .site-header {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

/* 인트로 동안 페이지 스크롤 잠금 (키보드 스페이스·앵커 점프 등 우회 차단) */
html.intro-lock,
html.intro-lock body {
  overflow: hidden;
  /* 앵커 이동(#top 등) 시 smooth 스크롤이 잠금을 우회해 페이지를 밀어내지 않도록 */
  scroll-behavior: auto;
  overscroll-behavior: none;
}

html.intro-lock {
  touch-action: none;
}

/* 6. 히어로 */
.hero {
  min-height: 100vh;
  min-height: 100svh; /* 모바일 브라우저 주소창/툴바로 인한 영상 잘림 방지 */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 2.5rem 5rem;
  position: relative;
  overflow: hidden;
}

#hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  z-index: 0;
  pointer-events: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0);
  z-index: 1;
  pointer-events: none;
}

.hero-grain {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 70% 20%, rgba(200, 169, 110, 0.06) 0%, transparent 60%);
  z-index: 1;
  pointer-events: none;
}

/* 타이틀 강조용 비네팅 (main.js가 진행률에 맞춰 opacity 제어) */
.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 34%, rgba(16, 14, 11, 0.45) 88%, rgba(16, 14, 11, 0.7) 100%);
  opacity: 0;
}

/* 인트로 중앙 G_JUNEMON 타이틀 (휠 진행률에 따라 translateY/opacity 변경) */
.hero-title-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}

.hero-title {
  font-family: 'Bodoni Moda', serif;
  font-weight: 700;
  font-size: clamp(2.5rem, 13vw, 12rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-paper);
  text-align: center;
  line-height: 1;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(85vh);
  will-change: transform, opacity;
  user-select: none;
}

.hero-content {
  max-width: 1100px;
  position: relative;
  z-index: 2;
}

.hero-content p {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.2s forwards;
}

.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  right: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  animation: fadeUp 0.9s ease 1s forwards;
}

.scroll-line {
  width: 1px;
  height: 50px;
  background-color: var(--color-border);
  position: relative;
  overflow: hidden;
}

.scroll-line-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-accent);
  animation: scrollLine 1.8s ease-in-out infinite;
}

.scroll-indicator > span {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted);
  writing-mode: vertical-rl;
}

/* 7. WORKS 섹션 */
#work {
  padding: 6rem 2.5rem;
  border-top: 1px solid var(--color-border);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.title-serif {
  font-family: 'Bodoni Moda', serif;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
}

.link-viewmore {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--color-ink);
  color: var(--color-ink);
  padding: 0.6rem 1.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background-color 0.25s, color 0.25s;
}

.link-viewmore:hover {
  background-color: var(--color-ink);
  color: var(--color-paper);
}

/* 그리드 아래 View More (우측 정렬) */
.section-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 2rem;
}

.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.filter-btn {
  background: transparent;
  color: var(--color-muted);
  border: 1px solid var(--color-ink);
  padding: 0.4rem 1rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-color 0.2s, color 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--color-ink);
  color: var(--color-paper);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background-color: var(--color-paper);
  border: 1px solid var(--color-border);
}

/* 셀 테두리 방식 — 필터링 시 빈 영역이 회색(gap 배경)으로 보이지 않음 */
.work-grid > .fade-in {
  min-width: 0; /* 그리드 셀: 긴 텍스트가 트랙을 밀어내지 않도록 */
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.work-grid > .fade-in:nth-child(4n) {
  border-right: none;
}

/* JS(syncGridHairlines)가 마지막 행 셀에 부여 */
.work-grid > .fade-in.no-bottom {
  border-bottom: none;
}

@media (max-width: 1024px) {
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .work-grid > .fade-in:nth-child(4n) {
    border-right: 1px solid var(--color-border);
  }
  .work-grid > .fade-in:nth-child(2n) {
    border-right: none;
  }
}

@media (max-width: 640px) {
  .work-grid {
    grid-template-columns: 1fr;
  }
  .work-grid > .fade-in:nth-child(2n) {
    border-right: 1px solid var(--color-border);
  }
  .work-grid > .fade-in:nth-child(n) {
    border-right: none;
  }
}

.work-card {
  min-width: 0; /* 카드가 그리드 셀 너비를 넘지 않도록 */
  background-color: var(--color-paper);
  cursor: pointer;
  overflow: hidden;
}

.work-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: var(--color-paper-dark);
}

.work-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease, filter 0.6s ease;
}

.work-card:hover .work-thumb-img {
  transform: scale(1.04);
  filter: brightness(0.9);
}

.work-category {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: var(--color-paper);
  padding: 0.25rem 0.6rem;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.work-body {
  padding: 1.25rem;
}

.work-title-row {
  width: 100%;
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.work-title {
  font-family: 'Freesentation', sans-serif;
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  line-height: 1.3;

  /* 🔥 1줄 말줄임 처리 (우선순위 강제 적용) */
  display: block !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.work-client-row {
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.work-client {
  font-size: 0.75rem;
  color: var(--color-muted);
}

/* 태그 칩 (tags 배열 표시) */
.work-tags {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.work-tag-chip {
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  line-height: 1.4;
}

/* 빈 그리드 안내 */
.empty-state {
  grid-column: 1 / -1;
  padding: 3.5rem 1rem;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* 8. ABOUT 섹션 */
#about {
  padding: 6rem 2.5rem;
  border-top: 1px solid var(--color-border);
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

.title-about {
  font-family: 'Bodoni Moda', serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 6rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

/* 9. SERVICES 섹션 — 라이트 리디자인 (원본 다크 버전은 하단 주석으로 보관) */
#services {
  padding: 6rem 2.5rem;
  border-top: 1px solid var(--color-border);
  background-color: var(--color-paper);
}

.services-label {
  font-size: 1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 3rem;
}

/* 가운데 정렬 유지: 열 수를 고정하고 최대 폭을 제한 */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  max-width: 1280px;
  margin: 0 auto;
  border: 1px solid var(--color-border);
  background-color: var(--color-paper);
}

.services-grid > .fade-in {
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.services-grid > .fade-in:nth-child(4n) {
  border-right: none;
}

.services-grid > .fade-in:nth-last-child(-n + 4) {
  border-bottom: none;
}

.service {
  padding: 2.5rem 2rem;
  height: 100%;
  transition: background-color 0.3s ease;
}

.service:hover {
  background-color: var(--color-paper-dark);
}

.service-num {
  font-size: 0.7rem;
  color: var(--color-accent);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 1rem;
}

.service h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.service p {
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--color-muted);
}

@media (max-width: 1199px) {
  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 720px;
  }
  .services-grid > .fade-in:nth-child(4n) {
    border-right: 1px solid var(--color-border);
  }
  .services-grid > .fade-in:nth-child(2n) {
    border-right: none;
  }
  .services-grid > .fade-in:nth-last-child(-n + 4) {
    border-bottom: 1px solid var(--color-border);
  }
  .services-grid > .fade-in:nth-last-child(-n + 2) {
    border-bottom: none;
  }
}

@media (max-width: 640px) {
  .services-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
  }
  .services-grid > .fade-in:nth-child(2n) {
    border-right: 1px solid var(--color-border);
  }
  .services-grid > .fade-in:nth-child(n) {
    border-right: none;
  }
  .services-grid > .fade-in:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--color-border);
  }
  .services-grid > .fade-in:nth-last-child(-n + 1) {
    border-bottom: none;
  }
}

/* ══ [복원용 참고] 원래 다크 서비스 스타일 ══
   #services { background-color: var(--color-ink); color: var(--color-paper); }
   .services-grid { grid-template-columns: repeat(auto-fill, minmax(320px,1fr));
                    gap: 0; border-top: 1px solid rgba(245,243,239,0.12);
                    max-width: none; margin: 0; border: 0; background: none; }
   .services-grid > .fade-in { border: 0; }
   .service { border-bottom: 1px solid rgba(245,243,239,0.12);
              border-right: 1px solid rgba(245,243,239,0.12); }
   .service:hover { background-color: transparent; }
   .service p { color: rgba(245,243,239,0.55); }
*/

/* 10. CONTACT 섹션 */
#contact {
  padding: 6rem 2.5rem 5rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.contact-label {
  font-family: 'Freesentation', sans-serif;
  font-weight: 300;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 2rem;
}

.title-contact {
  font-family: 'Bodoni Moda', serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 6rem);
  letter-spacing: 0;
  line-height: 0.95;
  margin: 0 auto 3rem;
  max-width: 700px;
}

.title-contact span {
  font-style: italic;
}

.contact-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-solid {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--color-ink);
  color: var(--color-paper);
  padding: 0.9rem 2rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity 0.2s;
}

.btn-solid:hover {
  opacity: 0.8;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--color-ink);
  color: var(--color-ink);
  padding: 0.9rem 2rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-color 0.2s, color 0.2s;
}

.btn-outline:hover {
  background-color: var(--color-ink);
  color: var(--color-paper);
}

/* 11. FOOTER */
footer {
  padding: 2rem 2.5rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-text {
  font-size: 0.75rem;
  color: var(--color-muted);
}

/* 12. YouTube 모달 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal[hidden] {
  display: none;
}

.modal-inner {
  position: relative;
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  background-color: #000;
}

#youtube-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.modal-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  color: var(--color-paper);
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem;
}

/* 13. 반응형 미세 조정 (모바일 / 태블릿 / 데스크톱) */
@media (max-width: 1024px) {
  #work,
  #about,
  #services,
  #contact {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (max-width: 640px) {
  #site-header,
  #work,
  #about,
  #services,
  #contact,
  footer {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .hero {
    padding: 0 1.25rem 5rem;
  }

  .mobile-menu {
    padding: 1.5rem 1.25rem;
  }

  .scroll-indicator {
    right: 1.25rem;
    bottom: 2.5rem;
  }

  .work-body {
    padding: 1rem;
  }

  .service {
    padding: 2rem 1.25rem;
  }
}