/* =========================================================
   도시건축연구소 — style.css
   ========================================================= */

/* 나눔스퀘어라운드 (OFL, fonts/ 폴더에 포함) — 사이트 전체 글꼴 */
@font-face {
  font-family: 'NanumSquareRound';
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/NanumSquareRoundL.woff2') format('woff2');
}
@font-face {
  font-family: 'NanumSquareRound';
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/NanumSquareRoundR.woff2') format('woff2');
}
@font-face {
  font-family: 'NanumSquareRound';
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/NanumSquareRoundB.woff2') format('woff2');
}
@font-face {
  font-family: 'NanumSquareRound';
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/NanumSquareRoundEB.woff2') format('woff2');
}

:root {
  --black: #111;
  --gray: #c4c4c4;
  --muted: #777;
  --line: #e6e6e6;
  --ph: #f1f1f1;               /* 이미지 없을 때 자리표시 배경 */
  /* 화면 폭·높이 단위. 보통은 1vw · 1svh 그대로.
     세로로 돌린 큰 모니터(데스크톱 세로 모드)에서는 index.html 의 스크립트가
     '폭 1080px 인데 세로로 긴 화면'으로 보이도록 값을 바꾸고 전체를 축소(zoom)함 */
  --vw: 1vw;
  --vh: 1svh;
  --pad: round(clamp(20px, calc(4 * var(--vw)), 48px), .5px);
  --maxw: 1240px;
  --gap: round(clamp(14px, calc(2.4 * var(--vw)), 32px), .5px);
  --grid-gap: round(var(--gap) * 1.5, .5px);   /* 목록(THINK · BUILD · MEMBERS) 사각형 사이 간격 = 기본의 1.5배 */
  --icon: 19px;                /* + 와 집 아이콘 크기 (동일) */
  --stroke: 2.5px;               /* + 와 집 아이콘 선 굵기 (동일) */
  --font: 'NanumSquareRound', 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;   /* 사이트 전체 = 나눔스퀘어라운드 (한자는 자동으로 Noto Sans KR) */
  --round: var(--font);
  --hanja: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;   /* 都市樂 */
  --soft-color: rgba(17, 17, 17, .5);   /* 블랙 50% */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }   /* 스크롤바 자리를 항상 비워 둠 → 페이지마다 가운데가 같음 */
body {
  font-family: var(--font);
  color: var(--black);
  background: #fff;
  --lh: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* 줄 높이: 각 요소의 글자 크기 × --lh 를 정수 px 로 반올림
   (줄 높이를 바꿀 때는 line-height 대신 --lh 값을 바꿉니다) */
* { line-height: round(calc(var(--lh, 1.6) * 1em), .5px); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--black); outline-offset: 3px; }

/* 페이지 전체: 내용 + 맨 아래 카피라이트 */
#app { min-height: 100vh; min-height: calc(100 * var(--vh)); display: flex; flex-direction: column; }
#app > main { flex: 1 0 auto; width: 100%; }

/* ---------------------------------------------------------
   상단 바 — 왼쪽: 집(홈) / 오른쪽: 메뉴 + 버튼
   - 목록 페이지: sticky(고정) → 아래 그리드만 스크롤
   - 상세 페이지: .is-static → 내용과 함께 스크롤
   --------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  padding: var(--pad) var(--pad) 0;
}
.topbar.is-static { position: relative; }

.topbar-row {
  display: flex;
  align-items: center;
  min-height: 32px;
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: round(clamp(12px, calc(2.4 * var(--vw)), 32px), .5px);
}

/* 집 아이콘 (홈으로) */
.home-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: -6.5px;
  transition: opacity .2s;
}
.home-link svg { width: var(--icon); height: var(--icon); overflow: visible; }
.home-link svg path { stroke-width: var(--stroke); vector-effect: non-scaling-stroke; }
.home-link:hover { opacity: .55; }

/* 가운데 연구소 이름: 도시건축연구소 都市樂 (메인 제외 모든 페이지) */
.topbar-row { position: relative; }
.brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  transition: opacity .25s;
}
.brand-ko { font-family: var(--round); font-weight: 800; font-size: 16px; letter-spacing: 1px; word-spacing: -1px; }   /* 띄어쓰기 = 보통의 75% (4px → 3px) */
.hj-t { font-family: var(--hanja); }          /* 글 속 한자 (app.js 가 감쌈) */
.hj-b { font-weight: 600; }                   /* 굵은 글 속 한자: 한 단계 가볍게 → 한글 굵기와 비슷하게 */
.brand-hj { font-family: var(--hanja); font-weight: 800; font-size: 16px; letter-spacing: 1px; }
.brand:hover { opacity: .55; }
@media (min-width: 601px) {        /* 큰 화면: 메뉴가 펼쳐지는 동안만 잠시 숨김 */
  body.menu-open .brand { opacity: 0; pointer-events: none; }
}
@media (max-width: 600px) {
  .brand { gap: 6px; }
  .brand-ko { font-size: 15px; }
  .brand-hj { font-size: 15px; }
}

