/* ============ DFY ODYSSEY — styles ============ */
:root {
  --black: #111;
  --white: #fff;
  --gray-bg: #ececec;
  --gray-text: #666;
  --pad: clamp(20px, 3.5vw, 48px);
  --hero-gap: clamp(10px, 1.3vw, 20px);   /* 히어로 주변 화이트 인셋 (mtn과 동일) */
  --footer-h: clamp(420px, 46vw, 640px);  /* 고정 푸터 리빌 높이 */
  --ease-out: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-hero: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, sans-serif;
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  word-break: keep-all;
  overscroll-behavior: none;               /* 바운스 시 푸터 아래 배경 노출 방지 */
  padding-bottom: var(--footer-h);         /* 고정 푸터를 드러내는 스크롤 여백 */
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; background: none; border: 0; cursor: pointer; color: inherit; }

/* 스크롤 레이어 — 고정 푸터 위를 덮고 올라가는 불투명 판 */
.site { position: relative; z-index: 1; background: var(--white); }

/* ---------- GNB (데스크톱: 흰색 반투명 풀와이드 바 — 크기 모션 없음) ----------
   히어로 아래(두번째 섹션)부터: 스크롤 다운 → 위로 숨김 / 업 → 재등장 */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  transition: transform 0.32s cubic-bezier(0.65, 0, 0.35, 1);
}
.topbar.is-hidden { transform: translateY(-110%); pointer-events: none; }
.topbar__wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 58px;
  padding: 0 var(--pad);
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: background 0.25s ease, border-color 0.25s ease,
              backdrop-filter 0.25s ease, -webkit-backdrop-filter 0.25s ease;
}
.topbar__logo img {
  height: 14px;
  width: auto;
  filter: invert(1);   /* 화이트 바 위 블랙 로고 */
}
.topbar__search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-right: -8px;
  border-radius: 50%;
  color: var(--black);
  transition: background 0.25s, color 0.25s ease;
}
.topbar__search:hover { background: rgba(0, 0, 0, 0.06); }
.topbar__search { position: relative; }
.topbar__search svg { width: 18px; height: 18px; }
@keyframes gnbFade { from { opacity: 0; } to { opacity: 1; } }

/* 검색 아이콘 ↔ X 모핑 (mtn 버거→X와 동일한 인터랙션) */
.ic-search { transition: transform 0.3s var(--ease-out), opacity 0.3s; }
.ic-close {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
}
.ic-close i {
  position: absolute;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}
.ic-close i:nth-child(1) { transform: rotate(45deg); }
.ic-close i:nth-child(2) { transform: rotate(-45deg); }
.topbar.search-open .ic-search { opacity: 0; transform: rotate(90deg) scale(0.6); }
.topbar.search-open .ic-close { opacity: 1; transform: rotate(0) scale(1); }

/* 오버레이 열림: 로고는 오버레이 아래로 사라지고 X 버튼만 남음 (mtn과 동일) */
.topbar.search-open { transform: none !important; pointer-events: auto; }
.topbar.search-open .topbar__logo { opacity: 0; pointer-events: none; }
.topbar__logo { transition: opacity 0.25s ease; }
.topbar.search-open .topbar__wrap,
.topbar.solid.search-open .topbar__wrap {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.topbar.search-open .topbar__search,
.topbar.solid.search-open .topbar__search {
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: var(--white);   /* 데스크톱 다크 오버레이 위 X (모바일은 아래에서 블랙으로 재정의) */
}

/* ---------- search overlay (GNB보다 아래 레이어 — X 버튼이 위에 남음) ---------- */
.search {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(17, 17, 17, 0.82);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  backdrop-filter: blur(24px) saturate(1.2);
  color: var(--white);
  padding: clamp(60px, 12vh, 140px) var(--pad) 40px;
  overflow-y: auto;
  animation: searchIn 0.35s var(--ease-out);
}
@keyframes searchIn { from { opacity: 0; } to { opacity: 1; } }
.search__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 16px;
}
.search__input {
  flex: 1;
  background: none;
  border: 0;
  outline: 0;
  color: var(--white);
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 600;
  font-family: inherit;
}
.search__input::placeholder { color: rgba(255, 255, 255, 0.35); }
.search__results { max-width: 900px; margin: 32px auto 0; }
.search__results li a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  transition: opacity 0.2s;
}
.search__results li a:hover { opacity: 0.6; }
.search__results .r-no { font-size: 12px; color: rgba(255, 255, 255, 0.5); min-width: 90px; }
.search__results .r-month { font-size: 20px; font-weight: 600; min-width: 140px; }
.search__results .r-line { font-size: 14px; color: rgba(255, 255, 255, 0.6); }

