:root {
  --paper: #faf7f0;
  --ink: #271d19;
  --muted: #62534c;
  --accent: #872d24;
  --line: #dcd1c5;
  --serif: "Noto Serif CJK KR", "Noto Serif KR", Batang, serif;
  --sans: "Noto Sans CJK KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  line-height: 1.55;
}

* { box-sizing: border-box; }
body { margin: 0; padding-bottom: 3rem; }
p, h1, h2, h3 { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.wrap { width: min(100% - 2.5rem, 54rem); margin-inline: auto; }
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  min-height: 5rem;
  border-bottom: 2px solid var(--ink);
}
.masthead h1, .brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font: 800 clamp(1.28rem, 5vw, 1.8rem)/1.2 var(--serif);
  letter-spacing: -.07em;
  text-decoration: none;
}
.brand:hover { color: var(--accent); }
.masthead p { color: var(--muted); font-size: .76rem; white-space: nowrap; }
.mark {
  width: 1.2rem;
  height: 1rem;
  border: 2px solid var(--accent);
  border-radius: 1px;
  box-shadow: 3px -3px 0 -1px var(--paper), 3px -3px 0 1px var(--accent);
  transform: translateX(-2px);
}
.search {
  margin-block: 1.3rem 2rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  min-height: 3.1rem;
  padding-inline: .8rem;
  border: 1px solid #a39387;
  border-radius: 2px;
  background: #fffdf9;
}
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-icon {
  flex: none;
  width: .8rem;
  height: .8rem;
  margin-right: .12rem;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  position: relative;
}
.search-icon::after {
  content: "";
  position: absolute;
  width: .36rem;
  height: 1.5px;
  background: var(--muted);
  right: -.28rem;
  bottom: -.12rem;
  transform: rotate(45deg);
}
.search input { flex: 1; width: 0; padding: .65rem 0; color: inherit; border: 0; background: none; }
.search input:focus { outline: none; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search button { padding: 0 .25rem; min-height: 2.75rem; border: 0; background: none; color: var(--accent); font-size: .75rem; }
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--ink);
}
.list-header h2 { font: 800 1.1rem/1.4 var(--serif); }
.list-header span, .source { color: var(--muted); font-size: .78rem; }
.story-list { list-style: none; margin: 0; padding: 0; }
.story-list > li { border-bottom: 1px solid var(--line); }
.story-link {
  display: grid;
  grid-template-columns: minmax(4rem, 25%) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(.65rem, 3vw, 1.5rem);
  min-height: 7.8rem;
  padding-block: 1rem;
  text-decoration: none;
}
.story-link:hover h3, .story-link:focus-visible h3 { color: var(--accent); text-decoration: underline; text-underline-offset: .18em; }
.story-copy h3 {
  margin-block: .16rem .3rem;
  font: 800 clamp(1.03rem, 4.6vw, 1.65rem)/1.36 var(--serif);
  letter-spacing: -.065em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.topic { color: var(--accent); font-size: .72rem; font-weight: 700; }
.description { display: none; }
.item-arrow { color: var(--accent); }
.empty { padding-block: 2rem; color: var(--muted); }
.back {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-block: .5rem 1rem;
  color: var(--accent);
  font-size: .88rem;
  text-underline-offset: .22em;
}
.article { max-width: 40rem; margin-inline: auto; }
.article h1 {
  margin-block: .3rem .2rem;
  font: 800 clamp(1.9rem, 7vw, 3.15rem)/1.2 var(--serif);
  letter-spacing: -.075em;
  word-break: keep-all;
}
.source-link { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--accent); font-size: .84rem; font-weight: 650; text-underline-offset: .2em; }
.lede { margin-block: .55rem 1.45rem; color: var(--muted); }
.slide {
  margin: 0;
  border: 1px solid var(--line);
  background: #fffdf9;
}
.slide .art { width: 100%; aspect-ratio: 2.5; margin-bottom: 1rem; }
.slide h2 { font: 800 clamp(1.27rem, 5vw, 1.9rem)/1.35 var(--serif); letter-spacing: -.055em; }
.slide p { min-height: 5em; margin-top: .55rem; color: var(--muted); word-break: keep-all; }
.controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: .65rem; }
.controls button { min-width: 4.75rem; min-height: 2.75rem; padding-inline: .6rem; border: 1px solid #a39387; background: none; }
.controls button:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }
.controls button:disabled { border-color: var(--line); color: #776b61; }
.slide-count { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }

.art { display: block; aspect-ratio: 1; position: relative; isolation: isolate; overflow: hidden; }
.art::before, .art::after, .art-detail { position: absolute; content: ""; }
.art--heat { background: #853425; }
.art--heat::before { width: 36%; aspect-ratio: 1; background: #f1ad6e; border-radius: 50%; top: 11%; right: 13%; }
.art--heat::after {
  inset: 35% 0 0;
  background: #3c2821;
  clip-path: polygon(0 47%, 13% 47%, 13% 28%, 29% 28%, 29% 60%, 42% 60%, 42% 10%, 53% 10%, 53% 38%, 69% 38%, 69% 53%, 83% 53%, 83% 35%, 100% 35%, 100% 100%, 0 100%);
}
.art--heat .art-detail { z-index: 1; inset: 82% 0 0; background: #bd684b; clip-path: polygon(10% 65%, 100% 0, 100% 10%, 10% 75%); }
.art--contrast { background: linear-gradient(112deg, #302a54 50%, #ebcca4 50%); }
.art--contrast::before, .art--contrast::after {
  content: "a";
  font: italic 700 clamp(2rem, 10vw, 4.2rem)/1 Georgia, serif;
  top: 50%;
  transform: translate(-50%, -54%);
}
.art--contrast::before { color: #f9dfbe; left: 25%; }
.art--contrast::after { color: #573451; left: 75%; }
.art--sea { background: #e0c77f; }
.art--sea::before {
  inset: 0;
  background: #325950;
  clip-path: polygon(0 0, 63% 0, 56% 18%, 61% 34%, 56% 50%, 42% 65%, 38% 82%, 47% 100%, 0 100%);
}
.art--sea::after {
  inset: 0;
  background: #75a392;
  clip-path: polygon(0 74%, 21% 63%, 42% 65%, 38% 82%, 47% 100%, 0 100%);
}
.art--sea .art-detail {
  z-index: 1;
  inset: 35% 15% 35% 16%;
  background: #fff5d5;
  clip-path: polygon(0 42%, 80% 42%, 66% 0, 75% 0, 100% 50%, 75% 100%, 66% 100%, 80% 58%, 0 58%);
}

.visually-hidden { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (min-width: 36rem) {
  .wrap { width: min(100% - 5rem, 54rem); }
  .masthead { min-height: 6.75rem; }
  .search { margin-top: 1.6rem; }
  .story-link { grid-template-columns: 9rem minmax(0, 1fr) 1rem; }
  .story-link .art { aspect-ratio: 4 / 3; }
  .description { display: block; margin-bottom: .35rem; color: var(--muted); font-size: .95rem; }
}

.story-link .cover-image {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--paper);
}

.slide .card-image {
  display: block;
  width: 100%;
  height: auto;
}

.article h1 { overflow-wrap: anywhere; }
.article-meta { color: var(--muted); margin-block: .65rem; }
.article-notes { margin-block: 2rem; }
.article-notes h2 { margin-bottom: .6rem; }
.article-notes p { white-space: pre-wrap; overflow-wrap: anywhere; }

.original-title {
  color: var(--muted);
  font-size: .85rem;
  overflow-wrap: anywhere;
}
.gallery { margin-block-start: 1.3rem; }
.card-zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.zoom-label {
  display: block;
  padding: .65rem 1rem;
  color: var(--accent);
  text-align: right;
  text-decoration: underline;
  text-underline-offset: .18em;
}
.card-caption {
  padding: .85rem 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
html:has(.zoom-dialog[open]) { overflow: hidden; }
.zoom-dialog {
  width: min(100%, 80rem);
  max-width: calc(100% - 1rem);
  max-height: calc(100% - 1rem);
  padding: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}
.zoom-dialog::backdrop { background: #271d19d9; }
.zoom-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  padding: .5rem;
  border-bottom: 1px solid var(--line);
}
.zoom-toolbar button {
  min-height: 2.75rem;
  padding-inline: .75rem;
  border: 1px solid #a39387;
  background: #fffdf9;
}
.zoom-viewport { overflow: auto; max-height: calc(100dvh - 5rem); }
.zoom-image { display: block; width: 100%; height: auto; }
.zoom-viewport.is-enlarged .zoom-image { width: 200%; max-width: none; }
