/* ============================================================
   VARIABLES
   ============================================================ */
:root {
  --bg:       #0a0a0a;
  --bg2:      #161616;
  --bg3:      #1f1f1f;
  --fg:       #f0ece4;
  --fg2:      #8a8278;
  --fg3:      #4a4642;
  --accent:   #c8a96e;       /* 골드 */
  --accent-hover: #dfc087;
  --accent-dim:   rgba(200,169,110,0.12);
  --border:   rgba(255,255,255,0.08);
  --border2:  rgba(255,255,255,0.04);
  --danger:   #e05555;
  --radius:   10px;
  --radius-sm: 5px;
  --shadow:   0 4px 24px rgba(0,0,0,0.5);
  --shadow-hover: 0 8px 40px rgba(0,0,0,0.7);
  --transition: 0.2s ease;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-kr:    'Noto Serif KR', 'Nanum Myeongjo', serif;
}

/* ============================================================
   PAGE TRANSITIONS
   ============================================================ */

/* ── CSS fallback (View Transitions 미지원 브라우저) ── */
@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes page-fade-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}

main { animation: page-fade-in 0.38s ease both; }

body.page-leaving main {
  animation: page-fade-out 0.22s ease both;
}

/* ── View Transitions API (크롬 111+, 사파리 18+) ── */
@keyframes vt-slide-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes vt-slide-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}

::view-transition-old(root) {
  animation: vt-slide-out 0.22s ease both;
}
::view-transition-new(root) {
  animation: vt-slide-in 0.38s ease both;
}

/* 이미지는 크로스페이드 (슬라이드 X) */
::view-transition-old(hero-img),
::view-transition-new(hero-img) {
  animation-duration: 0.5s;
}

/* FOUC 방지용 — HTML에 light-pending 클래스가 있으면 body에 바로 적용 */
html.light-pending body {
  background: #f4f1eb;
  color: #1c1a17;
}

/* ── 라이트 모드 ── */
body.light {
  --bg:       #f4f1eb;
  --bg2:      #ebe7df;
  --bg3:      #e1dbd0;
  --fg:       #1c1a17;
  --fg2:      #6a6460;
  --fg3:      #a8a29b;
  --accent:   #9a7840;
  --accent-hover: #b8914e;
  --accent-dim:   rgba(154,120,64,0.1);
  --border:   rgba(0,0,0,0.10);
  --border2:  rgba(0,0,0,0.05);
  --shadow:   0 4px 24px rgba(0,0,0,0.1);
  --shadow-hover: 0 8px 40px rgba(0,0,0,0.18);
}

