/* ===== 폰트: EB Garamond (font 폴더) ===== */
/* 일반·이탤릭 모두 굵기 400–800 조절되는 한 파일씩. latin-ext 는 ō, ő 같은 악센트 글자용 */
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../font/EBGaramond-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../font/EBGaramond-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url("../font/EBGaramond-Italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url("../font/EBGaramond-Italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ===== 공통 값 — 여기만 바꾸면 사이트 전체가 바뀜 ===== */
:root {
  /* 글자색은 두 단계만 */
  --bg: #fff;
  --text: #111;
  --text-muted: rgba(17, 17, 17, 0.6); /* 흰 배경에서 AA 대비 통과 */
  --line: rgba(17, 17, 17, 0.15);

  --font-sans: "Helvetica Neue", Arial, sans-serif;
  --font-serif: "EB Garamond", Garamond, "Times New Roman", Georgia, serif;

  /* 여백 단계 — 이 값들만 사용 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 80px;
  --space-10: 96px;
  --space-11: 128px;

  /* 움직임 속도는 두 가지 */
  --dur-fast: 150ms;

  /* 글자 크기는 이 단계만 (Sabine 14 · Jessica 16/62 · Philip 18/24/36) */
  --fs-sm: 14px;
  --fs-md: 18px;
  --fs-lg: 24px;
  --fs-xl: 36px;
  --fs-display: 56px;
  --fs-title: 50px; /* 페이지 제목: 36px 의 140% */
  --fs-cv-year: 24px; /* CV 연도 */
  --dur-base: 260ms;
  /* 느리고 부드러운 움직임 (Studio Sabine Marcelis 레퍼런스: 350–600ms) */
  --dur-slow: 500ms;
  --ease-soft: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html,
body {
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

/* 문단 마지막 줄에 단어 하나만 남지 않게, 제목은 줄을 고르게 */
p,
li {
  text-wrap: pretty;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

/* hidden 으로 숨긴 요소는 어떤 display 값보다 우선해서 숨김 (CV 필터 등) */
[hidden] {
  display: none !important;
}

/* 메인페이지는 스크롤 없이 화면 한 장.
   영상 첫 장면을 배경으로 깔아 둠 → 영상이 오기 전에도 같은 장면이 보임 */
body.home {
  height: 100%;
  overflow: hidden;
  background: #000 url("../video/trailer-poster.jpg") center / cover no-repeat;
}

a {
  color: inherit;
  text-decoration: none;
}

/* 키보드(Tab)로 이동할 때만 보이는 표시 */
a:focus-visible,
button:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 4px;
}

/* 둥근 버튼 공통 (Copy email / Sound on) */
.contact-copy,
.video-sound {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color var(--dur-fast), border-color var(--dur-fast), background var(--dur-fast);
}

/* 작은 대문자 라벨 공통 */
.page-label,
.contact-label,
.cv-cat {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* 12칸 격자 공통 (About / 상세페이지 / CV / Contact) */
.about-body,
.project-top,
.cv-year,
.contact-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--space-6);
  align-items: start;
}

/* ===== 상단 메뉴 (모든 페이지 공통) ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-5) var(--space-6);
}

/* 서브페이지에서는 메뉴 뒤에 배경을 깔아 스크롤 시 글자가 겹치지 않게 */
body:not(.home) .site-header {
  background: var(--bg);
}

/* 영상 위에서는 글자를 흰색으로 (메인페이지 / 상세페이지 영상) */
.home,
.project-video {
  --bg: #000;
  --text: #fff;
  --text-muted: rgba(255, 255, 255, 0.7);
  --line: rgba(255, 255, 255, 0.3);
}

.home {
  background: var(--bg);
}

/* 메인페이지에서는 메뉴만 오른쪽에 */
.home .site-header {
  justify-content: flex-end;
}

.site-logo {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.site-nav {
  display: flex;
  gap: var(--space-5);
}

.site-nav a {
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  transition: color var(--dur-fast);
}

/* 영상 위에서는 잘 읽히도록 흰색 */
.home .site-nav a {
  color: var(--text);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 6px;
}

@media (max-width: 600px) {
  .site-header {
    padding: var(--space-4);
    flex-wrap: wrap;
    row-gap: var(--space-3);
  }
  .site-nav {
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
  }
  .site-nav a,
  .site-logo {
    font-size: 12px;
  }
}

/* ===== 서브페이지 (About / Projects / CV / Contact) ===== */
.page {
  padding: var(--space-10) var(--space-6) var(--space-9);
}

@media (max-width: 600px) {
  .page {
    padding: var(--space-11) var(--space-4) var(--space-8);
  }
}

/* ===== Projects 분류 메뉴 (All / Installations / ...) ===== */
.project-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  margin: 0 0 var(--space-6);
  font-size: 14px;
  letter-spacing: 0.06em;
}

.project-filter a {
  color: var(--text-muted);
  transition: color var(--dur-fast);
}

.project-filter a:hover,
.project-filter a[aria-current="page"] {
  color: var(--text);
}

.project-filter a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* 분류별 개수 (CV 필터와 같은 작은 숫자) */

@media (max-width: 600px) {
  .project-filter {
    gap: var(--space-2) var(--space-4);
    font-size: 13px;
  }
}

/* ===== Projects 목록 =====
   왼쪽 2/3: 2단 메이슨리 — 사진을 원래 비율대로 빈틈없이 쌓음 (Daniel Martin 레퍼런스).
   카드를 왼쪽·오른쪽에 번갈아 놓아서 위에서 아래로 연도 순서가 유지됨
   오른쪽 1/3: 마우스를 올린 작품의 짧은 설명 (Philip Vermeulen 레퍼런스: 큰 고딕, 18/24/36, 촘촘한 줄 간격) */
.projects-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--space-6);
  align-items: start;
}

