/* 사진 아카이브 — 공통 디자인 시스템
   톤: 종이색 바탕 + 잉크색 글자 + 주홍 포인트 하나. 사진이 주인공이 되도록 장식은 최소화. */
:root {
  --paper: #f4f2ec;
  --paper-2: #ebe8df;
  --card: #fffefb;
  --ink: #15140f;
  --ink-2: #3a3830;
  --muted: #747064;
  --line: #dcd8cc;
  --line-2: #c9c4b5;
  --accent: #d8461b;
  --accent-ink: #b5370f;
  --accent-soft: #fbe6dc;
  --ok: #2f7a4b;
  --ok-soft: #e2f1e6;
  --warn: #9a6a00;
  --warn-soft: #f8edd0;
  --info: #2c5b8f;
  --info-soft: #e0eaf6;
  --danger: #b3261e;
  --danger-soft: #f9e1df;
  --radius: 14px;
  --radius-s: 9px;
  --shadow: 0 1px 2px rgba(21, 20, 15, .06), 0 8px 24px rgba(21, 20, 15, .06);
  --shadow-l: 0 24px 64px rgba(21, 20, 15, .18);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --wrap: 1240px;
  --pad: clamp(18px, 4vw, 40px);
  --header-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper);
  font-size: 16px; line-height: 1.6; letter-spacing: -0.011em; word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: 0; }
.muted { color: var(--muted); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: currentColor; }

/* ---------- 시연 안내 띠 · 헤더 ---------- */
.demo-bar {
  background: var(--ink); color: #f4f2ec; font-size: 13px; text-align: center; padding: 7px 12px; line-height: 1.4;
}
.demo-bar b { color: #ffb08f; font-weight: 700; }
.demo-bar a { color: #f4f2ec; text-underline-offset: 3px; }

.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -0.02em; font-size: 17px; flex: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--ink); position: relative; overflow: hidden; }
.brand-mark::before { content: ""; position: absolute; inset: 6px 6px 11px 6px; border: 2px solid var(--paper); border-radius: 2px; }
.brand-mark::after { content: ""; position: absolute; right: 5px; bottom: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.brand small { font-weight: 600; color: var(--muted); font-size: 13px; margin-left: 2px; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a {
  text-decoration: none; font-size: 15px; font-weight: 600; color: var(--ink-2); padding: 8px 12px; border-radius: 999px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--paper-2); }
.nav .nav-admin { margin-left: 8px; border: 1px solid var(--line-2); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; width: 40px; height: 40px; border-radius: 10px; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 5px auto; border-radius: 2px; }
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: calc(var(--header-h) + 0px) 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--paper); padding: 12px var(--pad) 20px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: .18s;
  }
  .nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 12px 14px; font-size: 16px; }
  .nav .nav-admin { margin: 6px 0 0; }
}

