/* =============================================================================
   pf.css — 포트폴리오 전용. /style.css 의 CSS 변수(--bg, --accent 등) 재사용
   ========================================================================== */

.pf-wrap {
  max-width: 1320px;
  margin: 1.6rem auto 4rem;
  padding: 0 1.5rem;
  animation: pf-page-impact-shake 700ms linear 350ms;
}

@keyframes pf-page-impact-shake {
  0%, 67% { translate: 0 0; }
  68% { translate: -5px 2px; }
  72% { translate: 5px -2px; }
  76% { translate: -4px 1px; }
  81% { translate: 3px -1px; }
  87% { translate: -2px 1px; }
  93% { translate: 1px 0; }
  100% { translate: 0 0; }
}

/* ------------------------------------------------------------------ 히어로 */
.pf-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.58fr);
  align-items: end;
  gap: 2.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
}
.pf-hero-kicker {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.pf-hero h1 {
  font-size: clamp(2rem, 3.2vw, 2.65rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.035em;
  margin-bottom: 0.75rem;
}
.pf-hero-tag {
  font-size: 1.02rem;
  color: var(--accent);
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 1rem;
}
.pf-hero-summary {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.8;
  max-width: 72ch;
  margin-bottom: 1.2rem;
}
.pf-hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
}
.pf-hero-links a {
  font-size: 0.82rem;
  background: var(--tag-bg);
  color: var(--tag-color);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}
.pf-hero-links a:hover { text-decoration: none; opacity: 0.82; }

.pf-hero-evidence {
  margin: 0 0 1.15rem;
  padding: 0.75rem 0 0.72rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.pf-hero-evidence > p {
  margin: 0 0 0.42rem;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.pf-hero-evidence ol { margin: 0; padding: 0; list-style: none; }
.pf-hero-evidence li {
  display: grid;
  grid-template-columns: 6.4rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.23rem 0;
}
.pf-hero-evidence span {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
}
.pf-hero-evidence strong {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.55;
}

.pf-hero-mascot {
  --pf-mascot-caption-width: clamp(132px, 15vw, 170px);
  --pf-dino-hop-back: clamp(17px, 2vw, 25px);
  --pf-dino-runup: calc(var(--pf-mascot-caption-width) / 2);
  position: relative;
  align-self: center;
  width: 100%;
  aspect-ratio: 1370 / 667;
  min-width: 0;
  overflow: visible;
}
.pf-dino-hop {
  position: absolute;
  inset: 0;
  display: block;
  transform-origin: 50% 100%;
  animation: pf-dino-hop 250ms ease-in-out 100ms both;
}
.pf-hero-mascot img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform-origin: 50% 100%;
  animation: pf-dino-bump 700ms cubic-bezier(.2,.8,.25,1) 350ms both;
}
@keyframes pf-dino-hop {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(calc(var(--pf-dino-hop-back) * -1), -20%) rotate(4deg); }
  100% { transform: translate(calc(var(--pf-dino-hop-back) * -1), 0) rotate(8deg); }
}
.pf-hero-mascot span {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  width: var(--pf-mascot-caption-width);
  max-width: calc(100% - 1rem);
  padding: 0.35rem 0.45rem 0.35rem 0.7rem;
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--pf-paper) 82%, transparent);
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.55;
}
@keyframes pf-dino-bump {
  0% {
    opacity: 1;
    transform: translateX(calc(var(--pf-dino-runup) * -1)) rotate(0deg);
    animation-timing-function: cubic-bezier(.55, 0, 1, .45);
  }
  68% {
    opacity: 1;
    transform: translateX(calc(var(--pf-dino-hop-back) + 2px)) rotate(-5deg);
    animation-timing-function: cubic-bezier(.16, .8, .3, 1);
  }
  82% {
    transform: translateX(calc(var(--pf-dino-hop-back) - 3px)) rotate(-5deg);
    animation-timing-function: ease-out;
  }
  100% { opacity: 1; transform: translateX(var(--pf-dino-hop-back)) rotate(-5deg); }
}

/* 공룡이 박는 순간(pf-dino-bump 68%)에 CSS로 그린 벽이 세로로 반 쪼개진다.
   벽 애니메이션 duration/delay/easing 을 공룡과 동일하게 두고 파괴 키프레임을 68% 에 맞췄다. */
