@font-face{
  font-family:'JoseonGulim';
  src:url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_20-04@1.0/ChosunGu.woff') format('woff');
  font-weight:normal;
  font-display:swap;
}
/* ───────── lithon blog ───────── */
:root{
  --bg:#fdfdf2; --red:#ca1e08; --ink:#8e1606; --text:#111111; --panel:#f2f2e8;
  --pixel:'DotGothic16',monospace;
  --mono:'Space Mono','JoseonGulim','Noto Sans KR',monospace;
  --sans:'JoseonGulim','Noto Sans KR',-apple-system,BlinkMacSystemFont,sans-serif;
  --body:'JoseonGulim','Noto Sans KR',-apple-system,sans-serif;
  /* 화면 최대 가로 폭 — 여기 하나만 고치면 전체가 같이 바뀝니다 */
  --wrap:1600px;
}
*{box-sizing:border-box}
html{scroll-padding-top:60px}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--mono);-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}
:focus-visible{outline:2px solid var(--red);outline-offset:2px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.muted{opacity:.6;font-size:.85em}
.h-pixel,.pixel{font-family:var(--pixel);font-weight:400}
.h-pixel{font-size:45px;line-height:.9;margin:0 0 18px}

/* nav */
.topnav{position:sticky;top:0;z-index:30;height:45px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 14px;background:var(--bg);border:1px solid var(--red);border-top:0;font-family:var(--pixel);font-size:13px}
.topnav a:hover{opacity:.7}
.topnav__title{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.navbtn{display:none;flex-direction:column;justify-content:center;gap:4px;
  width:30px;height:28px;padding:0 4px;border-radius:5px;flex-shrink:0}
.navbtn span{display:block;height:1.5px;background:var(--red);border-radius:2px;
  transition:transform .26s cubic-bezier(.2,.7,.2,1),opacity .18s}
.navbtn:hover{background:rgba(202,30,8,.08)}
.navbtn.is-open span:nth-child(1){transform:translateY(5.5px) rotate(45deg)}
.navbtn.is-open span:nth-child(2){opacity:0}
.navbtn.is-open span:nth-child(3){transform:translateY(-5.5px) rotate(-45deg)}
.backdrop{position:fixed;inset:45px 0 0 0;z-index:55;background:rgba(40,20,14,.35);
  opacity:0;pointer-events:none;transition:opacity .26s}
.backdrop.is-on{opacity:1;pointer-events:auto}

/* ───── home ───── */
.home{max-width:var(--wrap);margin:0 auto}
.shelf{position:relative;display:flex;justify-content:center;align-items:center;gap:clamp(12px,3vw,36px);min-height:calc(100vh - 45px);min-height:calc(100svh - 45px);padding:40px 16px 110px}
.scroll-hint{position:absolute;left:50%;bottom:26px;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:6px;font-family:var(--pixel);font-size:13px;transition:opacity .4s}
.scroll-hint svg{width:18px;height:18px;fill:none;stroke:var(--red);stroke-width:1.5;animation:nudge 1.6s ease-in-out infinite}
@keyframes nudge{0%,100%{transform:translateY(0)}50%{transform:translateY(6px)}}
.is-scrolled .scroll-hint{opacity:0;pointer-events:none}
.board{scroll-margin-top:60px}
.js [data-reveal]{opacity:0;transform:translateY(40px);transition:opacity .7s ease,transform .7s cubic-bezier(.2,.7,.2,1);transition-delay:var(--d,0s)}
.js [data-reveal].is-in{opacity:1;transform:none}
@media (prefers-reduced-motion:reduce){.js [data-reveal]{opacity:1;transform:none;transition:none}.scroll-hint svg{animation:none}}
.niche{position:relative;width:min(296px,30vw);aspect-ratio:600/766}
.niche__arch{position:absolute;inset:0;display:block}
.niche__bg{width:100%;height:100%}
.niche__bear{position:absolute;left:50%;bottom:7%;transform:translateX(-50%);transition:transform .25s}
.niche__arch:hover .niche__bear{transform:translateX(-50%) scale(1.04)}
.niche__tag{position:absolute;top:86.8%;width:25.3%;aspect-ratio:160/199;z-index:2;color:#3f3f3f;text-align:center}
.niche__tag img{position:absolute;inset:0;width:100%;height:100%}
.niche__tagname,.niche__tagcount{position:absolute;left:0;right:0;line-height:1}
.niche__tagname{top:53%;font-family:var(--sans);font-weight:700;font-size:clamp(8px,1.05vw,13px)}
.niche__tagcount{top:69%;font-family:var(--pixel);font-size:clamp(7px,.9vw,11px)}

/* receipt: floats on top of the clicked arch */
.niche.is-open{z-index:10}
.receipt{position:absolute;left:0;top:-3.7%;width:100%;min-height:119%;z-index:5;display:flex;
  filter:drop-shadow(0 13px 9px rgba(0,0,0,.20));animation:pop .18s ease-out}
.receipt__paper{flex:1;display:flex;flex-direction:column;align-items:center;background:#fffdf7;
  padding:30px 16px 26px;color:#1a1a1a;font-family:'Space Mono','JoseonGulim','Noto Sans KR',monospace}
.receipt[hidden]{display:none}
@keyframes pop{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none}}
.receipt__title{margin:10px 0 0;font-weight:700;font-size:20px;letter-spacing:.32em;text-indent:.32em}
.receipt__store{margin:8px 0 0;font-size:10px;letter-spacing:.22em;opacity:.65}
.receipt__meta{margin:4px 0 0;font-size:10px;opacity:.5}
.receipt__rule{width:100%;border-top:1px dashed rgba(0,0,0,.45);margin:14px 0}
.receipt__rule--double{border-top:3px double rgba(0,0,0,.5);margin:12px 0 14px}
.receipt__cat{font-size:12px;font-weight:700;letter-spacing:.08em}
.receipt__head{display:flex;justify-content:space-between;width:100%;margin:0 0 10px;font-size:9.5px;letter-spacing:.2em;opacity:.55}
.receipt__list{list-style:none;margin:0;padding:0;width:100%;display:flex;flex-direction:column;gap:9px}
.receipt__list a{display:flex;align-items:baseline;gap:6px;width:100%}
.receipt__item{font-family:var(--sans);font-size:12.5px;white-space:nowrap}
.receipt__dots{flex:1;border-bottom:1px dotted rgba(0,0,0,.4);transform:translateY(-3px)}
.receipt__n{font-size:12px;font-weight:700;white-space:nowrap}
.receipt__list a:hover .receipt__item{text-decoration:underline}
.receipt__empty{font-family:var(--sans);font-size:11px;opacity:.5;text-align:center}
.receipt__total{display:flex;justify-content:space-between;width:100%;margin:0;font-size:13px;font-weight:700;letter-spacing:.14em}
.receipt__barcode{width:74%;height:34px;margin-top:auto;
  background:repeating-linear-gradient(90deg,#1a1a1a 0 2px,transparent 2px 4px,#1a1a1a 4px 5px,transparent 5px 9px,#1a1a1a 9px 12px,transparent 12px 14px)}
.receipt__code{margin:6px 0 0;font-size:9px;letter-spacing:.2em;opacity:.7}
.receipt__note{margin:10px 0 0;font-family:var(--sans);font-size:9.5px;opacity:.45}

/* hello board + grid */
.board{margin:0 40px;border:1px solid var(--red);overflow:hidden}
.board__hello{border-bottom:1px solid var(--red);min-height:255px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:22px;padding:40px 16px}
.board__big{margin:0;font-family:var(--pixel);font-size:34px;letter-spacing:-1px}
.board__small{margin:0;font-size:11px}
.grid{display:grid;background:var(--bg)}
.grid--4{grid-template-columns:repeat(auto-fill,minmax(min(250px,100%),1fr));margin:0 -1px -1px 0}
.grid--4>.card{border-right:1px solid var(--red);border-bottom:1px solid var(--red)}
.grid--2{grid-template-columns:repeat(auto-fill,minmax(min(260px,100%),1fr));padding:0 1px 1px 0}
.grid__item{display:flex;background:var(--bg);border:1px solid var(--red);margin:0 -1px -1px 0}
.grid__item[hidden]{display:none}
.grid__item.is-swap{animation:cardIn .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:var(--d,0s)}
.rise{animation:cardIn .5s cubic-bezier(.2,.7,.2,1) both;animation-delay:var(--d,0s)}
@media (prefers-reduced-motion:reduce){.rise{animation:none}}
@keyframes cardIn{from{opacity:0;transform:translateY(18px) scale(.97)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.grid__item.is-swap{animation:none}}
.card{flex:1;min-width:0;background:var(--bg);display:flex;flex-direction:column;align-items:center;gap:clamp(12px,1.7vw,18px);padding:clamp(18px,2.4vw,28px) clamp(14px,2vw,24px) clamp(16px,1.8vw,22px);transition:background .15s}
.card:hover{background:#faf6e6}
.card__folios{width:100%;display:flex;justify-content:space-between;gap:8px;font-family:var(--sans);font-size:14px}
.card__img{width:100%;aspect-ratio:16/9;background:#fff;border:1px solid var(--red);display:flex;align-items:center;justify-content:center;overflow:hidden}
.card__img--photo img{width:100%;height:100%;object-fit:cover;transition:transform .4s}
.card:hover .card__img--photo img{transform:scale(1.04)}
.card__img--text{align-items:flex-start;justify-content:flex-start;padding:clamp(12px,1.6vw,18px)}
.card__excerpt{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden;font-family:var(--body,var(--sans));font-size:13px;line-height:1.65;color:rgba(17,17,17,.42);text-align:left;word-break:keep-all;overflow-wrap:anywhere}
.card__title{font-size:15px;line-height:1.35;text-align:center;word-break:keep-all}
.card__meta{display:flex;flex-direction:column;align-items:center;gap:6px}
.card__date{font-family:'Space Mono',monospace;font-size:11px;opacity:.55}
.card__arrow{align-self:flex-end;width:23px;height:23px;fill:none;stroke:var(--red);stroke-width:1}

/* footer */
.footer{margin-top:60px;border-top:1px solid var(--red);padding:60px 16px 64px;display:flex;flex-direction:column;align-items:center;gap:20px;text-align:center}
.footer p{margin:0;display:flex;flex-wrap:wrap;align-items:baseline;justify-content:center;gap:12px}
.footer__big{font-family:var(--pixel);font-size:32px}
.footer p a{font-size:15px;text-decoration:underline;text-underline-offset:4px}
.main .footer{margin-top:auto}

/* ───── sidebar layout ───── */
.with-sidebar{display:flex;max-width:var(--wrap);margin:0 auto;min-height:calc(100vh - 45px)}
.sidebar{width:280px;flex-shrink:0;border-left:1px solid var(--red);border-right:1px solid var(--red);padding:80px 22px 40px;display:flex;flex-direction:column;align-items:stretch;gap:24px}
.profile{display:flex;align-items:center;gap:12px}
.profile img{width:96px;height:96px;border-radius:50%;object-fit:cover;border:1px solid rgba(202,30,8,.3);flex-shrink:0}
.profile span{font-size:15px}
.sidebar__nav{display:flex;flex-direction:column;align-items:stretch;gap:14px;font-size:15px}
.sidebar__nav>a:hover,.tree a:hover{opacity:.7}
.tree{display:flex;flex-direction:column;gap:8px;margin-top:4px}
.tree__root{display:block;font-size:15px;font-weight:700}
.tree__cat{margin-left:6px;padding-left:10px;border-left:1px solid rgba(202,30,8,.54);display:flex;flex-direction:column;gap:6px}
.tree__cat + .tree__cat{margin-top:8px}
.tree__head{display:flex;align-items:center;gap:8px}
.tree__toggle{display:flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0;margin-left:-4px;border-radius:3px}
.tree__toggle:hover{background:rgba(202,30,8,.10)}
.tree__label{display:flex;align-items:center;gap:9px;font-size:15px;color:var(--ink)}
.tree__thumb{width:52px;height:auto;flex-shrink:0;transition:transform .22s}
.tree__label:hover .tree__thumb{transform:scale(1.05)}
.tree__label:hover{opacity:.7}
.tree__label.is-on{font-weight:700}
.chev{width:6px;height:6px;border-right:1.4px solid var(--red);border-bottom:1.4px solid var(--red);transform:rotate(45deg);transition:transform .25s;flex-shrink:0;margin-bottom:2px}
.tree__cat.is-closed .chev{transform:rotate(-45deg);margin-bottom:0}
.tree__subs{overflow:hidden;display:flex;flex-direction:column;gap:5px;padding-left:24px;padding-top:2px}
.tree__cat.is-closed .tree__subs{display:none}
.tree__sub{text-align:left;font-size:14px;color:#3f3f3f;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tree__sub.is-on{color:var(--ink);font-weight:700}
.tree__n{font-size:10.5px;opacity:.55}
.main{flex:1;min-width:0;display:flex;flex-direction:column;border-right:1px solid var(--red)}
.section{padding:80px 60px 40px}

/* category list page */
.pagehead{position:relative;border-bottom:1px solid var(--red);display:flex;align-items:center;justify-content:center;overflow:hidden}
.pagehead--list{height:190px}
.pagehead__big{margin:0;font-family:var(--pixel);font-weight:400;font-size:64px}
.pagehead__bear{position:absolute;right:0;bottom:-24px;width:140px;height:auto}
.tabs{display:flex;flex-wrap:wrap;gap:clamp(8px,1.4vw,14px);padding:24px clamp(16px,3vw,40px)}
.tab{min-width:clamp(96px,14vw,150px);padding:clamp(9px,1.2vw,13px) clamp(14px,2vw,22px);border:1px solid var(--red);font-family:var(--sans);font-size:15px;color:#000;transition:background .15s}
.tab small{font-size:11px;opacity:.6;margin-left:4px}
.tab:hover{background:rgba(202,30,8,.06)}
.tab.is-on{background:var(--red);color:var(--bg)}
.listwrap{padding:8px clamp(16px,3vw,40px) 40px}
.empty{padding:60px 0;text-align:center;opacity:.7}

/* post */
.posthead{position:relative;min-height:230px;border-bottom:1px solid var(--red);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:40px clamp(24px,7vw,90px);overflow:hidden;text-align:center}
.posthead__meta,.posthead__date{margin:0;font-family:var(--sans);font-size:14px}
.posthead__meta a:hover{text-decoration:underline}
.posthead__title{margin:0;font-family:var(--sans);font-weight:400;font-size:clamp(28px,4vw,48px);line-height:1.15;word-break:keep-all}
.posthead__title.pixel{font-family:var(--pixel)}
.prose{max-width:760px;width:100%;margin:0 auto;padding:80px 40px;color:var(--text);font-family:var(--body,var(--sans));font-size:16px;line-height:1.85;word-break:keep-all;overflow-wrap:anywhere}
.prose h2,.prose h3{font-family:var(--pixel);font-weight:400;color:var(--ink);line-height:1.1}
.prose h2{font-size:34px;margin:2.4em 0 .8em;text-align:left }
.prose h2:first-child{margin-top:0}
.prose h3{font-size:24px;margin:2em 0 .6em}
.prose a{color:var(--red);text-decoration:underline;text-underline-offset:3px}
.prose strong{color:var(--text)}
.prose blockquote{margin:1.5em 0;padding:4px 20px;border-left:3px solid var(--red);background:rgba(202,30,8,.04)}
.prose img{margin:1.5em auto;border:1px solid rgba(202,30,8,.3)}
/* 본문 사진 크기 — 글에서 {: .small } 처럼 붙여요 */
.prose img.small{width:240px}
.prose img.medium{width:55%;min-width:220px}
.prose img.full{width:100%}
/* 사진 옆에 글 쓰기 */
.prose img.left{float:left;max-width:46%;margin:.35em 1.6em 1.1em 0}
.prose img.right{float:right;max-width:46%;margin:.35em 0 1.1em 1.6em}
.prose img.left.small,.prose img.right.small{max-width:none}
.prose h2,.prose h3,.prose hr{clear:both}
.prose .clear{clear:both}
/* 사진 두 장 나란히 — {: .pair } 를 문단에 붙여요 */
.prose p.pair{display:flex;gap:14px;align-items:flex-start}
.prose p.pair img{flex:1;min-width:0;margin:1.5em 0}
.prose hr{border:0;border-top:1px dashed var(--red);margin:3em 0}
.prose table{border-collapse:collapse;width:100%;display:block;overflow-x:auto;font-size:14px}
.prose th,.prose td{border:1px solid rgba(202,30,8,.35);padding:8px 12px}
.prose th{background:rgba(202,30,8,.06);color:var(--ink)}
.prose code{font-family:'Space Mono',monospace;font-size:.88em;background:rgba(202,30,8,.07);color:var(--ink);padding:2px 6px}
.prose pre{background:#fffdf5;border:1px solid rgba(202,30,8,.35);padding:16px 18px;overflow-x:auto;line-height:1.6}
.prose pre code{background:none;padding:0;color:#24292f;font-size:13.5px}
.prose div.highlighter-rouge{margin:1.5em 0}

/* prev / next */
.postnav{display:grid;grid-template-columns:1fr 1fr 215px;border-top:1px solid var(--red);border-bottom:1px solid var(--red);min-height:250px}
.postnav__cell{background:var(--panel);border-right:1px solid var(--red);padding:36px 44px;display:flex;flex-direction:column;justify-content:space-between;gap:20px;font-family:var(--sans);font-size:18px}
.postnav__top{display:flex;justify-content:space-between;gap:12px}
.postnav__top span{font-size:15px;line-height:1.5}
.postnav__cell:first-child .postnav__top span{text-align:right}
.postnav__top a:hover{text-decoration:underline}
.postnav__bottom{display:flex;justify-content:space-between;align-items:flex-end}
.postnav__thumb{width:120px;height:80px;object-fit:cover;background:#fff;border:1px solid rgba(202,30,8,.35);display:block}
img.postnav__thumb{transition:transform .3s}
.postnav__cell:hover img.postnav__thumb{transform:scale(1.03)}
.postnav__go svg{width:70px;height:70px;fill:none;stroke:var(--red);stroke-width:2;transition:transform .2s}
.postnav__go:hover svg{transform:scale(1.08)}
.postnav__cell.is-empty .postnav__top span{opacity:.5}
.postnav__others{padding:24px 10px;font-family:var(--sans);text-align:center}
.postnav__others p{margin:0 0 10px;font-size:16px}
.postnav__others ul{list-style:none;margin:0;padding:0}
.postnav__others a{display:block;padding:4px 6px;font-size:13px;border-bottom:1px solid rgba(202,30,8,.28);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.postnav__others a:hover{background:rgba(202,30,8,.06)}
.postnav__others a.is-on{background:#9e3224;color:#fff}
.comments{padding:60px 40px 0}

/* categories accordion */
.acc{display:flex;flex-direction:column;gap:24px;margin-top:40px}
.acc__item{border:1px solid var(--red)}
.acc__head{position:relative;list-style:none;display:flex;align-items:center;gap:12px;height:74px;padding:0 34px;background:rgba(202,30,8,.08);cursor:pointer}
.acc__head::-webkit-details-marker{display:none}
.acc__head>a{font-size:17px;font-weight:700}
.acc__head>a:hover{text-decoration:underline}
.acc__chev{margin-left:auto;width:9px;height:9px;border-right:1.5px solid var(--ink);border-bottom:1.5px solid var(--ink);transform:rotate(45deg);transition:transform .35s cubic-bezier(.2,.7,.2,1)}
.acc__item[open] .acc__chev{transform:rotate(-135deg)}
.acc__bear{position:absolute;right:90px;bottom:0;width:100px;height:auto;pointer-events:none}
.acc__panel{overflow:hidden}
.acc__list{list-style:none;margin:0;padding:6px 0 18px;border-top:1px solid var(--red)}
.acc__list a{display:flex;align-items:center;gap:10px;padding:13px 46px;font-size:15px}
.acc__list a:hover{background:rgba(202,30,8,.04)}
.acc__none{padding:13px 46px}
.ico{width:18px;height:16px;fill:var(--red);fill-opacity:.75;flex-shrink:0}
.ico--line{width:16px;height:14px;fill:none;stroke:var(--red);stroke-width:1.2}

/* tags / pills */
.pills{list-style:none;padding:0;margin:28px 0 0;display:flex;flex-wrap:wrap;gap:12px 10px}
.pills--center{justify-content:center}
.pill{display:inline-flex;align-items:baseline;gap:6px;padding:7px 14px;border:1px solid rgba(202,30,8,.45);border-radius:999px;font-size:15px;transition:background .15s}
.pill small{font-size:11px;opacity:.6}
.pill:hover{background:rgba(202,30,8,.07)}

/* archives */
.archive__year{font-family:var(--pixel);font-weight:400;font-size:28px;margin:40px 0 12px}
.archive{list-style:none;padding:0;margin:0;border-top:1px solid rgba(202,30,8,.35)}
.archive li{display:flex;gap:16px;align-items:baseline;padding:12px 4px;border-bottom:1px solid rgba(202,30,8,.2);font-family:var(--sans);font-size:15px}
.archive time{font-family:'Space Mono',monospace;font-size:13px;opacity:.7}
.archive a:hover{text-decoration:underline}
.archive .muted{margin-left:auto;white-space:nowrap}

/* about */
.about{padding:80px 40px;display:flex;flex-direction:column;align-items:center;gap:80px;text-align:center}
.about section{display:flex;flex-direction:column;align-items:center;gap:8px;max-width:520px}
.about__photo{width:180px;height:180px;border-radius:50%;object-fit:cover;border:1px solid var(--red);margin-bottom:24px}
.about p{font-family:var(--body,var(--sans));color:var(--text);font-size:15px;line-height:1.8;margin:0}
.about__contact{list-style:none;padding:0;margin:10px 0 0;display:flex;flex-direction:column;gap:14px;font-size:15px}
.about__contact a{text-decoration:underline;text-underline-offset:4px}

/* rouge (github light) */
.highlight .c,.highlight .c1,.highlight .cm{color:#6e7781;font-style:italic}
.highlight .k,.highlight .kd,.highlight .kn,.highlight .kr{color:#cf222e}
.highlight .s,.highlight .s1,.highlight .s2,.highlight .sb{color:#0a3069}
.highlight .m,.highlight .mi,.highlight .mf{color:#0550ae}
.highlight .nf,.highlight .fm{color:#8250df}
.highlight .nb,.highlight .bp{color:#953800}
.highlight .o,.highlight .ow{color:#cf222e}
.highlight .nc{color:#953800;font-weight:600}

/* ───── responsive ───── */
@media (max-width:1000px){
  .navbtn:not([hidden]){display:flex}
  /* 사이드바는 위로 가지 않고, 왼쪽에서 열리는 서랍이 돼요 */
  .with-sidebar{display:block}
  .sidebar{position:fixed;top:45px;left:0;bottom:0;z-index:60;
    width:284px;max-width:84vw;background:var(--bg);
    border-left:0;border-right:1px solid var(--red);
    padding:26px 22px 40px;overflow-y:auto;
    align-items:stretch;
    transform:translateX(-102%);transition:transform .28s cubic-bezier(.2,.7,.2,1)}
  .sidebar.is-open{transform:none;box-shadow:0 0 30px rgba(0,0,0,.18)}
  .profile img{width:76px;height:76px}
  .main{border-left:0;border-right:0;min-height:calc(100vh - 45px)}
  .postnav{grid-template-columns:1fr 1fr}
  .postnav__others{grid-column:1/-1;border-top:1px solid var(--red)}
  .posthead{padding:36px 20px 80px}
}
@media (prefers-reduced-motion:reduce){
  .sidebar,.navbtn span,.backdrop{transition:none}
}
@media (max-width:640px){
  .topnav__title{display:none}
  .shelf{gap:8px;padding-left:8px;padding-right:8px}
  .niche{width:31vw}
  .receipt{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:min(300px,86vw);min-height:0;z-index:50;animation:none}
  .receipt__paper{padding-bottom:18px}
  .board{margin:0 12px}
  .section{padding:48px 20px 24px}
  .prose{padding:48px 20px}
  .prose img.left,.prose img.right{float:none;max-width:100%;margin:1.5em auto}
  .prose img.small,.prose img.medium{width:min(240px,100%)}
  .prose p.pair{flex-direction:column}
  .postnav{grid-template-columns:1fr}
  .postnav__cell{border-right:0;border-bottom:1px solid var(--red);padding:24px}
  .acc__head{padding:0 16px}
  .acc__bear{right:40px;width:70px}
  .acc__list a{padding:12px 24px}
  .footer__big{font-size:24px}
  .h-pixel{font-size:34px}
  .pagehead__big{font-size:44px}
}

/* ───── 글 목차 (오른쪽 막대, 마우스를 올리면 펼쳐져요) ───── */
/* 본문 칸(--wrap) 안쪽 오른쪽에 붙여요 */
.rail{position:fixed;right:max(14px, calc(50vw - var(--wrap) / 2 + 18px));top:50%;transform:translateY(-50%);z-index:25;
  display:flex;flex-direction:column;align-items:flex-end;gap:10px}
.toc{width:46px;max-height:74vh;overflow:hidden;
  display:flex;flex-direction:column;gap:8px;padding:13px 14px;box-sizing:border-box;
  transition:width .26s cubic-bezier(.2,.7,.2,1),background .2s,border-color .2s,box-shadow .2s;
  background:transparent;border:1px solid transparent;border-radius:10px}
.toc[hidden]{display:none}
.toc:hover{width:236px;gap:11px;padding:15px 14px;background:var(--bg);border-color:rgba(202,30,8,.45);
  box-shadow:0 6px 20px rgba(0,0,0,.10);overflow-y:auto}
.toc__item{display:flex;align-items:flex-start;gap:9px;text-decoration:none;color:var(--ink)}
.toc__bar{display:block;height:2px;margin-top:3px;border-radius:2px;flex-shrink:0;
  background:rgba(202,30,8,.4);transition:width .26s cubic-bezier(.2,.7,.2,1),background .2s}
.toc__item--h2 .toc__bar{width:18px}
.toc__item--h3 .toc__bar{width:11px;margin-left:8px}
.toc:hover .toc__item--h2 .toc__bar{width:12px}
.toc:hover .toc__item--h3 .toc__bar{width:8px}
.toc__text{flex:1;min-width:0;opacity:0;max-height:0;overflow:hidden;
  transition:opacity .18s,max-height .26s cubic-bezier(.2,.7,.2,1);
  font-size:12.5px;line-height:1.35;word-break:keep-all;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.toc:hover .toc__text{opacity:1;max-height:3.6em}
.toc__item:hover .toc__bar{background:var(--red)}
.toc__item:hover .toc__text{text-decoration:underline;text-underline-offset:3px}
.toc__item.is-on .toc__bar{background:var(--red);height:3px;margin-top:2.5px}
.toc__item.is-on .toc__text{font-weight:700}
@media (max-width:1180px){.rail{display:none}}
@media (prefers-reduced-motion:reduce){.toc,.toc__bar,.toc__text,.totop{transition:none}}

/* 맨 위로 버튼 (목차 바로 밑) */
.totop{width:46px;height:36px;display:flex;align-items:center;justify-content:center;
  border:1px solid rgba(202,30,8,.45);border-radius:8px;background:var(--bg);
  opacity:0;transform:translateY(-4px);pointer-events:none;
  transition:opacity .22s,transform .22s,background .18s}
.totop[hidden]{display:none}
.totop.is-in{opacity:1;transform:none;pointer-events:auto}
.totop svg{width:15px;height:15px;fill:none;stroke:var(--red);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.totop:hover{background:rgba(202,30,8,.08)}

/* 사이드바 검색 */
.search{position:relative;display:flex;align-items:center;gap:7px;
  border:1px solid rgba(202,30,8,.4);border-radius:7px;padding:0 9px;height:34px;
  transition:border-color .18s}
.search:focus-within{border-color:var(--red)}
.search__icon{width:13px;height:13px;flex-shrink:0;fill:none;stroke:var(--red);stroke-width:1.5;stroke-linecap:round;opacity:.75}
.search__input{flex:1;min-width:0;border:0;outline:0;background:none;
  font-family:var(--mono);font-size:13px;color:var(--ink)}
.search__input::placeholder{color:var(--ink);opacity:.45}
.search__input::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none}
.search__panel{position:absolute;left:0;top:calc(100% + 7px);z-index:40;
  width:max(100%,296px);max-height:60vh;overflow-y:auto;
  background:var(--bg);border:1px solid var(--red);border-radius:8px;
  box-shadow:0 8px 22px rgba(0,0,0,.12);padding:5px}
.search__panel[hidden]{display:none}
.search__hit{display:block;padding:9px 10px;border-radius:5px;text-decoration:none}
.search__hit:hover,.search__hit.is-on{background:rgba(202,30,8,.08)}
.search__title{display:block;font-size:13.5px;color:var(--ink);line-height:1.35;word-break:keep-all}
.search__meta{display:block;margin-top:3px;font-family:'Space Mono',monospace;font-size:10.5px;color:var(--ink);opacity:.55}
.search__snip{display:block;margin-top:4px;font-size:11.5px;line-height:1.5;color:var(--text);opacity:.65;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.search__hit mark{background:rgba(202,30,8,.18);color:inherit;padding:0 1px}
.search__none{padding:12px 10px;font-size:12.5px;color:var(--ink);opacity:.6}

/* ===== 첨부파일 ===== */
.attach{margin:38px 0 10px;display:flex;flex-direction:column;align-items:flex-start}
.attach__label{margin:0 0 9px;font-family:var(--mono);font-size:13px;font-weight:700;letter-spacing:.04em;color:var(--ink)}
.attach__item{display:inline-flex;align-items:center;gap:9px;max-width:100%;min-width:0;padding:10px 13px;margin-bottom:7px;border:1px solid rgba(142,22,6,.22);border-radius:5px;background:var(--panel);color:var(--text);text-decoration:none;transition:border-color .16s,background .16s,transform .16s}
.attach__item:last-child{margin-bottom:0}
.attach__item:hover{border-color:rgba(202,30,8,.55);background:var(--bg);transform:translateY(-1px)}
.attach__clip{flex:none;width:16px;height:16px;color:var(--red)}
.attach__name{flex:0 1 auto;min-width:0;font-family:var(--mono);font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.attach__meta{flex:none;font-family:var(--mono);font-size:12px;color:#8a8a7e}
.attach__ext{flex:none;padding:2px 7px;border-radius:3px;background:var(--red);color:#fff;font-family:var(--mono);font-size:10px;font-weight:700;letter-spacing:.06em}
@media (max-width:560px){
  .attach__item{padding:10px 11px;gap:7px}
  .attach__name{font-size:13px}
  .attach__meta{display:none}
}

/* ===== 형광펜 — 글에서 <mark>텍스트</mark> 처럼 써요 ===== */
.prose mark{
  background:linear-gradient(to top, rgba(255,222,88,.75) 0 44%, transparent 44%);
  color:inherit;
  padding:0 2px;
  border-radius:1px;
  box-decoration-break:clone;
  -webkit-box-decoration-break:clone;
}
.prose mark.pink{background:linear-gradient(to top, rgba(255,160,150,.65) 0 44%, transparent 44%)}
.prose mark.mint{background:linear-gradient(to top, rgba(140,225,205,.70) 0 44%, transparent 44%)}
.prose mark.blue{background:linear-gradient(to top, rgba(160,200,255,.70) 0 44%, transparent 44%)}

/* ── 목차 위계 (펼쳤을 때 대/소제목 구분) ── */
.toc:hover .toc__item--h2{margin-top:10px}
.toc:hover .toc__item--h2:first-child{margin-top:0}
.toc:hover .toc__item--h2 .toc__text{font-size:13px;font-weight:700;color:var(--ink)}
.toc:hover .toc__item--h2 .toc__bar{background:var(--red)}
.toc:hover .toc__item--h3{padding-left:15px}
.toc:hover .toc__item--h3 .toc__text{font-size:11.5px;color:rgba(142,22,6,.72)}
.toc:hover .toc__item--h3.is-on .toc__text{color:var(--ink)}

/* ── 사이드바 따라오기 (넓은 화면에서만) ── */
@media (min-width:1001px){
  /* 사이드바가 내용 높이만큼만 차지하게 되면서 테두리 선이 끊기므로,
     세로 선은 바깥 틀과 본문 쪽으로 옮겨요 */
  .with-sidebar{border-left:1px solid var(--red)}
  .main{border-left:1px solid var(--red)}
  .sidebar{
    position:sticky;
    top:45px;
    align-self:flex-start;
    max-height:calc(100vh - 45px);
    overflow-y:auto;
    overscroll-behavior:contain;
    border-left:0;
    border-right:0;
    padding:34px 22px 28px;
    scrollbar-width:thin;
    scrollbar-color:rgba(202,30,8,.3) transparent;
  }
  .sidebar::-webkit-scrollbar{width:6px}
  .sidebar::-webkit-scrollbar-thumb{background:rgba(202,30,8,.3);border-radius:3px}
  .sidebar::-webkit-scrollbar-track{background:transparent}

}
/* ───── 콜아웃 (블록인용에 {: .note } 처럼 붙여요) ───── */
.prose blockquote.note,
.prose blockquote.tip,
.prose blockquote.warn,
.prose blockquote.check{
  margin:1.7em 0;
  padding:34px 20px 14px;
  border:1.5px solid;
  border-radius:6px;
  position:relative;
}
.prose blockquote.note > :first-child,
.prose blockquote.tip > :first-child,
.prose blockquote.warn > :first-child,
.prose blockquote.check > :first-child{margin-top:0}
.prose blockquote.note > :last-child,
.prose blockquote.tip > :last-child,
.prose blockquote.warn > :last-child,
.prose blockquote.check > :last-child{margin-bottom:0}

/* 왼쪽 위 라벨 */
.prose blockquote.note::before,
.prose blockquote.tip::before,
.prose blockquote.warn::before,
.prose blockquote.check::before{
  position:absolute;
  top:10px; left:20px;
  font-family:var(--mono);
  font-size:10.5px;
  font-weight:700;
  letter-spacing:.14em;
}

/* 참고 라벨 없이, 갈색 */
.prose blockquote.note{border-color:#a9846a;background:rgba(169,132,106,.10);padding-top:14px}
.prose blockquote.note::before{content:none}

.prose blockquote.tip{border-color:#c8862a;background:rgba(200,134,42,.09)}
.prose blockquote.tip::before{content:"팁";color:#9a6512}

.prose blockquote.warn{border-color:var(--red);background:rgba(202,30,8,.06)}
.prose blockquote.warn::before{content:"주의";color:var(--ink)}

.prose blockquote.check{border-color:#4f9e81;background:rgba(79,158,129,.08)}
.prose blockquote.check::before{content:"정리";color:#2f7f63}

@media (max-width:640px){
  .prose blockquote.note,.prose blockquote.tip,
  .prose blockquote.warn,.prose blockquote.check{padding:30px 14px 12px}
  .prose blockquote.note::before,.prose blockquote.tip::before,
  .prose blockquote.warn::before,.prose blockquote.check::before{left:14px}
}