/* =========================================================
   포트폴리오 공통 스타일 (베이지 톤 포트폴리오 템플릿 스타일)
   레이아웃: 섹션마다 위쪽 회갈색 띠 → 아래 모서리가 둥근 미색 머리 영역 → 흰 본문.
   첫 페이지와 마지막 페이지는 "미색 위 + 베이지 아래" 2단 표지.
   색은 따뜻한 회갈색 계열 하나로 통일하고, 강조는 굵기·크기·면 색으로.
   ========================================================= */

:root {
  color-scheme: light;

  /* 색상 (흰 배경 대비: 본문 16.5:1, 보조 7.3:1 / 베이지 위 보조 5.0:1) */
  --bg: #ffffff;
  --bar: #6f6c65;           /* 맨 위 메뉴 띠 (흰 글자 대비 5.2:1) */
  --strip: #8a877f;         /* 섹션 위 회갈색 띠 */
  --paper: #edebe6;         /* 미색 머리 영역 */
  --sand: #d9d6cb;          /* 베이지 면 */
  --stone: #aca89d;         /* 장식 원·왼쪽 선 */
  --card: #f3f2ef;          /* 연회색 카드 */
  --line: #dcd9d1;          /* 구분선 */
  --text: #1f1e1c;
  --muted: #57544d;
  --btn: #3b3934;           /* 진한 버튼 */
  --accent: #5c4a3b;        /* 강조색(다크 브라운): 제목 왼쪽 바, 결과(후) 값 (흰 배경 대비 8.4:1) */
  --todo-border: #8f8b80;   /* [작성 필요] 점선 */

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;

  /* 크기·간격 */
  --container: 1200px;
  --gutter: clamp(20px, 4vw, 56px);
  --header-h: 48px;
  --round: 24px;            /* 머리 영역 아래 모서리 */
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* 고정 바에 제목이 가려지지 않도록 */
  scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* 움직임 줄이기 설정을 켠 사용자에게는 전환 효과도 끔 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  /* 한국어는 단어 중간에서 줄바꿈되지 않게 */
  word-break: keep-all;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.3;
  text-wrap: balance;
}

p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

a {
  color: var(--text);
  text-underline-offset: 4px;
}

