/* =========================================================
   포트폴리오 스타일
   색과 글꼴은 아래 :root 안의 값만 바꾸면 사이트 전체가 바뀝니다.
   ========================================================= */

:root {
  /* 색: 양극산화 알루미늄 같은 차가운 회색 + 포인트 파랑 */
  --paper: #e8ebec;     /* 배경 */
  --plate: #f4f6f6;     /* 이미지 자리, 밝은 면 */
  --ink: #1d2428;       /* 본문 글자, 선 */
  --muted: #687278;     /* 보조 글자 */
  --line: #c3c9cc;      /* 구분선 */
  --accent: #2c56c9;    /* 포인트 색 (링크, 강조) */

  /* 글꼴: 제목은 넓은 Archivo, 본문은 한글용 Pretendard */
  --display: "Archivo", "Pretendard Variable", system-ui, sans-serif;
  --body: "Pretendard Variable", "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;

  --page: min(1280px, 100% - 2 * var(--gutter));
  --gutter: clamp(20px, 4vw, 48px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161a1d;
    --plate: #1f2529;
    --ink: #e2e6e8;
    --muted: #8f999f;
    --line: #333b40;
    --accent: #7d9cf0;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.7;
  word-break: keep-all;          /* 한글이 단어 중간에서 끊기지 않게 */
  overflow-wrap: break-word;
}

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

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap { width: var(--page); margin-inline: auto; }

/* ---------- 상단 메뉴 ---------- */
.site-header {
  width: var(--page);
  margin-inline: auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-block: 28px;
}
.site-header .home {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 700;
  text-decoration: none;
  font-size: 18px;
}
.site-header nav { display: flex; gap: 28px; }
.site-header nav a {
  text-decoration: none;
  color: var(--muted);
}
.site-header nav a:hover,
.site-header nav a[aria-current="page"] { color: var(--ink); }

/* ---------- 메인 첫 화면 ---------- */
.hero {
  width: var(--page);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: var(--gutter);
  padding-block: clamp(32px, 8vw, 96px) clamp(48px, 9vw, 120px);
}
.hero h1 {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(44px, 7.4vw, 108px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
}
.hero p {
  max-width: 30em;
  margin: 0;
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--muted);
}
.hero p strong { color: var(--ink); font-weight: 600; }

/* 분해도 그림 */
.exploded { width: 100%; max-width: 460px; justify-self: end; }
.exploded .face { fill: var(--plate); stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.exploded .side { fill: var(--paper); stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.exploded .board .face { stroke: var(--accent); }
.exploded .chip { fill: var(--accent); opacity: 0.85; }
.exploded .hole { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; }
.exploded .axis { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 5; fill: none; }
.exploded .layer {
  animation: explode 1.4s cubic-bezier(.2, .7, .2, 1) 0.3s both;
}
.exploded .axis { animation: fade 0.8s ease 1.2s both; }
@keyframes explode { from { transform: translateY(var(--d)); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .exploded .layer, .exploded .axis { animation: none; }
}

/* ---------- 프로젝트 목록 ---------- */
.work {
  width: var(--page);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  row-gap: clamp(48px, 7vw, 88px);
  padding-bottom: clamp(64px, 10vw, 140px);
}
.project { grid-column: span 6; text-decoration: none; display: block; }
.project.wide { grid-column: span 12; }
.project .thumb {
  background: var(--plate);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.project.wide .thumb { aspect-ratio: 16 / 7; }
.project .thumb img { width: 100%; height: 100%; object-fit: cover; }
.project .caption {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding-top: 16px;
}
.project h2 {
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.2;
  margin: 0;
}
.project .year { color: var(--muted); font-variant-numeric: tabular-nums; }
.project .summary { grid-column: 1 / -1; color: var(--muted); margin: 0; max-width: 42em; }
.project:hover h2 { color: var(--accent); }

/* ---------- 프로젝트 상세 ---------- */
.project-head {
  width: var(--page);
  margin-inline: auto;
  padding-block: clamp(24px, 6vw, 72px) clamp(32px, 5vw, 56px);
}
.back { color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }
.project-head h1 {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(40px, 6.5vw, 96px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 24px 0 20px;
}
.project-head .lede {
  font-size: clamp(18px, 1.8vw, 22px);
  max-width: 34em;
  margin: 0;
}

.cover {
  width: var(--page);
  margin-inline: auto;
  background: var(--plate);
  aspect-ratio: 16 / 8;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }

.project-body {
  width: var(--page);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--gutter);
  padding-block: clamp(40px, 6vw, 80px) clamp(64px, 10vw, 140px);
}

/* 프로젝트 정보표 */
.specs { margin: 0; align-self: start; position: sticky; top: 24px; }
.specs div { padding-block: 12px; border-top: 1px solid var(--line); }
.specs dt { color: var(--muted); font-size: 14px; }
.specs dd { margin: 2px 0 0; }

.story { max-width: 46em; }
.story section + section { margin-top: clamp(48px, 6vw, 72px); }
.story h2 {
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.25;
  margin: 0 0 16px;
}
.story p { margin: 0 0 1em; }
.story figure { margin: 32px 0 0; }
.story figure .img { background: var(--plate); aspect-ratio: 3 / 2; }
.story figure .img img { width: 100%; height: 100%; object-fit: cover; }
.story figcaption { color: var(--muted); font-size: 15px; padding-top: 10px; }
.story .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.story .pair figure { margin-top: 32px; }

.next {
  width: var(--page);
  margin-inline: auto;
  border-top: 1px solid var(--line);
  padding-block: 32px 64px;
}
.next a {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 700;
  font-size: clamp(24px, 3vw, 40px);
  text-decoration: none;
}
.next a:hover { color: var(--accent); }
.next span { display: block; color: var(--muted); font-size: 15px; }

/* ---------- 소개 ---------- */
.about {
  width: var(--page);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--gutter);
  padding-block: clamp(32px, 7vw, 96px) clamp(64px, 10vw, 140px);
}
.about h1 {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(40px, 5.5vw, 80px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
}
.about .text { max-width: 36em; }
.about .text > p:first-child { font-size: clamp(19px, 2vw, 24px); line-height: 1.55; margin-top: 0; }
.about h2 { font-size: 15px; font-weight: 600; color: var(--muted); margin: 48px 0 8px; }
.about ul { list-style: none; padding: 0; margin: 0; }
.about li { padding-block: 10px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 6em 1fr; gap: 16px; }
.about li span { color: var(--muted); font-variant-numeric: tabular-nums; }
.about .contact a { color: var(--accent); }

/* ---------- 하단 ---------- */
.site-footer {
  width: var(--page);
  margin-inline: auto;
  border-top: 1px solid var(--line);
  padding-block: 24px 40px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 15px;
}
.site-footer a { color: var(--muted); }

/* ---------- 휴대폰 화면 ---------- */
@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; }
  .exploded { justify-self: start; max-width: 320px; order: -1; }
  .project, .project.wide { grid-column: 1 / -1; }
  .project.wide .thumb { aspect-ratio: 4 / 3; }
  .project-body { grid-template-columns: 1fr; }
  .specs { position: static; display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
  .about { grid-template-columns: 1fr; }
  .story .pair { grid-template-columns: 1fr; }
  .site-header nav { gap: 18px; }
}