/* 라이트 모드 — 헤더 */
body.light .site-header.scrolled {
  background: rgba(244,241,235,0.92);
}
/* 라이트 모드 — 인라인 스타일 재정의 */
body.light [style*="background:#111"],
body.light [style*="background: #111"]       { background: var(--bg2) !important; }
body.light [style*="background:#161616"],
body.light [style*="background: #161616"]    { background: var(--bg3) !important; }
body.light [style*="background:#0b0b0b"],
body.light [style*="background: #0b0b0b"]    { background: var(--bg2) !important; }
body.light [style*="background:#1a1812"],
body.light [style*="background: #1a1812"]    { background: #efe8d8 !important; }

body.light [style*="color:#f5f1e8"]          { color: #1c1a17 !important; }
body.light [style*="color:#b5aea3"]          { color: #4a4440 !important; }
body.light [style*="color:#8f897f"],
body.light [style*="color:#91897d"],
body.light [style*="color:#8e877c"]          { color: #6a6460 !important; }
body.light [style*="color:#c9a96a"],
body.light [style*="color:#c8a96a"]          { color: var(--accent) !important; }

body.light [style*="border:1px solid rgba(255,255,255,0.08)"],
body.light [style*="border: 1px solid rgba(255,255,255,0.08)"] {
  border-color: rgba(0,0,0,0.10) !important;
}
body.light [style*="border:1px solid rgba(255,255,255,0.1)"],
body.light [style*="border: 1px solid rgba(255,255,255,0.1)"] {
  border-color: rgba(0,0,0,0.12) !important;
}

/* 라이트 모드 — 네비 검색창 */
body.light .nav-search input {
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.12);
}

/* 다크모드 토글 버튼 */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg2);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 10px;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  line-height: 1;
}
.theme-toggle:hover {
  color: var(--fg);
  border-color: var(--fg3);
  background: var(--border2);
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ============================================================
   LAYOUT
   ============================================================ */
.container { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  padding: 1.1rem 0;
  transition: background var(--transition), border-color var(--transition);
}
.site-header.scrolled {
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
}

.logo {
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.18em;
  color: var(--fg); text-transform: uppercase;
}
.logo:hover { color: var(--accent); }

nav { display: flex; gap: 0.15rem; align-items: center; }
nav a {
  font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--fg2); padding: 0.45rem 0.85rem; border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
nav a:hover { color: var(--fg); background: var(--border2); }
nav .admin-link:hover { color: var(--accent); }

/* 네비게이션 검색창 */
.nav-search { display: flex; align-items: center; }
.nav-search input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 5px 12px;
  color: var(--fg);
  font-size: 12px;
  width: 110px;
  outline: none;
  transition: width var(--transition), border-color var(--transition);
}
.nav-search input:focus {
  width: 160px;
  border-color: rgba(200,169,110,0.4);
}

/* 모바일 햄버거 */
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-toggle span { display: block; width: 22px; height: 1.5px; background: var(--fg2); transition: var(--transition); }

/* ============================================================
   HERO  (100vh, no scroll)
   ============================================================ */
.hero {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 미묘한 배경 그라디언트 */
.hero::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 70% at 72% 40%, rgba(200,169,110,0.05) 0%, transparent 65%),
    radial-gradient(ellipse 35% 50% at 20% 80%, rgba(255,255,255,0.015) 0%, transparent 55%);
}

/* ── 메인 바디 (좌/우 분할) ── */
.hero-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0 max(2.5rem, 6vw);
  padding-top: 20vh;
  padding-bottom: 2rem;
  align-items: flex-start;
}

/* ── 좌측 텍스트 ── */
.hero-left {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-right: 4vw;
}

.hero-eyebrow {
  font-family: inherit;
  font-size: 0.65rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.hero-eyebrow::before {
  content: '';
  flex-shrink: 0;
  width: 28px; height: 1px;
  background: var(--accent);
}

.hero-title {
  margin-bottom: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.15em;
}

/* "Gyusang Bae" — Cormorant Garamond 라이트 */
.hero-name-en {
  display: block;
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2.8rem, 5.5vw, 5.6rem);
  letter-spacing: 0.14em;
  line-height: 1;
  color: var(--fg);
  white-space: nowrap;
}

/* "기록하는 감독" — Noto Serif KR 볼드 */
.hero-name-kr {
  display: block;
  font-family: var(--font-kr);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 4rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--fg);
}

.hero-desc {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--fg2);
  text-transform: uppercase;
  margin-bottom: 2.8rem;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg);
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(200,169,110,0.5);
  transition: color var(--transition), border-color var(--transition), gap var(--transition);
}
.hero-cta:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  gap: 1.1rem;
}
.hero-cta-arrow {
  transition: transform var(--transition);
  display: inline-block;
}
.hero-cta:hover .hero-cta-arrow { transform: translateX(3px); }

/* ── 우측 프로필 이미지 ── */
.hero-right {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding-left: 2vw;
}

.profile-image-wrap {
  width: min(260px, 24vw);
  /* 2:3 세로 비율 */
  aspect-ratio: 2 / 3;
  position: relative;
  flex-shrink: 0;
}

/* 실제 사진 (<img class="profile-image">) */
.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