/* + 버튼 → 열리면 45° 회전해서 × */
.menu-toggle {
  position: relative;
  flex: none;
  width: 32px;
  height: 32px;
  margin-right: -6.5px;
}
.menu-toggle span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--icon);
  height: var(--stroke);
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform .35s cubic-bezier(.6, 0, .2, 1);
}
.menu-toggle span:nth-child(2) { transform: translate(-50%, -50%) rotate(90deg); }
body.menu-open .menu-toggle span:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
body.menu-open .menu-toggle span:nth-child(2) { transform: translate(-50%, -50%) rotate(135deg); }

.main-nav {
  display: flex;
  justify-content: flex-end;
  gap: round(clamp(12px, calc(2.4 * var(--vw)), 32px), .5px);
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px);
  transition: opacity .3s, transform .3s, visibility .3s;
}
body.menu-open .main-nav { opacity: 1; visibility: visible; transform: none; }

.main-nav a {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 3px 0;
  border-bottom: 2px solid transparent;
  transition: border-color .2s;
}
.main-nav a:hover,
.main-nav a.is-current { border-bottom-color: currentColor; }

/* 폰 메뉴 (폭 600px 이하)
   - 메인: 박스 없이 글자만 + 아래로 내려옴
   - 나머지: 집·제목은 그대로, 제목 아래로 아코디언처럼 펼쳐지며
             가로줄과 그 아래 내용이 늘어난 만큼 밀려 내려감 */
.mnav { display: none; }
@media (max-width: 600px) {
  .topbar-right { position: relative; }
  .main-nav {                               /* 메인 페이지용: 글자만 */
    position: absolute;
    top: calc(100% + 10px);
    right: -6.5px;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    padding: 0 6.5px;
    background: none;
    transform: translateY(-6px);
  }
  .main-nav a { font-size: 14px; line-height: 17px; padding: 9px 0 0; }   /* 줄 간격 · 밑줄 거리 */
  .topbar.has-title .main-nav { display: none; }

  .topbar.has-title .page-title { border-bottom: 0; }   /* 가로줄은 메뉴 아래로 이동 */
  .mnav {
    display: grid;
    grid-template-rows: 0fr;
    border-bottom: 1px solid var(--line);
    transition: grid-template-rows .35s cubic-bezier(.6, 0, .2, 1);
  }
  .is-static .mnav { border-bottom: 1px dashed var(--gray); }
  body.menu-open .mnav { grid-template-rows: 1fr; }
  .mnav-inner { min-height: 0; overflow: hidden; }
  .mnav-list {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    padding: 0 0 14px;
  }
  .mnav a {
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 1px;
    --lh: 1.2;
    padding: 9px 0 0;         /* 줄 간격 · 밑줄 거리 */
    border-bottom: 2px solid transparent;
  }
  .mnav a.is-current { border-bottom-color: currentColor; }
}

/* 페이지 제목: THINK | BUILD, MEMBERS, CONTACT */
.page-title {
  display: flex;
  align-items: baseline;
  gap: round(.3825em, .5px);   /* 쌍점 좌우 간격 (이전 .45em 의 85%) */
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
  font-size: round(clamp(18px, calc(2.4 * var(--vw)), 26px), .5px);
  letter-spacing: round(.02em, .5px);
  --lh: 1.2;
}
.is-static .page-title { border-bottom: 1px dashed var(--gray); }
/* THINK : BUILD 사이 쌍점 — 높이 = THINK 대문자 높이의 약 80%, 대문자 가운데에 맞춤 */
.page-title .sep,
.hero-switch .sep {
  color: var(--black);
  font-weight: 800;
  font-size: round(1.03em, 1px);
  position: relative;
  top: round(-.02em, .5px);
}
.hero-switch .sep { top: round(-.045em, .5px); }   /* 메인: 윗선 정렬 배치라 살짝 더 올림 */
.page-title a { color: var(--gray); transition: color .2s; }
.page-title a:hover { color: var(--black); }
.page-title .is-active { color: var(--black); }
.page-title a.is-active:hover { opacity: .6; }

/* ---------------------------------------------------------
   카피라이트 (모든 페이지 맨 아래)
   --------------------------------------------------------- */
.site-footer {
  padding: 28px var(--pad) 32px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 400;             /* Regular */
  letter-spacing: 1px;
  color: var(--black);          /* K100 */
}

/* ---------------------------------------------------------
   MAIN (홈)
   --------------------------------------------------------- */
.page-home .topbar { position: absolute; left: 0; right: 0; background: transparent; }

/* 3단: [위쪽 글자] [都市樂] [THINK | BUILD]
   위·아래 칸 높이가 같아서 都市樂 이 항상 화면 세로 가운데 */
.page-home {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: #fff;
}
/* 배경: 도시 선 그림 — 화면을 꽉 채운 뒤 115% 확대 */
.page-home::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url('../images/bg-city.svg') center / cover no-repeat;
  transform: scale(1.15);       /* 확대 비율 */
  pointer-events: none;
}
.hero {
  display: grid;
  grid-template-rows: minmax(min-content, 1fr) auto minmax(min-content, 1fr);
  justify-items: center;
  min-height: 100vh;
  min-height: calc(100 * var(--vh));
  padding: 48px var(--pad);      /* 위아래 같게 (가운데 유지) */
  text-align: center;
}
.hero-top {
  align-self: end;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: round(calc(clamp(28px, calc(5 * var(--vw)), 80px) * var(--hk, 1)), .5px);   /* 위쪽 글자 ↔ 한자 간격 */
}
.hero-bottom { align-self: start; }
.page-home .site-footer { position: absolute; left: 0; right: 0; bottom: 0; }
@media (max-width: 640px) { .hero { --hk: 1.25; } }   /* 폰: 메인 글자 · 간격 1.25배 (아래 저작권 줄은 그대로) */

