*, *::before, *::after { box-sizing: border-box; }

:root {
  --ink: #111;
  --muted: #8a8a8a;
  --line: rgba(0, 0, 0, 0.12);
  --pad: clamp(16px, 2.4vw, 36px);
  --list-size: clamp(20px, 2.3vw, 34px);
}

html, body { margin: 0; padding: 0; }
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  transition: color .25s ease;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Header ── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: baseline;
  padding: var(--pad);
  font-size: 15px; letter-spacing: -0.01em;
  color: #fff; mix-blend-mode: difference; /* 어떤 배경 위에서도 보이도록 */
}
.site-header .name { font-weight: 500; }
.site-header nav { display: flex; gap: clamp(14px, 2vw, 28px); }
.site-header nav a { opacity: .45; transition: opacity .2s; }
.site-header nav a:hover, .site-header nav a.current { opacity: 1; }

/* ── Full-screen hover stage ── */
#stage {
  position: fixed; inset: 0; z-index: 0;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  opacity: 0; transition: opacity .25s ease;
  pointer-events: none;
}
#stage > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s ease; }
#stage > video.on { opacity: 1; }
#stage::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.28); z-index: 1; }
body.hovering { color: #fff; }
body.hovering #stage { opacity: 1; }
/* 흰 배경 썸네일(제품 사진 등): 어두운 글씨, 오버레이 없음 */
body.hovering.light { color: #111; }
body.light #stage::after { background: rgba(255,255,255,.15); }

/* ── Work list ── */
.list-page { position: relative; z-index: 1; padding: calc(var(--pad) * 4) var(--pad) calc(var(--pad) * 3); }
.list-head, .row {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr) minmax(0, 0.55fr);
  gap: 16px;
  align-items: baseline;
}
.list-head {
  font-size: 13px; color: var(--muted);
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
body.hovering .list-head { color: rgba(255,255,255,.7); border-color: rgba(255,255,255,.3); }
.row {
  font-size: var(--list-size); line-height: 1.15; letter-spacing: -0.02em;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  transition: opacity .2s ease, border-color .25s;
}
.row .year, .row .client { color: var(--muted); transition: color .25s; }
.row .year { font-size: 13px; letter-spacing: 0; align-self: center; }
.row .client { font-size: calc(var(--list-size) * 0.55); letter-spacing: -0.01em; }
body.hovering .row { opacity: .3; border-color: rgba(255,255,255,.25); }
body.hovering .row.active { opacity: 1; }
body.hovering .row .year, body.hovering .row .client { color: #fff; }

/* ── Project page ── */
.project-hero {
  height: 88vh; background-size: cover; background-position: center; background-repeat: no-repeat;
  background-color: #111;
}
.project { padding: var(--pad); }
.project-meta {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px;
  padding: calc(var(--pad) * 1.2) 0 calc(var(--pad) * 2);
  border-bottom: 1px solid var(--line);
}
.project-meta h1 {
  margin: 0; font-weight: 400; font-size: clamp(36px, 5.5vw, 88px);
  letter-spacing: -0.035em; line-height: 1;
}
.project-meta dl { margin: 0; display: grid; grid-template-columns: 4.5rem 1fr; gap: 6px 16px; font-size: 15px; align-self: end; }
.project-meta dt { color: var(--muted); }
.project-meta dd { margin: 0; }
.awards { display: flex; gap: 14px; margin-top: 18px; grid-column: 2; }
.awards img { height: 56px; width: auto; }

.block-text {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px;
  padding: calc(var(--pad) * 2) 0;
}
.block-text h2 { margin: 0; font-weight: 400; font-size: 15px; color: var(--muted); }
.block-text p { margin: 0; font-size: clamp(18px, 1.6vw, 24px); line-height: 1.4; letter-spacing: -0.01em; max-width: 38ch; }
.block-images { display: grid; gap: 12px; }
.block-images.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.block-images img, .block-images video { display: block; width: 100%; height: auto; background: #fff; }

.pager {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: calc(var(--pad) * 3); padding: var(--pad) 0;
  border-top: 1px solid var(--line);
  font-size: clamp(18px, 2vw, 28px); letter-spacing: -0.02em;
}
.pager span { display: block; font-size: 13px; color: var(--muted); letter-spacing: 0; margin-bottom: 4px; }
.pager a:last-child { text-align: right; }
.empty { padding: calc(var(--pad) * 2) 0; color: var(--muted); }

/* ── About ── */
.about { position: relative; z-index: 1; padding: calc(var(--pad) * 4) var(--pad) calc(var(--pad) * 3); }
.about .intro {
  font-size: clamp(28px, 3.6vw, 56px); line-height: 1.1; letter-spacing: -0.03em;
  max-width: 22ch; margin: 0 0 calc(var(--pad) * 2.5);
}
.about section {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px;
  padding: 18px 0; border-top: 1px solid var(--line); font-size: 17px; line-height: 1.5;
}
.about h2 { margin: 0; font-weight: 400; font-size: 15px; color: var(--muted); }
.about ul { list-style: none; margin: 0; padding: 0; }
.about a { border-bottom: 1px solid var(--line); }
.about a:hover { border-color: currentColor; }

/* ── Mobile ── */
@media (max-width: 720px) {
  .list-head .client, .row .client { display: none; }
  .list-head, .row { grid-template-columns: 3.5rem minmax(0, 1fr); }
  .project-hero { height: 60vh; }
  .project-meta, .block-text, .about section { grid-template-columns: 1fr; }
  .awards { grid-column: 1; }
  .block-images.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (hover: none) { #stage { display: none; } }

/* 사진 모음: 세로/가로 사진이 섞여도 빈칸 없이 쌓이는 2단 배치 */
.block-images.masonry { display: block; columns: 2; column-gap: 12px; }
.block-images.masonry > * { margin-bottom: 12px; break-inside: avoid; }
@media (max-width: 720px) { .block-images.masonry { columns: 1; } }

/* 흰 배경 썸네일일 때는 글씨와 선을 어둡게 */
body.hovering.light .list-head { color: rgba(0,0,0,.6); border-color: rgba(0,0,0,.2); }
body.hovering.light .row { border-color: rgba(0,0,0,.15); }
body.hovering.light .row .year, body.hovering.light .row .client { color: #111; }

/* ── 갤러리 (잘림 없이 정렬) ── */
html, body { overflow-x: hidden; }
.gallery { max-width: 1280px; margin: 0 auto; padding: 12px 0 calc(var(--pad) * 1.5); }
.g-row { display: flex; gap: 12px; margin: 0 auto 12px; align-items: flex-start; }
.g-col { display: flex; flex-direction: column; gap: 12px; flex: none; }
.g-item { width: 100%; background: #fff; }
.g-item > img, .g-item > video { display: block; width: 100%; height: 100%; object-fit: contain; }
.g-item > .embed { width: 100%; height: 100%; aspect-ratio: auto; }
.embed { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.g-row.stack { flex-direction: column; width: 100% !important; }
.g-row.stack .g-col { width: 100% !important; }