/* placeholder: 사진 없을 때 */
.profile-image--placeholder {
  border: 1px solid rgba(200,169,110,0.4);
  background:
    linear-gradient(135deg, rgba(200,169,110,0.04) 0%, transparent 60%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
/* 코너 장식 */
.profile-image--placeholder::before,
.profile-image--placeholder::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border-color: var(--accent);
  border-style: solid;
  opacity: 0.5;
}
.profile-image--placeholder::before {
  top: 10px; left: 10px;
  border-width: 1px 0 0 1px;
}
.profile-image--placeholder::after {
  bottom: 10px; right: 10px;
  border-width: 0 1px 1px 0;
}

.profile-placeholder-text {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg3);
  text-align: center;
  line-height: 2;
}

/* ── 하단 카테고리 스트립 ── */
.hero-categories {
  display: flex;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.hero-cat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  padding: 0.9rem 0.5rem;
  border-right: 1px solid var(--border);
  transition: background var(--transition);
  position: relative;
  overflow: hidden;
}
.hero-cat:last-child { border-right: none; }

.hero-cat::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.hero-cat:hover::after { width: 40%; }
.hero-cat:hover { background: rgba(255,255,255,0.02); }
.hero-cat:hover .hero-cat-kr { color: var(--accent); }

.hero-cat-kr {
  font-family: var(--font-kr);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--fg2);
  transition: color var(--transition);
}
.hero-cat-en {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg3);
}


/* ============================================================
   FEATURED / RECENT SECTIONS
   ============================================================ */
.featured-section { padding: 5rem 0; }

.section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 2.5rem;
}
.section-title {
  font-size: 1rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg);
  display: flex; align-items: center; gap: 0.75rem;
}
.section-title::before {
  content: '';
  display: inline-block; width: 20px; height: 1px; background: var(--accent);
}
.section-more {
  font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg2); transition: color var(--transition);
}
.section-more:hover { color: var(--accent); }

/* ============================================================
   CARDS
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.card:hover {
  border-color: rgba(200,169,110,0.3);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* 16:9 이미지 래퍼 */
.card-img {
  position: relative; padding-top: 56.25%;
  overflow: hidden; background: var(--bg3);
  flex-shrink: 0;
}
.card-img img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card-img img { transform: scale(1.05); }
.card-img-placeholder {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--fg3); font-size: 1.8rem;
}

.card-body { padding: 1.1rem 1.25rem 1.3rem; flex: 1; display: flex; flex-direction: column; }
.card-meta { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.55rem; flex-wrap: wrap; }
.card-body h3 {
  font-size: 0.98rem; font-weight: 700; line-height: 1.4;
  margin-bottom: 0.35rem; color: var(--fg);
}
.card-body p {
  font-size: 0.84rem; color: var(--fg2); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; flex: 1;
}

/* ============================================================
   TAGS / BADGES
   ============================================================ */
.tag {
  display: inline-block; padding: 0.18rem 0.6rem;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(200,169,110,0.25);
  border-radius: 20px; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
}
.tag-sm {
  display: inline-block; padding: 0.15rem 0.5rem;
  background: transparent; color: var(--fg3);
  border: 1px solid var(--border);
  border-radius: 20px; font-size: 0.68rem;
  margin: 0.2rem 0.1rem 0 0; white-space: nowrap;
}
.tag-list { margin-top: 0.6rem; }
.year { font-size: 0.72rem; color: var(--fg3); }

.badge {
  display: inline-block; padding: 0.22rem 0.65rem;
  background: var(--bg3); color: var(--fg2);
  border: 1px solid var(--border);
  border-radius: 20px; font-size: 0.75rem;
  margin: 0.2rem 0.1rem 0 0;
}

/* ============================================================
   PAGE HEADER (내부 페이지용)
   ============================================================ */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7rem 0 2rem; gap: 1rem;
}
.page-header h1 {
  font-size: 2rem; font-weight: 800; letter-spacing: -0.02em;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.filter-btn {
  padding: 0.38rem 1.1rem;
  border: 1px solid var(--border); border-radius: 20px;
  font-size: 0.82rem; letter-spacing: 0.04em;
  color: var(--fg2); background: transparent;
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-dim); font-weight: 600;
}

/* ============================================================
   PROJECT DETAIL
   ============================================================ */
.project-detail { max-width: 820px; margin: 0 auto; padding: 0 1.5rem 6rem; }

