/* ===================================================================
   포트폴리오 v3 — Simple / Airy
   모노 + 블루 포인트 하나. 박스·테두리 최소, 얇은 가로선과 여백으로 구분.
   라이트 기본 + html[data-theme="dark"] 토글. HTML/JS 구조는 v1·v2와 동일.
   참고: 크래프톤 Studios·News 섹션(큰 제목 · 가로선 · 여백)
   =================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
*, *::before, *::after { transition: background-color .2s ease, border-color .2s ease, color .2s ease; }

:root {
  --bg: #fafaf8;
  --bg-alt: #f2f2ee;
  --ink: #111111;
  --ink-dim: #4b4b48;
  --ink-faint: #8c8c87;
  --rule: #e2e2dd;
  --rule-strong: #c4c4bd;
  --surface: #ffffff;
  --accent: #4f6bff;
  --accent-ink: #ffffff;
  --header-bg: rgba(250, 250, 248, 0.86);
  --maxw: 1120px;
  --gutter: clamp(22px, 6vw, 80px);
  --radius: 6px;
  --font-display: "Paperlogy", -apple-system, BlinkMacSystemFont, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --font-mono: var(--font-display);
}

html[data-theme="dark"] {
  --bg: #0a0a0b;
  --bg-alt: #121214;
  --ink: #f4f4f2;
  --ink-dim: #b5b5b0;
  --ink-faint: #7b7b77;
  --rule: #26262a;
  --rule-strong: #3d3d42;
  --surface: #141416;
  --accent: #8ca0ff;
  --accent-ink: #0a0a0b;
  --header-bg: rgba(10, 10, 11, 0.84);
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--accent-ink); }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: var(--header-bg);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.logo { display: inline-flex; align-items: center; gap: 5px; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; }
.logo-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); display: block; font-size: 0; margin-top: 3px;
}
.header-actions { display: flex; align-items: center; gap: clamp(18px, 3vw, 44px); }
.nav { display: flex; gap: clamp(16px, 2.6vw, 36px); }
.nav a {
  font-size: 0.95rem; font-weight: 500;
  color: var(--ink-dim);
  padding: 6px 0;
}
.nav a:hover { color: var(--ink); }
.nav a em { font-style: normal; font-size: 0.78em; font-weight: 600; color: var(--accent); margin-right: 6px; }

.theme-toggle-wrap { position: relative; display: flex; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--rule-strong); color: var(--ink-dim);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 17px; height: 17px; display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

.theme-hint {
  position: absolute; top: calc(100% + 12px); right: 0;
  width: 220px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--ink); color: var(--bg);
  font-size: 0.85rem; line-height: 1.5;
  opacity: 0; transform: translateY(-4px); pointer-events: none;
}
.theme-hint.show { opacity: 1; transform: none; pointer-events: auto; }
.theme-hint-close {
  position: absolute; top: 6px; right: 10px;
  background: none; border: none; color: inherit; cursor: pointer; font-size: 0.9rem;
}

.nav-toggle { display: none; width: 38px; height: 38px; border-radius: 50%; background: none; border: 1px solid var(--rule-strong); cursor: pointer; padding: 10px; }
.nav-toggle span { display: block; height: 1.5px; background: var(--ink); margin: 3px 0; transition: transform .2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }

/* 세로 사이드 텍스트는 쓰지 않음 */
.rail-label { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: clamp(72px, 16vh, 168px);
  padding-bottom: clamp(64px, 12vh, 140px);
}
.hero-inner { display: block; }
.hero-copy { max-width: none; }
.hero .eyebrow, .eyebrow {
  font-size: 0.95rem; font-weight: 600;
  color: var(--accent);
  margin-bottom: clamp(20px, 3vw, 32px);
  display: inline-block;
}
.hero h1 {
  font-size: clamp(2.5rem, 6.6vw, 5.2rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--ink);
  max-width: 14em;
}
.hero h1 .accent-text { color: var(--accent); }
.hero-desc {
  margin-top: clamp(28px, 4vw, 44px);
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
  line-height: 1.85;
  color: var(--ink-dim);
  max-width: 36em;
}
.hero-actions { margin-top: clamp(32px, 5vw, 52px); display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.95rem; font-weight: 600;
  padding: 14px 26px; border-radius: 999px;
  border: 1px solid var(--ink);
}
.btn .arrow { font-size: 0; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-top: 1.5px solid currentColor; transform: rotate(45deg); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: none; color: var(--ink); border-color: var(--rule-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Stat row ---------- */
.stat-row {
  list-style: none;
  margin-top: clamp(64px, 10vw, 120px);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 5vw, 64px);
  border-top: 1px solid var(--rule-strong);
  padding-top: clamp(28px, 4vw, 44px);
  max-width: 640px;
}
.stat-num {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1;
  display: flex; align-items: baseline; gap: 2px;
}
.stat-num b { color: var(--accent); font-weight: 800; }
.stat-num small { font-size: 0.9rem; font-weight: 600; color: var(--ink-faint); margin-right: 8px; letter-spacing: 0; }
.stat-num i { font-style: normal; font-size: 0.5em; color: var(--ink-faint); }
.stat-label { display: block; margin-top: 14px; font-size: 0.95rem; color: var(--ink-dim); }

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding-top: clamp(64px, 10vh, 120px);
  padding-bottom: clamp(64px, 10vh, 120px);
}
.section-alt { background: var(--bg-alt); }
.section-title {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.1;
  margin-bottom: clamp(44px, 7vw, 88px);
  display: flex; align-items: baseline; gap: 14px;
}
.section-title .num {
  font-size: 0.95rem; font-weight: 600; letter-spacing: 0;
  color: var(--accent);
  align-self: flex-start; margin-top: 0.6em;
}

/* ---------- About ---------- */
.about-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(36px, 5vw, 64px);
}
.about-card { border-top: 1px solid var(--rule-strong); padding-top: 28px; }
.about-index { display: none; }
.about-card h3 {
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.35;
  margin-bottom: 18px;
}
.about-card p { color: var(--ink-dim); font-size: 1rem; line-height: 1.85; margin-bottom: 14px; }
.about-card p:last-child { margin-bottom: 0; }
.about-card strong { color: var(--ink); font-weight: 700; }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(32px, 4vw, 56px);
}
.skill-group { border-top: 1px solid var(--rule-strong); padding-top: 22px; }
.skill-group h3 {
  font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em;
  margin-bottom: 18px;
}
.tag-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.tag-list li { font-size: 0.98rem; color: var(--ink-dim); }