.project-grid {
  grid-column: 1 / span 8;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-6);
  align-items: start;
}

.project-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
}

.project {
  display: block;
  transition: opacity var(--dur-slow) var(--ease-soft);
}

/* 한 프로젝트에 마우스를 올리면 나머지는 흐려져서 시선이 모임 */
.project-grid:has(.project:hover) .project:not(:hover) {
  opacity: 0.35;
}

.project-thumb {
  display: block;
  overflow: hidden;
}

.project-thumb img {
  display: block;
  width: 100%;
  height: auto;
  outline: 1px solid var(--line); /* 흰 표지(Me & Anti Me 등)가 배경에 묻히지 않게 */
  outline-offset: -1px;
  transition: transform var(--dur-slow) var(--ease-soft); /* 명암과 같은 속도·곡선 */
}

/* 스크롤 효과: 화면에 들어오는 카드가 투명했다가 아래에서 올라오며 나타남 (js/projects.js).
   스크립트가 켜진 경우에만 숨겨 둠 → 스크립트가 꺼져 있어도 목록은 보임 */
.js-reveal .project:not(.is-in) {
  opacity: 0;
  transform: translateY(var(--space-6));
}

.js-reveal .project {
  transition:
    opacity 900ms var(--ease-soft) var(--delay, 0ms),
    transform 900ms var(--ease-soft) var(--delay, 0ms);
}

/* 나타난 뒤에는 마우스를 올렸을 때 흐려지는 원래 속도로 */
.js-reveal .project.is-done {
  transition: opacity var(--dur-slow) var(--ease-soft);
}

.project:hover .project-thumb img,
.project:hover .thumb-video {
  transform: scale(1.03);
}

/* 트레일러 미리보기: 사진 위에 겹쳐서 부드럽게 나타남 (js/projects.js) */
.project-thumb {
  position: relative;
}

.thumb-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* 사진 자리를 꽉 채움 */
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-soft), transform var(--dur-slow) var(--ease-soft);
  pointer-events: none;
}

.project.is-playing .thumb-video {
  opacity: 1;
}

/* 작품별 구도: Sea Monks 는 아래 자막까지 다 보이도록 영상 전체를 칸 안에 맞춤
   (칸이 영상보다 살짝 가로로 길어서 좌우에 얇은 여백, 영상은 잘리지 않음) */