/* 1줄: 도 시  건 축  연 구 소 — 화면 폭을 꽉 채우도록 균등 배치 */
.hero-name {
  display: flex;
  justify-content: space-between;
  width: round(min(100%, 11.5em), .5px);      /* 자간: 숫자를 키우면 넓어지고 줄이면 좁아짐 */
  font-family: var(--round);
  font-weight: 800;
  font-size: round(calc(clamp(22px, calc(6 * var(--vw)), 105px) * var(--hk, 1)), 1px);   /* 글자 크기는 항상 정수 px */
  --lh: 1.1;
}
.hero-name .gap { width: 0; }   /* 단어 사이를 한 칸 더 벌림 */

/* [기본 b] 2줄: 도 시  락 — 1줄과 같은 크기·같은 자간 */
.hero-nick {
  display: flex;
  justify-content: center;
  gap: round(.5625em, .5px);                 /* 1줄 글자 간격과 동일: (11.5em - 7em) / 8 */
  margin-top: round(.3em, .5px);
  font-family: var(--round);
  font-weight: 800;
  font-size: round(calc(clamp(22px, calc(6 * var(--vw)), 105px) * var(--hk, 1)), 1px);
  --lh: 1.1;
}
.hero-nick .gap { width: 0; }

/* [alt] 2줄 / [기본 b] 3줄: 都 市 樂 — 가장 크게 / 한글 '도시 락'은 樂 오른쪽 아래 */
.hero-dosirac {
  position: relative;
  top: round(.0275em, .5px);                 /* 글자 모양 보정: 획의 중심이 화면 정중앙에 오도록 */
  display: inline-flex;
  gap: round(.5em, .5px);
  font-family: var(--hanja);
  font-weight: 800;
  font-size: round(min(calc(clamp(58px, calc(12.4 * var(--vw)), 210px) * var(--hk, 1)), calc(21.8 * var(--vw))), 1px);   /* 아주 좁은 폰(320)에서도 화면 안에 */
  --lh: 1;
}
.hero-dosirac .hg {
  position: absolute;          /* 都市樂 은 정확히 가운데 유지 */
  left: 100%;
  bottom: round(.23em, .5px);               /* 글자 밑선을 樂 밑선에 맞춤 */
  margin-left: round(1.75em, .5px);          /* 樂 과의 거리 */
  white-space: nowrap;
  font-family: var(--round);
  font-weight: 700;             /* Bold */
  font-size: round(.2em, 1px);
  --lh: 1;
  letter-spacing: round(.05em, .5px);
  color: var(--black);          /* K100 */
}

/* ---- 메인 후보안 c / d / e (都市樂 은 공통) ---- */
/* c: 위계형 */
.v-label {
  font-family: var(--round);
  font-weight: 400;
  font-size: round(calc(clamp(15px, calc(2.7 * var(--vw)), 44px) * var(--hk, 1)), 1px);
  letter-spacing: round(.5em, .5px);
  margin-right: round(-.5em, .5px);          /* 마지막 글자 뒤 자간 보정 → 정확히 가운데 */
  color: var(--black);
  --lh: 1.2;
}
.v-nick {
  display: flex;
  gap: round(.3em, .5px);                    /* 도 · 시 · 락 균등 간격 */
  margin-top: round(.5em, .5px);             /* 1줄과의 간격 */
  font-family: var(--round);
  font-weight: 800;
  font-size: round(calc(clamp(24px, calc(4.56 * var(--vw)), 80px) * var(--hk, 1)), 1px);
  --lh: 1.05;
}

/* d: 굵기 대비형 (같은 크기) */
.v-d-lab, .v-d-nick {
  font-family: var(--round);
  font-size: round(clamp(30px, calc(6.4 * var(--vw)), 112px), .5px);
  --lh: 1.12;
  letter-spacing: round(.08em, .5px);
  margin-right: round(-.08em, .5px);
}
.v-d-lab { font-weight: 300; color: var(--soft-color); font-size: round(clamp(24px, calc(4.8 * var(--vw)), 84px), .5px); }
.v-d-nick { font-weight: 800; font-size: round(clamp(40px, calc(8.4 * var(--vw)), 146px), .5px); }

/* e: 한 줄형 */
.v-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 round(.5em, .5px);
  font-family: var(--round);
  --lh: 1.1;
  font-size: round(clamp(44px, calc(8 * var(--vw)), 140px), .5px);
}
.v-line-lab { font-size: round(.42em, .5px); font-weight: 400; letter-spacing: round(.12em, .5px); color: var(--soft-color); }
.v-line-nick { font-weight: 800; letter-spacing: round(.02em, .5px); }

