/* =========================================================
   Design tokens
   값을 바꾸고 싶으면 여기만 고치세요.
   (주소 뒤에 ?tune 을 붙이면 화면에서 슬라이더로 조정할 수 있어요)
========================================================= */
:root {
  /* Color */
  --bg: #fff;
  --fg: #111;
  --muted: #555;       /* 메뉴 */
  --faint: #a3a3a3;    /* 보조 텍스트, 푸터, 연도 */
  --line: #e8e8e8;     /* 구분선 */

  /* Font */
  --font: 'Pretendard', sans-serif;

  /* Layout: 공통 */
  --page-x: 29px;
  --header-y: 14px;
  --title-size: 18px;
  --nav-size: 15px;

  /* Layout: 메인 */
  --subtitle-size: 12px;
  --subtitle-gap: 20px;
  --grid-cols: 2;
  --grid-gap: 30px;
  --card-ratio: 1.7778;
  --hover-scale: 1.03;
  --hover-dim: 0.85;
  --overlay-title: 14px;
  --overlay-desc: 12px;

  /* Layout: 메인 피드 / 인덱스 */
  --feed-meta-w: 288px;
  --feed-col-gap: 54px;
  --feed-gap: 67px;
  --feed-ratio: 1;
  --meta-size: 13px;
  --work-title: 26px;
  --index-row-y: 23px;

  /* Layout: 프로젝트 상세 */
  --detail-gap: 60px;
  --detail-pad-y: 80px;
  --detail-left-max: 480px;
  --detail-title: 24px;
  --detail-body: 15px;
  --detail-lh: 1.6;
  --detail-img-gap: 20px;
  --detail-img-max: 1200px;

  /* Layout: About / Contact */
  --about-gap: 40px;
  --about-name: 28px;
  --about-body: 15px;
  --about-lh: 1.8;
  --contact-mail: 22px;
}


/* =========================================================
   Base
========================================================= */
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
}


/* =========================================================
   Header / Navigation
========================================================= */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: var(--header-y) var(--page-x);
  padding: 5px 0;
}

.title {
  font-size: var(--title-size);
  font-weight: 800;
  margin: 0;
}

.title a {
  color: inherit;
  text-decoration: none;
}

.nav a {
  margin-left: 20px;
  text-decoration: none;
  font-size: var(--nav-size);
  color: var(--muted);
  font-weight: 500;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--fg);
}


/* =========================================================
   Main page
========================================================= */
.header {
  padding: 0 var(--page-x) 5px;
}

.subtitle {
  font-size: var(--subtitle-size);
  font-weight: 300;
  color: var(--faint);
  margin-top: 0;
  margin-bottom: var(--subtitle-gap);
}

.grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  gap: var(--grid-gap);
  padding: 0 var(--page-x) 100px;
  max-width: 1600px;
  margin: 0 auto;
}

.card {
  display: block;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.image-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.image-wrapper img {
  width: 100%;
  aspect-ratio: var(--card-ratio);
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.overlay-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.overlay-text h2 {
  font-size: var(--overlay-title);
  font-weight: 600;
  margin: 0 0 4px 0;
}

.overlay-text p {
  font-size: var(--overlay-desc);
  margin: 0;
  color: var(--muted);
}

.card:hover img {
  transform: scale(var(--hover-scale));
  opacity: var(--hover-dim);
}

.card:hover .overlay-text {
  opacity: 1;
  transform: translateY(-4px);
}

.site-footer {
  text-align: center;
  padding: 40px 0 20px;
  font-size: 12px;
  color: var(--faint);
}


/* =========================================================
   Main page: feed / index
========================================================= */
.works {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--page-x) 100px;
}

.view-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 28px;
  font-size: var(--nav-size);
}

.chips {
  display: flex;
  gap: 18px;
}

.chip {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--faint);
  cursor: pointer;
  transition: color 0.2s ease;
}

.chip:hover,
.chip[aria-pressed="true"] {
  color: var(--fg);
}

.work {
  display: grid;
  grid-template-columns: var(--feed-meta-w) minmax(0, 1fr);
  gap: var(--feed-col-gap);
  padding-bottom: var(--feed-gap);
}

.work-meta {
  font-size: var(--meta-size);
  line-height: 1.6;
}

.work-meta p {
  margin: 0 0 4px;
}

.work-cat,
.work-year {
  color: var(--faint);
}

.work-title {
  font-size: var(--work-title);
  font-weight: 600;
  margin: 6px 0 4px;
}

.work-title a,
.work-more {
  color: inherit;
  text-decoration: none;
}

.work-type {
  color: var(--muted);
}

.work-desc {
  margin-top: 16px !important;
  color: #333;
  max-width: 28em;
}

.work-more {
  display: inline-block;
  margin-top: 8px;
  color: var(--faint);
}

.work-more:hover,
.work-title a:hover {
  text-decoration: underline;
}

.work-img {
  display: block;
  overflow: hidden;
}

.work-img img {
  display: block;
  width: 100%;
  aspect-ratio: var(--feed-ratio);
  object-fit: cover;
  transition: opacity 0.3s ease;
}

a.work-img:hover img {
  opacity: var(--hover-dim);
}

.index-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.index-row {
  display: grid;
  grid-template-columns: 64px 70px minmax(0, 1.2fr) minmax(0, 2fr) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: var(--index-row-y) 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--meta-size);
  color: inherit;
  text-decoration: none;
  transition: opacity 0.25s ease;
}