.project[data-trailer*="sea-monks"] .thumb-video {
  object-fit: contain;
  background: var(--bg);
}

/* 제목은 왼쪽, 연도는 오른쪽 */
.project-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  margin-top: var(--space-3);
}

.project-caption .project-title {
  margin-top: 0;
}

.project-year {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.project-title {
  display: block;
  margin-top: var(--space-3);
  font-size: 14px;
  letter-spacing: 0.03em;
}

.project:hover .project-title {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* 오른쪽 1/3 설명 칸: 스크롤해도 따라옴 */
.project-panel {
  grid-column: 10 / -1;
  position: sticky;
  top: var(--space-11);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  opacity: 0;
  transform: translateY(var(--space-2));
  transition: opacity var(--dur-slow) var(--ease-soft), transform var(--dur-slow) var(--ease-soft);
}

.project-panel.is-on {
  opacity: 1;
  transform: none;
}

.desc-title {
  font-size: var(--fs-lg);
  line-height: 1;
  letter-spacing: -0.01em;
}

.desc-meta,
.panel-hint {
  font-size: var(--fs-sm);
  line-height: 1.1;
  color: var(--text-muted);
}

.desc-text {
  font-size: var(--fs-md);
  line-height: 1.1;
  letter-spacing: -0.005em;
}

/* 태블릿·폰: 설명 칸 없이 목록만 */
@media (max-width: 900px) {
  .project-grid {
    grid-column: 1 / -1;
  }
  .project-panel {
    display: none;
  }
}

/* 폰: 한 줄로, 목록 번호(--i) 순서대로 → 연도 순서 유지 */
@media (max-width: 600px) {
  .project-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-7);
  }
  .project-col {
    display: contents;
  }
  .project {
    order: var(--i);
  }
}

/* ===== 프로젝트 상세 페이지 ===== */
/* 12칸: 왼쪽 8칸 = 제목 → 대표 사진 → 설명 글 / 오른쪽 3칸 = 정보 목록.
   정보 목록은 스크롤을 따라오다가 이 영역이 끝나는 곳(갤러리 사진 시작)에서 멈춤 */
.project-top {
  margin-bottom: var(--space-8);
}

.project-heading {
  grid-column: 1 / span 8;
  grid-row: 1;
  margin-bottom: var(--space-6);
}

.project-heading .page-title {
  margin-bottom: 0;
  font-size: var(--fs-xl); /* 작품 이름은 36px 그대로 */
}

.project-main {
  grid-column: 1 / span 8;
  grid-row: 2;
}

/* 제목 오른쪽에서 시작해서 따라옴 */
.project-aside {
  grid-column: 10 / -1;
  grid-row: 1 / span 2;
  position: sticky;
  top: var(--space-11);
  padding-top: var(--space-4);
}

/* 정보 목록이 없는 페이지는 왼쪽 영역을 끝까지 */
.project-top:not(:has(.project-aside)) .project-heading,
.project-top:not(:has(.project-aside)) .project-main {
  grid-column: 1 / -1;
}

/* 제목 아래 이탤릭 부제 */
.project-subtitle {
  max-width: 32em;
  margin-top: var(--space-3);
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  line-height: 1.3;
  font-style: italic;
  color: var(--text-muted);
}

/* 작은 정보 목록 (Year / Medium / Material / Location) */
.project-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: 14px;
  line-height: 1.5;
}

.project-meta div {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: var(--space-3);
}

.project-meta dt {
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* 대표 사진 */
.project-hero {
  margin: 0 0 var(--space-8);
}

.project-hero:last-child {
  margin-bottom: 0;
}

.project-hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
  object-position: left top;
  cursor: zoom-in;
  transition: opacity var(--dur-base);
}

/* ===== 상세페이지 영상 ===== */
/* 세로 영상일 때: 왼쪽 영상 / 오른쪽 설명 글 (Cursed House) */
.project-main--side {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-7);
  align-items: end;
}

.project-main--side .project-hero {
  margin: 0;
}