/* ---------- Career / Timeline ---------- */
.timeline { list-style: none; }
.timeline-item {
  display: grid; grid-template-columns: 200px 1fr; gap: clamp(16px, 3vw, 56px);
  padding: clamp(30px, 4vw, 48px) 0;
  border-top: 1px solid var(--rule-strong);
}
.timeline-item:last-of-type { border-bottom: 1px solid var(--rule-strong); }
.timeline-period { font-size: 0.95rem; color: var(--ink-faint); }
.timeline-content h3 {
  font-size: clamp(1.2rem, 1.9vw, 1.5rem);
  font-weight: 800; letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.timeline-content p { color: var(--ink-dim); font-size: 1rem; line-height: 1.85; max-width: 38em; }
.career-note { margin-top: 28px; font-size: 0.9rem; color: var(--ink-faint); }

/* ---------- Projects ---------- */
.project {
  position: relative;
  padding-top: clamp(64px, 9vw, 120px);
  margin-top: clamp(64px, 9vw, 120px);
  border-top: 1px solid var(--rule-strong);
}
.project:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
.project-index { display: none; }
.project-header { max-width: 38em; margin-bottom: clamp(36px, 5vw, 64px); }
.project-tag {
  font-size: 0.9rem; font-weight: 600;
  color: var(--accent); margin-bottom: 16px;
}
.project-header h3 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.15;
  margin-bottom: 22px;
}
.project-summary { color: var(--ink-dim); font-size: 1.08rem; line-height: 1.8; margin-bottom: 22px; }
.project-role {
  padding: 0;
  font-size: 1rem; line-height: 1.8; color: var(--ink-dim);
}
.project-role-label {
  display: block; font-size: 0.85rem; font-weight: 700;
  color: var(--ink-faint); margin-bottom: 6px;
}

.project-body-topics { display: flex; flex-direction: column; }
.project-block { margin-top: 36px; }

.project-topic {
  padding-top: clamp(32px, 4vw, 48px);
  margin-top: clamp(32px, 4vw, 48px);
  border-top: 1px solid var(--rule);
}
.project-body-topics > .project-topic:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.project-topic > h4 {
  font-size: clamp(1.25rem, 2.1vw, 1.65rem);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.3;
  margin-bottom: 20px;
}
.project-topic > p { color: var(--ink-dim); font-size: 1.02rem; line-height: 1.85; margin-bottom: 14px; max-width: 38em; }
.project-topic > p:last-child { margin-bottom: 0; }
.project-topic-empty { color: var(--ink-faint); }
.project-topic strong { color: var(--ink); font-weight: 700; }
.project-topic code, .data-table code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.86em;
  background: var(--bg-alt); border-radius: 4px; padding: 1px 6px;
}

/* 기획 의도: 테두리 없이 흐린 글씨 */
.topic-intent { margin: 22px 0; max-width: 38em; }
.topic-intent-label {
  display: block; font-size: 0.85rem; font-weight: 700;
  color: var(--accent); margin-bottom: 6px;
}
.topic-intent p { color: var(--ink-dim); font-size: 0.98rem; line-height: 1.8; margin: 0; }

/* 구조 요약 */
.topic-structure { margin: 22px 0; max-width: 38em; }
.topic-structure-label { font-size: 0.85rem; font-weight: 700; color: var(--ink-faint); margin-bottom: 10px; }
.topic-structure ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.topic-structure li { font-size: 0.97rem; line-height: 1.7; color: var(--ink-dim); padding-left: 16px; position: relative; }
.topic-structure li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 6px; height: 1.5px; background: var(--accent); }
.topic-structure li b { color: var(--ink); }
.topic-structure-note { margin-top: 10px; font-size: 0.88rem; color: var(--ink-faint); line-height: 1.7; }

/* 갤러리: 컬러 유지, 둥근 모서리 */
.project-gallery, .topic-gallery {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
  margin: 28px 0;
}
.topic-gallery-triple { grid-template-columns: repeat(3, 1fr); }
.topic-gallery-single { grid-template-columns: 1fr; }
.project-gallery img, .topic-gallery img {
  width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3;
  border-radius: var(--radius);
}
.project-gallery-feature { grid-template-columns: 1fr; }
.feature-shot img { aspect-ratio: 16 / 9; }

/* 데이터 테이블 (details) */
.data-tables { margin: 24px 0; }
.data-tables details { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--rule); }
.data-tables summary { cursor: pointer; padding: 14px 18px; font-size: 0.95rem; font-weight: 600; color: var(--ink-dim); }
.data-tables details[open] summary { border-bottom: 1px solid var(--rule); }
.data-block { padding: 18px; }
.data-block-label { font-weight: 700; font-size: 0.95rem; margin-bottom: 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.data-table th { font-size: 0.8rem; color: var(--ink-faint); font-weight: 600; }
.data-note { font-size: 0.85rem; color: var(--ink-faint); margin-top: 10px; line-height: 1.7; }

/* 상세 기획서 링크: 박스 대신 밑줄 행 */
.doc-link {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 24px; padding: 18px 40px 18px 0;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  max-width: 38em;
  position: relative;
}
.doc-link:hover { border-color: var(--accent); }
.doc-link-label { font-size: 0.85rem; font-weight: 700; color: var(--accent); }
.doc-link-title { font-size: 0.98rem; color: var(--ink); line-height: 1.55; }
.doc-link-arrow { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); }
.doc-link:hover .doc-link-arrow { color: var(--accent); }

/* 성과: 큰 숫자 하나 */
.project-result {
  margin-top: 28px;
  display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap;
  padding: 0;
  max-width: 38em;
}
.result-num {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  font-weight: 800; letter-spacing: -0.03em; color: var(--accent);
  white-space: nowrap;
}
.result-label { font-size: 0.95rem; color: var(--ink-dim); line-height: 1.55; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  padding-top: clamp(80px, 13vh, 160px);
  padding-bottom: clamp(48px, 6vh, 80px);
  background: var(--bg-alt);
}
.footer-inner { display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap; }
.footer-inner .eyebrow { color: var(--ink-faint); }
.footer-inner h2 {
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 800; letter-spacing: -0.035em; line-height: 1.1;
}
.contact-list { display: flex; flex-direction: column; min-width: 300px; }
.contact-item {
  display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 12px;
  padding: 18px 0; border-top: 1px solid var(--rule-strong);
}
.contact-item:last-child { border-bottom: 1px solid var(--rule-strong); }
.contact-item:hover { color: var(--accent); }
.contact-label { font-size: 0.85rem; font-weight: 600; color: var(--ink-faint); }
.contact-value { font-size: 1rem; }
.contact-item .arrow { font-size: 0; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-top: 1.5px solid currentColor; transform: rotate(45deg); }
.footer-bottom { margin-top: clamp(56px, 8vw, 104px); padding-top: 22px; border-top: 1px solid var(--rule-strong); }
.footer-bottom p { font-size: 0.85rem; color: var(--ink-faint); }

