/* =========================================================
 * fullpage.css
 * 풀페이지 스크롤 기본 틀
 * - 방식: native scroll 컨테이너 + scrollTo({behavior:'smooth'})
 *         (참고: velog igun0423 풀페이지 스크롤 글)
 * - 풀페이지 모드 조건: (너비 >= 1280px) AND (높이 >= 800px)
 * - 그 외(좁거나/낮은 화면): 일반 세로 스크롤로 폴백
 * ========================================================= */

/* ===== 전역 ===== */
html,
body {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  overscroll-behavior: none;
}

.wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

/* ===== 풀페이지 컨테이너 (네이티브 스크롤 사용) ===== */
#fullpage {
  position: relative !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden !important;
  overflow-y: scroll !important; /* JS가 scrollTo로 제어 */
  scroll-behavior: smooth; /* CSS smooth 도 함께 활성화 */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox 스크롤바 숨김 */
  -ms-overflow-style: none; /* IE/Edge 스크롤바 숨김 */
}
#fullpage::-webkit-scrollbar {
  /* WebKit 스크롤바 숨김 */
  display: none;
  width: 0;
  height: 0;
}

/* ===== 섹션 ===== */
.fp-section {
  position: relative;
  width: 100%;
  height: 100vh; /* 정확히 한 화면 */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #fff;
}

/* 메인(영상) 섹션 */
.fp-section.fp-hero {
  background: #000 !important;
}
.fp-section.fp-hero video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.fp-section.fp-hero .fp-hero-overlay {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  color: #fff;
  text-align: left;
}
.fp-section.fp-hero .fp-hero-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #00000065;
  pointer-events: none;
}
.fp-section.fp-hero .fp-hero-overlay > * {
  position: relative;
  z-index: 1;
}
.fp-section.fp-hero .fp-hero-copy {
  text-align: left;
}
.fp-section.fp-hero .fp-hero-slides {
  display: grid;
  text-align: left;
  overflow: hidden;
}
.fp-section.fp-hero .fp-hero-slides > div {
  grid-area: 1 / 1;
  z-index: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(48px);
  transition:
    opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.65s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.65s;
  pointer-events: none;
  text-align: left;
}
.fp-section.fp-hero .fp-hero-slides > div.is-active {
  z-index: 2;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}
.fp-section.fp-hero .fp-hero-slides > div.is-entering.from-right {
  z-index: 2;
  visibility: visible;
  opacity: 0;
  transform: translateX(48px);
}
.fp-section.fp-hero .fp-hero-slides > div.is-entering.is-active {
  opacity: 1;
  transform: translateX(0);
}
.fp-section.fp-hero .fp-hero-slides > div.is-active.is-leaving.to-left,
.fp-section.fp-hero .fp-hero-slides > div.is-leaving.to-left {
  z-index: 1;
  visibility: visible;
  opacity: 0;
  transform: translateX(-48px);
  pointer-events: none;
}
.fp-section.fp-hero .fp-hero-slides > div > p:first-of-type {
  margin-bottom:10px;
  font-size: min(14px, calc(100vw * 14 / 1300));
  font-weight: 400;
  color: #A4CFE5;
  text-align: left;
}
.fp-section.fp-hero .fp-hero-slides > div > h2 {
  display: block;
  margin-bottom: 10px;
  font-size: min(62px, calc(100vw * 62 / 1300));
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.03em;
  word-break: keep-all;
  color: #fff;
  text-align: left;
}
.fp-section.fp-hero .fp-hero-slides > div > h2::before {
  content: none;
  display: none;
}
.fp-section.fp-hero .fp-hero-slides > div > p:last-of-type {
  margin: 0;
  font-size: min(19px, calc(100vw * 19 / 1300));
  font-weight: 400;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.88);
  word-break: keep-all;
  text-align: left;
}
.fp-section.fp-hero .fp-hero-pager {
  display: flex;
  align-items: center;
  gap: min(32px, calc(100vw * 32 / 1300));
  margin-top: min(52px, calc(100vw * 52 / 1300));
}
.fp-section.fp-hero .fp-hero-pager > button {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: color 0.25s ease, transform 0.25s ease;
}
.fp-section.fp-hero .fp-hero-pager > button svg {
  width: 9px;
  height: 16px;
}
.fp-section.fp-hero .fp-hero-pager > button:hover {
  color: #fff;
  transform: scale(1.08);
}
.fp-section.fp-hero .fp-hero-pager > button svg path {
  stroke-width: 2;
}
.fp-section.fp-hero .fp-hero-pager > div {
  display: flex;
  align-items: center;
  gap: min(12px, calc(100vw * 12 / 1300));
}
.fp-section.fp-hero .fp-hero-pager > div > button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition:
    width 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.45s ease,
    box-shadow 0.45s ease;
}
.fp-section.fp-hero .fp-hero-pager > div > button.is-active {
  width: min(42px, calc(100vw * 42 / 1300));
  background: #fff;
  box-shadow: none;
}

