:root {
  --color-black: #000000;
  --color-white: #ffffff;
  --color-point: #E65529;
  --color-beige: #F2EDE4;
}

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

html, body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--color-black);
  /* body 배경은 footer와 동일한 검정으로 맞춘다. 다른 섹션은 전부 자기 배경으로
     화면을 꽉 채우기 때문에 평소엔 안 보이지만, section3 하단 모서리가 둥글게
     깎일 때 그 안쪽으로 이 배경이 드러나므로 footer 색과 이어지게 맞춰야 한다
     (samik.co.kr도 html 배경을 footer 배경과 동일한 색으로 맞춰서 이음새를 없앰). */
  background: var(--color-black);
  /* 모바일에서 footer 끝을 넘어 스크롤될 때(주소창 표시/숨김에 따른 뷰포트 변화,
     바운스 스크롤) 배경색이 드러나는 것을 막는다. */
  overscroll-behavior-y: none;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* ---------- GNB ---------- */
.gnb {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  transition: transform 0.35s ease;
}

.gnb--hidden {
  transform: translateY(-100%);
}

.gnb__logo img {
  height: 36px;
  filter: brightness(0) invert(1);
  transition: filter 0.25s ease;
}

.gnb__nav ul {
  display: flex;
  gap: 32px;
}

.gnb__nav a {
  color: var(--color-white);
  font-weight: 600;
  font-size: 15px;
  transition: color 0.2s ease;
}

.gnb__nav a:hover {
  color: var(--color-black);
}

/* 배경이 밝은 섹션(section2, section3 등) 위에 있을 때: 검정 텍스트 + hover 시 포인트컬러 */
.gnb--light .gnb__logo img {
  filter: none;
}

.gnb--light .gnb__nav a {
  color: var(--color-black);
}

.gnb--light .gnb__nav a:hover {
  color: var(--color-point);
}

/* 모바일 메뉴 패널(흰 배경)이 열려있는 동안은 gnb 테마와 무관하게 로고를 검정으로 */
.gnb--menu-open .gnb__logo img {
  filter: none;
}

/* ---------- GNB 햄버거 버튼 (모바일 전용) ---------- */
.gnb__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 22px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.gnb__burger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-white);
  transition: background 0.25s ease, transform 0.25s ease, opacity 0.25s ease;
}

.gnb--light .gnb__burger span {
  background: var(--color-black);
}

.gnb__burger.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.gnb__burger.is-active span:nth-child(2) {
  opacity: 0;
}

.gnb__burger.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 버거 버튼이 열림 상태일 땐 배경 섹션과 상관없이 항상 검정 X 아이콘(메뉴 패널이 흰/검정 배경이므로) */
.gnb__burger.is-active span {
  background: var(--color-black);
}

/* ---------- 모바일 메뉴 드로어 ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-white);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu__nav ul {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.mobile-menu__nav a {
  color: var(--color-black);
  font-size: 28px;
  font-weight: 700;
}

/* ---------- fullPage 스냅 (section1~3) ----------
   기본: .page 가 뷰포트에 고정(fixed)된 채, 내부 .snap-section들이 절대배치로
   쌓여있다가 wheel/touch 한 번에 정확히 한 섹션씩 밀려 올라오며 이전 섹션을 덮는다.
   section3까지 스냅이 끝나면 .page에 is-released 가 붙어 section3만 남기고 일반
   문서 흐름(static)으로 전환된다. footer는 별다른 트릭 없이 그 바로 아래 평범하게
   이어지고, section3 하단의 둥근 모서리가 footer 색이 드러나는 것처럼 보이게 한다
   (samik.co.kr 참고 — sticky pin이 아니라 그냥 둥근 모서리 + 평범한 footer였음). */
.page {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  z-index: 1;
}

.snap-section {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 700ms cubic-bezier(0.65, 0, 0.35, 1);
}

.snap-section.is-current {
  transform: translateY(0);
}

.hero.snap-section { z-index: 1; transform: translateY(0); }
.think.snap-section { z-index: 2; }
.works.snap-section { z-index: 3; }

/* section3까지 스냅을 마치고 일반 스크롤(footer)로 넘어간 상태:
   section3만 평범한 static 블록으로 남기고, 나머지는 그냥 문서 흐름에 맡긴다. */
