/* ============================================================
   Home v3 (2026-10-31) — 작업 벽 + 전체 화면 스테이지
   첫 화면에 작업이 바로 깔리고(최근작·분야 폭이 3초 안에 보인다), 타일을 누르면
   그 자리에서 화면 전체로 커진다. 글꼴은 Inter Tight 하나(한글은 Pretendard가 이어받음) —
   세리프·모노를 섞던 옛 화면이 산만해 보인 주원인이었다.
   ============================================================ */
.home-page {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
  --g: 24px;              /* 페이지 좌우 여백 — nav·머리·벽·푸터가 같은 선에 선다 */
  --gap: 10px;            /* 타일 간격 */
  --sans: "Inter Tight", "Pretendard Variable", Pretendard, "Noto Sans JP", system-ui, sans-serif;
  --muted: rgba(241, 239, 231, 0.56);
  background: #0c0c0e;
  font-family: var(--sans);
}
.home-page .nav { background: rgba(12, 12, 14, 0.82); }
.home-page .nav .wrap { max-width: none; padding: 0 var(--g); }
.home-page .nav-logo { font-family: var(--sans); font-size: 15px; }
.home-page .nav-links a, .home-page .nav-links button { font-family: var(--sans); font-size: 14px; }
body.has-stage { overflow: hidden; }

/* ── 1. 머리 ─────────────────────────────────────────────── */
.wall-head {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: end; gap: 28px 48px;
  padding: clamp(36px, 7vh, 72px) var(--g) clamp(22px, 3.4vh, 32px);
}
.wall-lead {
  margin: 0; max-width: 21em; font-weight: 500; font-size: clamp(30px, 3.5vw, 56px); line-height: 1.06; letter-spacing: -0.035em;
  word-break: keep-all; text-wrap: balance;
}
.wall-lead em { font-style: normal; color: var(--muted); }
.wall-side { display: flex; flex-direction: column; align-items: flex-end; gap: 22px; }
.wall-stats { display: flex; gap: clamp(20px, 3vw, 44px); margin: 0; }
.wall-stats div { display: flex; flex-direction: column-reverse; gap: 2px; }
.wall-stats dt { font-size: 12px; color: var(--muted); }
.wall-stats dd { margin: 0; font-size: clamp(20px, 1.8vw, 26px); font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.wall-filter { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14); background: transparent; color: var(--muted);
  font: 500 13px/1 var(--sans); cursor: pointer; transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.chip i { width: 6px; height: 6px; border-radius: 50%; background: rgb(var(--focus-glow-rgb, var(--ink-rgb))); }
.chip sup { font-size: 10px; top: 0; opacity: 0.6; font-variant-numeric: tabular-nums; }
.chip.is-on { color: #0c0c0e; background: var(--ink); border-color: var(--ink); }
.chip.is-on i { box-shadow: 0 0 0 1.5px rgba(12, 12, 14, 0.25); }
@media (hover: hover) { .chip:not(.is-on):hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.34); } }

/* ── 2. 작업 벽 — 12열, 행 높이 = 3열 타일이 16:9가 되는 값 ─────────── */
.wall { padding: 0 var(--g); }
.wall-grid {
  --col: calc((100vw - 2 * var(--g) - 11 * var(--gap)) / 12);
  --row: calc((var(--col) * 3 + var(--gap) * 2) * 9 / 16);
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: var(--row); grid-auto-flow: row dense; gap: var(--gap);
}
.t { grid-column: span 3; position: relative; }
.t--big { grid-column: span 6; grid-row: span 2; }
.t--big.t--r { grid-column: 7 / span 6; }
.t--wide { grid-column: span 6; }
.t.is-out { display: none; }
.t-btn {
  position: absolute; inset: 0; display: block; width: 100%; padding: 0; border: 0; border-radius: 6px; overflow: hidden;
  background: #17171a; color: inherit; cursor: pointer; text-align: left; isolation: isolate;
}
.t-btn:active { transform: none; }
.t-media, .t-media img, .t-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.t-media img { transition: transform 1.1s var(--ease), opacity 0.6s ease; }
.t-media video { opacity: 0; transition: opacity 0.5s ease; }
.t.is-playing .t-media video { opacity: 1; }
.t-cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  padding: 40px 14px 12px; background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
  opacity: 0; transform: translateY(6px); transition: opacity 0.35s ease, transform 0.5s var(--ease);
}
.t-title { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t--big .t-title { font-size: clamp(18px, 1.7vw, 26px); letter-spacing: -0.025em; }
.t-meta { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255, 255, 255, 0.7); font-variant-numeric: tabular-nums; }
.t-meta i, .stage-meta i { width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--ink)); }
/* 큰 타일(영상)은 제목을 늘 보인다 — 첫 화면의 정보 */
.t--big .t-cap { opacity: 1; transform: none; }
@media (hover: hover) and (pointer: fine) {
  .t:hover .t-cap, .t-btn:focus-visible .t-cap { opacity: 1; transform: none; }
  .t:hover .t-media img { transform: scale(1.035); }
  .t-btn { box-shadow: inset 0 0 0 0 transparent; }
  .t:hover .t-btn { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.55); }
  /* 나머지 타일 어둡게 — filter는 재생 중인 영상 타일을 매 프레임 다시 걸러 30fps로 떨어졌다(실측) → 검은 막의 opacity만 바꾼다 */
  .t-btn::after { content: ""; position: absolute; inset: 0; z-index: 2; background: #0c0c0e; opacity: 0; pointer-events: none; transition: opacity 0.45s ease; }
  .wall-grid.is-hovering .t:not(:hover) .t-btn::after { opacity: 0.42; }
}
@media (hover: none) {
  .t-cap { opacity: 1; transform: none; padding: 30px 10px 9px; }
  .t-title { font-size: 13px; }
  .t:not(.t--big):not(.t--wide) .t-meta { display: none; } /* 작은 칸은 제목만 — 분류·연도까지 넣으면 제목이 잘린다 */
}
/* 벽 등장 — 타일이 순서대로 떠오른다 */
.t { opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease), transform 0.9s var(--ease); transition-delay: calc(var(--i, 0) * 45ms); }
.t.is-in { opacity: 1; transform: none; }