@media (max-width: 900px) {
  .project-main--side {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

/* 대표 영상: 세로 영상도 화면 안에 들어오도록 폭 제한 (--ar = 가로/세로 비율) */
.project-video {
  position: relative;
  max-width: min(100%, calc(75vh * var(--ar)));
}

.project-video video,
.gallery-video video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
  cursor: pointer;
}

.gallery-video video {
  max-height: 70vh;
  object-fit: contain;
}

/* 영상 위 정보: 마우스를 올리거나 멈췄을 때 나타남 */
.video-ui {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-8) var(--space-4) var(--space-4);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
  opacity: 0;
  transition: opacity var(--dur-base);
  pointer-events: none;
}

.project-video:hover .video-ui,
.project-video:focus-within .video-ui,
.project-video.is-paused .video-ui {
  opacity: 1;
}

.video-ui button {
  pointer-events: auto;
}

/* 터치 화면(폰)에는 마우스 올리기가 없으니 항상 보이게 */
@media (hover: none) {
  .video-ui {
    opacity: 1;
  }
}

.video-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.video-time {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* 재생 중 표시 점 — Contact 시계와 같은 쫀쫀한 깜빡임 */
.video-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text);
  animation: tick-blink 2s cubic-bezier(0.76, 0, 0.24, 1) infinite;
}

.is-paused .video-dot {
  animation: none;
  opacity: 0.5;
}

.video-sound {
  padding: var(--space-1) var(--space-3);
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 12px;
}

.video-sound:hover,
.video-sound[aria-pressed="true"] {
  background: var(--text);
  color: #000;
}

/* 재생 위치 선 */
.video-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--text);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  pointer-events: none;
}

/* 설명 글 — About 과 같은 Garamond, 한 줄 약 65자 */
.project-text {
  max-width: 65ch;
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  line-height: 1.65;
  color: var(--text);
}

.project-text p + p,
.project-text ul + p {
  margin-top: 1.2em;
}

.project-text h2 {
  margin: 2.2em 0 0.8em;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-text ul {
  margin: 1em 0 0;
  padding-left: 1.2em;
}

.project-text li + li {
  margin-top: 0.4em;
}

.project-text strong {
  font-weight: 600;
}

/* 디테일 사진 갤러리: 잡지처럼 크기·위치가 번갈아 바뀌는 배치 (사진 5장이 한 묶음으로 반복).
   1 큰 사진 왼쪽 + 2 작은 사진 오른쪽(아래 정렬)
   3 작은 사진 왼쪽 + 4 큰 사진 오른쪽(조금 아래로)
   5 중간 사진 가운데 한 장 */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--space-6);
  row-gap: var(--space-8);
  margin-bottom: var(--space-9);
  counter-reset: shot;
}

.gallery-item {
  margin: 0;
  counter-increment: shot;
}

.gallery-item:nth-child(5n + 1) {
  grid-column: 1 / span 6;
}

.gallery-item:nth-child(5n + 2) {
  grid-column: 9 / span 3;
  align-self: end;
}

.gallery-item:nth-child(5n + 3) {
  grid-column: 2 / span 4;
}

.gallery-item:nth-child(5n + 4) {
  grid-column: 7 / span 5;
  padding-top: var(--space-10);
}

.gallery-item:nth-child(5n) {
  grid-column: 4 / span 5;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  object-position: left bottom;
  cursor: zoom-in;
  transition: opacity var(--dur-base);
}

