/* THINKCRAFT Archive: 티스토리 스킨
   서랍 안에 서류철을 쌓아 둔 화면. 분류는 파란 탭, 글은 회색 서류철, 연 글은 흰 종이로 보여 준다. */

:root {
	--accent: #2F31F5;
	--ink: #131314;
	--paper: #EBEBE9;
	--sheet: #FFFFFF;
	--muted: #5C5C63;
	--rule: #C6C6C1;
	--mark: #DBF059;
	--line: 1.5px;
	--sans: 'Pretendard Variable', Pretendard, 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
	--mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.7;
	word-break: keep-all;
	overflow-wrap: anywhere;
}

a { color: var(--accent); }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

.page { padding: 32px 16px 72px; }
.wrap { max-width: 928px; margin: 0 auto; display: flex; flex-direction: column; gap: 32px; }

/* ── 머리말 ───────────────────────── */
.site-head {
	display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
	gap: 8px 24px; padding-bottom: 12px; border-bottom: var(--line) solid var(--ink);
}
.wordmark { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; color: var(--ink); text-decoration: none; }
.wordmark .wm { font-size: 18px; font-weight: 600; letter-spacing: 0.42em; }
.wordmark .owner { font-size: 13px; color: var(--muted); }
.wordmark:hover .wm { color: var(--accent); }
.contact { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-size: 14px; }
.contact .label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--muted); }
.contact a { color: var(--ink); }

