/* =========================================================
   Yoon Jung Su: white cube portfolio
   글꼴: Jost(작가명·제목) / DM Sans(본문) / Pretendard(한글)
   배치: 왼쪽 고정 세로 메뉴 + 오른쪽 작품 (모바일은 위 머리글 + 전체 화면 메뉴)
   ========================================================= */

@font-face { font-family: "Jost"; src: url("fonts/jost.woff2") format("woff2"); font-weight: 300 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Jost"; src: url("fonts/jost-italic.woff2") format("woff2"); font-weight: 300 500; font-style: italic; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("fonts/dmsans.woff2") format("woff2"); font-weight: 300 600; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("fonts/dmsans-italic.woff2") format("woff2"); font-weight: 300 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Pretendard"; src: url("fonts/pretendard-subset.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --wall: #fafaf9;
  --ink: #151515;
  --mute: #6b6b6b;
  --faint: #9a9a98;
  --line: rgba(21, 21, 21, 0.09);
  --tile: #e6e6e5;
  --tint: #fafaf9;

  --sans: "DM Sans", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --display: "Jost", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-io: cubic-bezier(0.77, 0, 0.175, 1);

  --gutter: clamp(20px, 3vw, 48px);
  --side-w: clamp(240px, 17vw, 290px);
  --top: 40px;
  --head-h: 64px; /* 모바일 머리글 높이 */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
em { font-style: italic; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
.ico { width: 1em; height: 1em; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; border-radius: 1px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--wall); padding: 8px 12px; font-size: 13px; }
.skip:focus { top: 12px; }

/* ---------- 왼쪽 세로 메뉴 ---------- */
.side {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 20;
  width: var(--side-w);
  padding: var(--top) 24px 40px var(--gutter);
  display: flex; flex-direction: column;
}
.mark { display: inline-flex; flex-direction: column; gap: 11px; line-height: 1; align-self: flex-start; }
.mark-name { font-family: var(--display); font-weight: 500; font-size: 19px; letter-spacing: 0.045em; white-space: nowrap; }
.mark-loc { font-size: 12.5px; line-height: 13px; color: var(--mute); letter-spacing: 0.01em; }

.nav { margin-top: 44px; }
.nav-list { display: grid; }
.nav-list a {
  display: inline-block; padding: 2px 0; font-size: 13.5px; line-height: 24px; color: var(--ink);
  text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1px; text-underline-offset: 5px;
  transition: text-decoration-color 200ms ease, color 200ms ease;
}
.nav-list a[aria-current="page"] { text-decoration-color: currentColor; }
.nav-list .is-sub a::before,
.menu-list .is-sub a::before {
  content: ""; display: inline-block; vertical-align: middle;
  width: 11px; height: 1px; margin: 0 9px 2px 0; background: currentColor;
}
.nav-list .is-sub a { font-variant-numeric: tabular-nums; display: inline-flex; align-items: flex-start; }
/* 줄표를 정수 픽셀 위치에 두어 모든 연도의 줄 굵기가 똑같이 보이게 */
.nav-list .is-sub a::before { vertical-align: top; margin: 12px 9px 0 0; flex: none; }
@media (hover: hover) and (pointer: fine) {
  .nav-list a:hover { text-decoration-color: currentColor; }
}
.menu-btn { display: none; font-size: 14px; padding: 10px 0 10px 16px; }

/* 모바일 전체 화면 메뉴 */
.menu {
  position: fixed; inset: 0; z-index: 40;
  background: color-mix(in oklab, var(--wall) 94%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  opacity: 0; transition: opacity 260ms var(--ease-out);
}
.menu[hidden] { display: none; }
.menu.is-open { opacity: 1; }
.menu-inner { height: 100%; display: flex; flex-direction: column; padding: 10px var(--gutter) 32px; }
.menu-close { align-self: flex-end; width: 44px; height: 44px; display: grid; place-items: center; font-size: 22px; margin-right: -10px; }
.menu-list { margin-top: auto; display: grid; }
.menu-list a {
  display: inline-block; font-family: var(--display); font-weight: 300; font-size: clamp(40px, 12vw, 60px);
  line-height: 1.15; letter-spacing: -0.01em; color: var(--mute);
}
.menu-list .is-sub a { font-size: clamp(30px, 9vw, 44px); line-height: 1.25; font-variant-numeric: tabular-nums; }
.menu-list .is-sub a::before { width: 22px; height: 1.5px; margin: 0 14px 6px 4px; }
.menu-list a[aria-current="page"] { color: var(--ink); }
.menu-list li { opacity: 0; transform: translateY(18px); transition: opacity 420ms var(--ease-out), transform 520ms var(--ease-out); transition-delay: calc(var(--i) * 40ms + 60ms); }
.menu.is-open .menu-list li { opacity: 1; transform: none; }
.menu-foot { margin-top: 36px; font-size: 13.5px; color: var(--mute); }

/* ---------- 첫 방문 인트로 (PDF 표지) ---------- */
.intro { display: none; }
.intro-on .intro {
  display: flex; position: fixed; inset: 0; z-index: 60; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--wall); cursor: pointer;
  animation: intro-out 700ms var(--ease-io) 1150ms forwards;
}
.intro-name { font-family: var(--display); font-weight: 500; font-size: clamp(34px, 6.2vw, 84px); letter-spacing: 0.04em; line-height: 1; animation: intro-in 900ms var(--ease-out) both; }
.intro-loc { font-size: clamp(12px, 1.3vw, 17px); letter-spacing: 0.06em; animation: intro-in 900ms var(--ease-out) 120ms both; }
.intro.is-skip { animation: intro-out 260ms var(--ease-out) forwards; }
@keyframes intro-in { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes intro-out { to { opacity: 0; visibility: hidden; transform: translateY(-2%); pointer-events: none; } }

/* ---------- 슬라이더 공통 ---------- */
[data-slider] { position: relative; touch-action: pan-y; }
.frame {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  filter: blur(5px);
  transition: opacity 220ms var(--ease-out), filter 220ms var(--ease-out), transform 260ms var(--ease-out), visibility 0s linear 260ms;
}
.frame.is-active {
  opacity: 1; visibility: visible; filter: none; transform: none;
  transition: opacity 560ms var(--ease-out) 60ms, filter 560ms var(--ease-out) 60ms, transform 680ms var(--ease-out) 60ms, visibility 0s;
}
.frame.from-next { transform: translateX(14px); transition: none; }
.frame.from-prev { transform: translateX(-14px); transition: none; }
.frame.to-prev { transform: translateX(-8px); }
.frame.to-next { transform: translateX(8px); }
.frame img { width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }

.hit {
  position: absolute; top: 0; bottom: 0; width: 50%; z-index: 2;
  display: flex; align-items: center;
}
.hit-prev { left: 0; justify-content: flex-start; cursor: w-resize; }
.hit-next { right: 0; justify-content: flex-end; cursor: e-resize; }
.hint {
  display: grid; place-items: center; width: 44px; height: 44px; font-size: 20px;
  opacity: 0; transition: opacity 220ms ease, transform 320ms var(--ease-out);
}
.hit-prev .hint { transform: translateX(6px); }
.hit-next .hint { transform: translateX(-6px); }
@media (hover: hover) and (pointer: fine) {
  .plate-stage .hit:hover .hint { opacity: 1; transform: none; }
}
.hit:focus-visible { outline-offset: -6px; }
.hit:focus-visible .hint { opacity: 1; transform: none; }

/* ---------- 첫 화면: 사진만 크게 ---------- */
.page-home { background: color-mix(in oklab, var(--tint) 3.5%, var(--wall)); transition: background-color 1100ms ease; }
.home {
  margin-left: var(--side-w);
  height: 100dvh; min-height: 480px;
  padding: var(--top) var(--gutter) var(--top) 0;
}
.show, .stage { height: 100%; }
.home { position: relative; }
.show { position: relative; z-index: 1; }

.home .stage { overflow: hidden; }
/* 데스크톱 첫 화면: 위아래 여백 없이 화면 높이를 다 쓰되, 그림은 잘리지 않게 전체를 보여 준다 */
@media (min-width: 901px) {
  .home { padding: 0 var(--gutter) 0 0; }
  /* 그림은 오른쪽 끝(여백 하나 남기고)에 붙인다 */
  .home .frame { justify-content: flex-end; }
  .home .frame img { object-position: right center; }
}

/* ---------- 본문 영역 공통 ---------- */
.year, .index, .info { margin-left: var(--side-w); padding-right: var(--gutter); }
.page-title {
  font-family: var(--display); font-weight: 300; font-size: clamp(40px, 4vw, 64px);
  line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-left: -0.03em;
}

/* ---------- 연도별 작품 ---------- */
.year { padding-top: var(--top); max-width: calc(var(--side-w) + 1500px); }
.year .page-title { margin-bottom: clamp(40px, 7vh, 80px); }
.plates { min-width: 0; }
.plate { scroll-margin-top: var(--top); margin-bottom: clamp(96px, 17vh, 200px); }
/* 사진 자리의 기준점: 사진이 한 장인 작품도 반드시 자기 칸 안에 그려지게 */
.plate-stage { position: relative; width: 100%; max-height: 84vh; min-height: 220px; }
.plate-stage .frame { justify-content: flex-start; }
.plate-stage .frame img { object-position: left center; }
.plate-cap { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 48px; margin-top: 20px; }
.plate-cap .cap-title { font-family: var(--display); font-size: 18px; font-weight: 400; line-height: 1.3; margin-bottom: 4px; }
.plate-cap .cap-block p { font-size: 13px; color: var(--mute); line-height: 1.55; }
.pager { margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; }
.pager-btn { width: 40px; height: 40px; display: grid; place-items: center; font-size: 16px; color: var(--ink); border-radius: 50%; transition: background-color 200ms ease, transform 120ms ease-out; }
.pager-btn:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .pager-btn:hover { background: rgba(21, 21, 21, 0.05); } }
.pager-count { min-width: 44px; text-align: center; }


.year-pager {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  border-top: 1px solid var(--line); padding: 28px 0 0; margin-bottom: clamp(64px, 10vh, 120px);
  font-size: 13.5px;
}
.yp { display: inline-flex; align-items: center; gap: 10px; padding: 10px 0; transition: gap 320ms var(--ease-out); }
.yp span { font-family: var(--display); font-size: 24px; font-weight: 300; letter-spacing: -0.01em; }
.yp-all { color: var(--mute); }
.yp-next { justify-self: end; }
@media (hover: hover) and (pointer: fine) { .yp-prev:hover, .yp-next:hover { gap: 16px; } .yp-all:hover { color: var(--ink); } }

/* ---------- 작품 목록 ---------- */
.index { padding-top: var(--top); padding-bottom: clamp(64px, 10vh, 120px); max-width: calc(var(--side-w) + 1500px); }
.index .page-title { margin-bottom: clamp(40px, 7vh, 80px); }
.idx-year { padding: 22px 0 clamp(56px, 9vh, 96px); border-top: 1px solid var(--line); }
.idx-year-title { font-family: var(--display); font-weight: 300; font-size: 28px; line-height: 1; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin-bottom: 24px; }
.idx-year-title a { transition: color 200ms ease; }
.idx-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 24px; }
.idx-item a { display: block; }
.idx-thumb { display: block; aspect-ratio: 4 / 3; background: var(--tile); overflow: hidden; }
.idx-thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform 700ms var(--ease-out); }
.idx-title { display: block; margin-top: 12px; font-family: var(--display); font-size: 15.5px; line-height: 1.35; }
.idx-meta { display: block; font-size: 12.5px; color: var(--mute); margin-top: 2px; }
@media (hover: hover) and (pointer: fine) {
  .idx-item a:hover img { transform: scale(1.035); }
  .idx-year-title a:hover { color: var(--mute); }
}

