/* ============================================================================
 *  우정수 포트폴리오 —  스타일 (v6.1, 애플 정밀 폴리시)
 *  방침: 애플/OpenAI 기반을 유지하되, 자간·위계·마이크로 인터랙션을 정제.
 *        색은 절제된 모노톤(작품 사진만 색). 여백으로 위계, 디테일로 완성도.
 *  이전 디자인 복구: backups/apple · backups/sdl-kontaakt · backups/faithful
 * ==========================================================================*/

:root {
  --paper:  #ffffff;
  --paper-2:#f5f5f7;
  --ink:    #1d1d1f;
  --sub:    #6e6e73;
  --faint:  #86868b;
  --line:   #e6e6ea;
  --hair:   rgba(0,0,0,0.06);
  --radius: 0;              /* 이미지 각진 모서리 (라운딩 없음) */

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Pretendard Variable", Pretendard, "Segoe UI", Roboto,
          "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;

  --maxw: 1080px;
  --pad:  clamp(22px, 5vw, 44px);
  --ease:     cubic-bezier(0.4, 0, 0.2, 1);       /* 호버 등 짧은 전환 */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);     /* 등장(강한 ease-out) */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.6;
  font-weight: 400; letter-spacing: -0.015em;
  font-feature-settings: "kern" 1, "liga" 1; font-kerning: normal;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--ink); color: var(--paper); }

/* --- 헤더 --------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 var(--pad);
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hair);
}
.brand { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.header-right { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 26px); }
.contact { display: flex; gap: 16px; padding-left: clamp(16px, 2.4vw, 24px); border-left: 1px solid var(--line); }
.contact a { font-size: 14px; color: var(--sub); letter-spacing: -0.01em; transition: color 0.22s var(--ease); }
.contact a:hover { color: var(--ink); }
.nav { display: flex; gap: clamp(18px, 2.4vw, 30px); }
.nav a { position: relative; font-size: 14px; color: var(--sub); letter-spacing: -0.01em;
  transition: color 0.22s var(--ease); }
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); }
.nav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -19px;
  height: 1.5px; background: var(--ink); border-radius: 2px; }

/* --- 본문 --------------------------------------------------------------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

/* 스크롤 등장 */
.reveal { opacity: 0; transform: translateY(12px); }
.reveal.in { opacity: 1; transform: none;
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out); }

/* --- 홈 (원본과 동일한 담백한 스케일: 이름·위치도 본문 크기) ---------- */
.home { max-width: 40rem; padding: clamp(28px, 4vw, 52px) 0 96px; }
.home .name { font-size: 17px; font-weight: 600; letter-spacing: -0.012em; line-height: 1.5; margin-bottom: 0; }
.home .loc { font-size: 17px; color: var(--sub); letter-spacing: -0.012em; margin-bottom: 2em; }
.home > p { margin-bottom: 1.6em; line-height: 1.62; letter-spacing: -0.012em; }
.home > p.loc { margin-bottom: 2em; }
.home > p:last-child { margin-bottom: 0; }

/* ============================================================================
 *  리스트 행 — 좌: 정보 · 우: 이미지 카드
 * ==========================================================================*/
.rows { padding-bottom: 0; }
.row {
  display: grid; grid-template-columns: 288px minmax(0, 1fr);
  grid-template-areas: "meta media";
  gap: clamp(28px, 4.5vw, 60px);
  padding: clamp(38px, 5vw, 62px) 0;
  border-top: 1px solid var(--hair); align-items: start;
}
.row:first-child { border-top: none; padding-top: clamp(24px, 3vw, 40px); }

.row .meta { grid-area: meta; }
.row .meta .prefix { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--faint); margin-bottom: 10px; }
.row .meta .tline { margin-bottom: 9px; }
.row .meta .title { font-size: 20px; font-weight: 600; letter-spacing: -0.022em;
  line-height: 1.26; color: var(--ink); text-wrap: balance; }
/* 제목 링크: 밑줄이 좌→우로 자라남 + 화살표 슬라이드 (파란색 대신 절제된 잉크) */
a.title {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size 0.24s var(--ease-out);
}
a.title .ext { display: inline-block; margin-left: 4px; font-weight: 400; color: var(--faint);
  opacity: 0; transform: translateX(-3px);
  transition: opacity 0.24s var(--ease-out), transform 0.24s var(--ease-out); background: none; }