/* 사진 아래 작은 번호 01, 02 … */
.gallery-item::after {
  content: counter(shot, decimal-leading-zero);
  display: block;
  margin-top: var(--space-2);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.gallery-item img:hover,
.project-hero img:hover {
  opacity: 0.85;
}

/* 책 / PDF 페이지: 옆으로 넘겨보기 */
.project-book {
  margin-bottom: var(--space-9);
}

/* 구역 제목 (Images / 책 제목) */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.section-head h2 {
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.section-head span {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.book-strip {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: var(--space-4);
  scrollbar-color: var(--line) transparent;
}

.book-strip img {
  flex: none;
  height: min(60vh, 520px);
  width: auto;
  background: #fff;
  outline: 1px solid var(--line); /* 흰 페이지가 흰 배경에 묻히지 않게 */
  outline-offset: -1px;
  scroll-snap-align: start;
  cursor: zoom-in;
}

@media (max-width: 900px) {
  .project-top {
    grid-template-columns: 1fr;
  }
  .project-heading,
  .project-main,
  .project-aside {
    grid-column: auto;
    grid-row: auto;
  }
  .project-heading {
    margin-bottom: var(--space-6);
  }
  .project-aside {
    position: static;
    padding-top: 0;
    margin-bottom: var(--space-7);
  }
}

@media (max-width: 600px) {
  /* 폰: 한 장씩, 넓게/좁게(오른쪽) 번갈아 */
  .project-gallery {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    row-gap: var(--space-7);
  }
  .project-gallery .gallery-item:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .project-gallery .gallery-item:nth-child(even) {
    grid-column: 3 / -1;
    align-self: start;
    padding-top: 0;
  }
  .book-strip img {
    height: 52vh;
  }
}

/* ===== 사진 크게 보기 (라이트박스) ===== */
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(255, 255, 255, 0.97);
  color: var(--text);
}

/* 열렸을 때만 가운데 정렬 (닫힌 dialog 는 브라우저가 숨김) */
.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox::backdrop {
  background: transparent;
}

.lightbox img {
  max-width: calc(100vw - var(--space-11));
  max-height: calc(100vh - var(--space-10));
  max-height: calc(100dvh - var(--space-10));
  object-fit: contain;
}

.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: var(--text-muted);
  font: inherit;
  font-size: 28px;
  line-height: 1;
  padding: var(--space-4);
  cursor: pointer;
  transition: color var(--dur-fast);
}

.lightbox button:hover {
  color: var(--text);
}

.lightbox-close {
  top: var(--space-3);
  right: var(--space-4);
}

.lightbox-prev {
  left: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-count {
  position: absolute;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .lightbox img {
    max-width: 100vw;
  }
  .lightbox-prev,
  .lightbox-next {
    top: auto;
    bottom: var(--space-1);
    transform: none;
  }
}

.back-link {
  display: inline-block;
  margin-bottom: var(--space-5);
  font-size: 14px;
  color: var(--text-muted);
  transition: color var(--dur-fast);
}

.back-link:hover {
  color: var(--text);
}

.page-title {
  font-family: var(--font-serif);
  font-size: var(--fs-title);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-5);
}

/* 큰 제목 대신 쓰는 작은 라벨 (About) */
.page-label {
  margin-bottom: var(--space-4);
}

/* ===== 페이지 끝 이동 링크 (About / CV / Contact / 상세페이지) ===== */
.page-next {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-8);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
  font-family: var(--font-serif);
  font-size: var(--fs-md);
}

/* 상세페이지: 이전은 왼쪽, 다음은 오른쪽 */
.page-next--split {
  justify-content: space-between;
}

.page-next a {
  color: var(--text-muted);
  transition: color var(--dur-fast);
}

.page-next a:hover {
  color: var(--text);
}

.page-next span {
  display: inline-block;
  transition: transform var(--dur-base);
}

.page-next a:hover span:last-child {
  transform: translateX(var(--space-1));
}

.page-next a:hover span:first-child:not(:last-child) {
  transform: translateX(calc(-1 * var(--space-1)));
}

/* ===== Contact ===== */
/* 이메일을 아주 크게 + 복사 버튼 */
.contact-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-4) var(--space-6);
  padding-bottom: var(--space-7);
  margin-bottom: var(--space-7);
  border-bottom: 1px solid var(--line);
}

.contact-email {
  font-family: var(--font-serif);
  font-size: var(--fs-xl);
  line-height: 1;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
  text-decoration-color: var(--line);
  transition: text-decoration-color var(--dur-base);
}

.contact-email:hover {
  text-decoration-color: var(--text);
}

.contact-copy {
  padding: 0;
  border: 0; /* 테두리 없이 글자만 */
}

.contact-copy:hover {
  color: var(--text); /* 마우스를 올리면 진하게 */
}

.contact-copy:active {
  transform: translateY(1px);
}