/* ── 첫 화면 문장 ─────────────────── */
.hero { display: flex; flex-direction: column; gap: 10px; }
.kicker-mono { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.headline { margin: 0; font-size: 36px; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; max-width: 20em; }
.hero .lede { margin: 0; font-size: 15px; color: var(--muted); max-width: 38em; }

/* 첫 화면에서만 보이는 영역 */
body:not(#tt-body-index) .home-only { display: none; }

/* ── 분류 탭과 검색 ───────────────── */
.tools { display: flex; flex-direction: column; gap: 18px; }

.cat-tabs { border-bottom: var(--line) solid var(--ink); }
.cat-tabs ul { list-style: none; margin: 0; padding: 0; }
.cat-tabs .tt_category > li { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px; }
.cat-tabs .category_list { display: contents; }
.cat-tabs .category_list > li { display: contents; }
.cat-tabs .sub_category_list { display: none; }
.cat-tabs a {
	display: inline-flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 16px;
	background: var(--accent); color: #FFFFFF; text-decoration: none;
	font-size: 14px; font-weight: 600;
	border: var(--line) solid var(--ink); border-bottom: none; border-radius: 12px 12px 0 0;
	transform: translateY(var(--line));
}
.cat-tabs a .c_cnt { font-family: var(--mono); font-size: 12px; font-weight: 400; opacity: 0.85; }
.cat-tabs a.link_tit { background: var(--paper); color: var(--ink); }
.cat-tabs a:hover { filter: brightness(1.12); }
.cat-tabs a.is-active { background: var(--ink); color: var(--paper); }

.search { display: flex; flex-direction: column; gap: 6px; max-width: 384px; }
.search label { font-size: 13px; color: var(--muted); }
.search-row { display: flex; gap: 8px; }
.search-row input {
	flex: 1 1 auto; min-width: 0; font: inherit; font-size: 16px; color: var(--ink);
	background: var(--sheet); border: var(--line) solid var(--ink); border-radius: 0; padding: 8px 12px;
}

.btn {
	font: inherit; font-size: 13px; color: var(--ink); background: transparent; cursor: pointer;
	border: var(--line) solid var(--ink); border-radius: 0; padding: 6px 12px; min-height: 36px;
}
.btn:hover { background: var(--ink); color: var(--paper); }

/* ── 서랍 ─────────────────────────── */
.drawer { display: flex; flex-direction: column; align-items: center; padding-top: 6px; }

.list-head { align-self: stretch; margin-bottom: 14px; }
.list-title { margin: 0; display: flex; align-items: baseline; gap: 10px; }
.kicker { font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; }
.empty { align-self: stretch; margin: 0 0 24px; color: var(--muted); }

.folder {
	position: relative; display: block; width: 100%; margin: 0 auto -40px;
	color: var(--ink); text-decoration: none;
}
.folder .tab {
	position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
	width: 31%; min-width: 168px; max-width: 300px; height: 32px; margin: 0 0 calc(var(--line) * -1) 5%; padding: 0 18px;
	background: var(--paper); border: var(--line) solid var(--ink); border-bottom: none; border-radius: 12px 12px 0 0;
	transition: transform 0.15s ease, background-color 0.15s ease;
}
.folder .code { flex: 0 0 auto; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.folder .t { min-width: 0; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder .sheet {
	display: block; height: 46px; background: var(--paper);
	border: var(--line) solid var(--ink); border-bottom: none; border-radius: 10px 10px 0 0;
}
.folder:nth-of-type(3n+2) .tab { margin-left: 34%; }
.folder:nth-of-type(3n) .tab { margin-left: 63%; }

a.folder:hover .tab, a.folder:focus-visible .tab { transform: translateY(-5px); background: var(--ink); }
a.folder:hover .code, a.folder:hover .t,
a.folder:focus-visible .code, a.folder:focus-visible .t { color: var(--paper); }
a.folder:focus-visible { outline: none; }

.folder.is-open .tab { background: var(--ink); }
.folder.is-open .code, .folder.is-open .t { color: var(--paper); }

.folder.intro .tab { margin-left: 5%; }
#tt-body-index .folder.intro .tab { background: var(--ink); }
#tt-body-index .folder.intro .code, #tt-body-index .folder.intro .t { color: var(--paper); }
#tt-body-index .folder.intro .sheet { height: 59px; }

.prevnext { width: 100%; display: flex; flex-direction: column; align-items: center; margin-top: 8px; }
.prevnext:empty { display: none; }

/* ── 흰 종이(연 글, 소개) ─────────── */
.card {
	position: relative; z-index: 2; width: calc(100% - 44px); margin: 6px 0 0;
	display: flex; flex-direction: column; gap: 24px;
	background: var(--sheet); border: var(--line) solid var(--ink); border-bottom: none; border-radius: 6px 6px 0 0;
	padding: 26px 28px 60px;
}
.card.file { border-bottom: var(--line) solid var(--ink); border-radius: 6px; padding-bottom: 32px; margin-bottom: 18px; }
.drawer > .card.file:first-child { margin-top: 0; }

.card-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.card-top .meta { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-size: 13px; }
.pill {
	font-size: 13px; color: var(--ink); text-decoration: none;
	border: var(--line) solid var(--ink); border-radius: 999px; padding: 3px 12px;
}
.pill:hover { background: var(--ink); color: var(--paper); }

.admin { margin: -12px 0 0; display: flex; gap: 12px; font-size: 13px; }
.admin a { color: var(--muted); }

.card-head {
	display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px 32px;
	padding-bottom: 24px; border-bottom: var(--line) solid var(--ink);
}
.head-text { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.card .title { margin: 0; font-size: 30px; font-weight: 600; line-height: 1.38; }
.card .title a { color: inherit; text-decoration: none; }
.card .title .en { font-weight: 500; }
.card .lede { margin: 0; font-size: 17px; line-height: 1.75; color: var(--muted); }
.card .role { margin: 0; font-size: 13px; }
.byline { margin: 0; font-size: 14px; color: var(--muted); }
.byline a { color: var(--ink); }

/* 그림 상자 */
.fig { flex: 0 0 208px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.fig figcaption { font-size: 11px; letter-spacing: 0.04em; }
.fig-box {
	position: relative; display: block; width: 208px; height: 208px; overflow: hidden;
	background: var(--paper); border: var(--line) solid var(--ink);
}
.fig-box .ring { position: absolute; border: 1.2px solid var(--ink); border-radius: 50%; }
.fig-box .r1 { left: 15px; top: 15px; width: 175px; height: 175px; }
.fig-box .r2 { left: 44px; top: 44px; width: 117px; height: 117px; border-style: dashed; }
.fig-box .r3 { left: 73px; top: 73px; width: 59px; height: 59px; background: var(--accent); }
.fig-box .needle { position: absolute; left: 102px; top: 102px; width: 87px; border-top: 1.2px solid var(--ink); transform-origin: 0 0; transform: rotate(200deg); }
.fig-box .dot { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.fig-box .d1 { left: 72px; top: 89px; }
.fig-box .d2 { left: 44px; top: 79px; }
.fig-box .d3 { left: 17px; top: 69px; }

.portrait .fig-box { background: var(--ink); }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.portrait.no-photo img { display: none; }
.portrait.no-photo .fig-box::before {
	content: "사진"; position: absolute; inset: 0; display: grid; place-items: center;
	color: var(--paper); font-size: 13px;
}

.about-text { margin: 0; font-size: 16.5px; line-height: 1.85; max-width: 38em; }
.facts {
	margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px;
	font-size: 14px; padding-top: 18px; border-top: var(--line) dashed var(--rule);
}
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
.profiles { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.profiles a {
	display: inline-block; font-family: var(--mono); font-size: 12px; color: var(--ink); text-decoration: none;
	border: var(--line) solid var(--ink); padding: 4px 10px;
}
.profiles a:hover { background: var(--ink); color: var(--paper); }

/* ── 본문 ─────────────────────────── */
.entry { font-size: 16.5px; line-height: 1.85; max-width: 40em; }
.entry > :first-child, .entry .contents_style > :first-child { margin-top: 0; }
.entry p { margin: 0 0 1em; }
.entry h2, .entry h3, .entry h4 { line-height: 1.45; font-weight: 600; margin: 1.8em 0 0.6em; }
.entry h2 { font-size: 21px; }
.entry h3 { font-size: 19px; }
.entry h4 { font-size: 17px; }
.entry ul, .entry ol { padding-left: 1.2em; margin: 0 0 1em; }
.entry li { margin-bottom: 0.4em; }
.entry blockquote {
	margin: 1.2em 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--mark); color: var(--muted);
}
.entry img, .entry video, .entry iframe { max-width: 100%; height: auto; }
.entry figure { margin: 1.4em 0; }
.entry figcaption { font-size: 13px; color: var(--muted); }
.entry table { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.entry th, .entry td { border: 1px solid var(--rule); padding: 8px 10px; text-align: left; vertical-align: top; }
.entry th { background: var(--paper); font-weight: 600; }
.entry pre { overflow-x: auto; background: var(--paper); padding: 12px 14px; font-size: 13px; }
.entry code { font-family: var(--mono); font-size: 0.9em; }
.entry hr { border: 0; border-top: var(--line) dashed var(--rule); margin: 2em 0; }
.entry a { color: var(--accent); }

.tags { margin: 0; font-size: 14px; }
.tags .mono { margin-right: 8px; }
.tags a { color: var(--ink); }

.cite {
	display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 16px;
	background: var(--paper); padding: 12px 14px;
}
.cite-text { flex: 1 1 256px; min-width: 0; margin: 0; font-family: var(--mono); font-size: 13px; line-height: 1.6; }

.related { border-top: var(--line) dashed var(--rule); padding-top: 18px; }
.related-head { margin: 0 0 8px; display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.related ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.related li a { color: var(--ink); }

.comments:empty { display: none; }

.tag-cloud { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tag-cloud a { color: var(--ink); }

/* ── 서랍 받침 ────────────────────── */
.base-plate {
	position: relative; z-index: 3; align-self: stretch; margin: -24px -8px 0;
	display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 26px 16px 30px;
	background: var(--paper); border: var(--line) solid var(--ink); border-radius: 4px 4px 12px 12px;
}
.plate-label {
	font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
	background: var(--sheet); border: var(--line) solid var(--ink); padding: 6px 16px;
}
.handle { width: 120px; height: 16px; border: var(--line) solid var(--ink); border-radius: 999px; }

/* 소개 종이가 없는 화면에서는 받침을 서류철 바로 아래에 붙인다 */
body:not(#tt-body-index) .base-plate { margin-top: 48px; }

/* ── 페이지 번호 ──────────────────── */
.paging { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; font-family: var(--mono); font-size: 13px; }
.paging a { color: var(--ink); text-decoration: none; padding: 6px 8px; min-width: 32px; text-align: center; }
.paging .nums { display: flex; gap: 4px; }
.paging .selected, .paging .nums a.selected, .paging .nums span.selected { background: var(--ink); color: var(--paper); }
.paging .no-more-prev, .paging .no-more-next { visibility: hidden; }

.site-foot { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.site-foot p { margin: 0; }
.site-foot a { color: var(--muted); }

/* ── 좁은 화면 ────────────────────── */
@media (max-width: 640px) {
	.page { padding: 24px 16px 56px; }
	.headline { font-size: 27px; }
	.card { width: calc(100% - 16px); padding: 22px 18px 48px; }
	.card.file { padding-bottom: 24px; }
	.card .title { font-size: 25px; }
	.fig { flex-basis: 100%; }
	.fig-box { width: 160px; height: 160px; }
	.fig-box .ring, .fig-box .needle, .fig-box .dot { zoom: 0.77; }
	.facts { grid-template-columns: minmax(0, 1fr); }
	.folder .tab { width: 58%; min-width: 0; max-width: none; }
	.folder:nth-of-type(3n+2) .tab, .folder:nth-of-type(3n) .tab { margin-left: 5%; }
	.folder:nth-of-type(2n) .tab { margin-left: 37%; }
	.folder.intro .tab { margin-left: 5%; }
	.base-plate { margin-left: 0; margin-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.folder .tab { transition: none; }
}

/* 소개 표지: 겹친 두 정사각형 (원 디자인의 mark 도형) */
:root { --glass-a: #FFFFFF; --glass-b: #B9BEC9; --glass-c: #F7F9FC; --glass-d: #8E95A3; --glass-hi: #FFFFFF; }
.mark-fig svg.mark { display: block; width: 208px; height: 208px; background: var(--sheet); border: var(--line) solid var(--ink); }
.mark .g-a { stop-color: var(--glass-a); } .mark .g-b { stop-color: var(--glass-b); }
.mark .g-c { stop-color: var(--glass-c); } .mark .g-d { stop-color: var(--glass-d); }
.mark .ln { fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.mark .dash { stroke-dasharray: 3 4; }
.mark .bold { stroke-width: 3.2; stroke-linejoin: miter; stroke-linecap: square; }
.mark .soft { stroke: var(--muted); }
.mark .dot { fill: var(--ink); stroke: none; }
.mark .glass { fill: url(#glass); stroke: none; }
.mark .sheen { fill: var(--glass-hi); opacity: 0.5; stroke: none; }
.mark .grain { fill: var(--ink); stroke: none; filter: url(#grain); }
@media (max-width: 640px) { .mark-fig svg.mark { width: 160px; height: 160px; } }

/* 본문 문단 간격: 티스토리 기본 p 여백 제거 덮어쓰기 */
.entry .tt_article_useless_p_margin p, .entry .contents_style p { margin: 0 0 1.1em !important; }


/* 첫 화면 소개: 분류 서랍을 열었을 때처럼 INTRO 탭에 바로 붙은 흰 문서로 보이게 */
#tt-body-index #drawer:not(.cat-open) .folder.intro { margin-bottom: 0; }
#tt-body-index #drawer:not(.cat-open) .folder.intro .sheet { display: none; }
#tt-body-index #drawer:not(.cat-open) .card.about { position: relative; width: 100%; max-width: none; box-sizing: border-box; margin: 0 0 -40px; padding: 28px 28px 96px; background: var(--sheet); border: 1.5px solid var(--ink); border-bottom: 0; border-radius: 10px 10px 0 0; box-shadow: none; }
#tt-body-index #drawer:not(.cat-open) .card.about .card-top { display: none; }
@media (max-width: 640px) {
	#tt-body-index #drawer:not(.cat-open) .card.about { padding: 20px 16px 88px; }
}

/* 인덱스 하나를 고르면 나머지 탭은 INTRO 탭처럼 회색 바탕 + 검은 테두리로 접힌 모양 */
#drawer.cat-open .folder.divider:not(.is-current) .tab, .has-stack #drawer .folder.divider:not(.is-current) .tab { background: var(--paper); }
#drawer.cat-open .folder.divider:not(.is-current) .t, .has-stack #drawer .folder.divider:not(.is-current) .t { color: var(--ink); }
#drawer.cat-open .folder.divider:not(.is-current) .code, .has-stack #drawer .folder.divider:not(.is-current) .code { color: var(--muted); opacity: 1; }
#drawer.cat-open .folder.divider:not(.is-current) a.tab:hover, .has-stack #drawer .folder.divider:not(.is-current) a.tab:hover { background: var(--ink); }
#drawer.cat-open .folder.divider:not(.is-current) a.tab:hover .t, #drawer.cat-open .folder.divider:not(.is-current) a.tab:hover .code, .has-stack #drawer .folder.divider:not(.is-current) a.tab:hover .t, .has-stack #drawer .folder.divider:not(.is-current) a.tab:hover .code { color: var(--paper); }


/* INTRO 탭도 다른 인덱스와 같은 크기 */
#drawer .folder.intro .tab { width: 20%; min-width: 150px; max-width: 220px; }
@media (max-width: 640px) { #drawer .folder.intro .tab { width: 46%; min-width: 0; } }
/* 다른 인덱스를 열었을 때 INTRO도 같은 높이로 접혀 보이게 */
#tt-body-index #drawer.cat-open .folder.intro { margin-bottom: 3px; }

/* 분류·글 페이지: INTRO 아래 빈 칸 없이 다른 인덱스와 같은 높이로 */
.has-stack #drawer > .folder.intro.back { margin-bottom: -57px; }

/* 글 페이지: 글 탭 바로 아래에 본문 문서가 붙도록, 폭도 탭 서랍과 같게 */
.has-stack #drawer > .folder.is-open { margin-bottom: 0; }
.has-stack #drawer > .folder.is-open .sheet { display: none; }
.has-stack #drawer > article.card { margin: 0 auto 18px; max-width: none; box-sizing: border-box; border-radius: 10px 10px 0 0; box-shadow: none; }

/* 글 본문을 카드 폭에 맞게 꽉 채움 (왼쪽 쏠림 해소) */
article.card .entry { max-width: none; }