.page.is-released {
  position: static;
  height: auto;
  overflow: visible;
}

.page.is-released .snap-section {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  transform: none;
  transition: none;
}

.page.is-released .hero,
.page.is-released .think {
  display: none;
}

/* body가 flex column이므로, footer-wrap이 콘텐츠(works+footer)가 뷰포트보다
   짧은 화면에서도 남는 공간을 채워 그 아래로 흰 배경이 드러나지 않게 한다. */
.footer-wrap {
  position: relative;
  z-index: 0;
  flex: 1 0 auto;
}

/* ---------- Section 1 : Hero ---------- */
.hero {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--color-black);
  border-radius: 0 0 0 0;
}

.hero__video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%);
}

.hero__text {
  --hero-font-size: clamp(2.5rem, 6vw, 4.5rem);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 0;
  z-index: 1;
  white-space: nowrap;
}

.hero__text-fixed {
  font-size: var(--hero-font-size);
  line-height: 1;
  font-weight: 800;
  color: var(--color-white);
}

.hero__word-slot {
  position: relative;
  display: inline-block;
  min-width: 6ch;
  font-size: var(--hero-font-size);
  height: 1em;
  line-height: 1;
  overflow: visible;
}

.hero__word {
  position: absolute;
  left: 50%;
  top: 0;
  font-size: 1em;
  line-height: 1;
  font-weight: 800;
  color: var(--color-white);
  transition: opacity 0.5s ease, transform 0.5s ease;
  transform: translate(-50%, 0);
  opacity: 1;
}

.hero__word--enter {
  transform: translate(-50%, 60%);
  opacity: 0;
}

.hero__word--exit {
  opacity: 0;
}

.hero__word-underline {
  position: absolute;
  bottom: -14px;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.6);
}

/* ---------- Section 2 : Think & Design ---------- */
.think {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--color-white);
  padding: 120px 24px;
}

.think__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
}

.think__desc {
  margin-top: 20px;
  font-size: 17px;
  color: var(--color-point);
}

/* section에 처음 도달하면(is-revealed, 한 번 붙으면 계속 유지) 타이틀/서브카피가
   아래에서 위로 살짝 떠오르며 페이드인된다. footer 등장 모션과 동일한 값
   (translateY 24px, 0.6s, 서브카피 0.15s 지연)이며, footer처럼 한 번만 재생되고
   이후 다시 숨겨지지 않는다. */
.think__title,
.think__desc,
.works__title,
.works__desc {
  opacity: 0;
  transform: translateY(24px);
  /* 섹션 자체의 슬라이드업(700ms)이 끝난 뒤에 이어서 떠오르도록 지연시킨다.
     동시에 시작하면 섹션이 화면에 들어올 때 이미 페이드인이 끝나있어 모션이
     안 보이는 것처럼 느껴진다. */
  transition: opacity 0.6s ease 0.5s, transform 0.6s ease 0.5s;
}

.is-revealed .think__title,
.is-revealed .works__title {
  opacity: 1;
  transform: translateY(0);
}

.is-revealed .think__desc,
.is-revealed .works__desc {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.65s;
}

/* ---------- Shared pill button ---------- */
.btn-pill {
  margin-top: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 34px;
  border: 1px solid var(--color-black);
  border-radius: 999px;
  color: var(--color-black);
  font-weight: 600;
  font-size: 15px;
  background: var(--color-white);
  transition: background 0.25s ease, color 0.25s ease;
}

.btn-pill:hover {
  background: var(--color-black);
  color: var(--color-white);
}

.btn-pill--ghost {
  background: transparent;
}

/* ---------- Section 3 : Works marquee ---------- */
.works {
  background: var(--color-beige);
  padding: 100px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* height를 JS로 애니메이션할 때 일부 브라우저가 컨테이너 내부(특히 하단) 콘텐츠를
     리페인트하지 않고 남겨두는 경우가 있어, 별도 레이어로 강제 승격해 방지한다.
     (transform은 이미 snap-section 슬라이드 애니메이션이 쓰고 있어서 건드리지 않는다) */
  backface-visibility: hidden;
}

