/* 색, 글꼴, 너비와 여백은 이곳에서 바꿀 수 있습니다. */
:root {
  color-scheme: dark;
  --bg: #101012;
  --panel: #19191c;
  --text: #e9e6e0;
  --muted: #99969c;
  --line: #343338;
  --accent: #d6d0c6;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --mono: "Courier New", monospace;
  --header: 65px;
  --width: 1136px;
  --gutter: clamp(22px, 6vw, 84px);
  --chapter-space: clamp(74px, 10vw, 150px);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.9 var(--sans); }
body:has(dialog[open]) { overflow: hidden; }
h1, h2, h3, p, blockquote, dl, dd { margin: 0; }
h1, h2, h3 { overflow-wrap: anywhere; }
a { color: inherit; }
button { color: inherit; font: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
section:focus { outline: none; }
.wrap { width: min(var(--width), 100% - var(--gutter) * 2); margin-inline: auto; }
.muted { color: var(--muted); }
.eyebrow, .date, .enter, .wordmark, nav a, .footer {
  font: 400 .73rem/1.4 var(--mono); letter-spacing: .13em; text-transform: uppercase;
}
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; top: 12px; left: 12px; background: var(--panel); z-index: 20; padding: 8px 16px; }

/* 고정 목차와 가느다란 스크롤 진행선 */
.masthead { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.header-inner { min-height: var(--header); width: min(1280px, 100% - var(--gutter) * 2); margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.wordmark { text-decoration: none; font-weight: bold; white-space: nowrap; letter-spacing: .17em; }
nav { display: flex; gap: clamp(10px, 2.4vw, 32px); }
nav a { position: relative; padding-block: 15px; text-decoration: none; color: var(--muted); white-space: nowrap; }
nav a:hover, nav a[aria-current] { color: var(--text); }
nav a[aria-current]::after { content: ""; position: absolute; height: 1px; background: var(--accent); left: 0; right: 0; bottom: 8px; }
.menu-toggle { display: none; }
.progress { position: absolute; bottom: -1px; width: 100%; height: 1px; background: var(--accent); transform: scaleX(var(--progress, 0)); transform-origin: left; }

/* 표지 사진은 어두운 그라데이션으로 본문과 이어집니다. */
.hero { position: relative; isolation: isolate; display: grid; align-items: center; min-height: min(760px, calc(100svh - var(--header))); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-image, .hero-image::after, .hero-image img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-image { z-index: -1; }
.hero-image img { object-fit: cover; object-position: 63% 56%; opacity: .84; }
.hero-image::after { content: ""; background: linear-gradient(90deg, #101012f5 1%, #101012b8 39%, #10101215 100%), linear-gradient(0deg, #101012 0%, transparent 35%); }
.hero-inner { padding-block: clamp(90px, 13vh, 160px); }
.hero-label { color: var(--accent); display: flex; align-items: center; gap: 13px; margin-bottom: 25px; }
.hero-label::before { content: ""; width: 27px; height: 1px; background: currentColor; }
.hero h1 { font: 400 clamp(3.1rem, 8.8vw, 8.45rem)/.91 var(--serif); letter-spacing: -.065em; }
.hero-subtitle { margin-top: 18px; font: italic 400 clamp(1.45rem, 3vw, 2.55rem)/1.1 var(--serif); color: var(--accent); }
.hero blockquote { margin-top: clamp(25px, 5vh, 47px); color: var(--text); font-size: .93rem; }
.enter { display: inline-flex; align-items: center; min-height: 47px; margin-top: 33px; padding: 0 17px; text-decoration: none; border: 1px solid #a49e9277; background: #10101265; }
.enter:hover { background: var(--panel); border-color: var(--accent); }

/* 장 제목과 본문을 서로 다른 열에 배치해 목차를 읽는 리듬을 만듭니다. */
.chapter { border-bottom: 1px solid var(--line); }
.chapter-inner { padding-block: var(--chapter-space); display: grid; grid-template-columns: minmax(205px, .72fr) minmax(0, 2fr); gap: clamp(25px, 5vw, 74px); }
.chapter-heading h2 { font: 400 clamp(2.45rem, 4.1vw, 4.4rem)/.96 var(--serif); letter-spacing: -.06em; }
.chapter-number { color: var(--muted); margin-bottom: 20px; }
.chapter-subtitle { margin-top: 14px; color: var(--muted); font: italic 1.13rem/1.3 var(--serif); }
.about-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(120px, 1fr); gap: clamp(20px, 4vw, 48px); }
.prose { overflow-wrap: anywhere; }
.prose p + p { margin-top: 1em; }
.profile { border-top: 1px solid var(--line); }
.profile > div { padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.profile dt { color: var(--muted); font-size: .74rem; }
.profile dd { font-size: .87rem; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filter { background: transparent; border: 1px solid var(--line); min-height: 44px; padding: 3px 13px; color: var(--muted); font-size: .78rem; }
.filter:hover, .filter[aria-pressed="true"] { color: var(--text); border-color: var(--accent); background: var(--panel); }
.works { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.work { border-top: 1px solid var(--line); min-width: 0; }
.work-photo { display: block; width: 100%; padding: 0; background: var(--panel); border: 0; overflow: hidden; cursor: zoom-in; }
.work-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: opacity .2s; }
.work-photo:hover img { opacity: .75; }
.work-info { padding-top: 15px; }
.work-info .eyebrow { color: var(--muted); }
.work-info h3 { font: 400 1.38rem/1.08 var(--serif); margin: 8px 0; }
.work-info .muted { font-size: .81rem; }
#afterimages { background: var(--panel); }
.archive-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.archive-row { display: grid; width: 100%; grid-template-columns: 2.15rem minmax(0, 1fr) auto; gap: 10px; align-items: start; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 21px 4px; }
.archive-row:hover { background: var(--bg); }
.archive-row .eyebrow, .archive-arrow { color: var(--muted); padding-top: 6px; }
.archive-info { display: grid; gap: 4px; overflow-wrap: anywhere; }
.archive-title { font-size: clamp(1.05rem, 2vw, 1.36rem); }
.archive-info .muted, .dm { font-size: .87rem; }
.note { display: grid; grid-template-columns: 7.4rem minmax(0, 1fr); gap: 8px 15px; padding: 17px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.note:first-child { border-top: 1px solid var(--line); }
.date { color: var(--muted); }
.note .date { align-self: center; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 10px; padding: 0; border: 0; background: transparent; text-decoration: underline; text-underline-offset: 5px; font-size: .85rem; }
.dm { margin-top: 18px; }
.footer { width: min(var(--width), 100% - var(--gutter) * 2); margin: auto; padding: 29px 0; display: flex; justify-content: space-between; gap: 15px; color: var(--muted); }

/* 상세 글과 확대 사진은 같은 접근 가능한 대화상자를 사용합니다. */
dialog { width: min(680px, calc(100% - 32px)); max-height: 88dvh; color: var(--text); background: var(--panel); border: 1px solid var(--line); padding: 0 clamp(20px, 5vw, 50px) clamp(20px, 5vw, 50px); overflow: auto; }
dialog::backdrop { background: #080809e8; }
.reader-top { position: sticky; top: 0; background: var(--panel); display: flex; justify-content: flex-end; padding-block: 7px; }
.close { min-height: 44px; border: 1px solid var(--line); padding: 0 12px; background: var(--bg); }
#reader-content h2 { font-size: clamp(1.35rem, 4vw, 2.2rem); margin-bottom: 15px; }
#reader-content img { max-height: 57dvh; width: auto; margin: 13px auto 20px; object-fit: contain; }
.photo-reader { width: min(820px, calc(100% - 32px)); }
.reveal { transition: opacity .6s ease, transform .6s ease; }
.reveal.awaiting:not(:focus-within) { opacity: 0; transform: translateY(13px); }

@media (max-width: 850px) {
  :root { --header: 57px; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; border: 0; background: transparent; padding: 0 4px; font-size: .85rem; }
  nav { position: absolute; inset: 100% 0 auto; display: none; flex-direction: column; gap: 0; padding: 10px var(--gutter); background: var(--panel); border-bottom: 1px solid var(--line); max-height: calc(100dvh - var(--header)); overflow: auto; }
  .menu-toggle[aria-expanded="true"] + nav { display: flex; }
  nav a[aria-current]::after { right: auto; width: 30px; }
  .chapter-inner { grid-template-columns: 1fr; }
  .chapter-number { margin-bottom: 12px; }
}
@media (max-width: 540px) {
  .hero { min-height: min(670px, calc(100svh - var(--header))); }
  .hero-image img { object-position: 68% center; }
  .hero-image::after { background: linear-gradient(90deg, #101012da, #10101259), linear-gradient(0deg, #101012, transparent 43%); }
  .hero h1 { max-width: 8ch; font-size: clamp(3.2rem, 14.8vw, 5.5rem); }
  .about-grid { grid-template-columns: 1fr; }
  .profile { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 15px; }
  .works { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 23px 12px; }
  .note { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  .reveal.awaiting { opacity: 1 !important; transform: none !important; }
}
/* 로컬 파일을 열 때도 제목 글꼴을 사용할 수 있습니다. */
@font-face { font-family: "Instrument Serif"; src: url("assets/InstrumentSerif-Regular.ttf") format("truetype"); font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("assets/InstrumentSerif-Italic.ttf") format("truetype"); font-style: italic; font-display: swap; }
/* 섹션 제목 줄바꿈 방지 */
.chapter-heading h2 {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  font-size: clamp(1.9rem, 3vw, 3.25rem);
}