/* ---------- 정보 ---------- */
.info {
  padding-top: var(--top); padding-bottom: clamp(64px, 10vh, 120px); max-width: calc(var(--side-w) + 1300px);
  display: grid; grid-template-columns: minmax(220px, 4fr) 8fr; gap: clamp(32px, 5vw, 96px);
}
.info-side { position: sticky; top: var(--top); align-self: start; }
.info-name { margin-top: clamp(36px, 6vh, 64px); font-family: var(--display); font-size: 22px; line-height: 1.3; }
.info-name span { font-family: "Pretendard", var(--sans); font-weight: 500; margin-right: 6px; }
.info-born { color: var(--mute); font-size: 13.5px; margin-top: 4px; }
.contact { margin-top: 40px; display: grid; gap: 18px; }
.contact dt { font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); margin-bottom: 4px; }
.contact dd { display: grid; gap: 2px; justify-items: start; }
.contact a { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; padding: 3px 0; border-bottom: 1px solid var(--line); transition: border-color 200ms ease; }
.contact a .ico { font-size: 13px; color: var(--mute); }
@media (hover: hover) and (pointer: fine) { .contact a:hover { border-color: var(--ink); } }

.info-main { padding-top: 10px; }
.cv + .cv { margin-top: clamp(56px, 9vh, 96px); }
.cv h2 { font-family: var(--display); font-weight: 400; font-size: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.cv-list li, .cv-group { display: grid; grid-template-columns: 72px 1fr; gap: 16px; }
.cv-list li + li { margin-top: 6px; }
.cv-group + .cv-group { margin-top: 20px; }
.cv-year { font-variant-numeric: tabular-nums; color: var(--mute); font-size: 14px; line-height: 1.75; }
.cv-text, .cv-items li { font-size: 15px; line-height: 1.75; }
.cv-items { display: grid; gap: 2px; }

/* ---------- 바닥글 ---------- */
.site-foot {
  margin: 0 var(--gutter) 0 var(--side-w); padding: 28px 0 40px; max-width: 1500px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px;
  font-size: 12.5px; color: var(--mute); border-top: 1px solid var(--line);
}
.site-foot-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
@media (hover: hover) and (pointer: fine) { .site-foot a:hover { color: var(--ink); } }

/* ---------- 반응형 ---------- */
@media (max-width: 1400px) {
  .idx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .idx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .side {
    position: sticky; top: 0; bottom: auto; width: auto; height: var(--head-h);
    flex-direction: row; align-items: center; justify-content: space-between;
    padding: 0 var(--gutter);
    background: color-mix(in oklab, var(--wall) 86%, transparent);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    backdrop-filter: saturate(140%) blur(14px);
  }
  .page-home .side { position: relative; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .mark { gap: 7px; align-self: center; }
  .mark-name { font-size: 16px; }
  .mark-loc { font-size: 11.5px; }
  .nav { display: none; }
  .menu-btn { display: block; }

  .home { margin-left: 0; height: calc(100dvh - var(--head-h)); padding: 8px var(--gutter) 28px; }
  .year, .index, .info { margin-left: 0; padding-left: var(--gutter); }
  .site-foot { margin: 0 var(--gutter); }
  .year, .index, .info { padding-top: 24px; }
  .plate-stage { max-height: 76vh; }
  .plate-stage .frame { justify-content: center; }
  .plate-stage .frame img { object-position: center; }
  .plate { margin-bottom: 88px; scroll-margin-top: calc(var(--head-h) + 16px); }
  .hint { display: none; }

  .idx-grid { gap: 28px 14px; }

  .info { grid-template-columns: minmax(0, 1fr); }
  .info-side { position: static; }
}
@media (max-width: 480px) {
  .cv-list li, .cv-group { grid-template-columns: 52px 1fr; gap: 10px; }
  .cv-text, .cv-items li { font-size: 14.5px; }
  .yp span { font-size: 20px; }
}

/* 움직임 줄이기 */
@media (prefers-reduced-motion: reduce) {
  .frame, .frame.is-active { transform: none !important; filter: none !important; transition: opacity 200ms ease, visibility 0s linear 200ms; }
  .frame.is-active { transition: opacity 200ms ease, visibility 0s; }
  .menu-list li { transform: none; transition: opacity 200ms ease; transition-delay: 0ms; }
  .intro-on .intro { display: none; }
  .page-home { transition: none; }
  .idx-thumb img { transition: none; }
}
/* 페이지 안 이동만 부드럽게. 처음 열 때 #주소로 바로 가는 건 즉시 */
html.is-ready { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html.is-ready { scroll-behavior: auto; } }

/* ---------- 없는 주소(404) ---------- */
.notfound-text { margin-top: 18px; font-size: 15px; color: var(--mute); }
.notfound-link { color: var(--ink); border-bottom: 1px solid var(--line); padding-bottom: 2px; }
@media (hover: hover) and (pointer: fine) { .notfound-link:hover { border-color: var(--ink); } }