/* section3 하단 모서리 radius는 script.js가 스크롤에 연동해 0→64px로
   점점 키운다 (footer가 화면에 들어오는 만큼 비례) — samik.co.kr 참고 */

.works__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  text-align: center;
}

.works__desc {
  margin-top: 20px;
  margin-bottom: 48px;
  font-size: 17px;
  color: var(--color-point);
  text-align: center;
}

.marquee {
  width: 100%;
  overflow: hidden;
  cursor: grab;
  margin-bottom: 48px;
}

.marquee.is-dragging {
  cursor: grabbing;
}

.marquee__track {
  display: flex;
  gap: 24px;
  width: max-content;
  /* 위치는 script.js의 rAF 루프가 transform으로 직접 제어한다(드래그 시
     끊김/점프 없이 자연스럽게 이어지도록 CSS 애니메이션 대신 JS로 관리). */
}

.marquee__card {
  width: 320px;
  flex: 0 0 auto;
  user-select: none;
}

.marquee__card-media {
  width: 320px;
  height: 240px;
  border-radius: 32px;
  overflow: hidden;
}

.marquee__card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 원본 이미지 그대로 cover 하면 레퍼런스보다 여백이 많이 남아서,
     카드별로 확대/위치를 조정해 레퍼런스와 비슷하게 크롭한다. */
  transform: scale(1.2);
  object-position: center center;
}

.marquee__card-media--mbk img {
  transform: scale(1.5);
  object-position: center 58%;
}

.marquee__card-media--kdu img {
  transform: scale(1.22);
  object-position: center 48%;
}

.marquee__card-media--vv img {
  transform: scale(1.3);
  object-position: center 32%;
}

.marquee__card p {
  margin-top: 16px;
  font-size: 16px;
  font-weight: 600;
}

/* ---------- Footer ----------
   footer-wrap이 flex:1로 남는 공간을 채우기 때문에, footer 자신도 height:100%로
   그 공간을 따라가며 검정 배경을 끝까지 채운다. 로고~하단 텍스트 간격은
   justify-content: space-between 대신 margin-top으로 고정해, 화면이 남아도
   내용이 위쪽에 자연스럽게 모여 보이게 한다. */
.footer {
  height: 100%;
  background: var(--color-black);
  color: var(--color-white);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 70px 40px 32px;
}

.footer__logo {
  height: 44px;
  filter: brightness(0) invert(1);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.footer__bottom {
  align-self: stretch;
  margin-top: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--color-white);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease 0.15s, transform 0.6s ease 0.15s;
}

.footer-wrap.is-visible .footer__logo,
.footer-wrap.is-visible .footer__bottom {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 반응형: 태블릿(768px) ---------- */
@media (max-width: 768px) {
  .gnb { padding: 16px 20px; }
  .gnb__nav ul { gap: 18px; }
  .works { padding: 72px 0; }
  .marquee__card { width: 260px; }
  .marquee__card-media { width: 260px; height: 195px; }
  .footer { padding: 50px 24px 20px; }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 70px; }
}

/* ---------- 반응형: 모바일(375px) ---------- */
@media (max-width: 480px) {
  .gnb { padding: 14px 16px; }
  .gnb__logo img { height: 28px; }
  .gnb__nav { display: none; }
  .gnb__burger { display: flex; }

  .hero__text { --hero-font-size: clamp(1.6rem, 9vw, 2.5rem); }
  .hero__word-underline { bottom: -10px; }

  .think { padding: 80px 20px; }
  .think__title { font-size: clamp(1.6rem, 8vw, 2.2rem); }
  .think__desc { font-size: 15px; }

  .works { padding: 40px 0; }
  .works__title { font-size: clamp(1.6rem, 8vw, 2.2rem); }
  .works__desc { font-size: 15px; margin-bottom: 32px; }
  .marquee__card { width: 220px; }
  .marquee__card-media { width: 220px; height: 165px; border-radius: 20px; }

  .btn-pill { padding: 12px 26px; font-size: 14px; margin-top: 32px; }

  .footer { padding: 40px 20px 16px; }
  .footer__logo { height: 36px; }
  .footer__bottom { margin-top: 40px; }
}