.row .meta .venue { font-size: 15px; color: var(--sub); line-height: 1.5; letter-spacing: -0.01em; white-space: pre-line; }
.row .meta .year  { font-size: 15px; color: var(--faint); margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.row .meta .desc  { font-size: 15px; color: var(--sub); line-height: 1.62; letter-spacing: -0.01em; margin-top: 15px; max-width: 34rem; white-space: pre-line; }

/* 이미지 카드 */
.row .media { grid-area: media; max-width: 600px; }
.media .stage {
  position: relative; width: 100%; aspect-ratio: 452 / 272;
  background: var(--paper-2); overflow: hidden; cursor: zoom-in;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--hair), 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px -14px rgba(0,0,0,0.16);
  transition: box-shadow 0.28s var(--ease-out), transform 0.28s var(--ease-out);
}
.media .stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.42s var(--ease-out), transform 0.55s var(--ease-out); }
.media .stage img.on { opacity: 1; }
.media .arrow {
  position: absolute; top: 50%; transform: translateY(-50%) scale(0.88);
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, #fff 68%, transparent); color: #1d1d1f; border: 0; border-radius: 50%;
  cursor: pointer; z-index: 2; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 5px rgba(0,0,0,0.16); opacity: 0;
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease-out), background 0.2s var(--ease);
}
.media .arrow:hover { background: #fff; }

/* 호버 가능한 기기(마우스)에서만 호버 모션 — 터치 탭 후 잔상 방지 (Emil #8) */
@media (hover: hover) and (pointer: fine) {
  .media .stage:hover { transform: translateY(-3px);
    box-shadow: inset 0 0 0 1px var(--hair), 0 2px 4px rgba(0,0,0,0.05), 0 20px 44px -20px rgba(0,0,0,0.28); }
  .media .stage:hover img.on { transform: scale(1.035); }
  .media .stage:hover .arrow { opacity: 1; transform: translateY(-50%) scale(1); }
  a.title:hover { background-size: 100% 1.5px; }
  a.title:hover .ext { opacity: 1; transform: none; }
}
.media .arrow.prev { left: 11px; } .media .arrow.next { right: 11px; }
.media .arrow svg { display: block; }
/* 알약형 점 인디케이터 */
.media .dots { display: flex; justify-content: center; gap: 6px; margin-top: 15px; }
.media .dot { width: 6px; height: 6px; border-radius: 999px; border: 0; padding: 0; cursor: pointer;
  background: color-mix(in srgb, var(--faint) 45%, transparent);
  transition: width 0.34s var(--ease-out), background 0.24s var(--ease); }
.media .dot:hover { background: var(--faint); }
.media .dot.on { width: 18px; background: var(--ink); }
.media .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--faint); font-size: 13px; }

/* --- Texts ------------------------------------------------------------- */
.row.text { grid-template-columns: 1fr 1fr; grid-template-areas: "krm enm"; }
.row.text .ko { grid-area: krm; } .row.text .en { grid-area: enm; }
.row.text .title  { font-size: 17px; font-weight: 600; letter-spacing: -0.018em; line-height: 1.32; color: var(--ink); }
.row.text .author { font-size: 15px; color: var(--sub); margin-top: 5px; letter-spacing: -0.01em; }
.row.text .year   { font-size: 15px; color: var(--faint); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* --- 반응형 ------------------------------------------------------------- */
@media (max-width: 900px) {
  .row { grid-template-columns: 1fr; grid-template-areas: "meta" "media"; gap: 20px; }
  .row .media { max-width: 100%; margin-top: 4px; }
  .row.text { grid-template-columns: 1fr 1fr; grid-template-areas: "krm enm"; gap: 20px; }
}
@media (max-width: 560px) {
  .row.text { grid-template-columns: 1fr; grid-template-areas: "krm" "enm"; }
}

/* --- 라이트박스 --------------------------------------------------------- */
.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--paper) 93%, #000); padding: clamp(16px, 5vh, 64px);
  opacity: 0; pointer-events: none; transition: opacity 0.34s var(--ease-out); }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  box-shadow: 0 24px 80px rgba(0,0,0,0.24); transition: opacity 0.34s var(--ease-out); }
.lb-caption { position: absolute; left: 0; right: 0; bottom: clamp(14px,3vh,30px);
  text-align: center; font-size: 13px; letter-spacing: 0.01em; color: var(--faint); font-variant-numeric: tabular-nums; }
.lb-close, .lb-nav { position: absolute; background: none; border: 0; color: var(--sub); cursor: pointer;
  padding: 12px; opacity: 0.7; transition: opacity 0.2s var(--ease), transform 0.24s var(--ease-out), color 0.2s var(--ease); }
.lb-close:hover, .lb-nav:hover { opacity: 1; color: var(--ink); }
.lb-close { top: clamp(8px,2vh,20px); right: clamp(8px,2vw,20px); }
.lb-nav.prev { left: clamp(4px,1.5vw,20px); top: 50%; transform: translateY(-50%); }
.lb-nav.next { right: clamp(4px,1.5vw,20px); top: 50%; transform: translateY(-50%); }
.lb-nav.prev:hover { transform: translateY(-50%) translateX(-3px); }
.lb-nav.next:hover { transform: translateY(-50%) translateX(3px); }
.lb-nav svg, .lb-close svg { display: block; }

/* --- 푸터 --------------------------------------------------------------- */
.site-footer {
  max-width: var(--maxw); margin: 0 auto; padding: clamp(30px, 4vw, 44px) var(--pad) clamp(40px, 5vw, 56px);
  border-top: 1px solid var(--hair);
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap;
}
.foot-contact { display: flex; gap: 24px; }
.foot-contact a { font-size: 14px; color: var(--sub); letter-spacing: -0.01em; transition: color 0.2s var(--ease); }
.foot-contact a:hover { color: var(--ink); }
.foot-copy { font-size: 13px; color: var(--faint); letter-spacing: -0.005em; }

/* 모바일: 로고 + 메뉴 + Email 을 한 줄로 (폭에 맞춰 자동 축소) */
@media (max-width: 720px) {
  .site-header { height: 52px; padding: 0 var(--pad); }
  .brand { font-size: 15px; }
  .header-right { flex-wrap: nowrap; gap: 12px; }
  .contact { border-left: none; padding-left: 0; }
  .nav { gap: 12px; }
  .nav a, .contact a { white-space: nowrap; }
  .nav a.active::after { display: none; }
  .nav a.active { font-weight: 600; }
}
@media (max-width: 600px) {
  .brand { font-size: 14.5px; }
  .nav { gap: 11px; } .nav a, .contact a { font-size: 12.5px; }
  .header-right { gap: 11px; }
}
@media (max-width: 380px) {
  .brand { font-size: 14px; }
  .nav { gap: 9px; } .nav a, .contact a { font-size: 11.5px; }
  .header-right { gap: 9px; }
}

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .media .stage img.on { opacity: 1; }
}