/* 4줄: 구상 THINK | BUILD 구축 */
.hero-switch {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: round(.3825em, .5px);   /* 쌍점 좌우 간격 (이전 .45em 의 85%) */
  margin-top: round(calc(clamp(88px, min(calc(16 * var(--vw)), calc(22 * var(--vh))), 220px) * var(--hk, 1)), .5px);   /* 한자 ↔ THINK|BUILD 간격 (낮은 화면에선 자동으로 줄어듦) */
  font-weight: 800;
  font-size: round(min(calc(clamp(28px, calc(4.3 * var(--vw)), 60px) * var(--hk, 1)), calc(10.2 * var(--vw))), 1px);
  --lh: 1;
}

.hero-link { display: inline-flex; align-items: flex-start; gap: round(.4em, .5px); }
.hero-link .ko {                         /* THINK / BUILD 글자 윗선에 맞춤 */
  font-family: var(--round);
  font-size: round(.36em, 1px);
  font-weight: 400;
  --lh: 1;
  margin-top: round(.08em, .5px);
  letter-spacing: round(.05em, .5px);
  color: var(--soft-color);
}
.hero-link .en { position: relative; }
.hero-link .en::after {                  /* 마우스 올리면 밑줄 */
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: round(-.1em, .5px);
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s cubic-bezier(.6, 0, .2, 1);
}
.hero-link:hover .en::after,
.hero-link:focus-visible .en::after { transform: scaleX(1); }
.hero-link.is-closed:hover .en::after { transform: scaleX(0); }   /* 닫힌 메뉴: 밑줄 없음 */

/* ---------------------------------------------------------
   SUB 1·2·3 — 정사각형 그리드 (4 → 3 → 2열)
   --------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: round(var(--grid-gap) * 1.4, .5px) var(--grid-gap);   /* 위아래 | 좌우 */
  max-width: none;                      /* 폭 상한 없음 → 항상 집·+ 아이콘 좌우 끝선에 맞춰 사각형 크기가 창에 따라 변함 */
  margin: 0 auto;
  padding: round(var(--pad) * .9, .5px) var(--pad) round(var(--pad) * 1.5, .5px);
  align-content: start;
}
@media (max-width: 1024px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 16인치 노트북까지는 4열, 그보다 큰 모니터(창 너비 1800px+)는 5열 — 크기는 창에 맞춰 자동 */
@media (min-width: 1800px) {
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
/* 데스크톱 세로 모드(index.html): 실제 폭이 좁아도 노트북처럼 4열 */
.is-portrait-desk .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card { display: block; }
.card-thumb {
  aspect-ratio: 1 / 1;                  /* 가로 = 세로 */
  overflow: hidden;
  background: var(--ph);
}
.card-thumb:has(img) { background: none; }
.card-thumb img,
.card-thumb .ph { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .6, .2, 1); }
.card:hover .card-thumb img,
.card:hover .card-thumb .ph { transform: scale(1.04); }

.card-title {
  margin-top: 12px;
  font-weight: 800;
  font-size: 15px;
  --lh: 1.4;
}
.card-sub {
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--muted);
  --lh: 1.4;
}
.card-title, .card-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .card-title { font-size: 14px; }
  .card-sub { font-size: 12.5px; }
}

/* ---------------------------------------------------------
   글자 박스 (사진 대신) — 단색 + 흰색 볼드, 글자 크기는 박스 폭에 비례
   --------------------------------------------------------- */
.card-thumb, .frame--tile { container-type: inline-size; }
.tile {
  position: relative;                   /* 넘침 계산 기준 (app.js clamp) */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  height: 100%;
  padding: 10.5cqw;                     /* 위·왼쪽 여백 (BUILD · MEMBERS 같은 값) */
  background: var(--black);
  color: #fff;
  font-family: var(--font);
  font-weight: 800;
  letter-spacing: -.01em;
  overflow: hidden;
  transition: transform .6s cubic-bezier(.2, .6, .2, 1);
}
.card:hover .card-thumb .tile { transform: scale(1.04); }
.card--static { cursor: default; }
.card--static .card-thumb .tile,
.card--static .card-thumb img,
.card--static .card-thumb .ph { transform: none !important; }   /* 기수 박스 · 클릭 안 되는 항목: 확대 효과 없음 */
.tile-line { display: block; overflow-wrap: anywhere; }
/* THINK · BUILD: 모든 줄 같은 크기 */
.tile--project .tile-line { font-size: calc(10cqw * var(--ts, 1)); --lh: 1.28; }
.tile--project:not(.tile--fit) .tile-line { white-space: pre; overflow-wrap: normal; }
.tile--project .tile-line { letter-spacing: -.01em; }   /* 자간을 글자 크기에 비례하게 (박스 크기와 상관없이 같은 비율) */   /* 줄바꿈은 app.js 가 계산해 넣음 → 화면 크기와 상관없이 같은 자리에서 바뀜 */   /* --ts = 관리 화면 '글자 크기 배수' (THINK) */   /* THINK: 줄 간격 고정. 길어서 잘리면 app.js 가 글자 크기를 살짝 조절해 아래 여백까지 맞춤 */
/* BUILD: 가장 긴 줄이 좌우 여백까지 꽉 차게 (--fs 는 app.js fitTiles 가 계산) */
.tile--fit .tile-line { width: max-content; max-width: none; overflow-wrap: normal; white-space: nowrap; font-size: var(--fs, 10cqw); --lh: 1.05; }
/* MEMBERS: 위 IU (Bold) / 아래 큰 숫자 (Bold) — 둘 다 왼쪽 정렬 */
.tile--member .tile-line { width: max-content; font-size: 13cqw; font-weight: 800; --lh: 1.1; }   /* IU: Bold */
.tile--member { --tile-gap: 14cqw; }    /* IU 글자 바닥 ~ 01 글자 꼭대기 간격 */
.tile--member .tile-line:nth-child(2) { font-size: 60.5cqw; font-weight: 700; --lh: 1; letter-spacing: -.03em; }   /* 01 */