/* ---------- hero (mtn heroGrow와 동일한 인터랙션) ---------- */
.hero {
  margin: var(--hero-gap);
  height: calc(100vh - var(--hero-gap) * 2);
  height: calc(100svh - var(--hero-gap) * 2);
  min-height: 480px;
}
.hero__frame {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: clamp(8px, 1vw, 14px);
  transform-origin: center center;
  will-change: transform, border-radius;
  animation: heroGrow 1.25s var(--ease-hero) both;
}
/* 하단 화이트 그라데이션 — 아래 텍스트 블록과 같은 공간으로 읽히게 */
.hero__frame::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36%;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.5) 38%,
    rgba(255, 255, 255, 0.88) 66%,
    #fff 100%);
  pointer-events: none;
}
/* 작은 라운드 카드로 시작 → 위로 커지며 GNB 뒤로 풀블리드 확장 */
@keyframes heroGrow {
  0%   { transform: translateY(9%) scale(0.82); border-radius: clamp(28px, 3vw, 48px); }
  100% { transform: translateY(0) scale(1); border-radius: clamp(8px, 1vw, 14px); }
}
/* 모바일: 풀블리드 히어로 → 오프셋/라운드 없이 은은한 스케일업만 (mtn과 동일) */
@keyframes heroGrowM {
  0%   { transform: scale(0.94); }
  100% { transform: scale(1); }
}
.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ---------- issue ---------- */
/* 히어로 하단을 침범해 이미지와 텍스트가 공간을 공유.
   좌우 패딩은 히어로 인셋보다 깊게 — 텍스트가 이미지 "안"에 놓이도록 */
.issue {
  position: relative;
  z-index: 2;
  margin-top: calc(-1 * clamp(170px, 26vh, 320px));
  padding: 0 calc(var(--hero-gap) + clamp(32px, 5.5vw, 96px)) clamp(100px, 13vw, 200px);
}
[data-speed] { will-change: transform; }
.issue__no {
  font-size: 16px;                /* magazine-b 아이브로우 기준 */
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: clamp(16px, 2vw, 28px);
}
.issue__grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
.issue__title {
  font-size: clamp(56px, 8.5vw, 128px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.03em;
}
.issue__title .word { display: block; overflow: hidden; }
.issue__title .word > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1s var(--ease-out);
}
.issue__title.is-in .word > span { transform: translateY(0); }
.issue__title .word:nth-child(2) > span { transition-delay: 0.08s; }
.issue__lead {
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 20px;
  white-space: pre-line;
}
.issue__sub {
  font-size: clamp(17px, 1.5vw, 21px);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 16px;
}
.issue__col--sub { padding-top: clamp(40px, 6vw, 96px); }
.issue__body {
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: -0.01em;
  color: var(--gray-text);
}
.issue__cta {
  display: flex;
  justify-content: flex-end;
  margin-top: clamp(48px, 6vw, 96px);
}
.cta {
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--black);
  padding-bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.25s;
}
.cta:hover { opacity: 0.55; }
.cta__arrow { transition: transform 0.3s var(--ease-out); }
.cta:hover .cta__arrow { transform: translate(3px, -3px); }

/* ---------- oldies (mtn culture: 흩어진 컬럼 + 패럴랙스) ---------- */
.oldies { background: var(--gray-bg); padding: clamp(64px, 8vw, 120px) 0 clamp(120px, 16vw, 260px); }
.oldies__inner { padding: 0 var(--pad); }
.oldies__title {
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: clamp(48px, 6vw, 96px);
}
.oldies__title span {
  border-bottom: 3px solid var(--black);
  padding-bottom: 6px;
}
.oldies__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 4.5vw, 84px);
  align-items: start;
}
.oldies__col { display: flex; flex-direction: column; gap: clamp(80px, 11vw, 180px); }
/* 컬럼별 시작 높이를 어긋나게 */
.oldies__col:nth-child(1) { margin-top: clamp(90px, 12vw, 210px); }
.oldies__col:nth-child(2) { margin-top: 0; }
.oldies__col:nth-child(3) { margin-top: clamp(170px, 21vw, 340px); }
/* 카드 폭/정렬도 불규칙하게 */
.oldies__col .card:nth-child(4n + 1) { width: 100%; }
.oldies__col .card:nth-child(4n + 2) { width: 78%; align-self: flex-end; }
.oldies__col .card:nth-child(4n + 3) { width: 90%; }
.oldies__col .card:nth-child(4n + 4) { width: 72%; }
.oldies__col:nth-child(2) .card:nth-child(4n + 3) { align-self: flex-end; }