.pf-hero-wall {
  position: absolute;
  top: 6%;
  right: 0;
  width: clamp(7px, 1vw, 13px);
  height: 88%;
  pointer-events: none;
  background: repeating-linear-gradient(0deg,
    var(--accent) 0 15px,
    color-mix(in srgb, var(--accent) 45%, transparent) 15px 17px);
  border-radius: 2px;
  animation: pf-wall-hit 700ms cubic-bezier(.2,.8,.25,1) 350ms both;
}
.pf-hero-wall::before,
.pf-hero-wall::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  background: inherit;
  border-radius: inherit;
}
.pf-hero-wall::before {
  top: 0;
  height: calc(50% - 1px);
  transform-origin: right bottom;
  animation: pf-wall-top 700ms cubic-bezier(.2,.8,.25,1) 350ms both;
}
.pf-hero-wall::after {
  bottom: 0;
  height: calc(50% - 1px);
  transform-origin: right top;
  animation: pf-wall-bottom 700ms cubic-bezier(.2,.8,.25,1) 350ms both;
}
@keyframes pf-wall-top {
  0%, 64% { transform: translate(0, 0) rotate(0); }
  68% { transform: translate(6px, -11px) rotate(-9deg); }
  100% { transform: translate(3px, -5px) rotate(-4deg); opacity: 0.9; }
}
@keyframes pf-wall-bottom {
  0%, 64% { transform: translate(0, 0) rotate(0); }
  68% { transform: translate(6px, 11px) rotate(9deg); }
  100% { transform: translate(3px, 5px) rotate(4deg); opacity: 0.9; }
}
@keyframes pf-wall-hit {
  0%, 63% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  68% { box-shadow: -3px 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent),
                    -16px 0 24px 4px color-mix(in srgb, var(--accent) 22%, transparent); }
  100% { box-shadow: -34px 0 48px 12px transparent; }
}

.pf-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
.pf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.pf-btn:hover { background: var(--accent-hover); text-decoration: none; }
.pf-btn[hidden] { display: none !important; }
.pf-btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.pf-btn--ghost:hover { background: var(--border); color: var(--text); }
.pf-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  flex: 1 1 240px;
}

/* ------------------------------------------------------------------ 작업 목차 */
.pf-toc {
  display: grid;
  grid-template-columns: minmax(180px, 0.72fr) minmax(0, 2fr);
  gap: 2rem;
  margin: 0 0 3.2rem;
  padding: 1.35rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.pf-toc-kicker {
  margin-bottom: 0.25rem;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pf-toc-head h2 { margin-bottom: 0.45rem; font-size: 1.2rem; }
.pf-toc-head > p:last-child { color: var(--text-muted); font-size: 0.78rem; line-height: 1.55; }
.pf-toc-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pf-toc-section-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.15rem;
  padding: 0 0.15rem 0.45rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: color 140ms ease, padding-left 140ms ease;
}
.pf-toc-section-link:hover { color: var(--accent); padding-left: 0.35rem; }
.pf-toc-section-link strong { min-width: 0; font-weight: 800; }
.pf-toc-section-link .pf-toc-section-number {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.66rem;
  font-weight: 700;
}
.pf-toc-section-link small {
  min-width: 1.55rem;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.45;
  text-align: center;
}
.pf-toc-group ul {
  margin: 0.55rem 0 0;
  padding: 0 0 0 0.75rem;
  border-left: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  list-style: none;
}
.pf-toc-group li li + li { margin-top: 0.08rem; }
.pf-toc-group a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 2rem;
  margin-left: -0.2rem;
  padding: 0.32rem 0.35rem 0.32rem 0.55rem;
  border-radius: 2px;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.35;
  transition: color 130ms ease, background 130ms ease, transform 130ms ease;
}
.pf-toc-group a:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  text-decoration: none;
  transform: translateX(2px);
}
.pf-toc-item-title { min-width: 0; overflow-wrap: anywhere; }
/* 처음 보는 사람도 바로 읽을 수 있게 엔진/플랫폼을 텍스트 라벨로 — 범례 없이도 이해 가능 */
.pf-toc-item-engine {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 1px 6px;
  line-height: 1.5;
}
.pf-toc-group a:hover .pf-toc-item-engine { color: var(--accent); border-color: var(--accent); }
.pf-section { scroll-margin-top: 5.5rem; }

/* ------------------------------------------------------------------ 섹션 */
.pf-section { margin-bottom: 2.8rem; }
.pf-section-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 1.1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.pf-section-title span {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
}
.pf-section--featured .pf-section-title { border-bottom-color: var(--accent); }

@media (max-width: 700px) {
  .pf-toc { grid-template-columns: 1fr; gap: 1.2rem; }
  .pf-toc-groups { grid-template-columns: 1fr; gap: 1rem; }
}