@media (max-width: 1280px) {
  .fp-section.fp-hero .fp-hero-copy,
  .fp-section.fp-hero .fp-hero-slides,
  .fp-section.fp-hero .fp-hero-slides > div,
  .fp-section.fp-hero .fp-hero-slides > div > p:first-of-type,
  .fp-section.fp-hero .fp-hero-slides > div > h2,
  .fp-section.fp-hero .fp-hero-slides > div > p:last-of-type {
    text-align: center;
  }
  .fp-section.fp-hero .fp-hero-slides > div > h2 {
    font-size: 48px;
  }
  .fp-section.fp-hero .fp-hero-slides > div > p:first-of-type {
    font-size: 16px;
    line-height: 1.6;
  }
  .fp-section.fp-hero .fp-hero-slides > div > p:last-of-type {
    font-size: 19px;
    line-height: 1.6;
  }
  .fp-section.fp-hero .fp-hero-pager {
    justify-content: center;
    gap: 24px;
    margin-top: 36px;
  }
  .fp-section.fp-hero .fp-hero-pager > button {
    width: 12px;
    height: 12px;
  }
  .fp-section.fp-hero .fp-hero-pager > button svg {
    width: 8px;
    height: 14px;
  }
  .fp-section.fp-hero .fp-hero-pager > div {
    gap: 10px;
  }
  .fp-section.fp-hero .fp-hero-pager > div > button {
    width: 6px;
    height: 6px;
  }
  .fp-section.fp-hero .fp-hero-pager > div > button.is-active {
    width: 32px;
  }
}

@media (max-width: 1080px) {
  .fp-section.fp-hero .fp-hero-slides > div > h2 {
    font-size: min(40px, 4vw);
  }
  .fp-section.fp-hero .fp-hero-slides > div > p:first-of-type,
  .fp-section.fp-hero .fp-hero-slides > div > p:last-of-type {
    line-height: 1.4;
    font-size: min(17px, 1.7vw);
  }
}

@media (max-width: 900px) {
  .fp-section.fp-hero .fp-hero-overlay {
    position: absolute;
    inset: 0;
    align-items: stretch;
  }
  .fp-section.fp-hero .fp-hero-copy {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 24px 88px;
    box-sizing: border-box;
  }
  .fp-section.fp-hero .fp-hero-pager {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 50px;
    margin-top: 0;
    justify-content: center;
  }
  .fp-section.fp-hero .fp-hero-slides > div > p:first-of-type {
    font-size: 17px;
    color: #A4CFE5;
    text-shadow: none;
  }
  .fp-section.fp-hero .fp-hero-slides > div > h2 {
    font-size: min(44px, 6vw);
    text-shadow: none;
  }
  .fp-section.fp-hero .fp-hero-slides > div > p:last-of-type {
    font-size: min(20px, 3.2vw);
    color: rgba(255, 255, 255, 0.96);
    text-shadow: none;
  }
  .fp-section.fp-hero .fp-hero-slides > div[data-index="1"] > h2 br {
    display: block;
  }
}