/* ---------- Doc peek (슬라이드인 패널) ---------- */
.doc-peek { position: fixed; inset: 0; z-index: 100; }
.doc-peek[hidden] { display: none; }
.doc-peek-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity .3s ease; }
.doc-peek.open .doc-peek-backdrop { opacity: 1; }
.doc-peek-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(760px, 94vw);
  background: var(--bg);
  border-left: 1px solid var(--rule-strong);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .32s cubic-bezier(.4, 0, .2, 1);
}
.doc-peek.open .doc-peek-panel { transform: none; }
.doc-peek-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--rule); }
.doc-peek-eyebrow { font-size: 0.8rem; font-weight: 700; color: var(--accent); }
.doc-peek-title { flex: 1; font-size: 0.95rem; font-weight: 700; }
.doc-peek-newtab, .doc-peek-close {
  background: none; border: 1px solid var(--rule-strong); color: var(--ink-dim); border-radius: 50%;
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.9rem;
}
.doc-peek-newtab::after { content: "↗"; }
.doc-peek-close::after { content: "✕"; }
.doc-peek-newtab:hover, .doc-peek-close:hover { color: var(--accent); border-color: var(--accent); }
.doc-peek-body { flex: 1; overflow: hidden; }
.doc-peek-frame { width: 100%; height: 100%; border: 0; background: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .header-inner { height: 64px; }
  .nav {
    position: absolute; top: 64px; right: 0; left: 0;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--rule);
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .nav.open { max-height: 340px; }
  .nav a { padding: 16px var(--gutter); border-top: 1px solid var(--rule); }
  .nav-toggle { display: block; }
  .stat-row { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
  .project-gallery, .topic-gallery, .topic-gallery-triple { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  .skills-grid { grid-template-columns: 1fr; }
  .project-gallery, .topic-gallery, .topic-gallery-triple { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
  .contact-list { min-width: 0; }
}

/* ---------- Print (슬라이드 PDF는 이후 단계에서 별도 설계) ---------- */
@media print {
  .site-header, .nav-toggle, .theme-toggle-wrap, .doc-peek, .hero-actions { display: none !important; }
  * { box-shadow: none !important; }
}

/* ===================================================================
   v3 레이아웃 (2026-10-14 2차) — 히어로 비주얼, 슬라이드형 토픽
   =================================================================== */

/* 히어로: 글 왼쪽 + 게임 화면 3장 오른쪽 */
.hero-inner {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(36px, 5vw, 80px); align-items: center;
}
.hero--typo .hero-inner { display: block; }
.hero h1 { font-size: clamp(2.3rem, 4.4vw, 4rem); max-width: none; }
.hero-visual { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hero-chip { border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--bg-alt); }
.hero-chip.chip-1 { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
.hero-chip img { width: 100%; height: 100%; object-fit: cover; }

/* 수치 3칸 */
.stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; }

/* 소개 2×2 */
.about-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* 토픽: 사진이 있으면 글 왼쪽 · 사진 오른쪽 (슬라이드 한 장 느낌) */
.project-topic:has(> .topic-gallery) {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: clamp(32px, 5vw, 64px); align-items: start;
}
.project-topic:has(> .topic-gallery) > * { grid-column: 1; }
.project-topic > .topic-gallery { grid-column: 2; grid-row: 1 / span 8; margin: 0; align-self: center; }
.project-topic > p { font-size: 1.1rem; color: var(--ink); }
.topic-gallery-triple { grid-template-columns: repeat(3, 1fr); }
.topic-gallery-triple img { aspect-ratio: 9 / 16; }

/* BUDDY LAND: 대표 사진 1장 + 2장, 블록 3열 */
.project-gallery-feature { grid-template-columns: repeat(2, 1fr); }
.project-gallery-feature img { aspect-ratio: 16 / 10; }
.project-gallery-feature img.feature-shot { grid-column: 1 / -1; aspect-ratio: 16 / 8; }
.project-body:not(.project-body-topics) {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 48px);
}
.project-body:not(.project-body-topics) > .project-block { margin-top: 0; border-top: 1px solid var(--rule-strong); padding-top: 20px; }
.project-block h4 { font-size: 1.15rem; font-weight: 800; margin-bottom: 10px; }
.project-block p { color: var(--ink-dim); font-size: 0.98rem; line-height: 1.8; }
.project-body:not(.project-body-topics) > .project-result,
.project-body:not(.project-body-topics) > .data-block { grid-column: 1 / -1; }

@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
  .project-topic:has(> .topic-gallery) { display: flex; flex-direction: column; }
  .project-topic > .topic-gallery { margin: 24px 0; }
  .project-body:not(.project-body-topics) { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* 토픽 안 읽는 순서 (2026-10-14 3차): 제목 → 한 줄 → 성과 수치 → (모바일: 사진) → 핵심 불릿 → 상세 기획서 */
.project-topic { display: flex; flex-direction: column; }
.project-topic > h4 { order: 1; }
.project-topic > p { order: 2; }
.project-topic > .project-result { order: 3; margin: 6px 0 4px; }
.project-topic > .topic-gallery { order: 4; }
.project-topic > .topic-structure,
.project-topic > .topic-intent { order: 5; }
.project-topic > .doc-link { order: 6; }
.project-topic > .data-block { order: 7; }
.project-topic:has(> .topic-gallery) { display: grid; }
@media (max-width: 960px) {
  .project-topic:has(> .topic-gallery) { display: flex; }
}

/* 사진 없는 히어로(타이포만): 제목 다시 크게 */
.hero--typo h1 { font-size: clamp(2.5rem, 6vw, 5.2rem); max-width: 14em; }

/* 히어로 제목: 강조 부분은 항상 다음 줄 */
.hero--typo h1 .accent-text { display: block; }

/* 히어로: 이름을 크게 + 그 아래 정체성 한 줄 (2026-10-14) */
.hero--typo h1 { font-size: clamp(4.2rem, 13vw, 10rem); line-height: 1; letter-spacing: -0.05em; }
.hero--typo h1 .accent-text { display: inline; }
.hero-desc strong {
  display: block; margin-bottom: 16px;
  font-size: clamp(1.45rem, 2.6vw, 2.2rem); font-weight: 800; line-height: 1.35; letter-spacing: -0.025em;
  color: var(--ink);
}

/* 히어로 정체성 태그 */
.hero-desc strong { margin-bottom: 0; }
.hero-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.hero-tags li {
  font-size: 0.95rem; font-weight: 600; color: var(--ink-dim);
  padding: 7px 16px; border: 1px solid var(--rule-strong); border-radius: 999px;
}

/* 정체성 문구 안 강조 */
.hero-desc strong em { font-style: normal; color: var(--accent); }

/* 소개 3장 → 3열 (2026-10-14) */
.about-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .about-grid { grid-template-columns: 1fr; } }

/* 소개: 세로 펼침 목록 (aboutStyle: accordion) */
.about-grid--acc { display: block; }
.about-acc { border-top: 1px solid var(--rule-strong); padding-top: 0; }
.about-acc:last-child { border-bottom: 1px solid var(--rule-strong); }
.about-acc summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: clamp(24px, 3vw, 34px) 0;
}
.about-acc summary::-webkit-details-marker { display: none; }
.about-acc summary h3 { margin: 0; font-size: clamp(1.3rem, 2.4vw, 1.9rem); }
.about-acc summary:hover h3 { color: var(--accent); }
.about-acc-icon { position: relative; flex: 0 0 auto; width: 22px; height: 22px; transition: transform .25s ease; }
.about-acc-icon::before, .about-acc-icon::after {
  content: ""; position: absolute; left: 50%; top: 50%; background: var(--ink-dim);
  width: 18px; height: 2px; transform: translate(-50%, -50%);
}
.about-acc-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.about-acc[open] .about-acc-icon { transform: rotate(45deg); }
.about-acc[open] .about-acc-icon::before, .about-acc[open] .about-acc-icon::after { background: var(--accent); }
.about-acc-body { padding: 0 0 clamp(28px, 3.5vw, 40px); max-width: 46em; }
.about-acc-body p { font-size: 1.02rem; }

/* 줄바꿈 다듬기: 제목은 줄 길이 균형, 본문은 마지막 줄 한 단어 방지. 좁은 화면에선 강제 줄바꿈 해제 */
.about-acc summary h3, .project-header h3, .project-topic > h4, .section-title { text-wrap: balance; }
.about-acc-body p, .project-topic > p, .topic-structure li, .timeline-content p { text-wrap: pretty; }
@media (max-width: 860px) { .about-acc-body br { display: none; } }

/* 경력 상세 (careerDetail): 총 경력 · 기간 개월 수 · 대표 이미지 · 프로젝트 링크 */
.section-meta { margin-left: 18px; align-self: center; font-size: 1rem; font-weight: 600; letter-spacing: 0; color: var(--accent); }
.timeline-item--detail { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
.timeline-thumb { display: block; border-radius: var(--radius); overflow: hidden; }
.timeline-thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .3s ease; }
.timeline-thumb:hover img { transform: scale(1.03); }
.timeline-item--detail .timeline-period { display: block; margin-bottom: 8px; }
.timeline-period em { font-style: normal; font-weight: 600; color: var(--accent); margin-left: 10px; }
.timeline-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 0.95rem; font-weight: 600; color: var(--ink); }
.timeline-link:hover { color: var(--accent); }
.timeline-link .arrow { font-size: 0; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-top: 1.5px solid currentColor; transform: rotate(45deg); }
@media (max-width: 860px) {
  .timeline-item--detail { grid-template-columns: 1fr; gap: 18px; }
}

