/* 인쇄·PDF용. tools/make-pdf.ps1이 ?print=onepager|full 로 열어 Chrome으로 PDF를 만든다. */
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  :root { --c-ink: #111; --c-text: #111827; --c-muted: #4b5563; --c-line: #d1d5db; --c-surface: #fff; --c-soft: #f3f4f6; }
  /* 도식 색·카드 테두리를 인쇄에도 남긴다. 바탕은 흰색으로 */
  html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { font-size: 11pt; line-height: 1.55; background: #fff; word-break: keep-all; overflow-wrap: break-word; }
  .card { box-shadow: none; }
  .sec-head { margin-bottom: 5mm; }
  .sec-head .lead { max-width: none; }
  .nav, .progress, .skip, .roles, .hero__actions, .scene__actions, .more, dialog, .contact .btn, .d-next, #project-pdf, .toc { display: none !important; }
  .section { padding-block: 10mm 4mm; }
  .scene, .dbg, .other, .timeline li, .shot, .steps li { break-inside: avoid; }
  /* 문서 단계 8개는 인쇄에서 한 줄에 4개 */
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  h2 { break-after: avoid; }
  a { text-decoration: none; }
  .contact { background: none; color: var(--c-text); border-top: 2px solid var(--c-accent); margin-top: 8mm; padding-block: 6mm 0; }
  .contact h2, .contact a { color: var(--c-ink); }
  .contact .eyebrow { color: var(--c-accent); }
  .contact__list li { border-color: var(--c-line); }
  .metric__value { font-size: 20pt; }
  .scene__title { font-size: 20pt; }
  .hero { padding-top: 0; }
  .hero__headline { font-size: 26pt; }
  .hero__photo { width: 32mm; order: 0; }
  .hero__grid { grid-template-columns: 1fr 32mm; gap: 8mm; }
  /* A4 폭이 화면 900px 미만 규칙에 걸리므로 인쇄용 열 구성을 다시 잡는다. */
  .metrics { grid-template-columns: repeat(4, 1fr); }
  .debug { grid-template-columns: repeat(3, 1fr); }
  .records { grid-template-columns: 1fr 1fr; }
  .label, .facts dt, .d-solve dt, .skills dt { font-family: var(--f-sans); letter-spacing: 0; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 5mm; }
  .gallery--phone { grid-template-columns: repeat(4, 1fr); }
  .gallery li, .d-ch { break-inside: avoid; }
  .d-ch { grid-template-columns: 22mm 1fr; }
  .d-steps div { grid-template-columns: 18mm 1fr; }
  .d-sec { padding-top: 7mm; }
  .d-role li { grid-template-columns: 22mm 1fr; gap: 3mm; }

  /* 원페이저: 첫 화면 + 프로젝트 요약 + 연락처만 한 장에 */
  .print-onepager #debug, .print-onepager #build, .print-onepager #story, .print-onepager #records,
  .print-onepager .lead, .print-onepager .hero__proof, .print-onepager .hero__intro,
  .print-onepager .role-line, .print-onepager #others-title, .print-onepager #others, .print-onepager .contact h2 { display: none !important; }
  .print-onepager body { font-size: 9pt; }
  .print-onepager .hero { padding-bottom: 3mm; }
  .print-onepager .hero__headline { font-size: 20pt; margin-bottom: 2mm; }
  .print-onepager .hero__grid { grid-template-columns: 1fr 22mm; }
  .print-onepager .hero__photo { width: 22mm; }
  .print-onepager #projects { padding-block: 3mm 0; }
  .print-onepager #projects h2 { font-size: 13pt; margin-bottom: 2mm; }
  .print-onepager #scenes { display: grid; grid-template-columns: 1fr 1fr; gap: 0 6mm; }
  .print-onepager .scene { padding: 2.5mm 3.5mm; margin: 0 0 3mm; }
  .print-onepager .sec-head { margin-bottom: 2mm; }
  /* 새 디자인의 큰 글자·카드 여백을 한 장에 맞게 줄인다 */
  .print-onepager .hero__sub { font-size: 10pt; line-height: 1.5; margin-bottom: 0; }
  .print-onepager .hero__grid { gap: 5mm; }
  .print-onepager .eyebrow { margin-bottom: 1mm; font-size: 8pt; }
  .print-onepager #scenes { gap: 0 5mm; }
  .print-onepager .scene { padding: 2mm 3mm; margin: 0 0 2.5mm; }
  .print-onepager .facts { gap: 0 3mm; font-size: 7.5pt; line-height: 1.4; }
  .print-onepager .easy { line-height: 1.4; }
  .print-onepager .contact { margin-top: 2mm; }
  .print-onepager .scene > .label { display: none; }
  .print-onepager .scene__title { font-size: 12pt; margin-bottom: 1mm; }
  .print-onepager .easy { font-size: 8.5pt; margin-bottom: 1mm; }
  .print-onepager .facts { margin: 0; gap: 3mm; font-size: 8pt; }
  .print-onepager .metrics { grid-template-columns: 1fr 1fr; margin: 1mm 0 0; }
  .print-onepager .metric:nth-child(n + 3) { display: none; }
  .print-onepager .metric { padding: 1mm 1mm 1mm 0; gap: 1px; }
  .print-onepager .metric__value { font-size: 11pt; }
  .print-onepager .metric__label { font-size: 7.5pt; }
  .print-onepager .contact { padding-block: 3mm 0; }
  .print-onepager .contact__list { display: flex; gap: 6mm; margin: 0; }
  .print-onepager .contact__list li { border: 0; padding: 0; }
}
@media print {
  /* 숫자 칸: 4칸마다 줄 첫 칸만 세로선을 뺀다(화면의 좁은 폭 규칙을 덮어쓴다) */
  .metrics .metric { padding-left: 3mm; border-left: 1px solid var(--c-line); }
  .metrics .metric:nth-child(4n+1) { padding-left: 0; border-left: 0; }
  .print-onepager .metrics .metric:nth-child(odd) { padding-left: 0; border-left: 0; }
  /* 흐름 도식은 A4에서도 가로 한 줄로 둔다 */
  .flow__row { column-gap: 6mm; }
  .flow__step + .flow__step::before { left: -4.5mm; }
  .flow__step { font-size: 8.5pt; }
  .flow__step b { font-size: 9.5pt; }
  .d-sec > h2 { font-size: 18pt; margin-bottom: 4mm; }
  .d-head h1 { font-size: 26pt; }
  .d-card, .d-ch { padding: 5mm; }
}
@media print {
  /* 섹션 번호와 제목이 쪽 경계에서 갈라지지 않게 */
  .d-sec > h2, .sec-head { break-inside: avoid; break-after: avoid; }
}
@media print {
  /* 문제 해결 카드: 3열은 A4에서 너무 좁아 길어지고 잘리므로 한 줄에 하나, 요약 왼쪽·단계 오른쪽 */
  .debug { grid-template-columns: 1fr; gap: 4mm; }
  .dbg { display: grid; grid-template-columns: 58mm 1fr; column-gap: 6mm; align-items: start; break-inside: avoid; }
  .dbg > :not(.dbg__steps) { grid-column: 1; }
  .dbg__steps { grid-column: 2; grid-row: 1 / span 4; }
  .dbg__steps li:first-child { border-top: 0; padding-top: 0; }
  h3, .sub { break-after: avoid; }
  /* 기록: 반쪽 칸은 A4에서 글자가 세로로 쌓이므로 한 칸씩, 줄 단위로만 넘긴다 */
  .records { grid-template-columns: 1fr; gap: 4mm; }
  .rows li, .skills div { grid-template-columns: 34mm 1fr; break-inside: avoid; }
  .records > div { break-inside: avoid; }
  /* 상세 페이지: 화면 모음(길어서 어차피 넘어감)을 뺀 카드는 통째로 넘긴다 */
  .d-card:not(:has(.gallery)) { break-inside: avoid; }
  /* 끝의 화면용 아래 여백이 빈 쪽을 만들고, 섹션 간격이 커서 카드가 한 줄씩 넘치므로 줄인다 */
  .detail { padding-block: 0; }
  .d-sec { padding-top: 5mm; }
  .d-sec > h2 { font-size: 16pt; margin-bottom: 3mm; }
}
@media print {
  /* 관점별 PDF: 번호 섹션(01~06)은 새 쪽에서 시작해 되도록 한 쪽 안에 끝낸다. html 글자 크기로 rem 단위를 함께 줄인다 */
  html.print-full { font-size: 14px; }
  .print-full body { font-size: 10pt; line-height: 1.5; }
  .print-full #projects, .print-full #debug, .print-full #build, .print-full #story, .print-full #records { break-before: page; }
  .print-full .section { padding-block: 0; }
  .print-full .sec-head { margin-bottom: 4mm; }
  .print-full .sec-head h2 { font-size: 20pt; }
  /* 01 대표 프로젝트: 2열 카드 */
  .print-full #scenes { display: grid; grid-template-columns: 1fr 1fr; gap: 3mm; }
  .print-full .scene { margin: 0; padding: 3mm 4mm; break-inside: avoid; }
  .print-full .scene__title { font-size: 14pt; }
  .print-full .scene .easy { margin-bottom: 1mm; }
  .print-full .scene .facts { margin: 1mm 0; gap: 0 3mm; }
  .print-full .scene .role-line { margin: 0; }
  .print-full .scene .metrics { grid-template-columns: 1fr 1fr; margin: 2mm 0 0; }
  .print-full .scene .metrics .metric { padding: 1mm 0 1mm 3mm; gap: 1px; }
  .print-full .scene .metrics .metric:nth-child(odd) { padding-left: 0; border-left: 0; }
  .print-full .metric__value { font-size: 13pt; }
  /* 인사담당자가 PDF에서 바로 상세 페이지·보고서로 갈 수 있게 카드의 바로가기 줄을 인쇄에도 보인다 */
  .print-full .scene__actions { display: flex !important; gap: 0 5mm; margin-top: 2mm; }
  .print-full .scene__actions .more-link { min-height: 0; font-size: 9.5pt; }
  /* 바로가기 줄만큼 늘어난 높이를 카드 안 글자 간격으로 되찾는다 */
  .print-full .scene .easy { font-size: 9.5pt; line-height: 1.45; }
  .print-full .scene .facts, .print-full .scene .role-line { font-size: 8.5pt; line-height: 1.4; }
  .print-full .scene .metric__label { font-size: 8.5pt; line-height: 1.35; }
  /* 카드 수가 홀수(데이터 관점 3개)면 마지막 카드를 가로로 넓혀 높이를 줄이고, 그 외 프로젝트까지 한 쪽에 넣는다 */
  .print-full .scene:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .print-full .scene:last-child:nth-child(odd) .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .print-full .scene:last-child:nth-child(odd) .metrics .metric { padding-left: 3mm; border-left: 1px solid var(--c-line); }
  .print-full .scene:last-child:nth-child(odd) .metrics .metric:first-child { padding-left: 0; border-left: 0; }
  /* 그 외 프로젝트: 왼쪽 이름·기간, 오른쪽 설명의 한 줄형으로 줄여 대표 프로젝트 쪽에 붙인다 */
  /* 격자 대신 블록으로 쌓는다: 격자 안 항목은 Chrome 인쇄에서 남은 공간이 있어도 다음 쪽으로 밀리는 일이 있다 */
  .print-full .others { display: block; margin: 0; }
  .print-full .other + .other { margin-top: 2mm; }
  /* 화면용 터치 높이(44px)가 인쇄에서는 보이지 않는 빈칸이 되므로 없앤다 */
  .print-full .other .more-link { min-height: 0; }
  .print-full .other { display: grid; grid-template-columns: 58mm 1fr; column-gap: 4mm; padding: 2.5mm 4mm; }
  .print-full .other > .label, .print-full .other > h4 { grid-column: 1; margin: 0; }
  .print-full .other > :not(.label):not(h4) { grid-column: 2; margin: 0; }
  .print-full .other > p:nth-of-type(2) { grid-row: 1; }
  .print-full #others-title { margin: 3mm 0 2mm; }
  .print-full .other { break-inside: avoid; }
  /* 02 문제 해결 */
  .print-full .debug { gap: 3mm; }
  .print-full .dbg { padding: 4mm; grid-template-columns: 54mm 1fr; }
  .print-full .dbg__res b { font-size: 16pt; }
  /* 04 스토리 */
  .print-full .timeline li { padding-bottom: 3mm; max-width: none; }
  .print-full .timeline h3 { font-size: 11pt; margin-bottom: 1mm; }
  /* 05 기록: 2열로 되돌리고 날짜 칸만 좁힌다 */
  .print-full .records { grid-template-columns: 1fr 1fr; gap: 4mm; }
  .print-full .records > div { padding: 4mm; }
  .print-full .rows li, .print-full .skills div { grid-template-columns: 19mm 1fr; gap: 2mm; padding: 1mm 0; }
  /* 06 연락처 */
  /* 연락처는 내용이 짧아 새 쪽 대신 기록 쪽 아래에 남색 선으로 구분해 붙인다 */
  .print-full .contact { margin-top: 6mm; padding-top: 4mm; break-inside: avoid; }
  .print-full .contact h2 { font-size: 16pt; margin: 0 0 2mm; }
  .print-full .contact__list { margin: 0; }
  .print-full .contact__list li { padding-block: 1.5mm; }
}
@media print {
  /* 관점 PDF의 표지: 내용이 쪽 위쪽에 몰리지 않게 쪽 높이 안에서 가운데 두고 크게 보여 준다 */
  .print-full .hero { min-height: 266mm; display: flex; flex-direction: column; justify-content: center; padding: 0; }
  .print-full .hero__grid { grid-template-columns: 1fr 46mm; gap: 10mm; align-items: start; }
  .print-full .hero__photo { width: 46mm; }
  .print-full .hero .label { font-size: 11pt; margin-bottom: 3mm; }
  .print-full .hero__headline { font-size: 34pt; margin-bottom: 7mm; }
  .print-full .hero__sub { font-size: 13pt; line-height: 1.75; margin-bottom: 4mm; }
  .print-full .hero__intro { font-size: 11pt; }
  .print-full .hero__proof { font-size: 11pt; margin-top: 8mm; padding-top: 2mm; border-top: 2px solid var(--c-accent); }
  .print-full .hero__proof li { padding-block: 3mm; }
}
@media print {
  /* 전체 관점(대표 카드 7개)은 내용이 가장 많아 01·02 섹션이 한 줄씩 다음 쪽으로 넘치므로 이 경우에만 더 조인다 */
  html.print-full:has(#scenes > .scene:nth-child(7)) #scenes { gap: 2.5mm; }
  html.print-full:has(#scenes > .scene:nth-child(7)) .scene { padding: 2.5mm 3.5mm; }
  html.print-full:has(#scenes > .scene:nth-child(7)) .other { padding: 1.5mm 3.5mm; }
  html.print-full:has(#scenes > .scene:nth-child(7)) .other + .other { margin-top: 1.5mm; }
  html.print-full:has(#scenes > .scene:nth-child(7)) #others-title { margin: 2mm 0 1.5mm; }
  html.print-full:has(#scenes > .scene:nth-child(7)) .other { font-size: 8.5pt; line-height: 1.35; }
  html.print-full:has(#scenes > .scene:nth-child(7)) .scene .metrics .metric { padding-block: 0.6mm; }
  html.print-full:has(#scenes > .scene:nth-child(7)) .metric__value { font-size: 12pt; }
  html.print-full:has(#scenes > .scene:nth-child(7)) .dbg { padding: 3mm 4mm; grid-template-columns: 46mm 1fr; }
  html.print-full:has(#scenes > .scene:nth-child(7)) .dbg__steps { font-size: 8.5pt; line-height: 1.4; }
  html.print-full:has(#scenes > .scene:nth-child(7)) .dbg__steps li { padding: 0.8mm 0; }
}