.back-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin: 7rem 0 2rem; font-size: 0.8rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--fg2);
  transition: color var(--transition);
}
.back-link:hover { color: var(--accent); }

/* 16:9 썸네일 */
.detail-thumb-wrap {
  position: relative; padding-top: 56.25%;
  border-radius: var(--radius); overflow: hidden;
  margin-bottom: 2.5rem; background: var(--bg3);
}
.detail-thumb-wrap img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; object-fit: cover;
}

.detail-header { margin-bottom: 1.8rem; }
.detail-header h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem); font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.2;
  margin: 0.6rem 0 0.7rem; color: var(--fg);
}
.lead { font-size: 1.05rem; color: var(--fg2); line-height: 1.65; }

.detail-meta {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem 2rem;
  padding: 1.4rem 1.6rem;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 2.5rem; font-size: 0.875rem;
}
.detail-meta-item { display: flex; flex-direction: column; gap: 0.3rem; }
.detail-meta-label {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--fg3);
}
.detail-meta-value { color: var(--fg); font-weight: 500; }
.detail-tags { display: flex; flex-wrap: wrap; }

.detail-body {
  font-size: 1rem; line-height: 1.9; color: var(--fg2);
  margin-bottom: 2.5rem; border-left: 2px solid var(--border);
  padding-left: 1.5rem;
}
.detail-body p { margin-bottom: 1em; }
.detail-body p:last-child { margin-bottom: 0; }

.video-wrap {
  position: relative; padding-bottom: 56.25%; height: 0;
  overflow: hidden; border-radius: var(--radius);
  margin-bottom: 2.5rem; background: #000;
}
.video-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

.detail-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.65rem 1.5rem;
  background: var(--accent); color: var(--bg);
  border-radius: var(--radius); font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.04em; border: none; cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-outline {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.65rem 1.5rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.85rem; color: var(--fg2); background: transparent;
  transition: all var(--transition);
}
.btn-outline:hover { border-color: var(--fg2); color: var(--fg); }

.btn-danger {
  display: inline-flex; align-items: center;
  padding: 0.32rem 0.75rem;
  background: transparent; color: var(--danger);
  border: 1px solid var(--danger); border-radius: var(--radius-sm);
  font-size: 0.78rem; cursor: pointer;
  transition: all var(--transition);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-edit {
  display: inline-flex; align-items: center;
  padding: 0.32rem 0.75rem;
  background: transparent; color: var(--accent);
  border: 1px solid var(--accent); border-radius: var(--radius-sm);
  font-size: 0.78rem;
  transition: all var(--transition);
}
.btn-edit:hover { background: var(--accent); color: var(--bg); }

.action-cell { display: flex; gap: 0.4rem; align-items: center; }
.accent-link { color: var(--accent); }
.accent-link:hover { text-decoration: underline; }

/* ============================================================
   ADMIN TABLE
   ============================================================ */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; margin-top: 0.5rem; }
.admin-table th {
  text-align: left; padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--fg3);
}
.admin-table td { padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--border2); }
.admin-table tr:hover td { background: var(--bg2); }
code {
  background: var(--bg3); padding: 0.1rem 0.4rem;
  border-radius: 4px; font-size: 0.78rem;
  font-family: ui-monospace, "SF Mono", monospace;
  color: var(--accent);
}

/* ============================================================
   ADMIN FORM
   ============================================================ */
.admin-form { max-width: 860px; }

.form-section { margin-bottom: 2.5rem; }
.form-section-title {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--fg3);
  margin-bottom: 1rem; padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}