/* ===== 프로젝트 가독성 개선 (2026-10-14) ===== */
:root { --card: #ffffff; }
html[data-theme="dark"] { --card: #17171a; }

/* 프로젝트 = 카드 + 번호 → 게임 단위 구분 */
.project, .project:first-of-type {
  background: var(--card); border: 1px solid var(--rule); border-radius: 20px;
  padding: clamp(26px, 4.5vw, 64px);
}
.project { margin-top: clamp(28px, 4vw, 48px); }
.project:first-of-type { margin-top: 0; }
.project-index { display: block; margin-bottom: 14px; font-size: 0.9rem; font-weight: 700; color: var(--accent); -webkit-text-stroke: 0; }
.project-index::before { content: "PROJECT "; }
.project-header { max-width: none; }
.project-header h3 { margin-bottom: 0; }

/* 정보 줄: 기간 · 역할 · 장르 */
.project-meta {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 32px;
  margin: 24px 0 20px; padding: 18px 0;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.project-meta dt { font-size: 0.8rem; font-weight: 600; color: var(--ink-faint); margin-bottom: 4px; }
.project-meta dd { font-size: 0.98rem; font-weight: 600; color: var(--ink); line-height: 1.5; }
.project-summary { color: var(--ink); margin-bottom: 0; }

/* 토픽: 문제 → 한 일 → 결과 */
.project-topic > h4 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
.project-topic > .topic-pdr { order: 2; }
.topic-pdr { display: flex; flex-direction: column; gap: 18px; margin: 4px 0 0; }
.pdr-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; }
.pdr-row dt { padding-top: 3px; font-size: 0.85rem; font-weight: 700; color: var(--accent); }
.pdr-row dd p, .pdr-row dd li { font-size: 1.02rem; line-height: 1.75; color: var(--ink); text-wrap: pretty; }
.pdr-row dd ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.pdr-row dd li { position: relative; padding-left: 14px; }
.pdr-row dd li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-faint); }
.pdr-result b { display: block; font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 800; color: var(--accent); line-height: 1.3; }
.pdr-result span { display: block; margin-top: 4px; font-size: 0.92rem; color: var(--ink-dim); }

/* 상세 기획서: 잘 보이는 버튼 */
.doc-link, .project-topic > .doc-link {
  display: inline-flex; flex-direction: row; align-items: center; gap: 8px;
  align-self: flex-start; justify-self: start; width: auto; max-width: none;
  margin-top: 24px; padding: 12px 20px; position: static;
  border: 1.5px solid var(--accent); border-radius: 999px; background: transparent;
}
.doc-link-title { display: none; }
.doc-link-label { font-size: 0.95rem; font-weight: 700; color: var(--accent); }
.doc-link-label::after { content: " 보기"; }
.doc-link-arrow { position: static; transform: none; font-style: normal; color: var(--accent); }
.doc-link:hover { background: var(--accent); border-color: var(--accent); }
.doc-link:hover .doc-link-label, .doc-link:hover .doc-link-arrow { color: var(--accent-ink); }

/* 드로어 버튼 아이콘 중복 제거 (글자 아이콘만 사용) */
.doc-peek-newtab::after, .doc-peek-close::after { content: none; }
.doc-peek-newtab, .doc-peek-close { font-size: 1rem; line-height: 1; }

@media (max-width: 860px) {
  .project-meta { grid-template-columns: 1fr; gap: 12px; }
  .pdr-row { grid-template-columns: 1fr; gap: 6px; }
}

