:root {
  /* CCC Brand Guidelines (RGB/웹): Beyond Purple #6f1def, Grow Green #24d400 */
  --paper: #fdfcf9; --surface: #fff; --ink: #1d1b26; --muted: #6f6b7a; --line: #e8e5ee; --rule: #d9d5e3;
  --brand: #6f1def; --brand-soft: #f3edff; --green: #24d400;
  --sans: "Pretendard Variable", Pretendard, -apple-system, "Noto Sans KR", system-ui, sans-serif; --serif: var(--sans);
}
* { box-sizing: border-box; }
body { letter-spacing: -.005em; margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
mark { background: #ece3ff; color: inherit; padding: 0 1px; border-radius: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 로고 */
.logo { display: block; width: auto; min-width: 48px; max-width: 100%; }
.logo-fallback { font-family: var(--serif); font-weight: 700; letter-spacing: .08em; color: var(--brand); font-size: 1.35rem; line-height: 1; }

/* 검색창 */
.searchbox { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.searchbox:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(111,29,239,.12); }
.searchbox-icon { color: var(--muted); margin-left: 1rem; flex: none; }
.searchbox input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 1rem; padding: .8rem .75rem; }
.searchbox button { flex: none; white-space: nowrap; border: 0; background: var(--brand); color: #fff; font-weight: 500; padding: .8rem 1.6rem; cursor: pointer; align-self: stretch; }
.searchbox button:hover { background: #5a12c4; }

/* 메인 */
.home { min-height: calc(100vh - 78px); display: grid; place-items: center; padding: 3rem 1rem; }
.home-inner { width: 100%; max-width: 640px; text-align: center; }
.hero-logo { display: flex; justify-content: center; margin-bottom: 2.2rem; }
.hero-logo .logo { height: auto; width: min(300px, 62vw); }
.hero-logo { margin-bottom: 2.6rem; }
.eyebrow { margin: 0 0 .4rem; color: var(--muted); font-size: .9rem; letter-spacing: .12em; }
.hero-title { font-family: var(--sans); font-weight: 800; font-size: clamp(2.2rem, 7vw, 3.1rem); letter-spacing: -.03em; margin: 0 0 2rem; }
.hero-search .searchbox input { padding: 1rem .8rem; font-size: 1.05rem; }
.hero-search .searchbox button { padding: 1rem 2rem; }
.shelves { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin-top: 2.5rem; border-top: 1px solid var(--rule); }
.shelf { padding: 1.1rem .5rem; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: .15rem; transition: background .15s; }
.shelf:hover { background: var(--brand-soft); }
.shelf-label { font-weight: 500; }
.shelf-sub { font-size: .75rem; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }

/* 상단바 */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(253,252,249,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 1.5rem; padding-block: .75rem; }
.brandline { display: inline-flex; align-items: center; gap: .75rem; white-space: nowrap; }
.brandline .logo { height: 40px; width: auto; }
.brand-sm { font-weight: 700; font-size: 1rem; letter-spacing: -.01em; }
.topbar-search { flex: 1; max-width: 560px; margin-left: auto; }
.topbar-search .searchbox input { padding: .6rem .6rem; font-size: .95rem; }
.topbar-search .searchbox button { padding: .6rem 1.2rem; }

/* 본문 */
.page { padding-block: 1.5rem 4rem; }
.tabs { display: flex; gap: 1.6rem; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: .6rem 0; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--brand); font-weight: 700; border-bottom-color: var(--brand); }

.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 3.5rem; align-items: start; }

/* 분류 색인 */
.side-box { position: sticky; top: 84px; max-height: calc(100vh - 108px); display: flex; flex-direction: column; }
.side-box summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; font-weight: 700; font-size: .92rem; padding-bottom: .6rem; }
.side-box summary::-webkit-details-marker { display: none; }
.count { font-weight: 400; font-size: .8rem; color: var(--muted); }
.part-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.part-list a { display: flex; justify-content: space-between; gap: .75rem; padding: .3rem 0; font-size: .92rem; color: #4a4655; }
.part-list a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part-list a em { font-style: normal; font-size: .8rem; color: #a29db0; font-variant-numeric: tabular-nums; }
.part-list a:hover { color: var(--brand); }
.part-list a.is-active { color: var(--brand); font-weight: 700; }

.result-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; padding-bottom: .75rem; }
.result-head h2 { font-size: .95rem; font-weight: 400; margin: 0; color: var(--muted); }
.result-head strong { color: var(--ink); font-weight: 700; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { color: var(--brand); background: var(--brand-soft); border-radius: 4px; padding: .05rem .6rem; font-size: .82rem; }

/* 목록 */
.entries { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.entry { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.entry h3 { margin: 0; font-family: var(--sans); font-size: 1.05rem; font-weight: 650; letter-spacing: -.01em; line-height: 1.5; word-break: keep-all; }
.entry h3 small { font-family: var(--sans); font-weight: 400; font-size: .88rem; color: var(--muted); margin-left: .35rem; }
.entry:hover h3 { color: var(--brand); }
.meta { margin: .2rem 0 0; font-size: .85rem; color: var(--muted); }
.exp { margin: .45rem 0 0; font-size: .9rem; color: #4a4655; white-space: pre-line; }
.empty { text-align: center; color: var(--muted); padding: 3.5rem 1rem; border-bottom: 1px solid var(--line); }

.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: .25rem; margin-top: 2rem; }
.pager a, .pager .gap { min-width: 2.3rem; text-align: center; padding: .35rem .7rem; border-radius: 6px; font-size: .92rem; font-variant-numeric: tabular-nums; }
.pager a { border: 1px solid transparent; color: var(--muted); }
.pager a:hover { border-color: var(--rule); color: var(--ink); }
.pager a.is-active { color: var(--brand); border-color: var(--brand); font-weight: 700; }
.pager .gap { color: var(--muted); }

.site-footer { border-top: 1px solid var(--rule); color: var(--muted); text-align: center; padding: 1.4rem 0; font-size: .82rem; }
.site-footer .tagline { font-weight: 700; letter-spacing: .14em; font-size: .75rem; color: var(--brand); text-transform: uppercase; }
.site-footer .tagline b { color: var(--brand); }
.site-footer small { display: block; margin-top: .25rem; font-size: .8rem; }
.back { color: var(--brand); font-weight: 700; }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .side-box { position: static; max-height: none; }
  .part-list { max-height: 50vh; }
  .topbar-inner { flex-wrap: wrap; gap: .6rem; }
  .topbar-search { flex-basis: 100%; max-width: none; order: 3; }
}

/* 푸터 로고 */
.footer-logo { display: flex; justify-content: center; margin-bottom: .6rem; }
.footer-logo .logo { height: 34px; }