.card { display: block; will-change: transform; }
.card__thumb { overflow: hidden; margin-bottom: 18px; border-radius: 2px; }
.card__thumb img {
  width: 100%;
  transition: transform 0.7s var(--ease-out);
}
.card:hover .card__thumb img { transform: scale(1.045); }
.card__no {
  font-size: 16px;                /* magazine-b 아이브로우 기준 */
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--black);
  margin-bottom: 8px;
}
.card__month {
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 500;
  margin-bottom: 12px;
}
.card__lines li {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--gray-text);
}

/* ---------- footer (mtn 방식: 하단 고정 + .site가 걷히며 리빌) ---------- */
.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  height: var(--footer-h);
  overflow: hidden;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(40px, 5vw, 72px);
  padding: 0 var(--pad);
}
.footer__logo {
  width: min(560px, 72vw);
  height: auto;
  /* 리빌 진행도(JS)에 따라 transform/opacity 갱신 */
  transform: translateY(70px) scale(0.92);
  opacity: 0;
}
.footer__more {
  min-width: 200px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.footer__more.is-in { opacity: 1; transform: none; }
.footer__links li { margin-bottom: 0; }
.footer__links a {
  font-size: 15px;          /* 본문과 동일 */
  line-height: 1.8;         /* 탭 간격 확보 (1.2 × 1.5) */
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.25s;
}
.footer__links a:hover { opacity: 0.5; }

/* ---------- 플로팅 top 버튼 ---------- */
.to-top {
  position: fixed;
  right: clamp(16px, 2.5vw, 32px);
  bottom: clamp(16px, 2.5vw, 32px);
  z-index: 80;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--white);
  color: var(--black);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out), background 0.25s;
}
.to-top.is-show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.to-top:hover { background: #f2f2f2; }
.to-top svg { width: 18px; height: 18px; }

/* ---------- reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: translateY(0); }
.card.reveal { transition-delay: calc(var(--d, 0) * 90ms); }
/* 패럴랙스(data-speed) 대상은 리빌을 opacity로만 — transform은 JS가 매 프레임 제어 */
[data-speed].reveal { transform: none; transition: opacity 0.9s var(--ease-out); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .issue__grid { grid-template-columns: 1fr 1fr; }
  .issue__title { grid-column: 1 / -1; }
  .issue__col--sub { padding-top: 0; }
  .oldies__cols { grid-template-columns: repeat(2, 1fr); }
  .oldies__col:nth-child(1) { margin-top: clamp(60px, 9vw, 140px); }
}
@media (max-width: 600px) {
  /* ===== 모바일 GNB (mtn과 동일): 하나의 다크 바가 로고 쪽으로 수축하며
     로고 필 + 검색 필 두 개로 갈라지는 인터랙션 ===== */
  .topbar { padding-top: 12px; }
  .topbar.solid { padding-top: 12px; }              /* 모바일은 상하 이동 없음 */
  /* 히어로가 짧아 HIDE_AT이 너무 빨리 옴 → 숨김 없이 항상 플로팅 (mtn과 동일) */
  .topbar.is-hidden { transform: none !important; pointer-events: auto; }

  .topbar__wrap,
  .topbar.solid .topbar__wrap {
    position: relative;
    width: auto;
    height: 46px;
    margin: 0 10px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transition: none;
  }
  /* 화이트 바 = ::before 레이어 (뉴스레터 톤 — 블러/다크 없이 솔리드).
     수축은 right 인셋 애니메이션(scaleX 아님):
     오른쪽 라운드 캡이 그대로 왼쪽으로 이동 → 각진 꼬리 없음 (mtn과 동일) */
  .topbar__wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.28);
    transition: right 0.55s cubic-bezier(0.65, 0, 0.35, 1);
    animation: gnbFade 1.2s ease;
  }
  /* 로고 필 폭(로고 83px + 패딩 32px ≈ 115px)에서 멈춤 — 0까지 가면 얇은 조각이 남음 */
  .topbar.solid .topbar__wrap::before { right: calc(100% - 116px); }

  /* 로고: 자체 배경 없음 — 수축한 바가 곧 로고 필이 됨 (mtn과 동일).
     화이트 바 위라 블랙 로고로 반전 */
  .topbar__logo {
    position: relative;
    z-index: 2;
    padding: 0 16px;
    animation: gnbFade 1.2s ease both;
  }
  .topbar__logo img,
  .topbar.solid .topbar__logo img { height: 13px; filter: invert(1); }

  /* 검색 필 — 상단에선 투명, 바가 지나가며 수축하면 자기 배경이 생김.
     다운: 일찍(.1s) 채워지고 / 업: 바가 되돌아올 때쯤 늦게(.35s) 사라짐 (mtn 타이밍) */
  .topbar__search,
  .topbar.solid .topbar__search {
    position: relative;
    z-index: 2;
    width: 46px;
    height: 46px;
    margin-right: 0;
    border-radius: 12px;
    color: var(--black);
    filter: none;
    animation: gnbFade 1.2s ease both;
    transition: background 0.3s ease 0.35s, box-shadow 0.3s ease 0.35s, color 0.25s ease;
  }
  .topbar.solid .topbar__search {
    background: var(--white);
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.28);
    transition: background 0.3s ease 0.1s, box-shadow 0.3s ease 0.1s, color 0.25s ease;
  }
  /* 오버레이 열림: 화이트 바는 숨김, X는 화이트 오버레이 위라 블랙 유지 */
  .topbar.search-open .topbar__wrap::before { opacity: 0; transition: opacity 0.25s ease; }
  .topbar.search-open .topbar__search,
  .topbar.solid.search-open .topbar__search { color: var(--black); }
  /* 로고 숨김: gnbFade의 fill(both)이 opacity:0을 덮어쓰므로 애니메이션 자체를 끔 */
  .topbar.search-open .topbar__logo { animation: none; }

  /* 검색 오버레이: 모바일은 반전 — 화이트 배경 + 블랙 텍스트 */
  .search {
    background: var(--white);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    color: var(--black);
  }
  .search__inner { border-bottom-color: rgba(0, 0, 0, 0.3); }
  .search__input { color: var(--black); }
  .search__input::placeholder { color: rgba(0, 0, 0, 0.3); }
  .search__results li a { border-bottom-color: rgba(0, 0, 0, 0.1); }
  .search__results .r-no { color: rgba(0, 0, 0, 0.45); }
  .search__results .r-line { color: rgba(0, 0, 0, 0.55); }
  /* 히어로: 마진/라운드 없는 풀블리드 */
  .hero { margin: 0; height: auto; min-height: 0; }
  .hero__frame { aspect-ratio: 4 / 5; border-radius: 0; animation-name: heroGrowM; }
  .issue__grid { grid-template-columns: 1fr; }
  /* 풀블리드 히어로 위로 라벨+타이틀이 올라오는 정도만 침범 */
  .issue { margin-top: -190px; padding-left: 20px; padding-right: 20px; }
  /* 1단 스택에선 패럴랙스가 요소 간격을 뭉개므로 전부 끔 (mtn 모바일과 동일) */
  [data-speed] { transform: none !important; }
  /* 본문 타이포: magazine-b 모바일 기준 (큰 본문 + 여유 행간) */
  .issue__lead { font-size: 26px; }
  .issue__sub { font-size: 19px; }
  .issue__body {
    font-size: 18px;
    line-height: 1.65;
    letter-spacing: -0.01em;
    color: #333;
  }
  /* 카드 타이포 = 인트로 섹션과 동일 (제목/본문) */
  .card__month { font-size: 26px; font-weight: 700; }
  .card__lines li { font-size: 18px; line-height: 1.65; letter-spacing: -0.01em; color: #333; }
  .oldies__cols { grid-template-columns: 1fr; }
  .oldies__col { margin-top: 0 !important; gap: 56px; }
  .oldies__col .card { width: 100% !important; align-self: auto !important; }
  /* 아카이브 썸네일은 80% 폭 — 풀블리드 히어로와 크기 위계 구분 */
  .card__thumb { width: 80%; }
  .footer { --footer-h: 380px; height: 380px; }
  body { padding-bottom: 380px; }
  .footer__logo { width: 86vw; }
  .footer__more { min-width: 0; text-align: center; }
  .footer__links a { font-size: 18px; }  /* 모바일 본문과 동일 */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .issue__title .word > span { transition: none !important; transform: none !important; opacity: 1 !important; }
  .hero__frame { animation: none; }
  [data-speed] { transform: none !important; }
  .footer__logo { transform: none !important; opacity: 1 !important; }
  .footer__more { opacity: 1; transform: none; transition: none; }
}