/* ===== 토픽: 한 문장 요약 + 근거 불릿 (2026-10-14 2차) ===== */
.project-tag { display: none; }   /* 정보 줄과 중복 */
.project.project .project-topic.project-topic--lead {
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  column-gap: clamp(28px, 4vw, 56px); align-items: start;
}
.project-topic--lead:not(:has(> .topic-gallery)) { grid-template-columns: minmax(0, 1fr) !important; }
.project-topic--lead > .topic-text { grid-column: 1; grid-row: 1; order: 0; }
.project-topic--lead > .topic-gallery { grid-column: 2; grid-row: 1; align-self: start; margin: 4px 0 0; order: 0; }
.topic-text h4 { font-size: clamp(1.3rem, 2.1vw, 1.6rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; margin-bottom: 14px; text-wrap: balance; }
.topic-lead { font-size: clamp(1.06rem, 1.35vw, 1.18rem); font-weight: 600; line-height: 1.7; color: var(--ink); margin-bottom: 16px; text-wrap: pretty; }
.topic-lead b { color: var(--accent); font-weight: 800; }
.topic-points { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.topic-points li { position: relative; padding-left: 14px; font-size: 0.98rem; line-height: 1.7; color: var(--ink-dim); text-wrap: pretty; }
.topic-points li::before { content: ""; position: absolute; left: 0; top: 0.78em; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-faint); }
.topic-doc { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; font-size: 0.92rem; font-weight: 700; color: var(--accent); border-bottom: 1px solid transparent; }
.topic-doc i { font-style: normal; transition: transform .2s ease; }
.topic-doc:hover { border-bottom-color: var(--accent); }
.topic-doc:hover i { transform: translateX(3px); }
@media (max-width: 960px) {
  .project.project .project-topic.project-topic--lead { display: flex; flex-direction: column; }
  .project-topic--lead > .topic-gallery { margin: 20px 0 0; }
}

/* ===== 가독성 3차 (2026-10-14): 머리 압축 · 강조 한 곳 · 간격 리듬 ===== */
.project-header { display: flex; flex-direction: column; margin-bottom: clamp(8px, 1vw, 12px); padding-bottom: clamp(28px, 3.5vw, 40px); border-bottom: 1px solid var(--rule); }
.project-index { order: 0; margin-bottom: 10px; }
.project-header h3 { order: 1; }
.project-summary { order: 2; margin: 12px 0 0; font-size: 1.04rem; color: var(--ink-dim); }
.project-meta { order: 3; display: flex; flex-wrap: wrap; align-items: center; margin: 10px 0 0; padding: 0; border: 0; }
.project-meta > div { display: flex; }
.project-meta > div + div::before { content: "·"; margin: 0 10px; color: var(--ink-faint); }
.project-meta dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.project-meta dd { margin: 0; font-size: 0.92rem; font-weight: 500; color: var(--ink-faint); }

.project.project .project-topic.project-topic--lead { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.project-topic--lead { padding-top: clamp(36px, 4.5vw, 56px); margin-top: clamp(36px, 4.5vw, 56px); }
.project-body-topics > .project-topic--lead:first-child { padding-top: clamp(28px, 3.5vw, 40px); margin-top: 0; }
.topic-text h4 { margin-bottom: 18px; }
.topic-lead { font-weight: 400; font-size: clamp(1.05rem, 1.3vw, 1.14rem); line-height: 1.75; margin-bottom: 20px; }
.topic-lead b { font-weight: 700; }
.topic-points { gap: 10px; }
.topic-points li { font-size: 0.98rem; font-weight: 500; color: var(--ink); opacity: 0.78; }
.topic-doc { margin-top: 20px; }

/* 정보 한 줄 정리: 이전 3칸 배치 간격 제거, 모바일은 세로 나열 */
.project-meta { gap: 0; }
.project-meta > div { align-items: baseline; }
.project-meta > div + div::before { font-size: 0.92rem; }
@media (max-width: 860px) {
  .project-meta { flex-direction: column; align-items: flex-start; gap: 2px; }
  .project-meta > div + div::before { content: none; }
}

/* ===== 사진 원본 비율 · CRM 캡션 · 프로젝트 대표 이미지 (2026-10-14) ===== */
.project .project-gallery img, .project .topic-gallery img { aspect-ratio: auto; height: auto; object-fit: contain; }
.project .topic-gallery-single { display: flex; justify-content: center; align-items: center; background: var(--bg-alt); border-radius: var(--radius); overflow: hidden; }
.project .topic-gallery-single img { width: auto; max-width: 100%; max-height: 440px; border-radius: 0; }
.project .topic-gallery-triple { gap: 10px; align-items: start; }
.project .topic-gallery-triple img { width: 100%; aspect-ratio: 9 / 16; object-fit: contain; background: var(--bg-alt); }
.topic-figure { margin: 0; }
.topic-figure figcaption { margin-top: 8px; font-size: 0.82rem; font-weight: 600; color: var(--ink-dim); text-align: center; }
.project .project-gallery-feature { align-items: start; }
.project .project-gallery-feature img, .project .project-gallery-feature img.feature-shot { aspect-ratio: auto; height: auto; }

.project-header--cover { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); column-gap: clamp(28px, 4vw, 56px); align-items: center; }
.project-header-text { display: flex; flex-direction: column; }
.project-cover { margin: 0; border-radius: var(--radius); overflow: hidden; }
.project-cover img { width: 100%; height: auto; display: block; }
@media (max-width: 960px) {
  .project-header--cover { display: block; }
  .project-cover { margin-top: 22px; }
}

/* 대표 이미지가 있는 머리: 정보 줄 세로 나열 (좁은 칸에서 점이 줄 앞에 오는 것 방지) */
.project-header--cover .project-meta { flex-direction: column; align-items: flex-start; gap: 2px; }
.project-header--cover .project-meta > div + div::before { content: none; }

/* ===== 사진 확대 보기 (galleryMode: expand) ===== */
.topic-gallery-expand { display: block; }
.gallery-open { display: block; position: relative; width: 100%; padding: 0; border: 0; background: var(--bg-alt); border-radius: var(--radius); overflow: hidden; cursor: zoom-in; }
.project .gallery-open img { display: block; margin: 0 auto; width: auto; max-width: 100%; max-height: 440px; }
.gallery-open-badge { position: absolute; left: 12px; bottom: 12px; padding: 6px 12px; border-radius: 999px; background: rgba(17, 17, 17, 0.8); color: #fff; font-size: 0.82rem; font-weight: 600; }
.gallery-open:hover .gallery-open-badge { background: var(--accent); }
.gallery-lightbox { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; }
.gallery-lightbox[hidden] { display: none; }
.gallery-lightbox-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.72); }
.gallery-lightbox-panel { position: relative; width: min(1100px, 94vw); max-height: 90vh; overflow: auto; background: var(--bg); border-radius: 16px; padding: clamp(20px, 3vw, 36px); }
.gallery-lightbox-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--rule-strong); background: var(--bg); color: var(--ink); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.gallery-lightbox-close:hover { color: var(--accent); border-color: var(--accent); }
.gallery-lightbox-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.project .gallery-lightbox-grid img { width: 100%; height: auto; max-height: 70vh; object-fit: contain; background: var(--bg-alt); border-radius: var(--radius); }
@media (max-width: 860px) { .gallery-lightbox-grid { grid-template-columns: 1fr; } }

