/* =========================================
   1. 기본 설정 & 폰트 (GLOBAL)
   ========================================= */
@import url("https://fonts.googleapis.com/css2?family=Syne:wght@800&display=swap");

:root {
  --bg-color: #f9f8f4;
  --white: #ffffff;
  --text-main: #1d1d1f;
  --text-sub: #86868b;
  --border: #d2d2d7;
  --accent: #000000;

  /* 헤더 커스터마이즈 */
  --header-h: 70px; /* 헤더 높이 */
  --header-pad-x: 40px; /* 좌우 여백 */
  --logo-h: 56px; /* 로고 이미지 높이 */
  --menu-gap: 30px; /* PC 메뉴 간격 */
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans KR", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  word-break: keep-all;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s;
}

ul,
li {
  list-style: none;
}

/* 공통 main / section */
main {
  padding-top: var(--header-h); /* header fixed */
  min-height: 100vh;
}

section {
  position: relative;
}

/* 공통 inner (페이지 섹션용) */
.inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
}

/* =========================================
      2. HEADER (PC + Mobile 공통)
      - 기본 상태: 로고 왼쪽, 메뉴 오른쪽
      - 모바일: 햄버거 + 오버레이 메뉴
      - nav-compact: 로고 숨김 + 햄버거만 유지 + 오버레이 메뉴
      ========================================= */

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-h);
  z-index: 5000;

  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 0;
  box-shadow: none;
}

header::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: block;
  background: rgba(0, 0, 0, 0); /* 기본 0 */
  transition: background 180ms ease;
}

header .inner {
  height: var(--header-h);
  max-width: none;

  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--header-pad-x);
}

/* Logo */
header .logo {
  margin-top: 20px;
  position: static;
  transform: none;
  opacity: 1;
  pointer-events: auto;
  z-index: 5100;
}

header .logo a {
  display: flex;
  align-items: center;
  height: var(--header-h);
}

header .logo img {
  height: var(--logo-h);
  width: auto;
  display: block;
}

/* PC 메뉴 */
header .gnb {
  position: relative;
  z-index: 1100;
}

header .gnb ul {
  display: flex;
  gap: var(--menu-gap);
}

header .gnb a {
  font-family: "Noto Sans KR", sans-serif; /* Inter 미사용이면 안전하게 */
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  color: rgba(0, 0, 0, 0.72);
  opacity: 1;
}

header .gnb a:hover {
  color: rgba(0, 0, 0, 0.92);
}

/* 햄버거 버튼 (기본: PC 숨김) */
.btn-menu {
  display: none;
  background: none;
  border: none;
  width: 30px;
  height: 30px;
  position: relative;
  cursor: pointer;
  z-index: 4000;
}

.btn-menu span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text-main);
  margin: 6px 0;
  transition: 0.3s;
}

/* drop-shadow (원하면 제거 가능) */
header .logo img,
header .gnb a {
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.12));
}
/* 헤더가 밝은/복잡한 배경 위일 때 가독성 올리는 모드 */
header.is-invert::before {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.42),
    rgba(0, 0, 0, 0.22) 60%,
    rgba(0, 0, 0, 0)
  );
}
header.is-invert .logo img {
  filter: invert(1) brightness(1.25) contrast(1.15);
}
header.is-invert .gnb a {
  color: rgba(255, 255, 255, 0.98);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
  filter: none; /* drop-shadow 대신 text-shadow로 통일 */
}

/* =========================================
      3. Sub Visual (공통)
      ========================================= */
.sub-visual {
  padding-top: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: var(--bg-color);
}

.sub-visual h2 {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 10px;
  color: var(--text-main);
}

.sub-visual p {
  font-size: 20px;
  color: var(--text-sub);
}

/* =========================================
      4. Footer (공통)
      ========================================= */
footer {
  padding: 60px 0;
  text-align: center;
  background: var(--white);
  border-top: 1px solid #e5e5ea;
  color: var(--text-sub);
  font-size: 13px;
}

/* =========================================
      5. Responsive
      ========================================= */
@media (max-width: 1024px) {
  :root {
    --header-pad-x: 60px;
  }

  .inner {
    padding: 0 60px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-pad-x: 20px;
  }

  .inner {
    padding: 0 7%;
  }

  /* 모바일: PC 메뉴 대신 햄버거 */
  .btn-menu {
    display: block;
  }

  /* 모바일에서 gnb를 오버레이 메뉴로 */
  header .gnb {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 3500;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);

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

  header .gnb.active {
    right: 0;
  }

  header .gnb ul {
    flex-direction: column;
    text-align: center;
    gap: 40px;
  }

  header .gnb a {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
  }

  /* 햄버거 X 애니메이션 */
  .btn-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
  }
  .btn-menu.active span:nth-child(2) {
    opacity: 0;
  }
  .btn-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
  }

  .sub-visual h2 {
    font-size: 42px;
  }
}

@media (max-width: 480px) {
  .inner {
    padding: 0 20px;
  }
}

/* =========================================
      6. Scroll Compact Header
      header.nav-compact 이 붙으면:
      - 로고 숨김
      - 햄버거는 고정 노출
      - 메뉴는 오버레이 방식 유지(모바일과 동일)
      ========================================= */
header.nav-compact {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}

/* 로고 숨김 */
header.nav-compact .logo {
  opacity: 0;
  pointer-events: none;
}

/* nav-compact 상태에서 햄버거 강제 노출 + 위치 고정 */
header.nav-compact .btn-menu {
  display: block;
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 4000;
}

/* nav-compact에서 햄버거 라인 */
header.nav-compact .btn-menu span {
  background-color: #111;
}

/* nav-compact에서 gnb를 오버레이로 강제 */
header.nav-compact .gnb {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 3500;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);

  opacity: 1;
  pointer-events: auto;

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

header.nav-compact .gnb.active {
  right: 0;
}

header.nav-compact .gnb ul {
  display: flex;
  flex-direction: column;
  gap: 40px;
  text-align: center;
}

header.nav-compact .gnb a {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
}

/* =========================================
      7. Typography (Optional)
      ========================================= */
.main-visual h2,
.sub-visual h2,
.scene .content-text h3,
.project-detail .hero-txt h2,
.project-detail .flow-title h3,
.project-detail .flow-text h4 {
  letter-spacing: -0.5px;
}
header::before {
  z-index: 0;
}
header .inner {
  position: relative;
  z-index: 1;
}