/* 아이콘 (이메일 / 인스타그램) — 글자 크기에 맞춰 커지고, 글자색을 따라감 */
.icon {
  width: 0.62em;
  height: 0.62em;
  margin-right: 0.28em;
  vertical-align: -0.02em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--text-muted);
  transition: color var(--dur-fast);
}

.icon-dot {
  fill: currentColor;
  stroke: none;
}

a:hover .icon {
  color: var(--text);
}

/* 큰 이메일 옆 아이콘은 조금 더 작고 가늘게 */
.contact-email .icon {
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.22em;
  stroke-width: 1;
  vertical-align: 0.02em;
}

/* 아래: Instagram / 두 도시 시각 — 12칸 */
.contact-grid {
  row-gap: var(--space-8);
}

.contact-block:first-child {
  grid-column: 1 / span 6;
}

.contact-block:last-child {
  grid-column: 8 / -1;
}

.contact-label {
  margin-bottom: var(--space-4);
}

.contact-links,
.contact-cities {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  line-height: 1.15;
}

.contact-links a span {
  display: inline-block;
  font-size: 0.6em;
  vertical-align: 0.35em;
  color: var(--text-muted);
  transition: transform var(--dur-base), color var(--dur-fast);
}

.contact-links a:hover span {
  color: var(--text);
  transform: translate(var(--space-1), calc(-1 * var(--space-1)));
}

.contact-cities li {
  display: flex;
  align-items: center; /* 점선이 도시 이름 가운데 높이에서 시작 */
}

/* 도시 이름 끝에서 시간까지 이어지는 점선 */
.contact-cities li::after {
  content: "";
  flex: 1;
  order: 1;
  margin: 0 var(--space-3);
  border-bottom: 1px dotted var(--text-muted);
}

/* 점선과 시각을 같은 만큼 내려서 도시 이름(Garamond) 글자 가운데에 맞춤.
   시각은 커지는 효과(transform)와 겹치지 않게 top 으로 이동 */
.contact-cities li::after,
.contact-time {
  position: relative;
  top: 4px;
}

.contact-time {
  order: 2;
}

.contact-time {
  display: inline-block; /* 커지는 효과(transform)가 적용되도록 */
  transform-origin: right center;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  /* 1초 100% → 50%, 1초 다시 100%. 끝에서 오래 머물고 중간에 빠르게 넘어가는 곡선 */
  animation: tick-blink 2s cubic-bezier(0.76, 0, 0.24, 1) infinite;
}

@keyframes tick-blink {
  50% {
    opacity: 0.5;
  }
}


@media (max-width: 900px) {
  .contact-block:first-child,
  .contact-block:last-child {
    grid-column: 1 / -1;
  }
}

/* ===== About ===== */
/* 첫 화면: 아주 큰 이름 + 이어지는 문장 */
.about-hero {
  padding-bottom: var(--space-7);
  margin-bottom: var(--space-7);
  border-bottom: 1px solid var(--line);
}

.about-title {
  font-family: var(--font-serif);
  font-size: var(--fs-display);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.025em;
  margin-bottom: var(--space-4);
}

.about-lead {
  max-width: 22em;
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  line-height: 1.3;
  color: var(--text-muted);
}

.about-lead strong {
  font-weight: 400;
  color: var(--text);
}

/* 왼쪽 작은 사진(따라옴) + 오른쪽 본문 — 12칸 중 4칸 / 7칸 */
.about-body {
  row-gap: var(--space-6);
}

.about-photo {
  grid-column: 1 / span 3;
  position: sticky; /* 스크롤해도 사진이 화면에 따라옴 */
  top: var(--space-11);
}