.i-thumb {
  width: 64px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.i-year,
.i-type,
.i-cat {
  color: var(--faint);
}

.i-title {
  font-size: calc(var(--meta-size) + 2px);
  font-weight: 600;
}

@media (hover: hover) and (pointer: fine) {
  .index-list:hover .index-row:not(:hover) {
    opacity: 0.4;
  }
}


/* =========================================================
   Project detail
=========================================================
body.project-detail {
  font-size: 16px;
  line-height: 1.6;
}

.container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--detail-gap);
  padding: var(--detail-pad-y) 20px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: flex-start;
}

.left {
  flex: 1;
  min-width: 280px;
  max-width: var(--detail-left-max);
  padding-right: 20px;
}

.left h1 {
  font-size: var(--detail-title);
  font-weight: 700;
  margin-bottom: 14px;
}

.left p {
  line-height: var(--detail-lh);
  margin-bottom: 16px;
}

.left p:not(.project-year):not(.project-type) {
  font-size: var(--detail-body);
}

.project-year {
  font-size: 12px;
  font-weight: 400;
  color: var(--faint);
  letter-spacing: 0.02em;
}

.project-type {
  font-size: 14px;
  font-weight: 600;
  color: #444;
  letter-spacing: 0.03em;
}

.project-desc {
  color: #333;
  letter-spacing: 0.01em;
  word-spacing: 0.02em;
  text-align: left;
}

.back-link {
  display: inline-block;
  font-size: 14px;
  color: var(--faint);
  text-decoration: none;
  margin-top: 30px;
  transition: color 0.3s ease;
}

.back-link:hover {
  color: #333;
  text-decoration: underline;
}

.right {
  flex: 2;
  min-width: 400px;
  max-width: 100%;
}

.right img {
  display: block;
  width: 100%;
  max-width: var(--detail-img-max);
  margin-bottom: var(--detail-img-gap);
  border-radius: 0;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}


/* =========================================================
   About page
========================================================= */
body.about-page {
  padding-bottom: 80px;
}

.about-container {
  padding: 0 var(--page-x);
  box-sizing: content-box;
  display: flex;
  flex-wrap: wrap;
  gap: var(--about-gap);
  max-width: 1400px;
  margin: 0;
  align-items: flex-start;
}

.about-left {
  flex: 1;
  min-width: 260px;
  max-width: 400px;
}

.about-photo {
  width: 100%;
  max-width: 500px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.about-right {
  flex: 2;
  min-width: 280px;
  max-width: 700px;
}

.about-name {
  margin-top: 0;
  font-size: var(--about-name);
  font-weight: 700;
  margin-bottom: 8px;
}

.about-edu {
  font-size: 16px;
  font-weight: 500;
  color: #666;
  margin-bottom: 20px;
}

.cv h2 {
  font-size: 13px;
  font-weight: 400;
  color: var(--faint);
  margin: 40px 0 10px;
}

.cv ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cv li {
  display: grid;
  grid-template-columns: 9em 1fr;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.cv li span:first-child {
  color: var(--faint);
}

.cv.solo li {
  grid-template-columns: 1fr;
}

.cv.solo li span:first-child {
  color: var(--fg);
}

.about-contact {
  margin: 0 0 12px;
  font-size: 14px;
}

.about-contact a {
  color: inherit;
}

.about-desc {
  font-size: var(--about-body);
  line-height: var(--about-lh);
  letter-spacing: 0.01em;
  word-spacing: 0.02em;
  color: #333;
  margin-bottom: 30px;
}


/* =========================================================
   Contact page
========================================================= */
.contact-container {
  max-width: 720px;
  padding: 0 var(--page-x);
}

.contact-intro {
  font-size: 14px;
  color: #666;
  margin-bottom: 30px;
}

.contact-mail {
  display: inline-block;
  font-size: var(--contact-mail);
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  margin-bottom: 40px;
}

.contact-mail:hover {
  opacity: 0.6;
}

.contact-links {
  display: flex;
  gap: 20px;
}

.contact-links a {
  font-size: 14px;
  color: #666;
  text-decoration: none;
}

.contact-links a:hover {
  color: var(--fg);
}


/* =========================================================
   Responsive
========================================================= */
@media (max-width: 1200px) {
  .container {
    flex-direction: column;
    padding: 20px;
  }

  .right,
  .left {
    max-width: 100%;
  }

  .right {
    min-width: 0;
  }
}

@media (max-width: 768px) {
  :root {
    --page-x: 20px;
    --header-y: 20px;
    --grid-cols: 1;
    --grid-gap: 24px;
    --subtitle-gap: 24px;
  }

  .site-header {
    padding: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .nav a:first-child {
    margin-left: 0;
  }

  .grid {
    padding-bottom: 80px;
  }

  :root {
    --feed-gap: 56px;
  }

  .work {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .work-img {
    order: -1;
  }

  .index-row {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 14px;
  }

  .i-thumb {
    width: 56px;
  }

  .i-year {
    order: 3;
  }

  .i-type,
  .i-cat {
    display: none;
  }

  /* 모바일은 호버가 없어서 설명을 항상 표시 */
  .overlay-text {
    opacity: 1;
    position: static;
    padding: 10px 0 0;
    transform: none;
  }

  .card:hover img {
    transform: none;
    opacity: 1;
  }

  .about-container {
    flex-direction: column;
  }

  .cv li {
    grid-template-columns: 7em 1fr;
  }

  .about-photo {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  :root {
    --contact-mail: 18px;
  }

  .contact-links {
    flex-direction: column;
    gap: 12px;
  }
}