/* ------------------------------------------------------------------ 그리드 / 카드 */
.pf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.1rem;
}
.pf-grid--big { grid-template-columns: 1fr; gap: 1.1rem; }

.pf-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform 0.14s, border-color 0.18s;
}
.pf-card:hover { transform: translateY(-2px); border-color: var(--accent); text-decoration: none; }
.pf-card--big { flex-direction: row; }
.pf-card--big .pf-thumb { width: 40%; min-width: 220px; aspect-ratio: auto; }

.pf-thumb {
  aspect-ratio: 16 / 9;
  background: var(--code-bg);
  overflow: hidden;
  flex-shrink: 0;
}
.pf-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.pf-thumb--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.pf-thumb--ph span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  opacity: 0.92;
  text-align: center;
}
.pf-g-work  { background: linear-gradient(135deg, #0d9488, #0f766e); }
.pf-g-jam   { background: linear-gradient(135deg, #6366f1, #4338ca); }
.pf-g-tool  { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.pf-g-study { background: linear-gradient(135deg, #f59e0b, #b45309); }
.pf-g-doc   { background: linear-gradient(135deg, #64748b, #334155); }

.pf-card-body { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: 0.4rem; }
.pf-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.pf-card-head h3 { font-size: 1.02rem; font-weight: 700; line-height: 1.35; }
.pf-period { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.pf-sub { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }
.pf-summary { font-size: 0.86rem; color: var(--text); line-height: 1.6; }
.pf-note {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
  line-height: 1.55;
  background: var(--code-bg);
  border-left: 3px solid var(--accent);
  padding: 0.4rem 0.6rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.pf-note--lg { font-size: 0.92rem; margin-top: 0.8rem; }

.pf-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.1rem; }
.pf-chip {
  font-size: 0.7rem;
  background: var(--code-bg);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.pf-chip--on { background: var(--accent); color: #fff; }

/* ------------------------------------------------------------------ 상세 */
.pf-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: start;
  gap: 2.2rem;
}
.pf-detail-main { min-width: 0; }
.pf-detail-toc {
  position: sticky;
  top: 5.2rem;
  max-height: calc(100vh - 6.5rem);
  overflow: auto;
  padding-left: 1rem;
  border-left: 1px solid var(--border);
  scrollbar-width: thin;
}
.pf-detail-toc summary {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
}
.pf-detail-toc-list { margin: 0.7rem 0 0; padding: 0; list-style: none; }
.pf-detail-toc-list li + li { margin-top: 0.2rem; }
.pf-detail-toc-list button {
  width: 100%;
  padding: 0.16rem 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}
.pf-detail-toc-list button:hover,
.pf-detail-toc-list button[aria-current="true"] { color: var(--accent); }
.pf-detail-toc-level-3 { padding-left: 0.7rem; }
.pf-detail-toc-level-4 { padding-left: 1.4rem; }
.pf-body-heading { scroll-margin-top: 5.5rem; }

@media (max-width: 900px) {
  .pf-detail-layout { grid-template-columns: 1fr; gap: 0; }
  .pf-detail-toc {
    grid-row: 1;
    position: static;
    max-height: none;
    margin-bottom: 1.4rem;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }
  .pf-detail-main { grid-row: 2; }
  .pf-detail-toc-list { columns: 2; column-gap: 1.5rem; }
  .pf-detail-toc-list li { break-inside: avoid; }
}
@media (max-width: 560px) {
  .pf-detail-toc-list { columns: 1; }
}

.pf-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1.4rem;
}
.pf-back:hover { color: var(--accent); }

.pf-detail-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.4rem;
  margin-bottom: 1.6rem;
}
.pf-detail-head h1 {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 0.5rem 0 0.4rem;
}
.pf-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1rem;
  margin: 1rem 0 0;
  font-size: 0.85rem;
}
.pf-meta dt { color: var(--text-muted); font-weight: 600; }
.pf-meta dd { color: var(--text); }
.pf-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.pf-links a {
  font-size: 0.8rem;
  background: var(--tag-bg);
  color: var(--tag-color);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}
.pf-links a:hover { text-decoration: none; opacity: 0.82; }

.pf-embed { margin-bottom: 1.6rem; }
.pf-embed iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius-lg); }

/* 본문 내 유튜브 / 3D 임베드 (blog style.css .yt-wrapper 와 동일) */
.pf-embed-block { margin: 1.3rem 0; }
.yt-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.yt-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
  border-radius: var(--radius-lg);
}
.pf-embed-block > [data-3d-pending],
.pf-embed-block > .mv-viewer {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.pf-embed-fallback { display: none; font-size: 0.8rem; margin: 0.4rem 0 0; }
.pf-embed-fallback a { color: var(--accent); word-break: break-all; }

/* ```grid — 이미지·영상·유튜브·3D를 고정 비율 타일로 배치 */
.pf-mgrid {
  display: grid;
  grid-template-columns: repeat(var(--pf-cols, 2), 1fr);
  gap: 1.1rem 0.9rem;
}
.pf-gcell { margin: 0; min-width: 0; display: flex; flex-direction: column; }
.pf-gbox {
  position: relative;
  aspect-ratio: var(--pf-ratio, 16 / 9);
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.pf-gbox > * { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pf-gbox img,
.pf-gbox video {
  object-fit: var(--pf-fit, contain);
  background: var(--code-bg);
  margin: 0;
  max-width: none;
  border-radius: 0;
}
.pf-hero-copy { min-width: 0; }

/* ------------------------------------------------------------------ 쇼릴 */
.pf-reel {
  margin: 0 0 3.2rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}
.pf-reel-head-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.pf-reel-head { margin-bottom: 1.2rem; }
.pf-reel-head-row .pf-reel-head { margin-bottom: 0; }
.pf-reel-head h2 { margin-bottom: 0.45rem; font-size: 1.35rem; }
.pf-reel-head > p:last-child {
  max-width: 68ch;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.65;
}
.pf-reel-body .pf-mgrid { margin: 0; }
.pf-reel-body .pf-gcell { margin: 0; }
.pf-reel-body .pf-gcell:nth-child(n + 4) { display: none; }
.pf-reel--expanded .pf-reel-body .pf-gcell:nth-child(n + 4) { display: flex; }
.pf-reel-poster {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #111;
  color: #fff;
  cursor: pointer;
}
.pf-reel-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
  transition: opacity 150ms ease, transform 180ms ease;
}
.pf-reel-poster:hover img { opacity: 1; transform: scale(1.015); }
.pf-reel-play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  padding-left: 0.2rem;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 50%;
  background: rgba(18,34,32,.82);
  box-shadow: 0 3px 14px rgba(0,0,0,.28);
  transform: translate(-50%, -50%);
  font-size: 1.05rem;
}
.pf-reel-play-label {
  position: absolute;
  right: 0.65rem;
  bottom: 0.6rem;
  padding: 0.25rem 0.48rem;
  background: rgba(18,34,32,.78);
  font-size: 0.68rem;
  font-weight: 700;
}
.pf-reel-poster:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 60%, white);
  outline-offset: -4px;
}
.pf-reel-toggle {
  flex: 0 0 auto;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.pf-reel-toggle:hover { border-color: var(--accent); color: var(--accent); }
.pf-gcell--img .pf-gbox { cursor: zoom-in; }
.pf-gbox .pf-tile-link {
  display: flex; align-items: center; justify-content: center;
  padding: 0.8rem; font-size: 0.8rem; color: var(--accent);
  word-break: break-all; text-align: center;
}
.pf-gbox canvas { position: absolute; }           /* model-viewer 캔버스 */
.pf-gcell figcaption {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.45rem;
  text-align: center;
  line-height: 1.45;
}
@media (max-width: 560px) {
  .pf-mgrid { grid-template-columns: 1fr; }
}

/* 본문 단일 이미지도 클릭 확대 */
.pf-body p > img, .pf-body > img, .pf-body figure > img { cursor: zoom-in; }

/* 이미지 라이트박스 */
.pf-lightbox { display: none; }
.pf-lightbox.pf-lightbox--open {
  position: fixed; inset: 0; z-index: 3000;
  display: flex; align-items: center; justify-content: center;
  padding: 4vmin;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(3px);
}
.pf-lb-fig { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.pf-lightbox img {
  max-width: 100%; max-height: 86vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
.pf-lightbox figcaption { color: #eee; font-size: 0.85rem; margin-top: 0.8rem; text-align: center; max-width: 60ch; }
.pf-lb-count {
  position: fixed; bottom: 2.4vmin; left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.75); font-size: 0.8rem;
  font-variant-numeric: tabular-nums; letter-spacing: 0.04em;
}
.pf-lb-btn {
  position: fixed; z-index: 1;
  border: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.14); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.pf-lb-btn:hover { background: rgba(255, 255, 255, 0.3); }
.pf-lb-close { top: 2vmin; right: 2vmin; width: 42px; height: 42px; border-radius: 50%; font-size: 1.15rem; }
.pf-lb-prev, .pf-lb-next {
  top: 50%; transform: translateY(-50%);
  width: 48px; height: 68px; border-radius: 8px; font-size: 1.8rem; line-height: 1;
}
.pf-lb-prev { left: 2vmin; }
.pf-lb-next { right: 2vmin; }
@media (max-width: 560px) {
  .pf-lb-prev, .pf-lb-next { width: 40px; height: 56px; font-size: 1.5rem; }
  .pf-lb-prev { left: 0.5vmin; } .pf-lb-next { right: 0.5vmin; }
}

/* 본문 타이포 (블로그 .post-body 와 동일 계열) */
.pf-body { font-size: 0.94rem; line-height: 1.75; }
.pf-body h2, .pf-body h3, .pf-body h4 { margin: 1.8rem 0 0.7rem; line-height: 1.3; }
.pf-body h2 { font-size: 1.25rem; border-bottom: 1px solid var(--border); padding-bottom: 0.35rem; }
.pf-body h3 { font-size: 1.08rem; }
.pf-body h4 { font-size: 0.98rem; color: var(--text-muted); }
.pf-body p { margin-bottom: 0.9rem; }
.pf-body img {
  display: block;
  margin: 1.2rem auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.pf-body p > img { margin: 0 auto; }
.pf-body ul, .pf-body ol { margin: 0.4rem 0 1rem 1.4rem; }
.pf-body li { margin-bottom: 0.3rem; }
.pf-body blockquote {
  border-left: 4px solid var(--accent);
  margin: 1rem 0;
  padding: 0.5rem 1.1rem;
  background: var(--code-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
}
.pf-body code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.86em;
  font-family: 'Fira Code', 'Consolas', monospace;
}
.pf-body pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  margin: 1rem 0;
}
.pf-body pre code { background: none; padding: 0; }
.pf-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.86rem; }
.pf-body th, .pf-body td { border: 1px solid var(--border); padding: 0.45rem 0.8rem; text-align: left; vertical-align: top; }
.pf-body th { background: var(--code-bg); font-weight: 700; }
.pf-body hr { border: none; border-top: 1px solid var(--border); margin: 1.8rem 0; }
.pf-body a { color: var(--accent); }

/* ------------------------------------------------------------------ 반응형 */
@media (max-width: 720px) {
  .pf-wrap { padding: 0 1rem; margin-top: 1.2rem; }
  .pf-hero h1 { font-size: 1.55rem; }
  .pf-card--big { flex-direction: column; }
  .pf-card--big .pf-thumb { width: 100%; min-width: 0; aspect-ratio: 16 / 9; }
  .pf-grid, .pf-grid--big { grid-template-columns: 1fr; }
  .pf-meta { grid-template-columns: 1fr; gap: 0.15rem 0; }
  .pf-meta dd { margin-bottom: 0.5rem; }
}

/* =============================================================================
   인쇄 (PDF / 슬라이드)
   ========================================================================== */
.pf-print-root { display: none; }

/* 화면에서 "저장" 버튼을 눌렀을 때: 인쇄용 렌더를 화면에 올리고 나머지는 감춤 */
body.pf-printing .site-header,
body.pf-printing .pf-wrap,
body.pf-printing .site-footer { display: none; }
body.pf-printing .pf-print-root { display: block; }

.pf-print-root {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  color: #111;
}
.pf-print-cover { padding: 2rem 0 1rem; border-bottom: 2px solid #111; margin-bottom: 1.5rem; }
.pf-print-kicker { font-size: 0.9rem; color: #555; }
.pf-print-cover h1 { font-size: 1.9rem; font-weight: 800; margin: 0.3rem 0; }
.pf-print-tag { font-size: 1rem; font-weight: 600; color: #0f766e; margin-bottom: 0.8rem; }
.pf-print-summary { font-size: 0.9rem; line-height: 1.7; margin-bottom: 0.8rem; }
.pf-print-contact { font-size: 0.75rem; color: #444; word-break: break-all; margin-bottom: 0.6rem; }
.pf-print-toc { font-size: 0.78rem; color: #444; line-height: 1.6; }

.pf-print-item { padding: 1.4rem 0; border-top: 1px solid #ccc; }
.pf-print-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: #0f766e;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.pf-print-item h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.2rem; }
.pf-print-sub { font-size: 0.85rem; color: #555; margin-bottom: 0.3rem; }
.pf-print-meta { font-size: 0.76rem; color: #666; margin-bottom: 0.5rem; }
.pf-print-note {
  font-size: 0.82rem; font-weight: 600; color: #0f766e;
  border-left: 3px solid #0f766e; padding-left: 0.5rem; margin-bottom: 0.5rem;
}
.pf-print-links { font-size: 0.72rem; color: #555; word-break: break-all; margin-bottom: 0.6rem; }

/* ------------------------------------------------------------------ 포트폴리오 전시형 레이아웃 */
:root {
  --pf-desk: #e7dfcf;
  --pf-desk-line: rgba(65, 75, 68, 0.035);
  --pf-paper: #faf7ed;
  --pf-paper-edge: #d6cebc;
  --pf-note-featured: #f1e8bf;
  --pf-note-tool: #dce8d8;
  --pf-note-jam: #eadfd2;
  --pf-note-study: #dfe6e8;
  --pf-tape: rgba(224, 207, 158, 0.72);
  --pf-paper-shadow: rgba(58, 52, 40, 0.12);
}
[data-theme="dark"] {
  --pf-desk: #0f1919;
  --pf-desk-line: rgba(221, 217, 199, 0.025);
  --pf-paper: #1a2827;
  --pf-paper-edge: #34443f;
  --pf-note-featured: #403e2d;
  --pf-note-tool: #293e37;
  --pf-note-jam: #41352f;
  --pf-note-study: #2b383d;
  --pf-tape: rgba(151, 137, 99, 0.52);
  --pf-paper-shadow: rgba(0, 0, 0, 0.28);
}
body {
  background-color: var(--pf-desk);
  background-image: repeating-linear-gradient(0deg, transparent 0 27px, var(--pf-desk-line) 27px 28px);
}
.pf-hero,
.pf-content-main {
  background-color: var(--pf-paper);
  background-image: repeating-linear-gradient(0deg, transparent 0 31px, var(--pf-desk-line) 31px 32px);
  border: 1px solid var(--pf-paper-edge);
  border-radius: 2px;
  box-shadow: 3px 4px 0 var(--pf-paper-shadow);
}
.pf-hero {
  padding: clamp(1.7rem, 3.6vw, 2.8rem);
  margin-bottom: 2.5rem;
  border-top: 4px solid color-mix(in srgb, var(--accent) 68%, var(--pf-paper-edge));
}
.pf-content-main { padding: clamp(1.25rem, 3vw, 2.5rem); }
.pf-content-shell .pf-toc {
  padding: 1.1rem 1rem 1.2rem;
  background: color-mix(in srgb, var(--pf-paper) 88%, transparent);
  border: 1px solid var(--pf-paper-edge);
  border-radius: 2px;
}
.pf-section .pf-card { background: var(--pf-note-study); border-color: color-mix(in srgb, var(--text-muted) 28%, transparent); }
.pf-section--featured .pf-card { position: relative; background: var(--pf-note-featured); overflow: visible; }
.pf-section--featured .pf-grid--big {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}
.pf-section--featured .pf-card--big {
  min-width: 0;
  flex-direction: column;
}
.pf-section--featured .pf-card--big .pf-thumb {
  width: 100%;
  min-width: 0;
  aspect-ratio: 16 / 9;
  border-right: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--text-muted) 22%, transparent);
}
.pf-section--featured .pf-card--big:first-child {
  grid-column: 1 / -1;
  flex-direction: row;
}
.pf-section--featured .pf-card--big:first-child .pf-thumb {
  width: 48%;
  min-width: 260px;
  aspect-ratio: auto;
  border-right: 1px solid color-mix(in srgb, var(--text-muted) 22%, transparent);
  border-bottom: 0;
}
.pf-featured-rank {
  position: absolute;
  z-index: 4;
  top: 0.85rem;
  left: -0.55rem;
  min-width: 2rem;
  padding: 0.16rem 0.42rem;
  background: var(--accent);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-align: center;
  box-shadow: 2px 2px 0 var(--pf-paper-shadow);
}
#pf-section-tools .pf-card { background: var(--pf-note-tool); }
#pf-section-jams .pf-card { background: var(--pf-note-jam); }
#pf-section-study .pf-card { background: var(--pf-note-study); }
.pf-card {
  border-radius: 2px;
  box-shadow: 2px 3px 0 var(--pf-paper-shadow);
  transform: rotate(-0.12deg);
  transition: transform 140ms ease, border-color 160ms ease, box-shadow 140ms ease;
}
.pf-grid .pf-card:nth-child(3n + 2) { transform: rotate(0.12deg); }
.pf-grid .pf-card:nth-child(3n) { transform: rotate(-0.06deg); }
.pf-card:hover {
  transform: translateY(-3px) rotate(0deg);
  box-shadow: 3px 5px 0 var(--pf-paper-shadow);
}
.pf-section--featured .pf-card::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: -9px;
  left: 50%;
  width: 74px;
  height: 19px;
  transform: translateX(-50%) rotate(-1.5deg);
  background: var(--pf-tape);
  border-left: 1px dashed color-mix(in srgb, var(--text-muted) 22%, transparent);
  border-right: 1px dashed color-mix(in srgb, var(--text-muted) 22%, transparent);
}
.pf-thumb { border-bottom: 1px solid color-mix(in srgb, var(--text-muted) 22%, transparent); }
.pf-card--big .pf-thumb { border-right: 1px solid color-mix(in srgb, var(--text-muted) 22%, transparent); border-bottom: 0; }
.pf-reel-body .pf-gcell {
  padding: 0.45rem 0.45rem 0.65rem;
  background: var(--surface);
  border: 1px solid var(--pf-paper-edge);
  box-shadow: 2px 3px 0 var(--pf-paper-shadow);
  transform: rotate(-0.08deg);
}
.pf-reel-body .pf-gcell:nth-child(even) { transform: rotate(0.08deg); }
.pf-reel-body .pf-gbox { border-radius: 1px; border-color: var(--pf-paper-edge); }
.pf-reel-body .pf-gcell figcaption { padding: 0 0.25rem; }
.pf-content-shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); align-items: start; gap: clamp(1.8rem, 3.2vw, 3.5rem); }
.pf-content-main { min-width: 0; }
.pf-content-shell .pf-toc {
  position: sticky; top: 5.5rem; display: block; max-height: calc(100vh - 7rem);
  overflow-y: auto; margin: 0; padding: 1.25rem 1.05rem 1.35rem 1.2rem;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  box-shadow: 2px 3px 0 var(--pf-paper-shadow);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-muted) 42%, transparent) transparent;
}
.pf-content-shell .pf-toc::-webkit-scrollbar { width: 5px; }
.pf-content-shell .pf-toc::-webkit-scrollbar-track { background: transparent; }
.pf-content-shell .pf-toc::-webkit-scrollbar-thumb {
  min-height: 42px;
  border-radius: 0;
  background: color-mix(in srgb, var(--text-muted) 42%, transparent);
}
.pf-content-shell .pf-toc::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent) 68%, transparent);
}
.pf-content-shell .pf-toc::-webkit-scrollbar-button,
.pf-content-shell .pf-toc::-webkit-scrollbar-corner { display: none; background: transparent; }
.pf-content-shell .pf-toc-head h2 { font-size: 1.18rem; }
.pf-content-shell .pf-toc-head > p:last-child { font-size: 0.82rem; }
.pf-content-shell .pf-toc-groups { display: block; margin: 1.25rem 0 0; }
.pf-content-shell .pf-toc-group + .pf-toc-group { margin-top: 1.35rem; }
.pf-content-shell .pf-toc-group ul { margin-top: 0.55rem; }
.pf-content-shell .pf-toc-group a { display: flex; font-size: 0.875rem; line-height: 1.35; }
.pf-toc-toggle, .pf-toc-backdrop { display: none; }
.pf-reel-body .pf-gcell:first-child { grid-column: 1 / -1; }

.pf-toc a:focus-visible,
.pf-toc button:focus-visible,
.pf-card:focus-visible,
.pf-btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .pf-wrap { padding: 0 1rem; }
  .pf-hero-mascot { width: 82%; justify-self: end; }
  .pf-content-shell { display: block; }
  .pf-toc-toggle {
    display: inline-flex; position: sticky; z-index: 52; top: 4.6rem;
    align-items: center; gap: 0.5rem; width: 100%; margin: 0 0 1rem; padding: 0.68rem 0.85rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--pf-paper); color: var(--text); font: inherit; font-size: 0.82rem;
    font-weight: 800; box-shadow: 2px 3px 0 var(--pf-paper-shadow);
  }
  .pf-toc-toggle small { margin-left: auto; color: var(--text-muted); font-size: 0.72rem; font-weight: 600; }
  .pf-toc-toggle-icon { color: var(--accent); }
  .pf-content-shell .pf-toc {
    position: fixed; z-index: 61; top: 3.5rem; left: 0; display: block;
    width: min(88vw, 350px); height: calc(100dvh - 3.5rem); max-height: none;
    padding: 1.5rem 1.25rem 2rem; border: 0; border-right: 1px solid var(--border);
    background: var(--pf-paper); transform: translateX(-105%) rotate(0); transition: transform 180ms ease;
  }
  .pf-content-shell .pf-toc--open { transform: translateX(0); }
  .pf-toc-backdrop { position: fixed; z-index: 60; inset: 0; border: 0; background: rgba(10,20,19,.48); }
  .pf-toc-open .pf-toc-backdrop { display: block; }
  body.pf-toc-open { overflow: hidden; }
}

@media (max-width: 720px) {
  .pf-hero { grid-template-columns: 1fr; gap: 0.7rem; padding: 1.35rem 1.1rem 1.1rem; }
  .pf-hero-kicker { margin-bottom: 0.25rem; font-size: 0.8rem; }
  .pf-hero-summary { font-size: 0.9rem; line-height: 1.65; }
  .pf-hero-evidence { padding: 0.62rem 0; }
  .pf-hero-evidence li { grid-template-columns: 5.6rem minmax(0, 1fr); gap: 0.55rem; }
  .pf-hero-evidence span { font-size: 0.68rem; }
  .pf-hero-evidence strong { font-size: 0.74rem; }
  .pf-hero-mascot {
    --pf-dino-runup: clamp(54px, 15vw, 82px);
    width: min(76%, 360px);
    margin: 0 auto;
  }
  .pf-hero-mascot span { top: 0; left: -4%; font-size: 0.68rem; }
  .pf-section--featured .pf-grid--big { grid-template-columns: 1fr; }
  .pf-section--featured .pf-card--big,
  .pf-section--featured .pf-card--big:first-child { grid-column: auto; flex-direction: column; }
  .pf-section--featured .pf-card--big .pf-thumb,
  .pf-section--featured .pf-card--big:first-child .pf-thumb {
    width: 100%;
    min-width: 0;
    aspect-ratio: 16 / 9;
    border-right: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--text-muted) 22%, transparent);
  }
  .pf-reel-head-row { align-items: start; }
}

@media (max-width: 560px) {
  .pf-hero-summary { display: none; }
  .pf-hero-links a { display: none; }
  .pf-hero-links a:first-child,
  .pf-hero-links a:nth-child(4),
  .pf-hero-links a:last-child { display: inline-flex; }
  .pf-content-main { padding: 1rem 0.8rem; }
  .pf-card--big { overflow: hidden; }
  .pf-section--featured .pf-card::before { top: 7px; }
  .pf-reel-head-row { display: block; }
  .pf-reel-toggle { margin-top: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pf-wrap { animation: none; }
  .pf-dino-hop { animation: none; transform: none; }
  .pf-hero-mascot img { animation: none; transform: none; }
  .pf-hero-wall, .pf-hero-wall::before, .pf-hero-wall::after { animation: none; }
  .pf-hero-wall::before { transform: translate(3px, -5px) rotate(-4deg); }
  .pf-hero-wall::after { transform: translate(3px, 5px) rotate(4deg); }
  .pf-content-shell .pf-toc { transition: none; }
}

@media print {
  @page { size: A4; margin: 14mm 12mm; }
  .site-header, .site-footer, .pf-hero-actions,
  .pf-hero-links, .pf-back { display: none !important; }

  /* 버튼 경유 인쇄: 펼쳐진 인쇄 렌더만 */
  body.pf-printing .pf-print-root { display: block !important; }
  body.pf-printing .pf-print-item { break-inside: avoid; page-break-inside: avoid; }
  body.pf-printing .pf-print-item { border-top: none; }
  body.pf-printing .pf-print-cover { page-break-after: always; }
  body.pf-printing .pf-print-item + .pf-print-item { page-break-before: always; }

  /* 유튜브/3D/동영상 임베드는 종이에서 무의미 → 숨기고 링크만 노출. 이미지는 유지. */
  .yt-wrapper, .pf-embed iframe,
  .pf-gcell--yt .pf-gbox, .pf-gcell--model .pf-gbox, .pf-gcell--video .pf-gbox,
  .pf-embed-block [data-3d-pending], .pf-embed-block .mv-viewer { display: none !important; }
  .pf-embed-fallback { display: block !important; }
  .pf-mgrid { break-inside: avoid; gap: 0.5rem 1rem; }
  .pf-gcell figcaption { text-align: left; }
  .pf-lightbox { display: none !important; }

  /* 직접 Ctrl+P (버튼 안 거침): 현재 화면이라도 읽히게 */
  .pf-wrap { max-width: none; margin: 0; padding: 0; }
  .pf-card { break-inside: avoid; }
  a { color: #111 !important; text-decoration: none; }
  .pf-body pre, .pf-body table { break-inside: avoid; }
  :root { --surface: #fff; --bg: #fff; --border: #bbb; --text: #111; --text-muted: #555; --code-bg: #f3f3f3; }
}