/* ===== 토픽 사진 규격 통일: 모두 3:4 틀 + 가운데 정렬 (2026-10-14) ===== */
.project .topic-gallery-single, .project .gallery-open {
  aspect-ratio: 3 / 4; display: flex; align-items: center; justify-content: center;
  background: var(--bg-alt); border-radius: var(--radius); overflow: hidden;
}
.project .topic-gallery-single img, .project .gallery-open img { width: 100%; height: 100%; max-height: none; object-fit: contain; }
.project-topic--lead > .topic-gallery { align-self: center; margin: 0; }
@media (max-width: 960px) {
  .project .topic-gallery-single, .project .gallery-open { width: min(100%, 360px); margin: 0 auto; }
  .project-topic--lead > .topic-gallery { margin-top: 20px; }
}

/* SUPERSTAR는 가로 화면 게임 → 같은 규격을 16:10 틀로 (세로 게임 복싱스타는 3:4) */
#project-smtown-crm .topic-gallery-single, #project-smtown-crm .gallery-open { aspect-ratio: 16 / 10; }
@media (max-width: 960px) { #project-smtown-crm .topic-gallery-single, #project-smtown-crm .gallery-open { width: 100%; } }

/* CRM 확대 보기: 3장 같은 9:16 틀 */
.project .gallery-lightbox-grid img { width: 100%; height: auto; max-height: none; aspect-ratio: 9 / 16; object-fit: contain; }
.gallery-lightbox-grid figcaption { font-size: 0.95rem; }

/* 상세 기획서: 연한 배경의 사각 태그 (눈에 띄되 차분하게) */
:root { --accent-soft: #eef1ff; }
html[data-theme="dark"] { --accent-soft: rgba(140, 160, 255, 0.14); }
.topic-doc {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 22px; padding: 10px 16px;
  background: var(--accent-soft); border: 0; border-radius: 8px;
  font-size: 0.95rem; font-weight: 700; color: var(--accent);
}
.topic-doc-icon { width: 17px; height: 17px; flex: 0 0 auto; }
.topic-doc:hover { background: var(--accent); color: var(--accent-ink); border-bottom-color: transparent; }

/* 사진 규격: 복싱스타 9:16 (PvP·출석은 9:16로 잘라 맞춤, 메가펀치 원본 9:16), SUPERSTAR 970:554 (조건부 팝업을 웹스토어 비율로 잘라 맞춤) */
#project-boxingstar .topic-gallery-single, #project-boxingstar .gallery-open { aspect-ratio: 9 / 16; }
#project-smtown-crm .topic-gallery-single, #project-smtown-crm .gallery-open { aspect-ratio: 970 / 554; }
@media (max-width: 960px) { #project-boxingstar .topic-gallery-single, #project-boxingstar .gallery-open { width: min(100%, 320px); } }

/* BUDDY LAND: PC 가로 화면 → 16:9 틀 */
#project-buddyland .topic-gallery-single { aspect-ratio: 16 / 9; background: #111; }
@media (max-width: 960px) { #project-buddyland .topic-gallery-single { width: 100%; } }

/* ===== BUDDY LAND 전용 레이아웃: 어두운 쇼케이스 카드 (2026-10-14) ===== */
#project-buddyland {
  --card: #121214; --ink: #f4f4f2; --ink-dim: #b9b9b4; --ink-faint: #85857f;
  --rule: #26262b; --rule-strong: #3a3a40; --accent: #8ca0ff; --accent-ink: #0a0a0b;
  --bg-alt: #1b1b1f; --accent-soft: rgba(140, 160, 255, 0.14);
  background: var(--card); border-color: #26262b; color: var(--ink);
}
/* 머리: 글 위, 타이틀 화면 아래로 크게 */
#project-buddyland .project-header--cover { display: flex; flex-direction: column; }
#project-buddyland .project-cover { order: 9; margin-top: clamp(24px, 3vw, 36px); }
#project-buddyland .project-header--cover .project-meta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0; }
#project-buddyland .project-header--cover .project-meta > div + div::before { content: "·"; }
/* 토픽: PM은 넓은 한 줄, 나머지 3개는 사진 위 3열 카드 */
#project-buddyland .project-body-topics {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 3.5vw, 44px) clamp(20px, 2.5vw, 32px);
  padding-top: clamp(28px, 3.5vw, 40px);
}
#project-buddyland .project-topic.project-topic--lead {
  display: flex; flex-direction: column; margin: 0; padding: 0; border-top: 0;
}
#project-buddyland .project-topic--lead:first-child { grid-column: 1 / -1; padding-bottom: clamp(24px, 3vw, 36px); border-bottom: 1px solid var(--rule); }
#project-buddyland .project-topic--lead:first-child .topic-lead { font-size: clamp(1.1rem, 1.5vw, 1.25rem); }
#project-buddyland .project-topic--lead > .topic-gallery { order: -1; margin: 0 0 18px; }
#project-buddyland .topic-gallery-single { aspect-ratio: 16 / 9; width: 100%; }
#project-buddyland .topic-gallery-single img { object-fit: cover; }
#project-buddyland .topic-text h4 { font-size: 1.2rem; margin-bottom: 10px; }
#project-buddyland .project-topic--lead:not(:first-child) .topic-lead { font-size: 1rem; margin-bottom: 12px; }
#project-buddyland .topic-points li { font-size: 0.92rem; }
@media (max-width: 960px) {
  #project-buddyland .project-body-topics { grid-template-columns: 1fr; }
  #project-buddyland .project-topic.project-topic--lead { display: flex; }
}

#project-buddyland .project-header--cover { align-items: stretch; }

@media (max-width: 860px) { #project-buddyland .project-header--cover .project-meta { flex-direction: column; align-items: flex-start; gap: 2px; } #project-buddyland .project-header--cover .project-meta > div + div::before { content: none; } }

/* ===== BUDDY LAND 2차: 카드 한 줄에 하나씩 크게 (사진 왼쪽 · 글 오른쪽) ===== */
#project-buddyland .project-body-topics { grid-template-columns: 1fr; gap: clamp(32px, 4vw, 52px); }
#project-buddyland .project-topic.project-topic--lead:not(:first-child) {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  column-gap: clamp(24px, 3.5vw, 48px); align-items: center;
}
#project-buddyland .project-topic--lead:not(:first-child) > .topic-gallery { grid-column: 1; grid-row: 1; order: 0; margin: 0; }
#project-buddyland .project-topic--lead:not(:first-child) > .topic-text { grid-column: 2; grid-row: 1; }
#project-buddyland .project-topic--lead:not(:first-child) .topic-lead { font-size: 1.05rem; }
#project-buddyland .topic-text h4 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
/* 표지 사진: 원본 비율 그대로 크게 */
#project-buddyland .gallery-open, #project-buddyland .topic-gallery-single { aspect-ratio: auto; background: #000; }
#project-buddyland .gallery-open img, #project-buddyland .topic-gallery-single img { width: 100%; height: auto; max-height: none; object-fit: contain; }
/* 펼쳐 보기: 가로 기획서는 한 장씩 크게 */
#project-buddyland .gallery-lightbox-grid { grid-template-columns: 1fr; gap: 28px; }
#project-buddyland .gallery-lightbox-grid img { aspect-ratio: auto; max-height: none; background: #000; }
#project-buddyland .gallery-lightbox-panel { width: min(1200px, 94vw); background: #121214; }
#project-buddyland .gallery-lightbox-panel figcaption { color: #b9b9b4; }
#project-buddyland .gallery-lightbox-close { background: #1b1b1f; color: #f4f4f2; border-color: #3a3a40; }
@media (max-width: 960px) {
  #project-buddyland .project-topic.project-topic--lead:not(:first-child) { display: flex; flex-direction: column; }
  #project-buddyland .project-topic--lead:not(:first-child) > .topic-gallery { order: -1; margin-bottom: 18px; }
}

/* ===== BUDDY LAND 3차: 글 위 · 사진 아래, 사진 2:1 통일 ===== */
#project-buddyland .project-topic.project-topic--lead:not(:first-child) { display: flex; flex-direction: column; }
#project-buddyland .project-topic--lead:not(:first-child) > .topic-text { order: 0; }
#project-buddyland .project-topic--lead:not(:first-child) > .topic-gallery { order: 1; margin: 22px 0 0; width: 100%; }
#project-buddyland .project-topic--lead:not(:first-child) .topic-text { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); column-gap: clamp(24px, 3.5vw, 48px); align-items: start; }
#project-buddyland .project-topic--lead:not(:first-child) .topic-text h4 { grid-column: 1 / -1; }
#project-buddyland .project-topic--lead:not(:first-child) .topic-lead { grid-column: 1; margin-bottom: 0; }
#project-buddyland .project-topic--lead:not(:first-child) .topic-points { grid-column: 2; }
#project-buddyland .gallery-open, #project-buddyland .topic-gallery-single { aspect-ratio: 2 / 1; width: 100%; }
#project-buddyland .gallery-open img, #project-buddyland .topic-gallery-single img { height: 100%; object-fit: cover; object-position: center; }
#project-buddyland img[alt*="바비 인형 보스"] { object-position: center top; }
@media (max-width: 860px) {
  #project-buddyland .project-topic--lead:not(:first-child) .topic-text { display: block; }
  #project-buddyland .project-topic--lead:not(:first-child) .topic-lead { margin-bottom: 14px; }
  #project-buddyland .project-topic--lead:not(:first-child) > .topic-gallery { order: 1; margin-top: 18px; }
}

/* ===== BUDDY LAND 4차: 글 한 영역(요약 → 불릿), 카드 사이 구분선, 연출 확대 보기 2열 ===== */
#project-buddyland .project-topic--lead:not(:first-child) .topic-text { display: block; }
#project-buddyland .project-topic--lead:not(:first-child) .topic-lead { margin-bottom: 14px; }
#project-buddyland .project-body-topics { gap: 0; }
#project-buddyland .project-topic.project-topic--lead:not(:first-child) { padding: clamp(32px, 4vw, 48px) 0; border-bottom: 1px solid var(--rule); }
#project-buddyland .project-topic.project-topic--lead:last-child { border-bottom: 0; padding-bottom: 0; }
#project-buddyland .project-topic--lead:first-child { border-bottom: 1px solid var(--rule); }
#project-buddyland .gallery-lightbox-grid--cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 860px) { #project-buddyland .gallery-lightbox-grid--cols2 { grid-template-columns: 1fr; } }

#project-buddyland .project-topic.project-topic--lead:not(:first-child) { align-items: stretch; }
#project-buddyland .gallery-lightbox-grid--cols2 img { aspect-ratio: 16 / 9; object-fit: cover; }

/* 프로젝트 타이틀 옆 배지 (project.badges) */
.project-title-row { order: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.project-title-row h3 { margin: 0; }
.project-badges { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.project-badge { padding: 7px 14px; border-radius: 999px; font-size: 0.92rem; font-weight: 700; line-height: 1; white-space: nowrap; }
.project-badge--award { background: var(--accent); color: var(--accent-ink); }
.project-badge--tool { border: 1.5px solid var(--rule-strong); color: var(--ink); }

.project-title-row > h3 { order: 0; }
.project-title-row > .project-badges { order: 1; }

/* 배지 글자 가운데 정렬: 높이 고정 + flex 가운데 */
.project-badge { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 16px; line-height: 1; box-sizing: border-box; }
.project-badges { align-items: center; }
.project-title-row { align-items: center; }
.project-title-row > h3 { line-height: 1.1; }

/* 배지 세로 정렬: 폰트 위아래 여백을 잘라 글자 실제 높이 기준으로 가운데 (지원 브라우저), 미지원 시 아래 여백 보정 */
.project-badge { height: auto; padding: 10px 16px; line-height: 1; }
@supports (text-box: trim-both cap alphabetic) {
  .project-badge { text-box: trim-both cap alphabetic; padding: 11px 16px; }
}
@supports not (text-box: trim-both cap alphabetic) {
  .project-badge { padding: 11px 16px 9px; }
}

/* 상세 기획서 드로어: 기획서 배경과 같은 톤 */
.doc-peek-frame { background: var(--bg); }

/* ===== SUPERSTAR: 글 5 : 사진 5 (가로 사진 키우기) ===== */
#project-smtown-crm .project-topic.project-topic--lead { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* ===== 슬라이드 확대 보기 (galleryMode: carousel) ===== */
.gallery-carousel { margin-top: 28px; }
.gallery-carousel-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; border-radius: 10px;
}
.gallery-carousel-track::-webkit-scrollbar { display: none; }
.gallery-carousel-track > .topic-figure { flex: 0 0 100%; scroll-snap-align: center; margin: 0; }
.project .gallery-carousel-track img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; background: var(--bg-alt); border-radius: 10px; }
.gallery-carousel-track figcaption { margin-top: 12px; font-size: 1rem; font-weight: 600; color: var(--ink-dim); text-align: center; }
.gallery-carousel-nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 16px; }
.gallery-carousel-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--rule-strong);
  background: var(--bg); color: var(--ink); font-size: 1.6rem; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding-bottom: 3px;
}
.gallery-carousel-btn:hover { border-color: var(--accent); color: var(--accent); }
.gallery-carousel-count { min-width: 60px; text-align: center; font-size: 0.95rem; font-weight: 600; color: var(--ink-dim); font-variant-numeric: tabular-nums; }

