/* nachz — 만화 잡지 스타일
   종이(갱지) 위에 먹 + 별색 두 가지(빨강, 파랑)로 찍은 내지, 노란 표지 */
:root {
  --ink: #1d1b22;
  --paper: #e6e3d6;
  --paper-deep: #d5d0bd;
  --yellow: #ffd21a;
  --red: #e2231a;
  --blue: #1f3fae;
  --display: 'Black Han Sans', 'Malgun Gothic', sans-serif;
  --body: 'Gowun Batang', 'Batang', serif;
  --frame: 3px solid var(--ink);
  --pop: 6px 6px 0 var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.8 var(--body);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.1; margin: 0; }
p { margin: 0 0 .8em; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.pixel img { image-rendering: pixelated; }

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

/* ---------- 버튼 ---------- */
.btn {
  display: inline-block;
  padding: .55em 1.3em .5em;
  background: var(--red);
  color: #fff;
  font: 1.35rem/1.2 var(--display);
  text-decoration: none;
  border: var(--frame);
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { background: #c81d15; }
.btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }

.draft {
  display: inline-block;
  margin-left: .5em;
  padding: 0 .5em;
  border: 2px dashed var(--red);
  color: var(--red);
  font: 700 .8rem/1.6 var(--body);
  vertical-align: middle;
}

/* ---------- 표지 ---------- */
.cover {
  position: relative;
  background: var(--yellow);
  border-bottom: 6px solid var(--ink);
  padding: 1rem clamp(1rem, 4vw, 3rem) clamp(2.5rem, 6vw, 4.5rem);
  overflow: hidden;
  isolation: isolate;
}
/* 망점: 표지 오른쪽 아래로 번지는 인쇄 망점 */
.cover::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle, var(--red) 1.6px, transparent 2px) 0 0 / 9px 9px;
  mask-image: radial-gradient(ellipse at 100% 100%, #000 0%, transparent 55%);
  opacity: .55;
}
.cover > * { max-width: 72rem; margin-inline: auto; }
.cover-top {
  display: flex;
  justify-content: space-between;
  font: 700 .95rem/1 var(--body);
}
.cover-top span:last-child {
  background: var(--ink);
  color: var(--yellow);
  padding: .35em .6em;
  transform: rotate(3deg);
}
.logo {
  margin-top: .1em;
  font-size: clamp(5.5rem, 26vw, 17rem);
  line-height: .82;
  letter-spacing: -.03em;
  color: var(--red);
  text-shadow: .045em .045em 0 var(--ink);
  -webkit-text-stroke: .012em var(--ink);
  paint-order: stroke fill;
}
.logo a { text-decoration: none; }
.tagline {
  margin-top: .9rem;
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  font-weight: 700;
}

.cover-feature {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas: 'art title' 'art copy' 'art cta';
  grid-template-rows: auto 1fr auto;
  column-gap: clamp(1.5rem, 4vw, 3.5rem);
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  text-decoration: none;
}
.cover-art {
  grid-area: art;
  align-self: start;
  border: 4px solid var(--ink);
  box-shadow: 10px 10px 0 var(--ink);
  transform: rotate(-1.5deg);
  background: var(--ink);
}
.cover-art img { width: 100%; }
.burst {
  position: absolute;
  top: -2rem;
  left: -1.8rem;
  width: 7.5rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--ink);
  clip-path: polygon(50% 0%, 61% 17%, 79% 9%, 79% 29%, 98% 32%, 86% 49%, 100% 64%, 80% 70%, 82% 90%, 63% 84%, 50% 100%, 37% 84%, 18% 90%, 20% 70%, 0% 64%, 14% 49%, 2% 32%, 21% 29%, 21% 9%, 39% 17%);
  transform: rotate(12deg);
}
.burst::before {
  content: '';
  position: absolute;
  inset: 5px;
  background: var(--red);
  clip-path: inherit;
}
.burst span {
  position: relative;
  color: #fff;
  font: 1.45rem/1 var(--display);
  text-align: center;
}
.cover-title {
  grid-area: title;
  font: clamp(2.8rem, 7vw, 5.6rem)/1 var(--display);
  color: #fff;
  -webkit-text-stroke: .09em var(--ink);
  paint-order: stroke fill;
  text-shadow: .06em .06em 0 var(--ink);
  transform: rotate(-3deg);
  transform-origin: left;
  padding-top: .2em;
}
.cover-copy {
  grid-area: copy;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .3rem;
  margin-top: 1.2rem;
}
.cover-copy span {
  background: var(--blue);
  color: #fff;
  font: clamp(1.15rem, 2.2vw, 1.5rem)/1.3 var(--display);
  padding: .15em .45em;
}
.cover-copy span:nth-child(2) { margin-left: 1.2em; background: var(--ink); }
.cover-cta {
  grid-area: cta;
  justify-self: start;
  margin-top: 1.5rem;
  padding: .5em 1.2em .45em;
  background: var(--red);
  color: #fff;
  font: 1.4rem/1.2 var(--display);
  border: var(--frame);
  box-shadow: 5px 5px 0 var(--ink);
}
.cover-feature:hover .cover-cta { background: #c81d15; }
.cover-feature:hover .cover-art { transform: rotate(-1.5deg) translate(-3px, -3px); box-shadow: 13px 13px 0 var(--ink); }
.cover-feature:focus-visible { outline-offset: 8px; }

@media (max-width: 760px) {
  .cover-feature {
    grid-template-columns: 1fr;
    grid-template-areas: 'art' 'title' 'copy' 'cta';
  }
  .cover-title { margin-top: 1.6rem; }
  .burst { top: -1.2rem; left: auto; right: -.4rem; width: 6rem; }
  .burst span { font-size: 1.15rem; }
}

/* ---------- 차례 ---------- */
.toc {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem clamp(2rem, 5vw, 4rem);
}
.toc-title {
  grid-column: 1 / -1;
  font-size: clamp(3.5rem, 10vw, 6rem);
  color: var(--blue);
  border-bottom: 8px solid var(--ink);
  padding-bottom: .1em;
}
.toc-group h3 {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font-size: 1.5rem;
  padding: .2em .6em .15em;
  margin-bottom: 1.2rem;
}
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.6rem; }
.entry > a {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1.1rem;
  text-decoration: none;
}
.thumb {
  aspect-ratio: 4 / 5;
  border: var(--frame);
  background: var(--paper-deep);
  overflow: hidden;
  transition: transform .1s, box-shadow .1s;
  box-shadow: 4px 4px 0 var(--ink);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.entry > a:hover .thumb { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.entry > a:hover .entry-title { text-decoration: underline 4px var(--red); text-underline-offset: 5px; }
.entry-text { display: flex; flex-direction: column; align-items: flex-start; }
.entry-kind { color: var(--blue); font-weight: 700; font-size: .9rem; }
.new { color: #fff; background: var(--red); font: .85rem/1.4 var(--display); padding: 0 .35em; margin-left: .2em; }
.entry-title { font: 1.75rem/1.15 var(--display); margin: .1em 0 .3em; }
.entry-line { line-height: 1.6; }
.entry-meta { margin-top: .4em; font-size: .88rem; color: #5a5650; }
.empty {
  border: 2px dashed var(--ink);
  padding: 1.2rem;
  color: #4a4740;
}

.editor-note {
  grid-column: 1 / -1;
  max-width: 38rem;
  margin-top: 1rem;
  padding: 1.6rem 1.8rem 1.2rem;
  background: var(--paper-deep);
  border: var(--frame);
  line-height: 1.95;
}
.editor-note h2 { font-size: 1.6rem; margin-bottom: .6rem; color: var(--blue); }
.editor-note .sign { text-align: right; font-weight: 700; margin: 0; }

@media (max-width: 760px) {
  .toc { grid-template-columns: 1fr; }
  .entry > a { grid-template-columns: 6rem minmax(0, 1fr); }
  .entry-title { font-size: 1.5rem; }
}

/* ---------- 판권 ---------- */
.colophon {
  max-width: 72rem;
  margin: 0 auto 3rem;
  padding: 0 clamp(1rem, 4vw, 3rem);
  font-size: .85rem;
  color: #4a4740;
}
.colophon dl {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem 1.6rem;
  margin: 0 0 .4rem;
  padding-top: 1rem;
  border-top: var(--frame);
}
.colophon dl div { display: flex; gap: .5em; }
.colophon dt { font-weight: 700; color: var(--ink); }
.colophon dd { margin: 0; }

/* ---------- 작품 소개 (펼침면) ---------- */
.work .colophon { max-width: 64rem; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .55rem clamp(1rem, 4vw, 3rem);
  background: var(--yellow);
  border-bottom: var(--frame);
}
.brand {
  font: 2rem/1 var(--display);
  color: var(--red);
  text-decoration: none;
  -webkit-text-stroke: .04em var(--ink);
  paint-order: stroke fill;
  text-shadow: 2px 2px 0 var(--ink);
}
.to-toc { font-weight: 700; text-underline-offset: 4px; }

.spread {
  max-width: 64rem;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.spread figure { margin: 0; }
.phone {
  justify-self: center;
  width: min(100%, 22rem);
  padding: 14px 10px 18px;
  background: var(--ink);
  border-radius: 28px;
  box-shadow: 10px 10px 0 var(--blue);
}
.phone img { border-radius: 4px; }
.comic-cover { border: 4px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); }
.comic-cover img { width: 100%; }
.spread-kind { color: var(--blue); font-weight: 700; margin-bottom: .3rem; }
.spread-title { font-size: clamp(2.6rem, 6vw, 4.2rem); }
.spread-line { font-size: 1.2rem; font-weight: 700; margin: .7rem 0 1.4rem; }
.prose { max-width: 34rem; margin-bottom: 1.8rem; }
.specs { margin: 2rem 0 1rem; border-top: var(--frame); }
.specs div { display: grid; grid-template-columns: 4.5rem 1fr; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid #b9b4a2; }
.specs dt { color: var(--blue); font-weight: 700; }
.specs dd { margin: 0; }
.note { font-size: .9rem; color: #5a5650; margin-top: 1rem; }
.episodes { list-style: none; padding: 0; margin: 2rem 0 0; border-top: var(--frame); }
.episodes a {
  display: flex;
  gap: 1rem;
  padding: .7rem .2rem;
  border-bottom: 1px solid #b9b4a2;
  text-decoration: none;
}
.episodes a:hover { background: var(--paper-deep); }
.ep-no { font-family: var(--display); color: var(--blue); min-width: 3em; }

@media (max-width: 760px) {
  .spread { grid-template-columns: 1fr; }
  .phone { width: min(80%, 20rem); }
}

/* ---------- 404 ---------- */
.lost { max-width: 36rem; margin: 0 auto; padding: 5rem 1.5rem; text-align: center; }
.lost-bubble {
  display: inline-block;
  position: relative;
  margin-bottom: 2rem;
  padding: 1rem 1.6rem;
  background: #fff;
  border: var(--frame);
  border-radius: 50%;
  font: 1.8rem/1.2 var(--display);
}
.lost .btn { margin-top: 1.5rem; }

/* ---------- 만화 보기 ---------- */
.reader { background: #2a2830; color: var(--paper); }
.reader-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .55rem 1rem;
  background: var(--ink);
  font-size: .95rem;
}
.reader-back { font: 1.15rem/1 var(--display); color: var(--yellow); text-decoration: none; }
.reader-back::before { content: '‹ '; }
.reader .counter { margin-left: auto; font-variant-numeric: tabular-nums; }
.reader :focus-visible { outline-color: var(--yellow); }

.strip { max-width: 720px; margin: 0 auto; background: #fff; }
.strip img { width: 100%; }

.ep-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}
.ep-nav > :last-child { justify-self: end; }
.ep-nav a:not(.btn) { color: var(--paper); text-underline-offset: 4px; }
.ep-end { color: #a9a597; font-size: .9rem; }

.reader-pages { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.pager {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.pager::-webkit-scrollbar { display: none; }
.pager:focus-visible { outline-offset: -3px; }
.page {
  flex: 0 0 100%;
  display: grid;
  place-items: center;
  padding: .75rem;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}
.page img { max-height: calc(100dvh - 6rem); width: auto; object-fit: contain; }
.page-end .ep-nav { width: 100%; }
.pager-help { margin: 0; padding: .3rem; text-align: center; font-size: .8rem; color: #a9a597; }