.fp-section.fp-hero .fp-hero-slides > div > p br,
.fp-section.fp-hero .fp-hero-slides > div > h2 br {
  display: none;
}

@media (max-width: 500px) {
  .fp-section.fp-hero .fp-hero-slides > div[data-index="2"] > p:last-of-type br {
    display: block;
  }
}

@media (max-width: 600px) {
  .fp-section.fp-hero .fp-hero-slides > div[data-index="0"] > h2 br,
  .fp-section.fp-hero .fp-hero-slides > div[data-index="1"] > h2 br,
  .fp-section.fp-hero .fp-hero-slides > div[data-index="2"] > h2 br {
    display: block;
  }
  .fp-section.fp-hero .fp-hero-slides > div > h2 {
    font-size: min(42px, 7vw);
  }
  .fp-section.fp-hero .fp-hero-slides > div > p:first-of-type {
    font-size: min(13px, 3.2vw);
  }
  .fp-section.fp-hero .fp-hero-slides > div > p:last-of-type {
    font-size: min(16px, 4vw);
  }
  .fp-section.fp-hero .fp-hero-pager {
    gap: 22px;
    bottom: 50px;
  }
  .fp-section.fp-hero .fp-hero-pager > button {
    width: 12px;
    height: 12px;
  }
  .fp-section.fp-hero .fp-hero-pager > button svg {
    width: 8px;
    height: 14px;
  }
  .fp-section.fp-hero .fp-hero-pager > div {
    gap: 10px;
  }
  .fp-section.fp-hero .fp-hero-pager > div > button {
    width: 6px;
    height: 6px;
  }
  .fp-section.fp-hero .fp-hero-pager > div > button.is-active {
    width: 30px;
  }
}

/* ===== 풀페이지 컨테이너 끝의 일반 푸터 ===== */
#fullpage > footer {
  flex-shrink: 0;
  width: 100%;
}

/* ===== 헤더 (항상 최상단 고정) ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 200;
}

/* ===== 좌측 페이지 인디케이터 ===== */
.fp-indicator {
  position: fixed;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fp-indicator .fp-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
  border: 1px solid var(--color-text-muted);
  cursor: pointer;
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s ease,
    box-shadow 0.3s ease;
  display: block;
}
.fp-indicator .fp-dot:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  transform: scale(1.3);
}
.fp-indicator .fp-dot.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  transform: scale(1.6);
  box-shadow: 0 0 0 4px rgba(48, 187, 193, 0.2);
}
.fp-indicator .fp-dot .fp-tooltip {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  background: var(--color-text-strong);
  color: var(--color-white);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  letter-spacing: -0.02em;
}
.fp-indicator .fp-dot:hover .fp-tooltip {
  opacity: 1;
}

/* 메인(영상) 섹션 위에선 인디케이터를 흰색으로 */
.fp-indicator.on-dark .fp-dot {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: none;
}
.fp-indicator.on-dark .fp-dot:hover {
  background: var(--color-white);
  border-color: var(--color-white);
}
.fp-indicator.on-dark .fp-dot.active {
  background: var(--color-white);
  border-color: var(--color-white);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
}

/* ===== 스크롤 다운 안내 ===== */
.fp-scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 70px;
  transform: translateX(-50%);
  z-index: 2;
  color: #fff;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0.9;
  animation: fp-bounce 2s infinite;
}
@keyframes fp-bounce {
  0%,
  100% {
    transform: translate(-50%, 0);
    opacity: 0.9;
  }
  50% {
    transform: translate(-50%, 8px);
    opacity: 0.4;
  }
}

/* ===== 헤더 nav 활성 상태 (header.css 와 일관, 변수 기반) ===== */
header nav .gnb li a.active {
  color: var(--color-accent);
  font-weight: 700;
}
header.on nav .gnb li a.active {
  color: var(--color-accent);
}