/* ── 스테이지 — 전체 화면 ─────────────────────────────────── */
.stage { position: fixed; inset: 0; z-index: 300; color: #fff; }
.stage[hidden] { display: none; }
.stage-media { position: absolute; inset: 0; background: #000; overflow: hidden; transform-origin: 0 0; will-change: transform; }
.stage-inner { transform-origin: 50% 50%; will-change: transform; }
.stage-media > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.stage-media .is-fade { opacity: 0; transition: opacity 0.7s ease; }
.stage-media .is-fade.is-ready { opacity: 1; }
/* Vimeo 배경 플레이어 — iframe은 object-fit이 없어 16:9를 화면에 cover로 맞춘다 */
.stage-media iframe { position: absolute; left: 50%; top: 50%; border: 0; width: max(100vw, 177.78vh); height: max(100vh, 56.25vw); transform: translate(-50%, -50%); pointer-events: none; }
.stage-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0) 18%, rgba(0, 0, 0, 0) 48%, rgba(0, 0, 0, 0.78) 100%); }
.stage-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 20px var(--g); }
.stage-count { font-size: 13px; font-variant-numeric: tabular-nums; opacity: 0.8; }
.stage-close, .stage-nav button {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; padding: 0; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(0, 0, 0, 0.25); color: #fff; backdrop-filter: blur(8px);
  transition: background 0.25s ease, border-color 0.25s ease;
}
.stage-close svg, .stage-nav svg { width: 20px; height: 20px; }
@media (hover: hover) { .stage-close:hover, .stage-nav button:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.6); } }
.stage-copy { position: absolute; left: var(--g); right: var(--g); bottom: clamp(28px, 5vh, 48px); }
.stage-meta { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 14px; opacity: 0.85; font-variant-numeric: tabular-nums; }
.stage-meta span + span::before { content: "·"; margin-right: 10px; opacity: 0.6; }
.stage-title { margin: 0; max-width: 15em; font-weight: 500; font-size: clamp(40px, 6.2vw, 108px); line-height: 0.98; letter-spacing: -0.045em; word-break: keep-all; text-wrap: balance; }
.stage-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: clamp(20px, 3vh, 32px); }
.stage-open { display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 22px; border-radius: 999px; background: #fff; color: #0c0c0e; font-weight: 600; font-size: 15px; transition: transform 0.3s var(--ease); }
.stage-open:hover { transform: translateY(-2px); }
.stage-nav { display: flex; gap: 8px; }
.stage-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, 0.12); }
.stage-progress i { display: block; height: 100%; width: 100%; background: var(--c, #fff); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.stage-progress.is-off { display: none; }
/* 열림 전환 중엔 글·버튼을 숨겼다가 올린다 */
.stage-top, .stage-copy > * { transition: opacity 0.5s ease, transform 0.8s var(--ease); }
.stage:not(.is-shown) .stage-top, .stage:not(.is-shown) .stage-copy > * { opacity: 0; transform: translateY(14px); transition-duration: 0.2s; }
.stage.is-shown .stage-copy > :nth-child(2) { transition-delay: 0.06s; }
.stage.is-shown .stage-copy > :nth-child(3) { transition-delay: 0.12s; }
.stage-copy.is-swap > * { animation: stage-swap 0.7s var(--ease) both; }
.stage-copy.is-swap > :nth-child(2) { animation-delay: 0.05s; }
.stage-copy.is-swap > :nth-child(3) { animation-delay: 0.1s; }
@keyframes stage-swap { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ── 3. 3D 전시장 띠 ─────────────────────────────────────── */
.ex { padding: clamp(80px, 13vh, 150px) var(--g) clamp(64px, 10vh, 110px); }
.ex-band {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: end; gap: 12px 24px;
  padding: clamp(28px, 4vw, 48px) 0; border-top: 1px solid var(--hairline-strong); border-bottom: 1px solid var(--hairline-strong);
}
.ex-kicker { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.ex-title { font-weight: 500; font-size: clamp(40px, 6.4vw, 112px); line-height: 0.98; letter-spacing: -0.045em; word-break: keep-all; transition: color 0.4s ease; }
.ex-cta {
  display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 24px; border-radius: 999px; background: var(--motion); color: #14130f;
  font-weight: 600; font-size: 15px; white-space: nowrap; transition: transform 0.4s var(--ease), box-shadow 0.4s ease;
}
.ex-cta svg { width: 18px; height: 18px; transition: transform 0.4s var(--ease); }
@media (hover: hover) {
  .ex-band:hover .ex-title { color: var(--motion); }
  .ex-band:hover .ex-cta { transform: translateY(-2px); box-shadow: 0 14px 34px -12px rgba(var(--motion-rgb), 0.6); }
  .ex-band:hover .ex-cta svg { transform: translateX(4px); }
}
.ex-band:active { transform: none; }
.ex-body { max-width: 640px; margin: 22px 0 0; font-size: 15px; line-height: 1.75; color: var(--muted); word-break: keep-all; }

/* ── 4. About ─────────────────────────────────────────────── */
.about { padding: clamp(64px, 10vh, 120px) var(--g) clamp(80px, 12vh, 140px); border-top: 1px solid var(--hairline); }
.about .about-grid { padding: 0; max-width: 1080px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.sec-kicker { margin: 0; font-size: 13px; color: var(--muted); }
.home-portrait { width: 220px; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #121319; }
.home-portrait img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.2); }
.home-about-bio { max-width: 640px; }
.home-about-name { margin: 10px 0 20px; font-family: var(--sans); font-weight: 500; font-size: clamp(32px, 3.4vw, 46px); line-height: 1.1; letter-spacing: -0.03em; }
.home-about-name .about-name-en { font-size: 0.42em; color: var(--muted); font-family: var(--sans); letter-spacing: 0; }
.home-about-bio .home-about-text p { font-size: 16px; line-height: 1.8; color: var(--muted); margin: 0 0 14px; max-width: none; word-break: keep-all; }
.home-contact { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--hairline); }
.home-about-bio .home-contact-title { margin: 0 0 18px; font-family: var(--sans); font-weight: 500; font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -0.03em; line-height: 1.1; color: var(--ink); max-width: none; }
.home-contact-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.home-btn { display: inline-flex; align-items: center; gap: 9px; height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--hairline-strong); font-size: 15px; font-weight: 600; transition: transform 0.3s var(--ease), background 0.3s ease, box-shadow 0.3s ease; }
.home-btn[hidden] { display: none; }
.home-btn--primary { background: var(--motion); border-color: var(--motion); color: #14130f; }
.home-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px -10px rgba(var(--motion-rgb), 0.6); }
.home-email { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink); }
.home-copy { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--hairline-strong); border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; padding: 0; transition: color 0.3s ease, border-color 0.3s ease; }
.home-copy:hover { color: var(--motion); border-color: var(--motion); }
.home-copy .i-check, .home-copy.is-copied .i-copy { display: none; }
.home-copy.is-copied .i-check { display: block; color: var(--motion); }
.home-social { margin-top: 22px; gap: 12px; }
.home-social .social-icon-btn { width: 40px; height: 40px; }
.home-social .social-icon-btn svg { width: 18px; height: 18px; }