.about-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.about-photo figcaption {
  margin-top: var(--space-3);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.about {
  grid-column: 5 / span 7;
  max-width: 65ch;
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  line-height: 1.6;
}

.about p + p {
  margin-top: 1.4em;
}

.about strong {
  font-weight: 600;
}

/* 본문 속 강조 인용 */
.about-quote {
  margin: var(--space-7) 0;
  font-size: var(--fs-lg);
  font-style: italic;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.about-quote + p {
  margin-top: 0;
}

/* 화면이 좁으면: 이름 → 문장 → 사진 → 글 순서로 쌓기 */
@media (max-width: 900px) {
  .about-body {
    grid-template-columns: 1fr;
    gap: var(--space-7);
  }
  .about-photo,
  .about {
    grid-column: auto;
  }
  .about-photo {
    position: static;
    max-width: 280px;
  }
}

@media (max-width: 600px) {
  .about-hero {
    padding-bottom: var(--space-6);
    margin-bottom: var(--space-6);
  }
}

/* ===== CV ===== */
/* 분류 필터 */
.cv-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  margin: 0 0 var(--space-7);
}

/* 분류별 개수 — Projects·CV 공통: 오른쪽 위에 작게 5” */
.project-filter sup,
.cv-filter sup {
  display: inline-block; /* 밑줄이 숫자까지 이어지지 않게 */
  margin-left: -0.1em; /* 분류 이름과 숫자 사이 간격 */
  font-size: 0.75em;
  font-variant-numeric: tabular-nums;
}

.project-filter sup::after,
.cv-filter sup::after {
  content: "\201D"; /* ” */
}

/* Projects 분류 메뉴(.project-filter)와 같은 모양: 글자만, 선택된 것은 진하게 + 밑줄 */
.cv-filter button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color var(--dur-fast);
}

.cv-filter button:hover,
.cv-filter button[aria-pressed="true"] {
  color: var(--text);
}

.cv-filter button[aria-pressed="true"] {
  text-decoration: underline;
  text-underline-offset: 6px;
}


/* 연도별 타임라인: 왼쪽 큰 연도(그 해 구간 동안 따라옴) / 오른쪽 활동 */
.cv-year {
  row-gap: var(--space-6);
  padding: var(--space-5) 0 var(--space-7);
  border-top: 1px solid var(--line);
}

/* 필터 후 항목이 하나도 없는 연도는 숨김 */
.cv-year:not(:has(.cv-entry:not([hidden]))) {
  display: none;
}

.cv-year-num {
  grid-column: 1 / span 4;
  position: sticky;
  top: var(--space-11);
  font-family: var(--font-serif);
  font-size: var(--fs-cv-year);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: lining-nums;
}

.cv-entries {
  grid-column: 5 / -1;
  list-style: none;
}

/* 한 항목: 분류 | 무엇 + 어디 | 날짜 */
.cv-entry {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: var(--space-5);
  align-items: baseline;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--line);
  transition: background var(--dur-fast);
}

.cv-entry:first-child {
  padding-top: 0;
}

.cv-entry:last-child {
  border-bottom: 0;
}

.cv-cat {
  font-size: 11px;
  letter-spacing: 0.14em;
}

.cv-what {
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  line-height: 1.3;
}

.cv-where {
  margin-top: var(--space-1);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
}

.cv-where a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
}

.cv-where a:hover {
  color: var(--text);
}

.cv-day {
  font-size: 14px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .cv-year {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  .cv-year-num,
  .cv-entries {
    grid-column: auto;
  }
  .cv-year-num {
    position: static;
  }
}

@media (max-width: 600px) {
  .cv-entry {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-1) var(--space-4);
  }
  .cv-cat {
    grid-column: 1 / -1;
  }
}

/* 화면 전체를 꽉 채우는 배경 영상 */
.bg-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* 모바일 주소창 높이 대응 */
  object-fit: cover; /* 비율 유지하면서 화면을 꽉 채움 (넘치는 부분은 잘림) */
  z-index: 0;
  pointer-events: none;
}

/* 영상 위 반투명 레이어. 필요 없으면 opacity를 0으로 */
.bg-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0.25;
  z-index: 1;
  pointer-events: none;
}

.content {
  position: relative;
  z-index: 2;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--space-5);
}

.artist-name {
  font-size: clamp(1.75rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* OS에서 '동작 줄이기'를 켠 사람: 배경 영상 숨기고 모든 움직임 끔 */
@media (prefers-reduced-motion: reduce) {
  .bg-video {
    display: none;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
