:root {
  --ink: #12151c;
  --panel: #1a2029;
  --panel-raised: #202836;
  --line: #2c3546;
  --slate: #5b7fde;
  --brass: #c9a15d;
  --text: #ece9e2;
  --text-muted: #8b93a7;
  --radius: 3px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "IBM Plex Sans KR", "Apple SD Gothic Neo", sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
}

/* 이미지/텍스트 손쉬운 복사 억제를 위한 최소한의 장치.
   완벽한 차단은 불가능하며, 이는 어디까지나 일반 사용자를 위한 억제책입니다. */
img { -webkit-user-drag: none; user-select: none; pointer-events: none; }
body { -webkit-user-select: none; user-select: none; }
.card-body, .stage-desc { user-select: text; } /* 텍스트 자체는 읽기 위해 선택 허용 */

.frame {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* ── 좌측 서랍 ── */
.drawer {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 28px 0 28px 0;
  display: flex;
  flex-direction: column;
}

.drawer-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--line);
}

.drawer-mark {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--brass);
}

.drawer-head h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  margin: 0;
  letter-spacing: 0.02em;
}

.tabs {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}

.tab {
  position: relative;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.03em;
  padding: 13px 24px 13px 28px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tab:hover { background: rgba(255,255,255,0.03); color: var(--text); }

.tab.active {
  color: var(--text);
  border-left-color: var(--brass);
  background: linear-gradient(90deg, rgba(201,161,93,0.08), transparent);
}

.tab .idx {
  color: var(--slate);
  margin-right: 8px;
}

/* ── 우측 스테이지 ── */
.stage { padding: 48px 56px; max-width: 920px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--slate);
  margin: 0 0 10px;
}

.stage-head h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 34px;
  margin: 0 0 12px;
  line-height: 1.2;
}

.stage-desc {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 60ch;
  margin: 0 0 36px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.card {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: attr(data-idx);
  position: absolute;
  top: 12px;
  right: 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
}

.card-kind {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--brass);
  margin: 0 0 10px;
}

.card-body {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  margin: 0;
}

.card-file {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-file img {
  width: 100%;
  border-radius: 2px;
  display: block;
  pointer-events: none; /* 우클릭 저장 억제 (완벽 차단은 불가) */
}

.card-file a.file-link {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--slate);
  text-decoration: none;
  border-bottom: 1px dotted var(--slate);
  align-self: flex-start;
  pointer-events: auto;
  user-select: text;
}

.empty-state {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 13px;
  margin-top: 40px;
}

@media (max-width: 760px) {
  .frame { grid-template-columns: 1fr; }
  .drawer { border-right: none; border-bottom: 1px solid var(--line); }
  .tabs { flex-direction: row; overflow-x: auto; }
  .tab { border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; }
  .tab.active { border-bottom-color: var(--brass); }
  .stage { padding: 32px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

:focus-visible {
  outline: 2px solid var(--slate);
  outline-offset: 2px;
}