/* 작은 글 (예: Competition ⏎ Winner): 박스 아래 여백 선에 붙음, 최대 세 줄, 볼드 */
/* 사진 + 글자: 사진을 박스 가득 깔고 글자는 그 위에 (글자 색 기본 흰색, 검정 선택 가능) */
.tile--photo { background: #111; }
.tile .tile-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.tile--photo > span { position: relative; z-index: 1; }
.tile--photo > .tile-note { position: absolute; }
.tile--ink-black { color: #111; }

.tile-note { position: absolute; left: 10.5cqw; right: 10.5cqw; bottom: 10.5cqw; display: block; font-size: 8cqw; font-weight: 700; --lh: 1.15; line-height: 1.15; }
.tile-note > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 상세 페이지 첫 칸 */
.gallery .frame--tile { aspect-ratio: 1 / 1; max-width: 560px; }

/* 목록 페이지 번호 — DETAIL 아래 PREV · LIST · NEXT 와 같은 모양 */
.pager-wrap { padding: 0 var(--pad) round(var(--pad) * 1.2, .5px); }
.pager-wrap:empty { display: none; }
.pager {
  display: flex;
  justify-content: center;
  margin-top: round(var(--pad) * -.5, .5px);   /* 목록 아래 여백과 겹치는 만큼 당김 */
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
}
.pager a:hover { text-decoration: underline; text-underline-offset: 4px; }
.pager-nums { display: flex; gap: 14px; }
.pager-nums a { color: var(--gray); }
.pager-nums a:hover { color: var(--black); text-decoration: none; }
.pager-nums .is-current { color: var(--black); }
.pager-nums .pager-jump { color: var(--black); }               /* ‹ › : 앞·뒤 묶음으로 */

.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 60px 0; }

/* ---------------------------------------------------------
   이미지 자리표시 (실제 이미지 넣기 전)
   --------------------------------------------------------- */
.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--ph);
  color: #b3b3b3;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
}
.ph--think {            /* 다이어그램 느낌 모눈 */
  background-color: #f6f6f6;
  background-image:
    linear-gradient(#e7e7e7 1px, transparent 1px),
    linear-gradient(90deg, #e7e7e7 1px, transparent 1px);
  background-size: 18px 18px;
}
.ph--build { background: #ececec; }
.ph--member {
  background:
    radial-gradient(circle at 50% 38%, #dcdcdc 0 17%, transparent 17.5%),
    radial-gradient(ellipse at 50% 100%, #dcdcdc 0 38%, transparent 38.5%),
    #f3f3f3;
  color: transparent;
}

/* ---------------------------------------------------------
   NEWS — 한 줄에 [제목 | 카테고리 | 연도]
   --------------------------------------------------------- */
.news {
  padding: round(var(--pad) * .7, .5px) var(--pad) round(var(--pad) * 1.5, .5px);
}
.news-list {
  list-style: none;
  max-width: 760px;              /* 이 너비 이상으로는 늘어나지 않음 */
}
.news-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 135px 52.5px;   /* 제목 | 카테고리 | 연도 */
  gap: 24px;
  align-items: baseline;
  padding: 6px 0;                /* 건 사이 간격 (구분선 없음) */
  font-size: 15px;
  --lh: 1.5;
}
.news-title { font-weight: 700; word-break: keep-all; }
.news-title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.news-cat { color: var(--muted); letter-spacing: 0; }
.news-year { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {             /* 폰: [제목 + 카테고리] 한 열 | [연도] 한 열 */
  .news-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title year" "cat year";
    gap: 2px 20px;
    align-items: start;
    padding: 9px 0;
  }
  .news-title { grid-area: title; text-align: justify; text-align-last: left; }   /* 줄바꿈돼도 양쪽 정렬 */
  .news-cat   { grid-area: cat; font-size: 13px; }
  .news-year  { grid-area: year; }
}

/* ---------------------------------------------------------
   ABOUT — 가운데 정렬 글, 화면 정중앙
   --------------------------------------------------------- */
.page-about { position: relative; }
.about {
  position: absolute;            /* 화면 전체 기준으로 가로·세로 가운데 */
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px var(--pad);     /* 위아래 같게 → 정중앙 유지 */
  pointer-events: none;
}
.about-text {
  pointer-events: auto;
  max-width: 680px;
  text-align: center;
  font-size: round(clamp(15px, calc(1.5 * var(--vw)), 18px), .5px);
  --lh: 1.7;
  word-break: keep-all;
}
.about-text p + p { margin-top: round(1.4em, .5px); }
.page-about .site-footer { position: absolute; left: 0; right: 0; bottom: 0; }
/* 소장 소개가 있을 때: 연구소 소개(가운데) → 아래로 소장 소개가 이어짐 */
.page-about.has-director .about {
  position: static;
  display: block;
  padding: 0;
  pointer-events: auto;
}
.page-about.has-director .about-text {
  margin: 0 auto;
  padding: round(var(--pad) * 2.2, .5px) var(--pad);
  box-sizing: content-box;
}
.page-about.has-director .site-footer { position: static; }
.detail.about-director {
  margin: 0 var(--pad);
  padding-left: 0;
  padding-right: 0;
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------
   SUB 4 — CONTACT
   --------------------------------------------------------- */
.contact {
  max-width: 1280px;                    /* 글 한 줄 폭 약 1000px (노트북 기준) */
  padding: round(var(--pad) * 1.2, .5px) var(--pad) round(var(--pad) * 1.5, .5px);
}
.contact-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  padding: 28px 0;
}
.contact-row + .contact-row { border-top: 1px solid var(--line); }
.contact-row h2 { font-size: 18px; font-weight: 800; }
.contact-row p { font-size: 16.5px; word-break: keep-all; text-align: justify; text-align-last: left; }   /* 줄이 바뀌어도 좌우 맞춤 */
.contact-row p + p { margin-top: 9px; }
/* 관리 화면 글 (app.js rich): 엔터 1번 = 줄바꿈 / 2번 = 반 줄 / 3번 = 한 줄 공백 … */
.ln { display: block; }
.ln.gap-1 { margin-top: .5lh; }
.ln.gap-2 { margin-top: 1lh; }
.ln.gap-3 { margin-top: 1.5lh; }
.ln.gap-4 { margin-top: 2lh; }
.ln.gap-5 { margin-top: 2.5lh; }
.ln.gap-6 { margin-top: 3lh; }
.tr-en { color: var(--muted); }                       /* 한글 없는 줄(영어 번역) = 회색 */
.contact-row .rt { font-size: 16.5px; word-break: keep-all; text-align: justify; text-align-last: left; }
.contact-row .rt + p { margin-top: 1lh; }             /* 주소 ↔ 이메일 · 전화 */
.contact-row a { border-bottom: 1px solid currentColor; }
@media (max-width: 640px) {
  .contact-row { grid-template-columns: 1fr; gap: 10px; }
}

/* ---------------------------------------------------------
   DETAIL — 위: 소개글 / 사진들 / 연결 목록 / 개요
   제목·부제목은 가운데 정렬.
   그 아래 내용은 화면 가운데에 놓인 한 기둥(--col) 안에서 왼쪽 정렬
   (소개글 · 사진 · 목록의 왼쪽 끝이 모두 같은 선)
   --------------------------------------------------------- */
.detail {
  /* 프로젝트(THINK · BUILD): 가운데 기둥 폭 = 3:2 사진이 화면 세로에 꽉 차는 폭
     (화면 높이 − 위아래 여백) × 1.5, 단 화면 폭을 넘지 않음 */
  --photo-h: calc(100 * var(--vh) - 2 * var(--pad));
  /* 프로젝트: 사진 왼쪽에 캡션 칸(--capw)을 두고, [캡션 칸 + 사진 기둥]을 한 덩어리로 가운데 */
  --capw: round(clamp(120px, calc(11 * var(--vw)), 200px), 1px);
  --capgap: round(clamp(14px, calc(1.6 * var(--vw)), 24px), 1px);
  --col: min(calc(var(--photo-h) * 1.5), calc(100 * var(--vw) - 2 * var(--pad) - var(--capw) - var(--capgap)));
  padding: round(var(--pad) * 1.2, .5px) var(--pad) round(var(--pad) * 1.2, .5px);
}
.detail.is-member { --col: 960px; }     /* 사람: 사진 옆에 글이 놓이므로 프로젝트와 같은 폭 */
/* 프로젝트 본문 덩어리를 캡션 칸 폭의 절반만큼 왼쪽으로 → 오른쪽에 캡션 칸이 생김 */
.detail:not(.is-member) > .detail-intro,
.detail:not(.is-member) > .gallery,
.detail:not(.is-member) > .related,
.detail:not(.is-member) > .info { position: relative; left: calc((var(--capw) + var(--capgap)) / -2); }
.detail > .member-top,
.detail > .detail-intro,
.detail > .gallery,
.detail > .related,
.detail > .info {
  max-width: var(--col);
  margin-left: auto;
  margin-right: auto;
}
.detail-head { text-align: center; }
.detail-title { font-size: round(clamp(22px, calc(3 * var(--vw)), 34px), .5px); font-weight: 800; --lh: 1.3; word-break: keep-all; }
.detail-sub { margin-top: 6px; font-size: round(clamp(14px, calc(1.6 * var(--vw)), 17px), .5px); color: var(--muted); }

.detail-intro {
  margin-top: round(var(--pad) * .9, .5px);
  font-size: 16.5px;                    /* CONTACT 글과 같은 크기 */
  --lh: 1.5;             /* 줄 간격 150% */
  word-break: keep-all;
}
.detail:not(.is-member) .gallery + .detail-intro { margin-top: round(var(--pad) * 1.1, .5px); }   /* '사진 먼저': 사진 아래 설명 글 */
/* 프로젝트 글: 양쪽 정렬 (마지막 줄은 왼쪽) */
.detail:not(.is-member) .detail-intro,
.detail:not(.is-member) .gallery .block-text { text-align: justify; text-align-last: left; }
.detail-intro p + p,
.block-text p + p { margin-top: 12.5px; }
.is-member .detail-intro { text-align: justify; text-align-last: left; }   /* 사람 소개글: 16.5px (CONTACT 와 같음), 좌우 맞춤 */
/* 사람: 사진(목록 썸네일 크기) | 오른쪽에 소개글 */
.member-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--gap);
  align-items: start;
  margin-top: round(var(--pad) * 1.1, .5px);
}
.member-top > .gallery,
.member-top > .detail-intro { margin-top: 0; }
.member-top > .detail-intro { margin-top: -.3em; }   /* 글 첫 줄 윗선 ≈ 사진 윗선 */
@media (max-width: 640px) {                            /* 폰: 사진 아래로 글 */
  .member-top { display: block; }
  .member-top > .detail-intro { margin-top: round(var(--pad) * .9, .5px); }
}
/* PROFILE · OVERVIEW 안의 여러 줄: [연도 | 내용] 한 번 더 정렬 */
.meta-sub {
  display: grid;
  grid-template-columns: 5em minmax(0, 1fr);   /* 연도 칸 폭 고정 → Award · Career 등 내용이 같은 선 */
  gap: 6px 14px;
}
.meta-sub .ms-year { white-space: nowrap; font-variant-numeric: tabular-nums; }
.meta-sub .ms-full { grid-column: 1 / -1; }
.meta-sub .ms-text { word-break: keep-all; }

/* 사진: 위에서 아래로 크게 (왼쪽 정렬) */
.gallery {
  display: grid;
  gap: round(clamp(12px, calc(2 * var(--vw)), 24px), .5px);
  margin-top: round(var(--pad) * 1.1, .5px);
}
.gallery figure { margin: 0; }
.gallery img { width: 100%; height: auto; }
/* 프로젝트 사진: 3:2 는 기둥 폭에 맞춰 화면 세로에 꽉 차고, 세로로 긴 사진도 화면 높이를 넘지 않게 (왼쪽 정렬) */
.detail:not(.is-member) .gallery img { width: auto; max-width: var(--col); max-height: var(--photo-h); }   /* % 대신 --col: 사진 폭에 맞춘 figure 안에서 0 으로 줄어들지 않게 */
.gallery .frame--ph { aspect-ratio: 3 / 2; }
.detail:not(.is-member) .gallery .frame--ph { max-height: var(--photo-h); }
/* 글은 사진의 왼쪽 선에 맞추되, 너무 긴 줄이 되지 않게 */
.detail:not(.is-member) .detail-intro .ln,
.detail:not(.is-member) .gallery .block-text { max-width: 760px; }
/* 사진 크기 줄이기 (관리 화면 Media → 크기): --k = 0.75, 0.5 … */
.detail:not(.is-member) .gallery figure.is-sized img { max-height: calc(var(--photo-h) * var(--k)); max-width: calc(var(--col) * var(--k)); }
/* 사진이 아직 없는 자리(회색): 기둥 폭 3:2 */
.detail:not(.is-member) .gallery .frame--ph { width: var(--col); max-width: 100%; }
.detail:not(.is-member) .gallery figure.is-sized .frame--ph { width: calc(var(--col) * var(--k)); max-height: calc(var(--photo-h) * var(--k)); }
.gallery figcaption { margin-top: 8px; font-size: 14px; --lh: 1.45; color: var(--muted); word-break: keep-all; }
/* 프로젝트 캡션: 사진 바로 오른쪽, 몇 줄이든 마지막 줄이 사진 아랫선에 맞춤
   (figure 폭 = 사진 폭 → 세로 사진 · 줄인 사진도 사진 옆에 붙음) */
.detail:not(.is-member) .gallery figure { position: relative; width: fit-content; max-width: 100%; }
.detail:not(.is-member) .gallery img { display: block; }
.detail:not(.is-member) .gallery figcaption {
  position: absolute; bottom: 0; left: calc(100% + var(--capgap)); width: var(--capw);
  margin: 0; margin-bottom: -.28em;      /* 글자 바닥 ≈ 사진 아랫선 */
  text-align: justify; text-align-last: left;   /* 양쪽 정렬 (마지막 줄은 왼쪽) — 본문 글과 같게 */
}
/* 폰에서 잘라 보이기: 가로 사진을 정사각형으로 크게, 고른 쪽(왼쪽 · 가운데 · 오른쪽)을 남김 */
@media (max-width: 640px) {
  .detail:not(.is-member) .gallery figure[data-crop] { width: 100%; }
  .detail:not(.is-member) .gallery figure[data-crop] img {
    width: 100%; max-width: 100%; max-height: none; aspect-ratio: 1 / 1; object-fit: cover; object-position: center;
  }
  .detail:not(.is-member) .gallery figure[data-crop="left"] img { object-position: left center; }
  .detail:not(.is-member) .gallery figure[data-crop="right"] img { object-position: right center; }
  /* 폰: '크기 줄이기'는 절반만 적용 (50 → 75%, 75 → 87.5%) — 폰 화면은 좁아서 그대로 줄이면 너무 작음 */
  .detail:not(.is-member) .gallery figure.is-sized img { max-width: calc(var(--col) * (.5 + var(--k) / 2)); max-height: calc(var(--photo-h) * (.5 + var(--k) / 2)); }
  .detail:not(.is-member) .gallery figure.is-sized .frame--ph { width: calc(var(--col) * (.5 + var(--k) / 2)); max-height: calc(var(--photo-h) * (.5 + var(--k) / 2)); }
}
@media (max-width: 640px) {             /* 폰: 캡션 칸 없이 사진 아래 */
  .detail { --capw: 0px; --capgap: 0px; }
  .detail:not(.is-member) > .detail-intro, .detail:not(.is-member) > .gallery,
  .detail:not(.is-member) > .related, .detail:not(.is-member) > .info { left: 0; }
  .detail:not(.is-member) .gallery figcaption { position: static; width: auto; margin: 8px 0 0; }
}
.gallery .block-text {
  max-width: 720px;
  margin: 12px 0;
  font-size: 16.5px;
  --lh: 1.5;
  word-break: keep-all;
}
/* 사람(MEMBERS 상세 · ABOUT 소장): 사진은 목록 썸네일과 같은 크기의 정사각형
   목록 한 칸 폭 = (가로 폭 − 사이 간격) ÷ 한 줄 개수 — 목록과 같은 규칙(4 → 3 → 2, 큰 화면 5) */
.detail.is-member { container-type: inline-size; --cols: 4; }
@media (max-width: 1024px) { .detail.is-member { --cols: 3; } }
@media (max-width: 640px)  { .detail.is-member { --cols: 2; } }
@media (min-width: 1800px) { .detail.is-member { --cols: 5; } }
.is-portrait-desk .detail.is-member { --cols: 4; }
.is-member .gallery { justify-items: start; }
.is-member .gallery figure {
  width: calc((100cqw - (var(--cols) - 1) * var(--grid-gap)) / var(--cols));   /* 목록 썸네일과 같은 크기 */
  max-width: 100%;
}
.is-member .gallery img,
.is-member .gallery .frame--ph { aspect-ratio: 1 / 1; object-fit: cover; }
.is-member .gallery .frame--tile { max-width: none; }

/* 연결 목록(MEMBERS / PROJECTS) · 개요(OVERVIEW / PROFILE) — 같은 2단 정렬 */
.info {
  margin-top: round(var(--pad) * 1.3, .5px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.related + .info { margin-top: round(var(--pad) * .9, .5px); }
.info h3 {
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
}
.meta {
  display: grid;
  grid-template-columns: 120px 1fr;    /* 왼쪽 칸 폭 고정 → 두 섹션의 오른쪽 칸이 같은 선 */
  gap: 8px 0;
  font-size: 16.5px;                    /* PROFILE · OVERVIEW · MEMBERS 목록도 CONTACT 와 같은 크기 */
}
.meta dt { font-weight: 800; letter-spacing: 1px; }
.detail.is-member .meta { row-gap: 16px; }              /* PROFILE: EDUCATION · RESEARCH · CAREER · EMAIL 사이 2배 */
.detail.is-member .related .meta { row-gap: 8px; }      /* 참여 프로젝트 목록은 그대로 */
.meta dd { color: #444; }
.related .meta dt { font-weight: 400; color: var(--muted); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 8px; }
.rel-link { color: var(--black); font-weight: 700; }
.rel-text { color: var(--black); font-weight: 700; }   /* 클릭 안 되는 항목 이름 */
.rel-arrow {                  /* '>' : 기존 글자와 같은 폭, 높이는 1/2 */
  display: inline-block;
  width: 7px;
  height: 5px;
  margin-left: 6.5px;
  vertical-align: 3px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s;
}
.rel-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.rel-link:hover .rel-arrow { transform: translateX(3px); }
.related .meta .group-start:not(:first-of-type) { margin-top: 10px; }
.related .meta dd.is-guest { color: var(--muted); }   /* 함께한 사람 (연구생 외): 회색, 링크 없음 */   /* THINK 묶음 ↔ BUILD 묶음 사이 */

.detail-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  margin-top: round(var(--pad) * 1.6, .5px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
}
.detail-nav > :last-child { justify-self: end; }
.detail-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------------------------------------------------------
   기타
   --------------------------------------------------------- */
.notfound { padding: 120px var(--pad); text-align: center; }
.notfound a { border-bottom: 1px solid currentColor; }

.loading .grid, .loading .detail { opacity: .4; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