/* ===== 일반 스크롤 폴백 =====
 * 조건1) CSS 미디어 쿼리: 화면 너비 < 1280  또는  화면 높이 < 800
 * 조건2) JS 가 body 에 .fp-fallback 클래스 토글 (이중 안전망)
 *        둘 중 하나라도 만족하면 일반 스크롤로 동작
 */
@media (max-width: 1279px), (max-height: 799px) {
  html,
  body {
    overflow: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100% !important;
    position: static !important;
    -webkit-overflow-scrolling: touch; /* iOS 관성 스크롤 */
    overscroll-behavior-y: auto;
  }
  .wrap {
    height: auto !important;
    min-height: 100vh;
  }
  #fullpage {
    position: static !important;
    overflow: visible !important;
    overflow-y: visible !important;
    width: 100% !important;
    height: auto !important;
    scroll-behavior: auto !important;
  }
  /* 섹션은 컨텐츠 높이만큼만 (고정 100vh 해제) */
  .fp-section {
    height: auto !important;
    min-height: 0 !important;
    display: block !important;
  }
  /* 메인 영상 섹션은 비디오 배경 비율 유지 */
  .fp-section.fp-hero {
    height: auto !important;
    min-height: 0 !important;
    display: flex !important;
    aspect-ratio: 16/9;
    padding: 0;
  }
  .fp-section.fp-hero .fp-hero-copy {
    width: 100%;
    padding: 48px 24px;
  }
  .fp-hero-pager {
    margin-top: 28px;
  }
  .fp-indicator,
  .fp-scroll-hint {
    display: none !important;
  }
}

/* JS 강제 폴백 (미디어 쿼리와 동일 효과 - 이중 안전망) */
/* JS 가 <html>, <body> 모두에 .fp-fallback 클래스를 추가합니다. */
html.fp-fallback,
body.fp-fallback {
  overflow: auto !important;
  overflow-x: hidden !important;
  height: auto !important;
  min-height: 100% !important;
  position: static !important;
  -webkit-overflow-scrolling: touch; /* iOS 관성 스크롤 */
  overscroll-behavior-y: auto;
}
body.fp-fallback .wrap {
  height: auto !important;
  min-height: 100vh;
}
body.fp-fallback #fullpage {
  position: static !important;
  overflow: visible !important;
  overflow-y: visible !important;
  width: 100% !important;
  height: auto !important;
  scroll-behavior: auto !important;
}
/* 섹션은 컨텐츠 높이만큼만 (고정 100vh 해제) */
body.fp-fallback .fp-section {
  height: auto !important;
  min-height: 0 !important;
  display: block !important;
}
/* 메인 영상 섹션은 비디오 배경 비율 유지 */
body.fp-fallback .fp-section.fp-hero {
  height: auto !important;
  min-height: 0 !important;
  display: flex !important;
  padding: 0;
  aspect-ratio: 16/9;
}
body.fp-fallback .fp-section.fp-hero .fp-hero-copy {
  width: 100%;
  padding: 48px 24px;
}
body.fp-fallback .fp-hero-pager {
  margin-top: 28px;
}
body.fp-fallback .fp-indicator,
body.fp-fallback .fp-scroll-hint {
  display: none !important;
}

/* 900px 이하: 폴백(16/9)보다 뒤에 두어 영상 영역을 세로로 확장 */
@media (max-width: 900px) {
  .fp-section.fp-hero,
  body.fp-fallback .fp-section.fp-hero {
    aspect-ratio: auto !important;
    min-height: 75vh !important;
    height: auto !important;
  }
  .fp-section.fp-hero .fp-hero-copy,
  body.fp-fallback .fp-section.fp-hero .fp-hero-copy {
    padding: 56px 24px 88px;
  }
}

/* 600px 이하: 영상 영역 높이 뷰포트의 70% */
@media (max-width: 600px) {
  .fp-section.fp-hero,
  body.fp-fallback .fp-section.fp-hero {
    position: relative !important;
    min-height: calc(100vh * 0.6) !important;
    height: auto !important;
  }
}
