/*
  NIZ PORTFOLIO
  ------------------------------------------------------------
  가장 자주 수정할 값은 아래 :root 안에 모아두었습니다.

  참고:
  첨부 시안의 시각적 크기에 맞추기 위해 웹에서는 23pt 대신 23px,
  18pt 대신 18px로 적용했습니다. CSS의 23pt는 약 30.7px로 렌더되어
  시안보다 훨씬 크게 보입니다. 정말 pt 단위를 원하면 아래 값을
  23pt / 18pt로 직접 바꾸면 됩니다.
*/

@font-face {
  font-family: "Neue Haas Grotesk Text Pro";
  src: url("./fonts/NeueHaasGroteskTextPro-55Roman.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --page-padding: 16px;
  --background: #ffffff;
  --text: #000000;

  --font-main: 16px;
  --font-client: 12px;
  --line-height: 1.2;

  --logo-height: 36px;
  --logo-copy-gap: 32px;

  --nav-width: 524px;
  --year-width: 64px;
  --title-width: 460px;


  --column-gap: 120px;

  --header-to-content-gap: 48px;

  --row-padding: 5px;
  --rule: 1px solid #000000;

  --image-width: 640px;
  --image-height: auto;
  --image-gap: 8px;
  --title-image-gap: 12px;
  --image-description-gap: 12px;
  --project-gap: 120px;
}

/* 기본 초기화 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--background);
  color: var(--text);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--background);
  color: var(--text);
  font-family:
    "Neue Haas Grotesk Text Pro",
    "Helvetica Neue",
    Helvetica,
    Arial,
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    sans-serif;
  font-size: var(--font-main);
  font-weight: 400;
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button,
a {
  color: inherit;
  font: inherit;
}

a {
  text-decoration: none;
}

button {
  border: 0;
  padding: 0;
  background: none;
}

img {
  display: block;
  max-width: 100%;
}

/* 전체 2단 레이아웃 */
.site-shell {
  display: grid;
  grid-template-columns: var(--nav-width) minmax(0, 1fr);
  column-gap: var(--column-gap);
  min-height: 100vh;
  padding: var(--page-padding);
  overflow: clip;
}

/* 왼쪽 영역 */
.sidebar {
  position: sticky;
  top: var(--page-padding);
  align-self: start;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: var(--nav-width);
  height: calc(100vh - (var(--page-padding) * 2));
  min-height: 600px;
}

.intro {
  display: flex;
  align-items: flex-start;
  min-height: var(--logo-height);
}

.logo-link {
  flex: 0 0 auto;
  display: inline-block;
  line-height: 0;
}

.logo {
  width: auto;
  height: var(--logo-height);
}

.intro-copy {
  margin: 0 0 0 var(--logo-copy-gap);
  white-space: nowrap;
}

/* 프로젝트 목록 */
.project-nav {
  margin-top: var(--header-to-content-gap);
}

.project-list {
  width: 100%;
  border-bottom: var(--rule);
}

.project-link {
  display: grid;
  grid-template-columns: var(--year-width) var(--title-width) minmax(0, 1fr);
  grid-template-areas:
    "year title category"
    ". client .";
  width: 100%;
  padding: var(--row-padding) 0;
  border-top: var(--rule);
  cursor: pointer;
  text-align: left;
  transition: opacity 160ms ease;
}

.project-link:hover,
.project-link:focus-visible {
  opacity: 0.45;
}

.project-link:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 3px;
}

.project-link[aria-current="page"] {
  opacity: 0.45;
}

.project-year {
  grid-area: year;
  white-space: nowrap;
}

.project-title {
  grid-area: title;
  min-width: 0;
  white-space: nowrap;
}

.project-category {
  grid-area: category;
  justify-self: end;
  padding-left: 14px;
  white-space: nowrap;
  text-align: right;
}

.project-client {
  grid-area: client;
  margin-top: 1px;
  font-size: var(--font-client);
  white-space: nowrap;
}

/* 왼쪽 하단 연락처 */
.sidebar-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: var(--font-main);
  line-height: 1.1;
}

.mobile-label {
  display: none;
}

.sidebar-footer a:hover,
.sidebar-footer a:focus-visible {
  opacity: 0.45;
}

/* 오른쪽 상세 영역 */
.details {
  min-width: 0;
  padding-top: calc(var(--logo-height) + var(--header-to-content-gap));
}

.project-detail {
  min-width: 0;
}

.project-detail + .project-detail {
  margin-top: var(--project-gap);
}

.detail-title {
  margin: 0;
  font: inherit;
  font-weight: 400;
}

.media-strip {
  width: 100%;
  margin-top: var(--title-image-gap);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  cursor: grab;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-x pan-y;

  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scroll-padding-inline: 0;
}

.media-strip::-webkit-scrollbar {
  display: none;
}

.media-strip.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.media-track {
  display: flex;
  width: max-content;
  gap: var(--image-gap);
}