.home-foot { border-top: 1px solid var(--hairline); padding: 22px var(--g) 26px; }
.home-foot-row { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--muted); }
.home-foot-row a:hover { color: var(--ink); }

[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1.2s var(--ease); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* ── 반응형 ───────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .wall-head { grid-template-columns: 1fr; }
  .wall-side { align-items: flex-start; }
  .wall-filter { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .home-page { --g: 16px; --gap: 8px; }
  .wall-head { padding-top: 28px; gap: 22px; }
  .wall-lead { font-size: clamp(26px, 7.4vw, 34px); }
  .wall-stats dd { font-size: 20px; }
  /* 필터는 가로로 밀어 본다(줄바꿈하면 첫 화면을 다 먹는다) */
  .wall-filter { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--g)); padding: 0 var(--g); scrollbar-width: none; width: calc(100% + 2 * var(--g)); }
  .wall-filter::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .wall-grid { --col: calc((100vw - 2 * var(--g) - var(--gap)) / 2); --row: calc(var(--col) * 9 / 16); grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t { grid-column: span 1; }
  .t--big, .t--big.t--r { grid-column: 1 / -1; grid-row: span 2; }
  .t--wide { grid-column: 1 / -1; }
  .stage-title { font-size: clamp(34px, 10vw, 52px); }
  .stage-shade { background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0) 16%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.88) 100%); }
  .stage-close, .stage-nav button { width: 44px; height: 44px; }
  .stage-open { height: 44px; padding: 0 18px; font-size: 14px; }
  .ex-band { grid-template-columns: 1fr; }
  .ex-cta { justify-self: start; }
  .about .about-grid { grid-template-columns: 1fr; }
  .home-portrait { width: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  .t, [data-reveal] { transition: none !important; opacity: 1 !important; transform: none !important; }
  .stage-copy.is-swap > * { animation: none; }
}