/* 키보드 포커스는 항상 눈에 보이게 */
:focus-visible {
  outline: 3px solid var(--btn);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* 화면에는 숨기고 스크린리더에는 읽히게 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* [작성 필요] 표시: 내용을 채우면 이 span을 통째로 실제 내용으로 바꾸세요 */
.todo {
  display: inline-block;
  padding: 0 0.35em;
  border: 1px dashed var(--todo-border);
  background: rgba(0, 0, 0, 0.035);
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.35;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--btn);
  color: #fff;
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.muted-sm {
  color: var(--muted);
  font-size: 14px;
}

/* ---------- 맨 위 메뉴 띠 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bar);
  color: #fff;
}

/* 상세 페이지는 메뉴 띠 대신 목차 바를 고정 */
.page-detail .site-header {
  position: relative;
}

.site-header :focus-visible {
  outline-color: #fff;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}

.brand {
  flex-shrink: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.nav {
  min-width: 0;
  overflow-x: auto; /* 좁은 화면에서는 메뉴만 가로 스크롤 */
  scrollbar-width: none;
}

.nav ul {
  display: flex;
}

.nav a {
  display: block;
  padding: 8px 10px;
  color: #fff;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
}

/* 지금 보는 섹션 (js/main.js가 표시) */
.nav a:hover,
.nav a[aria-current] {
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px; /* 손가락으로 누르기 쉬운 높이 */
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--btn);
  color: #fff;
}

.btn-primary:hover {
  background: var(--text);
}

.btn-secondary {
  background: #fff;
  border-color: var(--stone);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--btn);
}

/* =========================================================
   표지 (첫 페이지, 마지막 THANK YOU 페이지)
   ========================================================= */
.cover {
  background: var(--sand);
}

/* 위: 미색 영역, 아래 모서리만 둥글게 */
.cover-top {
  padding: clamp(64px, 11vw, 150px) 0 clamp(28px, 4vw, 48px);
  border-radius: 0 0 var(--round) var(--round);
  background: var(--paper);
}

/* 큰 영문 글자 (굵기: 300 얇게 ~ 700 굵게) */
.cover-word {
  font-size: clamp(44px, 14vw, 176px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: 0.01em;
}

/* 아래: 베이지 영역 (왼쪽 글, 오른쪽 장식, 맨 아래 흰 박스) */
.cover-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px 48px;
  padding-top: 56px;
  padding-bottom: 56px;
}

.eyebrow {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.cover-title {
  margin-top: 8px;
  font-size: clamp(24px, 2.8vw, 34px);
  font-weight: 500;
  letter-spacing: -0.03em;
}

/* 한 줄 포지셔닝: 굵은 부분만 강조색 */
.cover-lead {
  margin-top: 12px;
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.6;
}

.cover-lead strong {
  color: var(--accent);
  font-weight: 700;
}


.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* 핵심 역량 태그: 흰 바탕 작은 칸 */
.focus-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.focus-tags li {
  padding: 5px 12px;
  border-left: 3px solid var(--stone);
  background: #fff;
  font-size: 14px;
  font-weight: 500;
}

/* 원 두 개 + 끈 장식: 미색과 베이지 경계에 걸치도록 위로 끌어올림 */
.deco {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  width: 110px;
  height: auto;
  margin-top: -230px;
  margin-right: 24px;
  color: var(--stone);
}

/* 흰 박스: "E-MAIL. ··· 값" */
.info-boxes {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.info-boxes > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 12px 24px;
  border-left: 3px solid var(--stone);
  background: #fff;
}

.info-boxes dt {
  flex-shrink: 0;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.info-boxes dd {
  min-width: 0;
  font-size: 15px;
  text-align: right;
}

/* 마지막 페이지: 미색 영역의 인사 + 베이지 영역의 연락처 박스 */
.cover-end .cover-top {
  padding: 56px 0 48px;
}

.end-title {
  margin-top: 8px;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 500;
  letter-spacing: -0.03em;
}

/* =========================================================
   일반 섹션 (회갈색 띠 → 미색 머리 영역 → 흰 본문)
   ========================================================= */
.section {
  border-top: 12px solid var(--strip);
}

.section-head {
  padding: 40px 0 36px;
  border-radius: 0 0 var(--round) var(--round);
  background: var(--paper);
}

.section-head-lg {
  padding: 56px 0 48px;
}

.section-head-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 48px;
}

/* "INTRODUCTION." 같은 작은 영문 라벨 */
.label {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.section-title {
  margin-top: 6px;
  font-size: clamp(24px, 2.8vw, 32px);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.section-note {
  max-width: 26em;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

.section-body {
  padding-top: 48px;
  padding-bottom: clamp(64px, 8vw, 96px);
}

.sub-title {
  margin: 56px 0 20px;
  font-size: 20px;
  font-weight: 600;
}

.sub-title-first {
  margin-top: 0;
}

/* ---------- 2. 핵심 성과 카드 ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.kpi-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kpi {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 24px 32px;
  background: var(--card);
  text-align: center;
}

/* 흰 원 안의 번호 (템플릿의 아이콘 자리) */
.kpi-num {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

/* 카드가 보여주는 역량 키워드 (검증 · 정합성 · 이력 관리) */
.kpi-tag {
  padding: 2px 12px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.kpi-value {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

/* 숫자 대신 짧은 글로 된 결과 */
.kpi-value-text {
  font-size: clamp(22px, 2.2vw, 28px);
}

.kpi-label {
  font-weight: 500;
}

.kpi-source {
  margin-top: auto;
  padding-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- 3. 자기소개 ---------- */
.intro-title {
  margin-top: 10px;
  font-size: clamp(30px, 4.2vw, 48px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

/* 왼쪽 글 + 오른쪽 사진. 두 칸 높이를 같게(stretch) 해서 아래 끝선을 맞춤 */
.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr);
  gap: 48px clamp(32px, 4vw, 48px);
  align-items: stretch;
}

.intro-text {
  max-width: 44em;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.can-block {
  margin-top: 36px;
}

.can-list {
  padding: 8px 8px 0;
}

/* 왼쪽 할 수 있는 것, 오른쪽 근거 프로젝트 */
.can-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.can-list li > :last-child {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 14px;
}

/* 휴대폰: 근거 프로젝트를 문장 아래로 */
@media (max-width: 734px) {
  .can-list li {
    flex-direction: column;
    gap: 2px;
  }
}

/* 2×2 정보 블록 */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 32px;
  margin-top: 56px;
}

/* 회색 머리줄 + 왼쪽 선 */
.block-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: var(--card);
  font-size: 17px;
  font-weight: 500;
}

.block-title-lg {
  padding: 16px 20px;
  font-size: clamp(20px, 2.2vw, 24px);
}

.block-title .num {
  color: var(--muted);
  font-size: 0.75em;
}

/* 이름표 왼쪽, 값 오른쪽 정렬 */
.kv {
  display: grid;
  gap: 8px;
  padding: 18px 8px 0;
}

.kv > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.kv dt {
  flex-shrink: 0;
  font-size: 15px;
}

.kv dd {
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere; /* 긴 이메일 주소도 칸 안에서 줄바꿈 */
}

/* 경력 블록: 두 칸을 가로로 모두 차지 */
.info-block-wide {
  grid-column: 1 / -1;
}

/* 경력 행: 왼쪽 기간 + 오른쪽 "곳 · 역할"과 하는 일 (왼쪽 정렬) */
.kv-career {
  gap: 14px;
}

.kv-career > div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
}

.kv-career dd {
  text-align: left;
}

.kv-career strong {
  font-weight: 600;
}

/* 근무·연수 기간: 한눈에 보이게 강조색 */
.career-dur {
  margin-left: 4px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

/* 하는 일: 짧은 항목, 2열 */
.career-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 16px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 15px;
}

.career-points-1 {
  grid-template-columns: 1fr;
}

.career-points li,
.skill-points li {
  position: relative;
  padding-left: 12px;
}

/* 항목 앞 작은 네모 */
.career-points li::before,
.skill-points li::before {
  content: "";
  position: absolute;
  top: 0.7em;
  left: 0;
  width: 4px;
  height: 4px;
  background: var(--stone);
}

/* 프로필 사진 틀: 왼쪽 글 높이만큼 늘어남 */
.intro-photo-wrap {
  position: relative;
  min-height: 380px;
  background: var(--sand);
}

/* 사진은 틀을 꽉 채우고, 얼굴이 잘리지 않게 위쪽 기준으로 자름 */
.intro-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
}

/* ---------- 4. 스킬 ---------- */
/* 왼쪽 미색 칸(기술 이름) + 오른쪽 흰 칸(설명) */
.skill-table {
  border-top: 1px solid var(--line);
}

.skill-table > div {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.skill-table dt {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  background: var(--paper);
  font-size: 18px;
  font-weight: 600;
}

.skill-table dd {
  display: grid;
  gap: 4px;
  padding: 20px 24px;
}

.skill-points {
  display: grid;
  gap: 2px;
}

/* 강점 역량 카드 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 28px;
  background: var(--card);
}

.card > :not(.card-label) {
  margin-inline: 24px;
}

/* 카드 맨 위 작은 라벨 줄 */
.card-label {
  padding: 10px 24px;
  background: #e6e3dc;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.card-title {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 600;
}

/* ---------- 5. 프로젝트 카드 ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.project {
  position: relative; /* 제목 링크를 카드 전체로 넓히기 위한 기준 */
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 28px;
  background: var(--card);
}

.project > :not(.card-label) {
  margin-inline: 28px;
}

.project-title {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.project-title a {
  text-decoration: none;
}

/* 제목 링크의 클릭 영역을 카드 전체로 확장 */
.project-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.project-title a:focus-visible {
  outline: none;
}

/* 키보드로 들어오면 카드 전체에 포커스 표시 */
.project:focus-within {
  outline: 3px solid var(--btn);
  outline-offset: 4px;
}

.project-more {
  margin-top: auto;
  font-weight: 600;
}

.project:hover .project-more {
  text-decoration: underline;
}

/* "이름표 | 내용" 행 */
.rows > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.rows > div:first-child {
  border-top: 1px solid var(--line);
}

.rows dt {
  color: var(--muted);
  font-size: 15px;
}

.row-stat {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.row-strong {
  font-weight: 600;
}

/* ---------- 푸터 ---------- */
.site-footer {
  background: var(--bar);
  color: #fff;
  font-size: 13px;
}

.site-footer a {
  color: #fff;
}

.site-footer :focus-visible {
  outline-color: #fff;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  padding-bottom: 16px;
}

/* =========================================================
   프로젝트 상세 페이지
   ========================================================= */

/* 목차 바: 위에 고정 */
.toc-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.toc-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 52px;
}

.toc-title {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.toc-links {
  display: flex;
  gap: 20px;
  min-width: 0;
  margin-left: auto;
  overflow-x: auto; /* 좁은 화면에서는 가로로 밀어서 보기 */
  scrollbar-width: none;
}

.toc-links a {
  display: block;
  padding: 6px 0;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
}

.toc-links .num {
  margin-right: 6px;
}

/* 지금 보는 섹션 (js/main.js가 표시) */
.toc-links a:hover,
.toc-links a[aria-current] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.page-detail .section {
  border-top: 0;
}

.back {
  margin-bottom: 24px;
  font-size: 14px;
}

.back a {
  color: var(--muted);
}

/* 결과 숫자 카드 + 개요 블록 */
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  margin-top: 40px;
}

/* 개요는 값이 길 수 있어서 왼쪽 정렬 */
.overview-grid .kv > div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
}

.overview-grid .kv dd {
  text-align: left;
}

.detail-body {
  display: grid;
  gap: 72px;
  padding-bottom: 96px;
}

.detail-section {
  display: grid;
  gap: 20px;
  min-width: 0; /* 표가 넓어도 레이아웃이 깨지지 않게 */
}

.detail-section .rows > div {
  grid-template-columns: 180px minmax(0, 1fr);
  padding: 16px 4px;
}

.detail-section .rows dt {
  color: var(--text);
  font-weight: 600;
}

/* 제목과 첫 내용 묶음 (PDF에서 제목만 페이지 끝에 남지 않게) */
.keep-together {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* 긴 SQL 줄이 화면을 넓히지 않게 (코드 칸 안에서만 가로 스크롤) */
  gap: 20px;
}

.detail-section .sub-title {
  margin: 16px 0 0;
}

/* 핵심 문제 해결 사례: 사례마다 독립된 행, 안에 문제 → 원인 → 해결 → 결과 4칸 */
.case {
  padding: 24px 28px 28px;
  border: 1px solid var(--line);
  background: #fff;
}

.case + .case {
  margin-top: 20px;
}

.case-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 600;
}

.case-title .num {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

/* 이 사례가 보여주는 역량 */
.case-tag {
  padding: 2px 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px; /* 칸 사이에 화살표 자리 */
}

.case-step {
  position: relative;
  padding: 16px 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--card);
  font-size: 15px;
}

.case-step h4 {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* 칸 사이 화살표 (장식이라 화면 낭독기는 읽지 않음) */
.case-step + .case-step::before {
  content: "→" / "";
  position: absolute;
  top: 50%;
  right: 100%;
  width: 28px;
  transform: translateY(-50%);
  color: var(--muted);
  text-align: center;
}

/* 마지막 칸(결과)만 강조색 테두리 + 굵은 글씨 */
.case-step-result {
  border-color: var(--accent);
  background: #fff;
}

.case-step-result h4 {
  color: var(--accent);
}

.case-step-result p {
  font-weight: 600;
}

/* 이 사례에서 직접 한 일 */
.case-role {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 15px;
}

.case-role strong {
  flex-shrink: 0;
  color: var(--accent);
  font-weight: 700;
}

/* 화면 캡처·DB 구조 자리 */
.shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.shot img,
.shot-slot {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  background: var(--card);
}

/* 실제 캡처는 잘리지 않게 원래 비율 그대로 (img 의 width·height 속성 기준) */
.shot img {
  height: auto;
  aspect-ratio: auto;
}

.shot-slot {
  display: grid;
  place-items: center;
}

/* 캡처 위에 직접 구현한 영역 표시 (위치는 HTML의 style 에서 %로 지정) */
.shot-frame {
  position: relative;
}

.shot-mark {
  position: absolute;
  border: 2px solid var(--accent);
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

/* 번호 동그라미 (data-n 이 있는 표시만): 글자를 가리지 않게 상자 왼쪽 바깥에 */
.shot-mark[data-n]::after {
  content: attr(data-n);
  position: absolute;
  top: 50%;
  left: -26px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.shot-legend {
  display: block;
  color: var(--text);
}

.shot-wide .shot-slot {
  aspect-ratio: 16 / 7;
}

.shot figcaption,
.code-figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

/* SQL 쿼리 예시 */
.code-block {
  min-height: 140px;
  margin: 0;
  padding: 18px 22px;
  overflow-x: auto; /* 긴 줄은 이 칸만 가로 스크롤 */
  border-left: 3px solid var(--stone);
  background: var(--card);
  font-family: ui-monospace, "D2Coding", Consolas, Menlo, monospace;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre;
}

/* SQL 예시: JOIN 키워드 */
.code-kw {
  color: var(--accent);
  font-weight: 700;
}

/* SQL 아래 설명: 이름표 + 내용 */
.code-notes {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: var(--text);
}

.code-notes li {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
}

.code-notes strong {
  color: var(--accent);
  font-weight: 700;
}

/* SQL 예시에서 핵심 줄 강조 */
.code-hl {
  background: #e9e1d8;
  color: var(--accent);
  font-weight: 700;
}

/* 데이터베이스 구조도: 고객 / 주문 / 상품 / 기준 정보 4열 */
.schema-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.schema-col {
  display: grid;
  gap: 14px;
}

.schema-table {
  width: 100%;
  border: 1px solid var(--line);
  border-collapse: collapse;
  background: #fff;
  font-size: 12px;
  line-height: 1.4;
}

/* 표 이름 (영문 테이블명 + 한글 설명) */
.schema-table caption {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--card);
  text-align: left;
}

.schema-name {
  font-family: ui-monospace, "D2Coding", Consolas, Menlo, monospace;
  font-size: 13px;
  font-weight: 700;
}

.schema-label {
  float: right;
  color: var(--muted);
  font-size: 12px;
}

.schema-table td {
  padding: 5px 8px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.schema-key {
  width: 30px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.schema-cname {
  font-family: ui-monospace, "D2Coding", Consolas, Menlo, monospace;
  overflow-wrap: anywhere;
}

/* 외래키가 가리키는 테이블 */
.schema-ref {
  display: block;
  color: var(--muted);
  font-family: var(--font);
  font-size: 11px;
}

.schema-type {
  color: var(--muted);
  font-family: ui-monospace, "D2Coding", Consolas, Menlo, monospace;
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}

/* 주문 당시 기준 조회에 쓰는 칼럼: 강조색 */
.schema-hl td {
  background: #f4efe9;
}

.schema-hl td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.schema-hl .schema-cname {
  color: var(--accent);
  font-weight: 700;
}

.schema figcaption {
  display: grid;
  gap: 2px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.schema-legend {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-left: 3px solid var(--accent);
  background: #f4efe9;
  vertical-align: -1px;
}

/* 결과 표 */
.table-wrap {
  overflow-x: auto; /* 좁은 화면에서는 표만 가로 스크롤 */
}

.result-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

.result-table th,
.result-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.result-table thead th {
  background: var(--paper);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.result-table tbody th {
  font-weight: 600;
}

/* 후(결과) 열: 강조색 + 굵게 */
.result-table .result-after {
  color: var(--accent);
  font-weight: 700;
}

/* 표 아래 검증 방법 안내 */
.result-note {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 20px;
  background: var(--card);
  font-size: 15px;
}

.result-note-title {
  font-weight: 600;
}

.num-cell {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 이전·다음 프로젝트: 표지의 흰 박스와 같은 모양 */
.pager-wrap {
  padding: 40px 0;
  background: var(--sand);
}

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.pager-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 16px 24px;
  border-left: 3px solid var(--stone);
  background: #fff;
  text-decoration: none;
}

.pager-link:hover .pager-title {
  text-decoration: underline;
}

.pager-label {
  font-size: 14px;
  letter-spacing: 0.02em;
}

.pager-title {
  font-weight: 600;
}

/* =========================================================
   화면 크기별 조정
   ========================================================= */

/* 태블릿 이하: 장식 숨기고 두 칸 배치를 한 칸으로 */
@media (max-width: 900px) {
  .deco {
    display: none;
  }

  .cover-bottom,
  .intro-grid,
  .project-grid,
  .card-grid,
  .case-grid,
  .shots,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .info-boxes {
    grid-template-columns: 1fr;
  }

  .case {
    padding: 20px;
  }

  .case-grid {
    gap: 24px;
  }

  .case-step + .case-step::before {
    content: "↓" / "";
    top: auto;
    right: auto;
    bottom: 100%;
    left: 50%;
    width: auto;
    height: 24px;
    line-height: 24px;
    transform: translateX(-50%);
  }

  .result-note {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .schema-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* 좁은 화면에서는 사진을 소개글 위로, 4:5 비율 */
  .intro-photo-wrap {
    order: -1;
    width: 100%;
    max-width: 300px;
    min-height: 0;
    aspect-ratio: 4 / 5;
  }
}

/* 스마트폰 (734px 이하) */
@media (max-width: 734px) {
  /* 데이터베이스 구조도: 휴대폰에서는 1열 */
  .schema-grid,
  .career-points,
  .code-notes li {
    grid-template-columns: 1fr;
  }

  .code-notes li {
    gap: 0;
  }

  .case-role {
    flex-direction: column;
    gap: 2px;
  }

  /* 메뉴 5개가 한 줄에 보이도록 PORTFOLIO 글자는 숨김 (표지에 크게 있음) */
  .brand {
    display: none;
  }

  .nav {
    width: 100%;
  }

  .nav ul {
    justify-content: space-between;
  }

  .nav a {
    padding: 8px 4px;
    font-size: 13px;
  }

  .section-head-inner {
    display: block;
  }

  .section-note {
    margin-top: 8px;
    text-align: left;
  }

  .kpi-grid,
  .kpi-grid-2,
  .info-grid {
    grid-template-columns: 1fr;
  }

  /* 경력 행: 기간 아래에 내용 */
  .kv-career > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .skill-table > div {
    grid-template-columns: 1fr;
  }

  .skill-table dt {
    padding: 12px 16px;
  }

  .skill-table dd {
    padding: 14px 16px 18px;
  }

  .rows > div {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  /* 상세 페이지 항목은 위아래로 쌓기 */
  .detail-section .rows > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .cta-row .btn {
    flex: 1 1 auto; /* 버튼을 가로로 꽉 채워 누르기 쉽게 */
  }

  .info-boxes > div {
    padding: 12px 18px;
  }

  .project > :not(.card-label) {
    margin-inline: 20px;
  }

  .card-label {
    padding-inline: 20px;
  }

  .pager {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   PDF(인쇄)용: tools/make-pdf.js 가 이 스타일로 assets/resume.pdf 를 만듦
   ========================================================= */
@media print {
  /* 배경색까지 그대로 인쇄 */
  html {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* 화면에서만 쓰는 요소는 숨김: 메뉴, 버튼, "상세 보기", 이전·다음, 푸터 */
  .skip-link,
  .site-header,
  .toc-bar,
  .cta-row,
  .back,
  .project-more,
  .pager-wrap,
  .site-footer,
  .pdf-hide {
    display: none !important;
  }

  /* 카드·블록·표의 행이 페이지 사이에서 잘리지 않게 */
  .kpi,
  .card,
  .project,
  .case,
  .shot,
  .code-figure,
  .info-block,
  .skill-table > div,
  .rows > div,
  .result-table tr,
  .result-note,
  .schema-table,
  .keep-together {
    break-inside: avoid;
  }

  /* 제목만 페이지 끝에 남고 내용이 다음 장으로 넘어가지 않게 */
  .section-head,
  .block-title,
  .sub-title {
    break-after: avoid;
  }

  /* 프로젝트 상세와 마지막 연락처는 새 페이지에서 시작 */
  .pdf-page {
    break-before: page;
  }

  /* 자기소개·기술 및 역량도 새 페이지에서 시작 (제목만 페이지 끝에 남는 것 방지) */
  #intro,
  #skills {
    break-before: page;
  }

  /* PDF 너비에서 PORTFOLIO 글자와 원 장식이 겹치지 않게 */
  .cover-word {
    font-size: 128px;
  }

  /* PDF에서 뺄 섹션
     - 마지막 연락처: 연락처는 표지와 자기소개에 있음
     - 프로젝트 요약 카드: 바로 뒤 상세 페이지 첫머리에 같은 내용이 있음 */
  #contact,
  #projects {
    display: none;
  }

  /* 상세 페이지 첫머리를 더 촘촘하게 */
  .pdf-page .section-head-lg {
    padding: 32px 0 28px;
  }

  .pdf-page .kpi {
    padding: 22px 20px 20px;
  }

  .pdf-page .overview-grid {
    margin-top: 24px;
  }

  /* 실행 화면 캡처는 PDF에서 한 장씩 크게 (글자가 읽히도록) */
  .shots {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .shots .shot {
    width: 80%;
  }

  /* PDF 쪽수를 줄이려고 상세 페이지 행·사례·코드 간격을 조금 좁힘 */
  .detail-section .rows > div {
    padding: 10px 4px;
  }

  .case {
    padding: 18px 22px 20px;
  }

  .case-step {
    padding: 12px 14px;
  }

  .case-role {
    margin-top: 10px;
    padding-top: 8px;
  }

  .code-block {
    padding: 14px 18px;
    font-size: 12.5px;
    line-height: 1.5;
  }

  /* 상세 페이지 제목·결과 표도 조금 좁게 (프로젝트별 3쪽 안에 들어가도록) */
  .block-title-lg {
    padding: 12px 18px;
  }

  .case-title {
    margin-bottom: 10px;
  }

  .result-table th,
  .result-table td {
    padding: 9px 14px;
  }

  .result-note {
    padding: 12px 16px;
  }

  /* 구조도도 PDF에서는 조금 촘촘하게 (앞 페이지 빈 공간에 들어가도록) */
  .schema-grid,
  .schema-col {
    gap: 10px;
  }

  .schema-table {
    font-size: 11px;
    line-height: 1.3;
  }

  .schema-table caption {
    padding: 6px 10px;
  }

  .schema-table td {
    padding: 3px 8px;
  }

  /* 상세 페이지 간격을 줄여 PDF 쪽수를 줄임 */
  .detail-body {
    gap: 32px;
    padding-bottom: 24px;
  }

  .section-body {
    padding-bottom: 48px;
  }
}