/* ---------- 버튼 · 입력 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font-weight: 700;
  font-size: 15px; text-decoration: none; white-space: nowrap; transition: transform .12s, background .15s, border-color .15s, color .15s;
}
.btn:hover { background: #2b2a23; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--card); border-color: var(--ink); }
.btn.light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn.light:hover { background: #fff; }
.btn.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 14px; }
.btn.xs { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.sm svg { width: 16px; height: 16px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink);
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

.field { display: grid; gap: 6px; align-content: start; }
.field > span, .label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.field > span em, .label em { font-style: normal; color: var(--accent); margin-left: 2px; }
.field small { color: var(--muted); font-size: 13px; }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius-s);
  background: var(--card); transition: border-color .15s, box-shadow .15s; font-size: 15.5px;
}
.textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.55; }
.select {
  appearance: none; padding-right: 38px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2315140f' stroke-width='1.6'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 10%, transparent); }
.invalid .input, .invalid .select, .invalid .textarea, .input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.field .err { color: var(--danger); font-size: 13px; display: none; }
.invalid .err { display: block; }
.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 15px; }
.check input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--ink); flex: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; font-size: 14px; font-weight: 600; color: var(--ink-2);
  text-decoration: none; white-space: nowrap; transition: .15s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.on, .chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .n { font-weight: 500; opacity: .6; font-size: 12.5px; }
.chip.tag::before { content: "#"; opacity: .45; margin-right: -3px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12.5px;
  font-weight: 700; white-space: nowrap; background: var(--paper-2); color: var(--ink-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge.received { background: var(--accent-soft); color: var(--accent-ink); }
.badge.reviewing { background: var(--warn-soft); color: var(--warn); }
.badge.scheduled { background: var(--info-soft); color: var(--info); }
.badge.done { background: var(--ok-soft); color: var(--ok); }
.badge.rejected { background: var(--paper-2); color: var(--muted); }

/* ---------- 카드 · 섹션 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.section { padding: clamp(56px, 9vw, 112px) 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.section-head h2 { margin: 10px 0 0; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.2; letter-spacing: -0.035em; font-weight: 800; }
.section-head p { margin: 10px 0 0; color: var(--muted); max-width: 520px; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; font-size: 15px; border-bottom: 1.5px solid var(--ink); padding-bottom: 2px; }
.link-arrow:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 정렬 사진 그리드 (가로 사진 비율 유지, 줄 끝 맞춤) ---------- */
.jgrid { display: flex; flex-wrap: wrap; gap: 10px; --row: 240px; }
.jgrid::after { content: ""; flex-grow: 999999; }
.jtile {
  position: relative; flex-grow: calc(var(--ar) * 100); flex-basis: calc(var(--ar) * var(--row)); aspect-ratio: var(--ar);
  max-height: calc(var(--row) * 1.6); border-radius: 10px; overflow: hidden; background: var(--paper-2); cursor: zoom-in;
  border: 0; padding: 0; text-align: left; color: #fff;
}
.jtile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1), opacity .3s; opacity: 0; }
.jtile img.loaded { opacity: 1; }
.jtile:hover img { transform: scale(1.035); }
.jtile .cap {
  position: absolute; inset: auto 0 0 0; padding: 36px 14px 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  background: linear-gradient(to top, rgba(10, 10, 8, .72), transparent); opacity: 0; transition: opacity .2s; font-size: 14px; font-weight: 600;
}
.jtile .cap small { display: block; font-weight: 500; opacity: .75; font-size: 12.5px; }
.jtile:hover .cap, .jtile:focus-visible .cap { opacity: 1; }
.jtile .dl {
  flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .94);
  color: var(--ink); text-decoration: none;
}
.jtile .dl:hover { background: var(--accent); color: #fff; }
.jtile .dl svg { width: 16px; height: 16px; }
@media (max-width: 640px) { .jgrid { --row: 150px; gap: 6px; } .jtile { border-radius: 7px; } }

.skeleton { background: linear-gradient(90deg, var(--paper-2) 25%, #f1eee6 50%, var(--paper-2) 75%); background-size: 200% 100%; animation: sk 1.3s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- 라이트박스 ---------- */
.lb { position: fixed; inset: 0; z-index: 200; background: #0e0e0c; color: #eeece6; display: grid; grid-template-columns: 1fr 380px; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 56px 72px; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.lb-stage .lb-loading { position: absolute; width: 36px; height: 36px; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.lb-nav {
  position: absolute; top: 50%; translate: 0 -50%; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.06); color: #fff; display: grid; place-items: center;
}
.lb-nav:hover { background: rgba(255,255,255,.16); }
.lb-nav svg { width: 22px; height: 22px; }
.lb-prev { left: 14px; } .lb-next { right: 14px; }
.lb-close { position: absolute; top: 14px; left: 14px; z-index: 2; }
.lb-close, .lb-side .icon-btn { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.2); color: #fff; }
.lb-side { background: #181815; border-left: 1px solid #2a2a25; overflow-y: auto; padding: 28px 26px; display: flex; flex-direction: column; gap: 22px; }
.lb-side h2 { margin: 6px 0 0; font-size: 24px; line-height: 1.3; letter-spacing: -0.03em; }
.lb-cat { color: #ffb08f; font-size: 13px; font-weight: 700; text-decoration: none; }
.lb-desc { color: #b9b6ab; font-size: 14px; margin: 0; }
.lb-desc a { color: #d9d6cc; }
.lb-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.lb-tags .chip { border-color: #3b3a33; color: #d9d6cc; height: 30px; }
.lb-tags .chip:hover { border-color: #eeece6; color: #fff; }
.lb-meta { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; margin: 0; font-size: 14px; }
.lb-meta dt { color: #8f8c82; }
.lb-meta dd { margin: 0; text-align: right; color: #eeece6; }
.lb-actions { display: grid; gap: 10px; margin-top: auto; }
.lb-actions .btn.ghost { color: #eeece6; border-color: #3b3a33; }
.lb-actions .btn.ghost:hover { background: #24241f; border-color: #eeece6; }
.lb-note { font-size: 12.5px; color: #8f8c82; line-height: 1.5; margin: 0; }
@media (max-width: 900px) {
  .lb { grid-template-columns: 1fr; grid-template-rows: minmax(0, 58vh) auto; overflow-y: auto; }
  .lb-stage { padding: 56px 12px 16px; }
  .lb-nav { top: auto; bottom: 18px; translate: none; width: 42px; height: 42px; }
  .lb-side { border-left: 0; border-top: 1px solid #2a2a25; }
}

/* ---------- 토스트 · 진행 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; translate: -50% 0; z-index: 400; background: var(--ink); color: var(--paper);
  padding: 12px 20px; border-radius: 999px; font-size: 15px; font-weight: 600; box-shadow: var(--shadow-l);
  opacity: 0; transform: translateY(10px); transition: .2s; pointer-events: none; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: none; }
/* ---------- 푸터 ---------- */
.site-footer { background: var(--ink); color: #c9c5b8; padding: 56px 0 40px; margin-top: 0; font-size: 14px; }
.site-footer .grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer .brand { color: var(--paper); }
.site-footer .brand-mark { background: var(--paper); }
.site-footer .brand-mark::before { border-color: var(--ink); }
.site-footer h4 { color: var(--paper); font-size: 14px; margin: 0 0 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { text-decoration: none; color: #c9c5b8; }
.site-footer a:hover { color: #fff; }
.site-footer .fine { margin-top: 40px; padding-top: 20px; border-top: 1px solid #2e2d27; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: #8f8c82; font-size: 13px; }
@media (max-width: 720px) { .site-footer .grid { grid-template-columns: 1fr 1fr; } .site-footer .grid > :first-child { grid-column: 1 / -1; } }

.empty-state { text-align: center; padding: 72px 20px; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); font-size: 18px; margin-bottom: 6px; }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; margin: 24px auto; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