.project-image {
  flex: 0 0 auto;
  width: var(--image-width);
  height: var(--image-height);
  object-fit: cover;
  background: #d9d9d9;

  /* 각 이미지의 중앙에서 스크롤 정지 */
  scroll-snap-align: center;
  scroll-snap-stop: always;

  /* 이미지 자체 클릭 및 드래그 방지 */
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* 이미지 아래 설명 */
.detail-meta {
  margin-top: var(--image-description-gap);
}

.detail-meta p {
  margin: 0;
}

.detail-description {
  max-width: 760px;
  margin-top: 24px !important;
  white-space: pre-line;
}



/* 태블릿/모바일: 한 단으로 전환 */
@media (max-width: 900px) {
  :root {
    --font-main: 18px;
    --font-client: 14px;
    --logo-height: 40px;
    --logo-copy-gap: 24px;
    --header-to-content-gap: 56px;
    --year-width: 58px;
    --title-image-gap: 18px;
    --image-gap: 16px;
    --image-description-gap: 18px;
    --project-gap: 84px;
  }

  .site-shell {
    display: block;
    min-height: 100vh;
    padding: var(--page-padding);
    overflow: visible;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    min-height: 0;
  }

  .intro-copy {
    white-space: normal;
  }

  .project-link {
    grid-template-columns: var(--year-width) minmax(0, 1fr) auto;
  }

  .project-title {
    padding-right: 12px;
    white-space: normal;
  }

  .project-category {
    align-self: start;
    padding-left: 6px;
    font-size: var(--font-client);
  }

  .project-client {
    white-space: normal;
  }

  .sidebar-footer {
    margin-top: 36px;
  }

  .details {
    padding-top: 0;
    margin-top: 84px;
  }

  .project-image {
    width: calc(100vw - (var(--page-padding) * 2));
    height: auto;
    aspect-ratio: 3 / 2;
  }

  .detail-description {
    max-width: 100%;
  }
}


/* 모바일 포트폴리오 화면 */
@media (max-width: 700px) {
  :root {
    --page-padding: 18px;

    --font-main: 14px;
    --font-client: 14px;

    --logo-height: 32px;
    --logo-copy-gap: 18px;

    --title-image-gap: 16px;
    --image-gap: 12px;
    --image-description-gap: 16px;
    --project-gap: 80px;
  }

  /*
    모바일에서는 좌우 2단을 없애고
    전체를 한 줄 구조로 변경합니다.
  */
  .site-shell {
    display: block;
    width: 100%;
    min-height: 100vh;
    padding: var(--page-padding);
    overflow-x: hidden;
  }

  /*
    사이드바를 모바일 헤더처럼 사용합니다.
  */
  .sidebar {
    position: relative;
    top: auto;
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
  }

  /*
    모바일에서는 프로젝트 리스트를 완전히 숨깁니다.
  */
  .project-nav {
    display: none;
  }

  /*
    우측 INSTA / MAIL 공간을 확보합니다.
  */
  .intro {
    min-height: var(--logo-height);
    padding-right: 78px;
  }

  .logo {
    width: auto;
    height: var(--logo-height);
  }

  .intro-copy {
    margin: 0 0 0 var(--logo-copy-gap);
    font-size: var(--font-main);
    line-height: 1.15;
    white-space: nowrap;
  }

  /*
    기존 좌측 하단 연락처를
    모바일에서는 우측 상단으로 이동합니다.
  */
  .sidebar-footer {
    position: absolute;
    top: 2px;
    right: 0;

    display: flex;
    flex-direction: column;
    align-items: flex-end;

    margin: 0;
    font-size: var(--font-main);
    line-height: 1.05;
    text-align: right;
  }

  .desktop-label {
    display: none;
  }

  .mobile-label {
    display: inline;
  }

  /*
    첫 프로젝트는 모바일 헤더 아래에서 시작합니다.
  */
  .details {
    width: 100%;
    min-width: 0;
    margin-top: 44px;
    padding-top: 0;
  }

  /*
    각 프로젝트 사이의 세로 간격입니다.
  */
  .project-detail + .project-detail {
    margin-top: var(--project-gap);
  }

  .detail-title {
    margin: 0;
    font-size: var(--font-main);
    line-height: var(--line-height);
  }

  /*
    오른쪽 패딩 영역까지 슬라이더를 확장해
    다음 이미지가 화면 오른쪽에 살짝 보이게 합니다.
  */
  .media-strip {
    width: calc(100% + var(--page-padding));
    margin-top: var(--title-image-gap);
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;

    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
  }

  .media-track {
    gap: var(--image-gap);
  }

  /*
    전체 화면보다 이미지를 조금 작게 만들어
    다음 이미지 일부가 보이게 합니다.
  */
  .project-image {
    width: calc(
      100vw - (var(--page-padding) * 2) - 24px
    );
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;

    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .detail-meta {
    margin-top: var(--image-description-gap);
  }

  .detail-meta p {
    font-size: var(--font-main);
    line-height: var(--line-height);
  }

  .detail-description {
    max-width: 100%;
    margin-top: 18px !important;
  }
}




/* 사용자가 모션 감소를 요청한 경우 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .project-link {
    transition: none;
  }
}