* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --blush: #FBE9E4;
  --paper: #FDF6F2;
  --maple: #C8102E;
  --maple-deep: #8F0E22;
  --ink: #2B2320;
  --ink-soft: #6E5A50;
  --clay: #8A736A;
  --line: #EBD5CD;
}
body {
  background: var(--blush);
  color: var(--ink);
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  line-height: 1.5;
}
h1, h2, .num, .done-title, .denied-title, .reader-brand {
  font-family: "Noto Serif KR", "AppleMyungjo", serif;
}

/* ---------- landing ---------- */
.hero {
  max-width: 72rem;
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
}
.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--maple);
}
.hero h1 {
  margin-top: 1rem;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero .sub {
  margin-top: 1.25rem;
  max-width: 44ch;
  color: var(--ink-soft);
}
.card {
  margin-top: 2rem;
  max-width: 28rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 8px 30px rgba(200, 16, 46, 0.08);
}
.card label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
}
.card label + input { margin-top: 0.375rem; }
.card input + label { margin-top: 1rem; }
.card .opt { font-weight: 500; color: var(--clay); }
.card input {
  width: 100%;
  border: 1px solid #E3C9C0;
  background: #fff;
  border-radius: 0.5rem;
  padding: 0.625rem 0.875rem;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card input:focus {
  border-color: var(--maple);
  box-shadow: 0 0 0 2px rgba(200, 16, 46, 0.2);
}
.err { margin-top: 0.5rem; font-size: 0.875rem; font-weight: 500; color: var(--maple); }
.card button {
  margin-top: 1.25rem;
  width: 100%;
  border: none;
  border-radius: 999px;
  background: var(--maple);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.75rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.card button:hover { background: var(--maple-deep); }
.card button:active { transform: scale(0.98); }
.card button:disabled { opacity: 0.6; }
.fine { margin-top: 0.75rem; font-size: 0.75rem; line-height: 1.6; color: var(--clay); }
.done-title { font-size: 1.25rem; font-weight: 700; color: var(--maple); }
.done-sub { margin-top: 0.5rem; font-size: 0.875rem; line-height: 1.6; color: var(--ink-soft); }
.btn-ghost {
  display: inline-block;
  margin-top: 1.25rem;
  border: 2px solid var(--maple);
  border-radius: 999px;
  padding: 0.625rem 1.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--maple);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, transform 0.05s;
}
.btn-ghost:hover { background: var(--maple); color: #fff; }
.btn-ghost:active { transform: scale(0.98); }
.hero-art { display: flex; justify-content: center; align-items: center; }
.hero-art img {
  width: 100%;
  max-width: 24rem;
  border-radius: 0.5rem;
  transform: rotate(1deg);
  box-shadow: 0 24px 60px rgba(43, 35, 32, 0.25);
  transition: transform 0.3s;
}
.hero-art img:hover { transform: rotate(0); }
@media (prefers-reduced-motion: reduce) {
  .hero-art img, .card button, .btn-ghost { transition: none; transform: none; }
}

.chapters { border-top: 1px solid var(--line); background: var(--paper); }
.chapters .inner, .author .inner { max-width: 56rem; margin: 0 auto; padding: 4rem 1.5rem; }
.chapters h2, .author h2 { font-size: 1.875rem; font-weight: 900; letter-spacing: -0.02em; }
.chapters ol { margin-top: 2rem; list-style: none; }
.chapters li {
  display: flex;
  gap: 1.25rem;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.chapters li:first-child { border-top: 1px solid var(--line); }
.num { width: 2rem; flex-shrink: 0; font-size: 1.125rem; font-weight: 700; color: var(--maple); font-variant-numeric: tabular-nums; }
.ct { font-weight: 700; }
.cs { margin-top: 0.125rem; font-size: 0.875rem; color: var(--clay); }

.author { border-top: 1px solid var(--line); }
.author p { margin-top: 1.25rem; max-width: 60ch; color: var(--ink-soft); }
.author strong { color: var(--ink); }
.insta {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--maple);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.insta:hover { color: var(--maple-deep); }
footer {
  background: var(--ink);
  color: #C9B8B0;
  text-align: center;
  font-size: 0.75rem;
  padding: 2rem 1rem;
}

@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; padding-top: 2.5rem; gap: 3rem; }
  .hero-art { order: -1; }
  .hero-art img { max-width: 16rem; }
}

/* ---------- reader ---------- */
.reader-body { background: #F1DED7; }
.reader-shell {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  min-height: 100dvh;
}
.reader-top {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 233, 228, 0.95);
  backdrop-filter: blur(6px);
  padding: 0.75rem 1rem;
}
.reader-top > div {
  max-width: 48rem;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.reader-brand { font-size: 0.875rem; font-weight: 700; }
.reader-who { font-size: 0.75rem; color: var(--clay); }
.reader-main { position: relative; max-width: 48rem; margin: 0 auto; padding: 1.5rem 0.75rem; }
.pages { display: flex; flex-direction: column; gap: 1rem; }
.pagewrap {
  position: relative;
  overflow: hidden;
  border-radius: 0.375rem;
  box-shadow: 0 6px 24px rgba(43, 35, 32, 0.15);
}
.pagewrap img { display: block; width: 100%; pointer-events: none; user-select: none; }
.shield { position: absolute; inset: 0; }
.watermark {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  overflow: hidden;
}
.wm-inner {
  height: 100%;
  transform: rotate(-24deg) scale(1.25);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem 0;
}
.wm-inner p {
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: rgba(200, 16, 46, 0.08);
}
.reader-foot {
  padding: 0.5rem 1.5rem 2.5rem;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--clay);
}
.cover-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blush);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.cover-screen.on { opacity: 1; pointer-events: auto; }
.cover-screen p {
  padding: 0 2rem;
  text-align: center;
  font-family: "Noto Serif KR", serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--maple);
}
.cover-screen p span {
  display: block;
  margin-top: 0.5rem;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-soft);
}
@media print {
  body * { display: none !important; }
  body::after {
    content: "이 문서는 인쇄가 제한된 개인 열람용 전자책입니다.";
    display: block;
    padding: 4rem 2rem;
    font-size: 1rem;
  }
}

/* ---------- denied ---------- */
.denied-body { }
.denied {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
}
.denied-title { font-size: 1.5rem; font-weight: 900; }
.denied-sub { margin-top: 0.75rem; max-width: 24rem; font-size: 0.875rem; line-height: 1.6; color: var(--ink-soft); }
.btn-fill {
  display: inline-block;
  margin-top: 1.5rem;
  background: var(--maple);
  color: #fff;
  border-radius: 999px;
  padding: 0.625rem 1.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}
.btn-fill:hover { background: var(--maple-deep); }