/* 슬라이드: 한 장만 정확히 보이게 (옆 장 비침 방지), 원본 비율 */
.gallery-carousel-track { scroll-behavior: auto; }
.gallery-carousel-track > .topic-figure { scroll-snap-align: start; overflow: hidden; }
.project .gallery-carousel-track img { aspect-ratio: 16 / 9; object-fit: cover; }

/* ===================================================================
   인터랙션 효과 (html[data-fx] 일 때만, 2026-10-14)
   =================================================================== */
/* 1. 스크롤 등장 */
html[data-fx] .fx-reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
html[data-fx] .fx-reveal.is-in { opacity: 1; transform: none; }

/* 3. 진행 바 + 현재 메뉴 */
.fx-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; transition: transform .1s linear; }
html[data-fx] .nav a { position: relative; }
html[data-fx] .nav a.is-active { color: var(--ink); }
html[data-fx] .nav a.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px; background: var(--accent); }

/* 4. 사진 호버 */
@media (hover: hover) and (pointer: fine) {
  html[data-fx] .topic-gallery-single img, html[data-fx] .gallery-open img { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
  html[data-fx] .topic-gallery-single:hover img, html[data-fx] .gallery-open:hover img { transform: scale(1.04); }
  html[data-fx] .gallery-open:hover .gallery-open-badge { background: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }
  html[data-fx] .gallery-open-badge { transition: background .2s ease, transform .2s ease; }
}

/* 5. 이름 글자 등장 */
html[data-fx] .fx-char { display: inline-block; opacity: 0; transform: translateY(0.45em); animation: fxChar .8s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes fxChar { to { opacity: 1; transform: none; } }

/* 6. 프로젝트 목차 (따라오는 가로 목차) */
.fx-toc {
  position: sticky; top: 84px; z-index: 20;
  display: flex; flex-wrap: wrap; gap: 8px; width: fit-content; max-width: 100%;
  margin: calc(-1 * clamp(20px, 3vw, 44px)) 0 clamp(24px, 3vw, 36px);
  padding: 6px; border-radius: 999px; border: 1px solid var(--rule);
  background: var(--header-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.fx-toc a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-size: 0.88rem; font-weight: 600; color: var(--ink-dim); white-space: nowrap; transition: background .2s ease, color .2s ease; }
.fx-toc a em { font-style: normal; font-size: 0.78rem; color: var(--accent); }
.fx-toc a:hover { color: var(--ink); }
.fx-toc a.is-active { background: var(--ink); color: var(--bg); }
.fx-toc a.is-active em { color: inherit; opacity: .7; }
@media (max-width: 860px) {
  .fx-toc { top: 72px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; border-radius: 14px; }
  .fx-toc::-webkit-scrollbar { display: none; }
  .fx-toc a { padding: 7px 11px; font-size: 0.8rem; }
}

/* 7. BUDDY LAND 손전등 */
#project-buddyland.fx-torch { background-image: radial-gradient(circle 340px at var(--mx, 50%) var(--my, 30%), rgba(255, 214, 150, 0), rgba(255, 214, 150, 0)); transition: background-image .3s ease; }
#project-buddyland.fx-torch.is-lit { background-image: radial-gradient(circle 340px at var(--mx, 50%) var(--my, 30%), rgba(255, 214, 150, 0.10), rgba(255, 214, 150, 0) 70%); }

/* 움직임 줄이기 · 인쇄: 효과 끄고 완성 상태 */
@media (prefers-reduced-motion: reduce) {
  html[data-fx] .fx-reveal, html[data-fx] .fx-char { opacity: 1 !important; transform: none !important; transition: none !important; animation: none !important; }
}
@media print {
  html[data-fx] .fx-reveal, html[data-fx] .fx-char { opacity: 1 !important; transform: none !important; animation: none !important; }
  .fx-progress, .fx-toc { display: none !important; }
}

/* 손전등 조금 더 밝고 크게 */
#project-buddyland.fx-torch.is-lit { background-image: radial-gradient(circle 420px at var(--mx, 50%) var(--my, 30%), rgba(255, 210, 140, 0.20), rgba(255, 210, 140, 0.06) 45%, rgba(255, 210, 140, 0) 72%); }

/* 연락처: 메뉴로 이동하면 화면 위쪽에 오도록 높이 확보 */
html[data-fx] .site-footer { min-height: calc(100vh - 72px); display: flex; flex-direction: column; justify-content: center; }
html[data-fx] .site-footer .footer-bottom { margin-top: auto; }
html { scroll-padding-top: 72px; }

/* BUDDY LAND 트레일러 */
.video-open { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #000; border-radius: var(--radius); overflow: hidden; cursor: pointer; }
.video-open img { width: 100%; height: auto; display: block; transition: transform .5s cubic-bezier(.2,.7,.2,1), opacity .3s ease; }
.video-play { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(255,255,255,0.92); box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: transform .25s ease, background .25s ease; }
.video-play::after { content: ""; position: absolute; left: 34px; top: 26px; border-left: 24px solid #111; border-top: 16px solid transparent; border-bottom: 16px solid transparent; }
.video-open-label { position: absolute; left: 16px; bottom: 16px; padding: 8px 14px; border-radius: 999px; background: rgba(17,17,17,.82); color: #fff; font-size: 0.9rem; font-weight: 700; }
.video-open:hover .video-play { transform: translate(-50%, -50%) scale(1.08); background: var(--accent); }
.video-open:hover .video-play::after { border-left-color: #fff; }
.video-open:hover img { opacity: .85; }
.video-lightbox-panel { width: min(1100px, 94vw); background: #0d0d0f; }
.video-frame { position: relative; margin-top: 28px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-caption { margin-top: 12px; text-align: center; font-size: 0.9rem; color: #b5b5b0; }
.video-caption a { color: #8ca0ff; font-weight: 700; margin-left: 6px; }
.video-lightbox .gallery-lightbox-close { background: #1b1b1f; color: #f4f4f2; border-color: #3a3a40; }
@media (max-width: 860px) { .video-play { width: 64px; height: 64px; } .video-play::after { left: 26px; top: 19px; border-left-width: 18px; border-top-width: 13px; border-bottom-width: 13px; } }

.video-open-label { background: var(--accent); color: var(--accent-ink); }