.form-group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--fg2); }
.form-group .hint { font-size: 0.75rem; color: var(--fg3); }

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group textarea {
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.9rem; background: var(--bg2); color: var(--fg);
  font-family: inherit; width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,169,110,0.15);
}
.form-group textarea { resize: vertical; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

.checkbox-row { display: flex; gap: 2rem; align-items: center; padding: 0.75rem 0; flex-wrap: wrap; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

.required { color: var(--danger); }
.form-actions {
  display: flex; gap: 1rem; align-items: center;
  margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
}

.alert-error {
  background: rgba(224,85,85,0.1); border: 1px solid rgba(224,85,85,0.3);
  color: #f87171; padding: 0.9rem 1.1rem; border-radius: 8px;
  margin-bottom: 1.5rem; font-size: 0.875rem;
}

/* 썸네일 업로드 인풋 행 */
.thumb-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.thumb-input-row input[type="url"] {
  flex: 1;
  min-width: 0;
}
.btn-upload {
  flex-shrink: 0;
  padding: 0 1.1rem;
  background: var(--bg3);
  color: var(--fg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.btn-upload:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* 업로드 상태 메시지 */
.thumb-upload-status {
  min-height: 1.2rem;
  font-size: 0.78rem;
  margin-top: 0.4rem;
}
.thumb-upload-status--loading { color: var(--fg2); }
.thumb-upload-status--success { color: #4ade80; }
.thumb-upload-status--error   { color: var(--danger); }

/* 썸네일 미리보기 */
.thumb-preview-wrap { margin-top: 0.7rem; }
.thumb-preview {
  display: none; position: relative; padding-top: 56.25%;
  border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg3);
}
.thumb-preview.visible { display: block; }
.thumb-preview img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb-preview-placeholder {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; color: var(--fg3);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}
.site-footer .container {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.5rem;
}
.footer-logo { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.18em; color: var(--fg2); }
.footer-copy { font-size: 0.75rem; color: var(--fg3); }

/* ============================================================
   MISC
   ============================================================ */
.empty { color: var(--fg2); padding: 4rem 0; text-align: center; font-size: 0.95rem; }

/* ============================================================
   HEADER SCROLL BEHAVIOR (JS 없이 CSS 폴백)
   ============================================================ */
@supports (animation-timeline: scroll()) {
  .site-header {
    animation: headerScroll linear both;
    animation-timeline: scroll();
    animation-range: 0px 80px;
  }
  @keyframes headerScroll {
    from { background: transparent; border-bottom-color: transparent; }
    to   {
      background: rgba(10,10,10,0.92);
      backdrop-filter: blur(14px);
      border-bottom: 1px solid rgba(255,255,255,0.08);
    }
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero-body {
    grid-template-columns: 1fr 1fr;
    padding-top: 18vh;
    gap: 0;
  }
  .profile-image-wrap { width: min(200px, 32vw); }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  /* 모바일: 이미지 숨기고 텍스트만 */
  .hero-body {
    grid-template-columns: 1fr;
    padding-top: 22vh;
    padding-bottom: 1rem;
  }
  .hero-right { display: none; }
  .hero-name-en { font-size: clamp(2.2rem, 11vw, 3.5rem); letter-spacing: 0.1em; }
  .hero-name-kr { font-size: clamp(1.6rem, 8vw, 2.8rem); }
  .hero-left { padding-right: 0; }

  /* 카테고리 스트립 — 텍스트 더 작게 */
  .hero-cat { padding: 0.7rem 0.2rem; }
  .hero-cat-kr { font-size: 0.68rem; }
  .hero-cat-en { display: none; }

  .site-header.open {
    background: var(--bg);
    padding-bottom: 0;
  }
  .site-header.open .container { flex-wrap: wrap; position: relative; }
  .nav-toggle { display: flex; }

  .card-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
  .form-row-2 { grid-template-columns: 1fr; }
  .detail-meta { grid-template-columns: 1fr 1fr; }
}

/* JS 폴백: scroll 감지 스크립트 지원 브라우저용 */

/* ============================================================
   QUILL EDITOR — DARK THEME OVERRIDES
   ============================================================ */
.ql-toolbar.ql-snow {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.ql-container.ql-snow {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-family: var(--font-kr);
  font-size: 0.95rem;
  color: var(--fg);
}
.ql-editor {
  min-height: 200px;
  color: var(--fg);
  line-height: 1.8;
}
.ql-editor.ql-blank::before {
  color: var(--fg3);
  font-style: normal;
}
.ql-editor p, .ql-editor h1, .ql-editor h2, .ql-editor h3 {
  color: var(--fg);
}
.ql-editor a { color: var(--accent); }
.ql-editor img { max-width: 100%; border-radius: var(--radius-sm); margin: 0.5rem 0; }

/* Toolbar buttons */
.ql-snow .ql-stroke { stroke: var(--fg2); }
.ql-snow .ql-fill  { fill: var(--fg2); }
.ql-snow .ql-picker-label { color: var(--fg2); }
.ql-snow .ql-picker-options {
  background: var(--bg3);
  border-color: var(--border);
}
.ql-snow .ql-picker-item { color: var(--fg2); }
.ql-snow .ql-picker-item:hover { color: var(--fg); }
.ql-snow button:hover .ql-stroke,
.ql-snow .ql-picker-label:hover .ql-stroke { stroke: var(--accent); }
.ql-snow button:hover .ql-fill,
.ql-snow .ql-picker-label:hover .ql-fill  { fill: var(--accent); }
.ql-snow button.ql-active .ql-stroke { stroke: var(--accent); }
.ql-snow button.ql-active .ql-fill  { fill: var(--accent); }
.ql-snow .ql-picker-label.ql-active,
.ql-snow .ql-picker-item.ql-selected { color: var(--accent); }

/* SRT 업로드 행 */
.srt-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}
.srt-filename {
  font-size: 0.78rem;
  color: var(--fg3);
}
.srt-filename--ok { color: #6ecfa0; }

/* SRT 미리보기 textarea */
.srt-preview {
  color: var(--fg2);
  font-size: 0.8rem;
  font-family: monospace;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

/* AI 메모 입력 */
.ai-memo-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg2);
  font-family: var(--font-kr);
  font-size: 0.85rem;
  padding: 0.6rem 0.75rem;
  resize: vertical;
  line-height: 1.6;
  margin-bottom: 0.5rem;
  transition: border-color var(--transition);
}
.ai-memo-input::placeholder { color: var(--fg3); }
.ai-memo-input:focus {
  outline: none;
  border-color: var(--accent);
  color: var(--fg);
}

/* AI 글 작성 버튼 영역 */
.editor-toolbar-extra {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}
.btn-ai-write {
  background: linear-gradient(135deg, #1a1a2e 0%, #2d1b4e 100%);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-family: var(--font-kr);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), opacity var(--transition);
  letter-spacing: 0.04em;
}
.btn-ai-write:hover {
  background: var(--accent);
  color: #0a0a0a;
}
.btn-ai-write:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-multi-upload {
  background: var(--bg3);
  color: var(--fg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-family: var(--font-kr);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.btn-multi-upload:hover {
  border-color: var(--fg2);
  color: var(--fg);
}
.ai-write-status {
  font-size: 0.8rem;
  margin-left: 0.25rem;
}
.ai-write-status--loading { color: var(--fg2); }
.ai-write-status--success { color: #6ecfa0; }
.ai-write-status--error   { color: var(--danger); }

/* ============================================================
   PROJECT DETAIL — 반응형 레이아웃 클래스
   ============================================================ */

/* 상단 헤더: 제목+메타 / 버튼 */
.pd-header-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 34px;
  align-items: end;
}

/* 본문: 사이드바 + 아티클 */
.pd-body-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 44px;
  align-items: start;
}

@media (max-width: 768px) {
  /* 상단 헤더: 1열 */
  .pd-header-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  /* 제목 글자 크기 줄이기 */
  .pd-title {
    font-size: clamp(2rem, 9vw, 3.5rem) !important;
    line-height: 1.15 !important;
  }
  /* 버튼 열 왼쪽 정렬 */
  .pd-header-actions {
    justify-content: flex-start !important;
  }
  /* 본문: 1열 (사이드바 위로) */
  .pd-body-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  /* sticky 해제 */
  .pd-sidebar {
    position: static !important;
  }
  /* 사이드바 항목 가로 나열 */
  .pd-sidebar-inner {
    display: flex !important;
    flex-wrap: wrap;
    gap: 12px 24px;
  }
}

/* detail-body HTML 렌더링 */
.detail-body h1, .detail-body h2, .detail-body h3 {
  font-family: var(--font-kr);
  color: var(--fg);
  margin: 1.5rem 0 0.5rem;
}
.detail-body strong { color: var(--fg); font-weight: 600; }
.detail-body em { color: var(--fg2); font-style: italic; }
.detail-body a { color: var(--accent); }
.detail-body ul, .detail-body ol {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}
.detail-body img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 1rem 0;
}

/* ============================================================
   SCROLL-TO-TOP BUTTON
   ============================================================ */
.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 300;
  box-shadow: 0 4px 16px rgba(200,169,110,0.35);
}
.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.scroll-top:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

/* ============================================================
   PAGE LOADING BAR
   ============================================================ */
#page-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 9999;
  transition: width 0.2s ease, opacity 0.4s ease;
  pointer-events: none;
}

/* ============================================================
   IMAGE SKELETON SHIMMER
   ============================================================ */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.img-skeleton {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg3) 50%, var(--bg2) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}
.card-img { background: var(--bg3); }
.card-img img { transition: opacity 0.3s ease, transform 0.4s ease; }
.card-img img[data-loaded="false"] { opacity: 0; }

/* ============================================================
   MOBILE NAV — SLIDE DOWN ANIMATION
   ============================================================ */
@media (max-width: 640px) {
  .site-header nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.2s ease;
    display: flex !important; /* override display:none above */
  }
  .site-header.open nav {
    max-height: 400px;
    padding: 0.5rem 1rem 1rem;
    border-bottom: 1px solid var(--border);
  }
  .site-header nav a { padding: 0.7rem 0.5rem; font-size: 0.85rem; width: 100%; }
  .site-header .nav-search { width: 100%; padding: 0.4rem 0.5rem; }
  .site-header .nav-search input { width: 100% !important; }

  /* 프로젝트 상세 — 강제 1열 */
  .pd-body-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .pd-header-grid {
    grid-template-columns: 1fr !important;
  }
  .pd-sidebar {
    position: static !important;
  }
  .pd-sidebar-inner {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px;
  }

  /* 홈 히어로 카드 — 글자 크기 */
  [style*="font-size:52px"] { font-size: 32px !important; }
  [style*="font-size:68px"] { font-size: 36px !important; }

  /* 모바일 최소 터치 영역 */
  .btn, a[style*="padding:14px"] { min-height: 44px; }
}

/* ============================================================
   PRINT / PDF
   ============================================================ */
@media print {
  /* 배경 강제 출력 */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* 헤더/푸터/버튼/갤러리/유튜브 숨김 */
  .site-header, .site-footer, #page-progress, .scroll-top,
  .pd-header-actions button, nav, .swiper, iframe,
  [onclick^="printPDF"] { display: none !important; }

  body, #body-root {
    background: #fff !important;
    color: #111 !important;
  }

  /* 링크 색상 */
  a { color: #8b6914 !important; }

  /* 페이지 여백 */
  @page {
    margin: 18mm 16mm;
    size: A4;
  }

  /* 제목/설명 색상 */
  h1, h2, h3 { color: #111 !important; }
  .project-description { color: #222 !important; font-size: 13px !important; line-height: 1.9 !important; }
  .project-description p, .project-description li { color: #222 !important; }
  .project-description strong { color: #000 !important; }

  /* 썸네일 이미지 */
  img { max-width: 100% !important; border-radius: 8px !important; }

  /* 사이드바 가로 배치 */
  .pd-body-grid { grid-template-columns: 1fr !important; }
  .pd-sidebar { position: static !important; border: 1px solid #ddd !important; border-radius: 8px !important; padding: 16px !important; margin-bottom: 24px !important; background: #f9f9f9 !important; }
  .pd-sidebar * { color: #333 !important; }

  /* 페이지 나눔 방지 */
  article, section { page-break-inside: avoid; }
  h1, h2, h3 { page-break-after: avoid; }
}
