:root {
  --bg: #070b14;
  --bg-strong: #0b1220;
  --bg-soft: #111b2c;
  --navy: #0d1b2a;
  --navy-deep: #08111d;
  --gold: #c89b3c;
  --gold-soft: #e7cb7c;
  --ivory: #f3efe5;
  --silver: #c5c9d1;
  --line: rgba(200, 155, 60, 0.24);
  --text: #f7f3ec;
  --muted: rgba(247, 243, 236, 0.72);
  --shadow: rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans KR", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(200, 155, 60, 0.14), transparent 28%),
    linear-gradient(180deg, #090d15 0%, #0c1320 100%);
  color: var(--text);
}

img {
  max-width: 100%;
  display: block;
}

button,
a {
  font: inherit;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.page-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 12, 20, 0.74) 0%, rgba(8, 12, 20, 0.18) 38%, rgba(8, 12, 20, 0.7) 100%),
    radial-gradient(circle at 76% 18%, rgba(200, 155, 60, 0.3), transparent 26%);
  pointer-events: none;
}

.container {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(8, 11, 18, 0.42);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 88px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
}

.brand img {
  width: 172px;
  height: auto;
  filter: drop-shadow(0 0 16px rgba(200, 155, 60, 0.42));
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 28px);
  flex: 1;
}

.main-nav a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.71rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color 0.22s ease;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--text);
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after {
  transform: scaleX(1);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(247, 243, 236, 0.7);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: all 0.2s ease;
}

.lang-btn.active {
  background: linear-gradient(135deg, rgba(200, 155, 60, 0.2), rgba(200, 155, 60, 0.08));
  color: var(--gold-soft);
  box-shadow: inset 0 0 0 1px rgba(200, 155, 60, 0.3);
}

.hero {
  position: relative;
  min-height: calc(100vh - 88px);
  display: flex;
  align-items: center;
  background-image:
    linear-gradient(90deg, rgba(8, 12, 20, 0.76) 0%, rgba(8, 12, 20, 0.35) 34%, rgba(8, 12, 20, 0.8) 100%),
    url("assets/ip/dalpumgung/dalpumgung-hero-v2.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 72% 18%, rgba(200, 155, 60, 0.18), transparent 20%),
    linear-gradient(180deg, rgba(10, 14, 22, 0.08), rgba(10, 14, 22, 0.18));
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.7fr);
  align-items: end;
  gap: clamp(24px, 5vw, 80px);
  padding: clamp(48px, 7vw, 120px) 0;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--gold-soft);
  font-size: 0.8rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.title-main,
.title-english {
  display: block;
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.title-main {
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: clamp(3rem, 6vw, 6.6rem);
  font-weight: 900;
  color: var(--ivory);
}

.title-english {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.2rem, 4vw, 4rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(243, 239, 229, 0.82);
}

.tagline {
  margin: 28px 0 0;
  max-width: 620px;
  color: var(--text);
  font-size: clamp(1.15rem, 2vw, 1.7rem);
  line-height: 1.7;
  letter-spacing: -0.02em;
  font-family: "Noto Sans KR", "Segoe UI", sans-serif;
}

.intro {
  max-width: 590px;
  margin-top: 18px;
  color: rgba(243, 239, 229, 0.8);
  font-size: 1.04rem;
  line-height: 1.8;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 28px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, rgba(200, 155, 60, 0.96), rgba(216, 180, 96, 0.8));
  color: #0a0d12;
  box-shadow: 0 18px 40px rgba(200, 155, 60, 0.24);
}

.btn-secondary {
  background: rgba(8, 14, 24, 0.42);
  color: var(--text);
  border-color: rgba(200, 155, 60, 0.4);
}

.meta-list {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.meta-list li {
  padding: 10px 14px;
  border: 1px solid rgba(200, 155, 60, 0.2);
  border-radius: 999px;
  background: rgba(10, 15, 23, 0.38);
  color: rgba(243, 239, 229, 0.82);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Company brand hero (index.html #home) — sits above the Moonlit Palace
   feature hero (#featured-ip). Reuses .hero's sizing/flex behavior but
   replaces the cinematic background with a plain brand-toned one and drops
   the two-column layout in favor of a single centered column. */
.company-hero {
  min-height: auto;
  padding: clamp(70px, 10vw, 140px) 0;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(200, 155, 60, 0.16), transparent 42%),
    radial-gradient(circle at 84% 78%, rgba(200, 155, 60, 0.1), transparent 38%),
    linear-gradient(180deg, #0b1220 0%, #070b14 100%);
}

.company-hero-inner {
  display: flex;
  justify-content: center;
  padding: 0;
}

.company-hero-copy {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.company-hero-title {
  margin: 0 0 24px;
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ivory);
}

/* Keeps a short Korean word/phrase from breaking mid-word when the line
   wraps (e.g. "세계로." splitting into "세계" / "로." on narrow screens). */
.nowrap-word {
  white-space: nowrap;
}

.company-hero-intro {
  margin: 0 0 8px;
  max-width: 600px;
}

.company-hero .cta-row {
  justify-content: center;
}

@media (max-width: 560px) {
  .company-hero-title {
    line-height: 1.35;
  }
}

.hero-panel {
  justify-self: end;
  width: min(100%, 360px);
  padding: 18px 18px 20px;
  border: 1px solid rgba(200, 155, 60, 0.28);
  border-radius: 22px;
  background: rgba(9, 12, 18, 0.48);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.about-section {
  position: relative;
  padding: 110px 0 120px;
  background:
    linear-gradient(180deg, rgba(6, 10, 16, 1) 0%, rgba(12, 18, 28, 1) 100%);
}

.about-inner {
  position: relative;
  z-index: 1;
}

.section-heading {
  margin-bottom: 32px;
}

.section-kicker {
  margin: 0 0 10px;
  color: var(--gold-soft);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.portfolio-section {
  position: relative;
  padding: 110px 0 118px;
  background: linear-gradient(180deg, rgba(9, 12, 17, 1), rgba(11, 18, 27, 1));
}

.portfolio-header {
  margin-bottom: 34px;
}

.feature-card {
  position: relative;
  border: 1px solid rgba(200, 155, 60, 0.22);
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(11, 17, 25, 0.96), rgba(17, 24, 35, 0.9));
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.28);
  perspective: 1800px;
  cursor: pointer;
}

.feature-card:focus-visible {
  outline: none;
  border-color: rgba(200, 155, 60, 0.7);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.28), 0 0 0 3px rgba(200, 155, 60, 0.35);
}

/* ==========================================================================
   Moonlit Palace feature card flip (same rotateY mechanism as the 6 mini
   cards below — see "Public buyer homepage — mini-card flip" — but sized
   for the large hero-style card: front face keeps the existing 2-column
   grid/size/placement untouched, back face is a wider luxe layout using the
   same label/value row pattern as the mini-card backs for visual unity).
   ========================================================================== */
.feature-card-inner {
  position: relative;
  transition: transform 0.7s cubic-bezier(0.4, 0.1, 0.2, 1);
  transform-style: preserve-3d;
}

.feature-card.is-flipped .feature-card-inner {
  transform: rotateY(180deg);
}

.feature-card-face {
  position: relative;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.feature-card-face-front {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr;
  gap: 0;
  pointer-events: auto;
}

.feature-card.is-flipped .feature-card-face-front {
  pointer-events: none;
}

.feature-card-face-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 5vw, 64px);
  background: linear-gradient(135deg, rgba(11, 17, 25, 0.98), rgba(17, 24, 35, 0.94));
  overflow-y: auto;
}

.feature-card.is-flipped .feature-card-face-back {
  pointer-events: auto;
}

.feature-card-back-inner {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  align-items: center;
  gap: 56px;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
}

.feature-back-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.feature-back-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feature-back-heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-back-title {
  margin: 0;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--ivory, #f3efe5);
}

.feature-back-title-en {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(243, 239, 229, 0.6);
}

.feature-back-completion {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(200, 155, 60, 0.22), rgba(216, 180, 96, 0.12));
  border: 1px solid rgba(200, 155, 60, 0.55);
  color: var(--gold-soft);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.05em;
}

.feature-card-back-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 4px;
}

.feature-back-right {
  border-left: 1px solid rgba(200, 155, 60, 0.22);
  padding-left: 48px;
}

.feature-back-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 32px;
}

.feature-back-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.feature-back-label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.feature-back-value {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(247, 243, 236, 0.92);
  overflow-wrap: break-word;
  word-break: keep-all;
}

.feature-card-flip-btn {
  align-self: flex-start;
  margin-top: 24px;
}

@media (prefers-reduced-motion: reduce) {
  .feature-card-inner {
    transition: none;
  }
}

@media (max-width: 760px) {
  .feature-card-back-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .feature-back-left {
    align-items: stretch;
  }

  .feature-back-right {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid rgba(200, 155, 60, 0.22);
    padding-top: 28px;
  }
}

@media (max-width: 640px) {
  .feature-back-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 480px) {
  .feature-card-back-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .feature-card-back-actions .btn {
    width: 100%;
  }
}

.feature-visual {
  position: relative;
  min-height: 420px;
  background:
    linear-gradient(180deg, rgba(7, 11, 18, 0.1), rgba(7, 11, 18, 0.66)),
    url("assets/ip/dalpumgung/dalpumgung-hero-v2.png") center/cover no-repeat;
}

.visual-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 64% 18%, rgba(200, 155, 60, 0.42), transparent 22%);
}

.feature-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 4vw, 42px);
}

.feature-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.label-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(200, 155, 60, 0.08);
  border: 1px solid rgba(200, 155, 60, 0.28);
  color: var(--gold-soft);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.feature-meta {
  display: grid;
  gap: 10px;
}

.feature-genre {
  margin: 0;
  color: rgba(247, 243, 236, 0.7);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.feature-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feature-title-wrap h3 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.feature-title-wrap span {
  color: rgba(243, 239, 229, 0.7);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.5rem, 2.4vw, 2.4rem);
  letter-spacing: 0.08em;
}

.feature-logline {
  margin: 20px 0 0;
  max-width: 620px;
  color: rgba(247, 243, 236, 0.86);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  line-height: 1.6;
}

.feature-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.info-label {
  display: block;
  margin-bottom: 8px;
  color: rgba(243, 239, 229, 0.6);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.feature-info-grid strong {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ivory);
}

.small-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 28px;
}

.mini-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(13, 19, 27, 0.94), rgba(9, 12, 17, 0.96));
  border: 1px solid rgba(200, 155, 60, 0.18);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.mini-card:focus-visible {
  outline: none;
  transform: translateY(-8px);
  border-color: rgba(200, 155, 60, 0.7);
  box-shadow: 0 24px 46px rgba(0, 0, 0, 0.26), 0 0 22px rgba(200, 155, 60, 0.28);
}

.mini-card:hover,
.mini-card:focus-within {
  transform: translateY(-8px);
  border-color: rgba(200, 155, 60, 0.7);
  box-shadow: 0 24px 46px rgba(0, 0, 0, 0.26), 0 0 22px rgba(200, 155, 60, 0.28);
}

.mini-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(200, 155, 60, 0.06), transparent 44%);
  pointer-events: none;
}

.mini-poster {
  position: relative;
  aspect-ratio: 1 / 1;
  border-bottom: 1px solid rgba(200, 155, 60, 0.2);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.poster-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mini-poster::before,
.mini-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.mini-poster::before {
  background: linear-gradient(180deg, rgba(8, 12, 18, 0.12), rgba(8, 12, 18, 0.72));
}

.mini-poster::after {
  background: radial-gradient(circle at 65% 18%, rgba(242, 195, 92, 0.45), transparent 20%);
}

.mini-poster-1 {
  background: linear-gradient(180deg, #1d1712 0%, #2a1d12 18%, #120f14 55%, #0b0d13 100%);
}

.mini-poster-2 {
  background: linear-gradient(180deg, #140d17 0%, #1c1128 26%, #120914 58%, #0e1118 100%);
}

.mini-poster-3 {
  background: linear-gradient(180deg, #12161d 0%, #1a2431 26%, #0d1017 58%, #101419 100%);
}

.mini-poster-4 {
  background: linear-gradient(180deg, #0a0f14 0%, #152428 26%, #090d10 58%, #0b141a 100%);
}

.mini-poster-5 {
  background: linear-gradient(180deg, #18130f 0%, #2b1d16 24%, #101216 54%, #0d0d12 100%);
}

.mini-poster-6 {
  background: linear-gradient(180deg, #120d18 0%, #1a1724 22%, #0d1117 56%, #0c1018 100%);
}

.mini-card-body {
  position: relative;
  z-index: 1;
  padding: 18px 18px 20px;
}

.mini-card-top {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-start;
  margin-bottom: 16px;
}

.mini-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(200, 155, 60, 0.28);
  background: rgba(200, 155, 60, 0.06);
  color: var(--gold-soft);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mini-card h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  letter-spacing: -0.04em;
}

.mini-genre,
.mini-hook,
.mini-status {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(243, 239, 229, 0.7);
  line-height: 1.7;
}

.mini-genre {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}

.mini-hook {
  margin-top: 10px;
  color: rgba(247, 243, 236, 0.9);
  font-size: 0.95rem;
  line-height: 1.6;
}

.mini-status {
  margin-top: 12px;
  color: var(--gold-soft);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ==========================================================================
   Public buyer homepage — mini-card flip (앞면: 포스터/제목/장르/후킹,
   뒷면: 장르/개발 단계/사업화 가능 분야 요약 + 문의 버튼). 상세페이지 이동을
   대체하는 같은 자리 전환용이며, 기존 검정·금색 디자인 토큰만 재사용한다.
   ========================================================================== */
.mini-card {
  perspective: 1400px;
}

.mini-card-inner {
  position: relative;
  transition: transform 0.6s cubic-bezier(0.4, 0.1, 0.2, 1);
  transform-style: preserve-3d;
}

.mini-card.is-flipped .mini-card-inner {
  transform: rotateY(180deg);
}

.mini-card-face {
  position: relative;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* backface-visibility only hides rendering, not hit-testing — without this,
   the face pointing away still intercepts clicks/taps on some browsers.
   Toggling pointer-events explicitly by flip state fixes it. */
.mini-card-face-front {
  pointer-events: auto;
}

.mini-card.is-flipped .mini-card-face-front {
  pointer-events: none;
}

.mini-card-face-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  /* Centers the (title…scope) info group + button as one block, so the
     leftover space above/below balances out instead of all collecting
     below a top-packed block. The gap below still separates the button
     from the info group by a fixed amount regardless of centering. */
  justify-content: center;
  gap: 22px;
  padding: 28px 22px;
  background: linear-gradient(180deg, rgba(15, 21, 30, 0.98), rgba(9, 12, 17, 0.99));
  overflow-y: auto;
}

.mini-card.is-flipped .mini-card-face-back {
  pointer-events: auto;
}

.mini-card-back-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mini-back-title {
  margin: 0;
  font-size: clamp(1.2rem, 1.9vw, 1.55rem);
  letter-spacing: -0.03em;
  color: var(--ivory, #f3efe5);
}

.mini-back-title-en {
  margin: -8px 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(243, 239, 229, 0.55);
}

.mini-back-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mini-back-label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.mini-back-value {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(247, 243, 236, 0.9);
}

.mini-card-inquiry-btn {
  align-self: flex-start;
  min-height: 46px;
  padding: 0 22px;
  font-size: 0.74rem;
}

/* Front-face English subtitle (shown only when the page is displaying
   Korean, mirroring the existing Moonlit hero title/English-subtitle
   pattern) — kept out of the way of the genre/hook lines below it. */
.mini-title-en {
  position: relative;
  z-index: 1;
  margin: -4px 0 8px;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(243, 239, 229, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  .mini-card-inner {
    transition: none;
  }
}

@media (max-width: 980px) {
  .small-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .small-card-grid {
    grid-template-columns: 1fr;
  }
}

.info-card {
  position: relative;
  padding: 28px 24px 26px;
  border: 1px solid rgba(200, 155, 60, 0.2);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(12, 17, 25, 0.9), rgba(9, 12, 18, 0.95));
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.18);
}

.info-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(200, 155, 60, 0.08), transparent 45%, rgba(255, 255, 255, 0.02));
  pointer-events: none;
}

.card-topline {
  position: relative;
  z-index: 1;
  display: inline-flex;
  margin-bottom: 18px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(200, 155, 60, 0.28);
  background: rgba(200, 155, 60, 0.04);
  color: var(--gold-soft);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.info-card h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 16px;
  font-size: clamp(1.5rem, 2vw, 2rem);
  letter-spacing: -0.04em;
}

.info-card p,
.info-card li {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(247, 243, 236, 0.8);
  line-height: 1.8;
}

.info-card p + p {
  margin-top: 18px;
}

.check-list {
  position: relative;
  z-index: 1;
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.check-list li {
  position: relative;
  padding-left: 18px;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.8em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--gold-soft);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.panel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  box-shadow: 0 0 18px rgba(200, 155, 60, 0.7);
}

.panel-body {
  padding-top: 18px;
}

.panel-kicker {
  margin: 0;
  color: rgba(200, 155, 60, 0.94);
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.panel-body h2 {
  margin: 18px 0 14px;
  font-size: clamp(1.7rem, 2.8vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.panel-body p:last-child {
  margin: 0;
  color: rgba(247, 243, 236, 0.78);
  line-height: 1.8;
}

@media (max-width: 980px) {
  .header-inner {
    flex-wrap: wrap;
    justify-content: center;
    padding: 12px 0 16px;
  }

  .brand img {
    width: 150px;
  }

  .main-nav {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    gap: 12px 18px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    align-items: end;
  }

  .hero-panel {
    justify-self: start;
  }

  .about-grid,
  .small-card-grid {
    grid-template-columns: 1fr;
  }

  .feature-card-face-front {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 28px, 1280px);
  }

  .brand {
    width: 100%;
    justify-content: center;
  }

  .brand img {
    width: 140px;
  }

  .brand-copy {
    letter-spacing: 0.1em;
  }

  .main-nav {
    gap: 10px 16px;
  }

  .main-nav a {
    font-size: 0.62rem;
    letter-spacing: 0.13em;
  }

  .lang-btn {
    padding: 7px 10px;
  }

  .hero {
    min-height: auto;
  }

  .hero-inner {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .eyebrow {
    letter-spacing: 0.2em;
    font-size: 0.66rem;
  }

  .tagline {
    font-size: 1.1rem;
    line-height: 1.5;
  }

  .intro {
    font-size: 0.95rem;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .meta-list {
    gap: 10px;
  }

  .meta-list li {
    width: 100%;
    text-align: center;
  }
}

/* ==========================================================================
   Contact section (index.html #contact)
   ========================================================================== */

.contact-section {
  position: relative;
  padding: 110px 0 130px;
  background: linear-gradient(180deg, rgba(11, 18, 27, 1), rgba(7, 10, 16, 1));
}

.contact-intro {
  max-width: 640px;
  margin: 0 0 40px;
  color: rgba(247, 243, 236, 0.78);
  font-size: 1rem;
  line-height: 1.8;
}

.contact-preselected-work {
  display: inline-flex;
  margin: -20px 0 30px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(200, 155, 60, 0.3);
  background: rgba(200, 155, 60, 0.08);
  color: var(--gold-soft);
  font-size: 0.82rem;
}

.contact-preselected-work[hidden] {
  display: none;
}

.contact-form {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-field > span:first-child {
  color: var(--gold-soft);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
}

.contact-field-full {
  grid-column: 1 / -1;
}

.contact-field input[type="text"],
.contact-field input[type="email"],
.contact-field select,
.contact-field textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.contact-field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold-soft) 50%), linear-gradient(135deg, var(--gold-soft) 50%, transparent 50%);
  background-position: calc(100% - 20px) center, calc(100% - 15px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.contact-field select option {
  background: var(--bg-strong);
  color: var(--text);
}

.contact-field textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-field input:focus,
.contact-field select:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: rgba(200, 155, 60, 0.55);
  background: rgba(255, 255, 255, 0.05);
}

.contact-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
}

.contact-checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(247, 243, 236, 0.82);
  font-size: 0.88rem;
}

.contact-checkbox-grid input {
  accent-color: var(--gold);
}

.contact-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-top: 4px;
}

.contact-consent input {
  margin-top: 4px;
  accent-color: var(--gold);
  flex-shrink: 0;
}

.contact-consent span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: rgba(247, 243, 236, 0.85);
  font-size: 0.88rem;
}

.contact-consent small {
  color: rgba(247, 243, 236, 0.55);
  font-size: 0.76rem;
  line-height: 1.5;
}

.contact-submit {
  align-self: flex-start;
  margin-top: 4px;
}

.contact-status {
  min-height: 1.2em;
  margin: 0;
  color: var(--gold-soft);
  font-size: 0.88rem;
}

@media (max-width: 700px) {
  .contact-grid,
  .contact-checkbox-grid {
    grid-template-columns: 1fr;
  }

  .contact-submit {
    align-self: stretch;
  }
}

/* ==========================================================================
   Moonlit Palace detail page — scoped to .moonlit-page (moonlit-palace.html)
   Do not let any rule below leak outside this scope.
   ========================================================================== */

.moonlit-page .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  color: rgba(243, 239, 229, 0.72);
  text-decoration: none;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}

.moonlit-page .back-link:hover,
.moonlit-page .back-link:focus-visible {
  color: var(--gold-soft);
}

.moonlit-page .moonlit-hero-inner {
  grid-template-columns: 1fr;
  align-items: center;
}

.moonlit-page .moonlit-hero .hero-copy {
  max-width: 820px;
}

.moonlit-page .moonlit-content {
  position: relative;
  z-index: 1;
  padding: 100px 0 130px;
}

.moonlit-page .detail-section {
  max-width: 760px;
  margin: 0 auto 110px;
  padding-top: 64px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.moonlit-page .detail-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.moonlit-page .detail-section:last-child {
  margin-bottom: 0;
}

.moonlit-page #characters,
.moonlit-page #worldview,
.moonlit-page #selling-points {
  max-width: none;
}

.moonlit-page .detail-section h2 {
  margin: 0 0 24px;
  font-size: clamp(1.9rem, 3.2vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.moonlit-page .detail-text {
  max-width: 700px;
  margin: 0 0 18px;
  color: rgba(247, 243, 236, 0.82);
  font-size: 1.05rem;
  line-height: 1.9;
}

.moonlit-page .detail-text:last-child {
  margin-bottom: 0;
}

.moonlit-page #characters .detail-text,
.moonlit-page #worldview .detail-text,
.moonlit-page #selling-points .detail-text,
.moonlit-page .adaptation-section .detail-text {
  max-width: 720px;
}

.moonlit-page .character-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.moonlit-page .character-card {
  position: relative;
  padding: 26px 22px 24px;
  border: 1px solid rgba(200, 155, 60, 0.2);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(12, 17, 25, 0.9), rgba(9, 12, 18, 0.95));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.moonlit-page .character-card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ivory);
}

.moonlit-page .character-card p {
  margin: 0;
  color: rgba(247, 243, 236, 0.76);
  font-size: 0.92rem;
  line-height: 1.75;
}

.moonlit-page .motif-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}

.moonlit-page .motif-card {
  padding: 22px 20px;
  border: 1px solid rgba(200, 155, 60, 0.2);
  border-radius: 18px;
  background: rgba(200, 155, 60, 0.04);
}

.moonlit-page .motif-card h3 {
  margin: 0 0 8px;
  color: var(--gold-soft);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.moonlit-page .motif-card p {
  margin: 0;
  color: rgba(247, 243, 236, 0.76);
  font-size: 0.88rem;
  line-height: 1.65;
}

.moonlit-page .selling-grid {
  display: grid;
  gap: 16px;
}

.moonlit-page .selling-card {
  position: relative;
  padding: 22px 24px 22px 28px;
  border-left: 2px solid rgba(200, 155, 60, 0.45);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 14px 14px 0;
}

.moonlit-page .selling-card h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
  color: var(--ivory);
}

.moonlit-page .selling-card p {
  margin: 0;
  color: rgba(247, 243, 236, 0.76);
  font-size: 0.92rem;
  line-height: 1.7;
}

.moonlit-page .adaptation-materials {
  margin-top: 28px;
  padding: 26px 28px;
  border: 1px solid rgba(200, 155, 60, 0.22);
  border-radius: 20px;
  background: rgba(200, 155, 60, 0.04);
}

.moonlit-page .adaptation-materials h3 {
  margin: 0 0 16px;
  font-size: 1.02rem;
  color: var(--gold-soft);
  letter-spacing: 0.02em;
}

.moonlit-page .adaptation-materials .check-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.moonlit-page .achievement-box {
  padding: 26px 28px;
  border: 1px solid rgba(200, 155, 60, 0.24);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(200, 155, 60, 0.08), rgba(200, 155, 60, 0.02));
}

.moonlit-page .achievement-text {
  margin: 0;
  max-width: none;
  color: rgba(247, 243, 236, 0.88);
  font-size: 1rem;
  line-height: 1.8;
}

.moonlit-page .rights-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.moonlit-page .rights-item {
  padding: 20px 22px;
  border: 1px solid rgba(200, 155, 60, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.moonlit-page .rights-item h3 {
  margin: 0 0 8px;
  color: var(--gold-soft);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.moonlit-page .rights-item p {
  margin: 0;
  color: rgba(247, 243, 236, 0.86);
  font-size: 0.98rem;
  line-height: 1.6;
}

.moonlit-page .rights-note {
  color: rgba(243, 239, 229, 0.66);
  font-size: 0.92rem;
}

.moonlit-page .curse-quote {
  position: relative;
  margin: 0 0 32px;
  padding: 36px 44px;
  border: 1px solid rgba(200, 155, 60, 0.4);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(200, 155, 60, 0.12), rgba(200, 155, 60, 0.02));
  overflow: hidden;
}

.moonlit-page .curse-quote::before {
  content: "“";
  position: absolute;
  top: -18px;
  left: 20px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 5.5rem;
  color: rgba(200, 155, 60, 0.35);
  line-height: 1;
  pointer-events: none;
}

.moonlit-page .curse-quote p {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: none;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: clamp(1.15rem, 2.1vw, 1.55rem);
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: var(--gold-soft);
  text-align: center;
}

.moonlit-page .inquiry-section {
  text-align: center;
}

.moonlit-page .inquiry-section .detail-text {
  margin-left: auto;
  margin-right: auto;
}

.contact-email-block {
  margin: 28px 0 8px;
}

.contact-email-label {
  margin: 0 0 10px;
  color: rgba(243, 239, 229, 0.62);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.contact-email-link {
  display: inline-block;
  color: var(--gold-soft);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-bottom: 1px solid rgba(200, 155, 60, 0.4);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.contact-email-link:hover,
.contact-email-link:focus-visible {
  color: var(--text);
  border-color: var(--gold-soft);
}

.moonlit-page .inquiry-section .cta-row {
  justify-content: center;
  margin-top: 8px;
}

@media (max-width: 560px) {
  .moonlit-page .curse-quote {
    padding: 28px 24px;
  }
}

@media (max-width: 980px) {
  .moonlit-page .character-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .moonlit-page .rights-box {
    grid-template-columns: 1fr;
  }

  .moonlit-page .adaptation-materials .check-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .moonlit-page .moonlit-content {
    padding: 72px 0 90px;
  }

  .moonlit-page .detail-section {
    margin-bottom: 72px;
    padding-top: 48px;
  }

  .moonlit-page .character-grid {
    grid-template-columns: 1fr;
  }

  .moonlit-page .achievement-box,
  .moonlit-page .adaptation-materials,
  .moonlit-page .rights-item {
    padding: 20px;
  }
}

/* ==========================================================================
   IP Portfolio card modal (index.html — "IN DEVELOPMENT" cards)
   ========================================================================== */

body.modal-open {
  overflow: hidden;
}

.ip-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 7, 12, 0.78);
  backdrop-filter: blur(6px);
  animation: ip-modal-fade-in 0.22s ease;
}

.ip-modal-overlay[hidden] {
  display: none;
}

@keyframes ip-modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.ip-modal {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 0;
  width: min(920px, 100%);
  max-height: min(720px, 90vh);
  overflow: hidden auto;
  border: 1px solid rgba(200, 155, 60, 0.32);
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(15, 21, 31, 0.98), rgba(9, 12, 18, 0.99));
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55), 0 0 60px rgba(200, 155, 60, 0.12);
  animation: ip-modal-pop-in 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes ip-modal-pop-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ip-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(6, 9, 14, 0.6);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ip-modal-close:hover,
.ip-modal-close:focus-visible {
  color: var(--gold-soft);
  border-color: var(--gold-soft);
  transform: rotate(90deg);
}

.ip-modal-poster {
  position: relative;
  min-height: 260px;
  background: linear-gradient(180deg, #10151d 0%, #0b0d13 100%);
}

.ip-modal-poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ip-modal-body {
  position: relative;
  padding: 40px 40px 36px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ip-modal-status {
  align-self: flex-start;
  margin-bottom: 10px;
}

.ip-modal-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.ip-modal-title {
  margin: 0;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--ivory);
}

.ip-modal-title-en {
  color: rgba(243, 239, 229, 0.62);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  letter-spacing: 0.04em;
}

.ip-modal-genre {
  margin: 0 0 16px;
  color: rgba(200, 155, 60, 0.9);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ip-modal-hook {
  margin: 0 0 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(247, 243, 236, 0.88);
  font-size: 1.02rem;
  line-height: 1.75;
}

.ip-modal-contact {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ip-modal-contact .contact-email-block {
  margin: 0;
}

@media (max-width: 720px) {
  .ip-modal {
    grid-template-columns: 1fr;
    max-height: min(680px, 92vh);
  }

  .ip-modal-poster {
    min-height: 180px;
  }

  .ip-modal-body {
    padding: 28px 24px 28px;
  }
}

@media (max-width: 420px) {
  .ip-modal-overlay {
    padding: 12px;
  }

  .ip-modal-body {
    padding: 24px 20px 24px;
  }
}

/* ==========================================================================
   Work detail page — scoped to .work-detail-page (work-detail.html)
   Generic template for CMS-managed works (not the 6 static cards, not
   Moonlit Palace, which each keep their own dedicated markup/styles).
   ========================================================================== */

.work-detail-page .work-detail-hero[hidden] {
  display: none;
}

.work-detail-page .work-detail-hero-inner {
  grid-template-columns: 1fr;
  align-items: center;
}

.work-detail-page .work-detail-hero .hero-copy {
  max-width: 820px;
}

.work-detail-page .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  color: rgba(243, 239, 229, 0.72);
  text-decoration: none;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}

.work-detail-page .back-link:hover,
.work-detail-page .back-link:focus-visible {
  color: var(--gold-soft);
}

.work-detail-page .work-detail-content {
  padding: 90px 0 120px;
}

.work-detail-page .work-detail-section {
  max-width: 760px;
  margin: 0 auto 80px;
}

.work-detail-page .work-detail-section:last-child {
  margin-bottom: 0;
}

.work-detail-page .work-detail-info-grid {
  max-width: none;
}

.work-detail-page .work-detail-section h2 {
  margin: 0 0 24px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
}

.work-detail-page .work-detail-text {
  max-width: 700px;
  margin: 0;
  color: rgba(247, 243, 236, 0.82);
  font-size: 1.02rem;
  line-height: 1.9;
}

.work-detail-page .work-detail-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.work-detail-page .work-detail-info-grid .info-card p {
  color: rgba(247, 243, 236, 0.82);
  line-height: 1.7;
}

.work-detail-page .work-detail-inquiry-section {
  text-align: center;
}

.work-detail-page .work-detail-inquiry-section .cta-row {
  justify-content: center;
}

.work-detail-page .work-detail-notfound {
  padding: 140px 0;
  display: flex;
  justify-content: center;
}

.work-detail-page .work-detail-notfound[hidden] {
  display: none;
}

.work-detail-page .work-detail-notfound-box {
  max-width: 480px;
  padding: 40px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  text-align: center;
}

.work-detail-page .work-detail-notfound-title {
  margin: 0 0 10px;
  font-size: 1.2rem;
  color: var(--ivory);
}

.work-detail-page .work-detail-notfound-text {
  margin: 0 0 24px;
  color: rgba(247, 243, 236, 0.7);
  font-size: 0.95rem;
}

@media (max-width: 720px) {
  .work-detail-page .work-detail-info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .work-detail-page .work-detail-content {
    padding: 64px 0 80px;
  }

  .work-detail-page .work-detail-section {
    margin-bottom: 56px;
  }

  .work-detail-page .work-detail-notfound-box {
    padding: 28px 20px;
  }
}

/* ==========================================================================
   Chapter list (work-detail.html) + chapter reading page (chapter-read.html)
   ========================================================================== */

.work-detail-page .work-detail-chapters-section[hidden] {
  display: none;
}

.work-detail-chapter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 700px;
}

.work-detail-chapter-row a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: var(--ivory, #f3efe5);
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.work-detail-chapter-row a:hover,
.work-detail-chapter-row a:focus-visible {
  border-color: rgba(200, 155, 60, 0.4);
  background: rgba(200, 155, 60, 0.06);
}

.chapter-row-number {
  flex-shrink: 0;
  color: rgba(247, 243, 236, 0.55);
  font-size: 0.85rem;
}

.chapter-row-title {
  flex: 1;
  font-size: 0.95rem;
}

.chapter-free-badge,
.chapter-lock-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.chapter-free-badge {
  border: 1px solid rgba(200, 155, 60, 0.35);
  background: rgba(200, 155, 60, 0.1);
  color: var(--gold-soft, #e7cb7c);
}

.chapter-lock-badge {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(247, 243, 236, 0.6);
}

.chapter-read-page .chapter-read-content[hidden] {
  display: none;
}

.chapter-read-page .chapter-read-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 0 120px;
}

.chapter-read-page .chapter-read-head {
  margin: 24px 0 44px;
  text-align: center;
}

.chapter-read-page .chapter-read-work-title {
  margin: 0 0 8px;
  color: rgba(247, 243, 236, 0.6);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chapter-read-page .chapter-read-title {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: var(--ivory, #f3efe5);
}

.chapter-read-page .chapter-author-notice {
  margin: 0 0 32px;
  padding: 18px 20px;
  border-radius: 14px;
  border-left: 3px solid var(--gold, #c89b3c);
  background: rgba(255, 255, 255, 0.04);
}

.chapter-read-page .chapter-author-notice[hidden] {
  display: none;
}

.chapter-read-page .chapter-author-notice-label {
  margin: 0 0 6px;
  color: var(--gold, #c89b3c);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chapter-read-page .chapter-author-notice-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--ivory, #f3efe5);
}

.chapter-read-page .chapter-author-notice-body {
  margin: 0 0 8px;
  white-space: pre-wrap;
  color: rgba(247, 243, 236, 0.86);
  font-size: 0.95rem;
  line-height: 1.7;
}

.chapter-read-page .chapter-author-notice-date {
  margin: 0;
  color: rgba(247, 243, 236, 0.5);
  font-size: 0.78rem;
}

.chapter-read-page .chapter-image {
  margin: 0 0 32px;
}

.chapter-read-page .chapter-image[hidden] {
  display: none;
}

.chapter-read-page .chapter-image img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(200, 155, 60, 0.22);
}

@media (max-width: 560px) {
  .chapter-read-page .chapter-image img {
    max-height: 240px;
    border-radius: 12px;
  }
}

.chapter-read-page .chapter-read-body {
  white-space: pre-wrap;
  color: rgba(247, 243, 236, 0.86);
  font-size: 1.05rem;
  line-height: 2;
}

.chapter-read-page .chapter-read-body[hidden] {
  display: none;
}

.chapter-read-page .chapter-read-locked {
  padding: 80px 24px;
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 20px;
}

.chapter-read-page .chapter-read-locked[hidden] {
  display: none;
}

.chapter-read-page .chapter-read-locked-icon {
  margin: 0 0 12px;
  font-size: 2rem;
}

.chapter-read-page .chapter-read-locked-title {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--ivory, #f3efe5);
}

.chapter-read-page .chapter-read-locked-text {
  margin: 0;
  color: rgba(247, 243, 236, 0.6);
  font-size: 0.92rem;
}

.chapter-read-page .chapter-read-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 60px;
}

.chapter-read-page .chapter-read-nav-link[hidden] {
  display: none;
}

@media (max-width: 560px) {
  .work-detail-chapter-row a {
    flex-wrap: wrap;
    padding: 14px 16px;
  }

  .chapter-read-page .chapter-read-nav {
    flex-direction: column;
  }
}

/* ==========================================================================
   Chapter comments (chapter-read.html only) — reader-only, gated on
   free + published chapters. Styling only; all behavior lives in
   public/chapter-comments.js.
   ========================================================================== */

.chapter-comments {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chapter-comments[hidden] {
  display: none;
}

.chapter-comments-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 20px;
}

.chapter-comments-header h2 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--ivory);
}

#cc-total-count {
  color: var(--gold-soft);
  font-weight: 700;
}

.chapter-comment-form {
  margin-bottom: 32px;
}

.chapter-comment-form textarea,
.chapter-comment-reply-form textarea,
.chapter-comment-edit-form textarea {
  width: 100%;
  min-height: 90px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.6;
  resize: vertical;
}

.chapter-comment-form textarea:focus,
.chapter-comment-reply-form textarea:focus,
.chapter-comment-edit-form textarea:focus {
  outline: none;
  border-color: rgba(200, 155, 60, 0.5);
}

.chapter-comment-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.chapter-comment-char-count {
  color: rgba(247, 243, 236, 0.5);
  font-size: 0.78rem;
}

.chapter-comment-status,
.chapter-comment-form-status {
  min-height: 1.2em;
  margin: 8px 0 0;
  color: #e6a58c;
  font-size: 0.82rem;
}

.chapter-comments-empty,
.chapter-comments-error {
  padding: 40px 0;
  text-align: center;
  color: rgba(247, 243, 236, 0.5);
  font-size: 0.9rem;
}

.chapter-comment-thread {
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.chapter-comment-thread:last-child {
  border-bottom: none;
}

.chapter-comment {
  padding: 10px 0;
}

.chapter-comment-depth-1 {
  margin-left: 28px;
}

.chapter-comment-depth-2 {
  margin-left: 56px;
}

.chapter-comment-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.chapter-comment-author {
  color: var(--gold-soft);
  font-weight: 700;
  font-size: 0.88rem;
}

.chapter-comment-author-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid rgba(200, 155, 60, 0.4);
  background: rgba(200, 155, 60, 0.12);
  color: var(--gold-soft);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.chapter-comment-time {
  color: rgba(247, 243, 236, 0.5);
  font-size: 0.76rem;
}

.chapter-comment-edited {
  color: rgba(247, 243, 236, 0.4);
  font-size: 0.72rem;
}

.chapter-comment-body {
  margin: 0;
  color: rgba(247, 243, 236, 0.9);
  font-size: 0.92rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.chapter-comment-body[hidden] {
  display: none;
}

.chapter-comment-body-tombstone {
  color: rgba(247, 243, 236, 0.4);
  font-style: italic;
}

.chapter-comment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}

.chapter-comment-like-btn,
.chapter-comment-reply-btn,
.chapter-comment-edit-btn,
.chapter-comment-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 0;
  padding: 0;
  color: rgba(247, 243, 236, 0.55);
  font-size: 0.78rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.chapter-comment-like-btn:hover,
.chapter-comment-reply-btn:hover,
.chapter-comment-edit-btn:hover,
.chapter-comment-delete-btn:hover {
  color: var(--gold-soft);
}

.chapter-comment-like-btn:disabled,
.chapter-comment-delete-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.chapter-comment-like-btn.is-liked {
  color: var(--gold-soft);
}

.chapter-comment-reply-form,
.chapter-comment-edit-form {
  margin-top: 10px;
}

.chapter-comment-reply-form[hidden],
.chapter-comment-edit-form[hidden] {
  display: none;
}

.chapter-comment-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.chapter-comment-btn-sm {
  min-height: 34px;
  padding: 0 14px;
  font-size: 0.76rem;
}

.chapter-comments-more-row {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

@media (max-width: 560px) {
  .chapter-comment-depth-1 {
    margin-left: 14px;
  }

  .chapter-comment-depth-2 {
    margin-left: 26px;
  }

  .chapter-comment-actions {
    gap: 10px;
  }
}

/* ==========================================================================
   Reader site (reader.html) — bookstore-style "read now" catalog
   ========================================================================== */

.reader-hero {
  padding: clamp(56px, 8vw, 100px) 0 40px;
}

.reader-hero-inner h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.03em;
}

.reader-hero-text {
  max-width: 620px;
  margin: 0;
  color: rgba(247, 243, 236, 0.78);
  font-size: 1.02rem;
  line-height: 1.8;
}

.reader-works-section {
  padding: 20px 0 120px;
}

.reader-empty-text {
  color: rgba(247, 243, 236, 0.6);
  font-size: 0.95rem;
}

.reader-purchase-note {
  max-width: 720px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

.reader-purchase-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.reader-purchase-group {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
}

.reader-purchase-group h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--ivory);
}

/* ==========================================================================
   광고·제휴 배너 슬롯(index.html #home 하단, reader.html 작품 목록 상단).
   배너가 없으면 [hidden]으로 완전히 숨어 빈 공간을 남기지 않는다.
   ========================================================================== */

.ad-banner-slot {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.ad-banner-slot[hidden] {
  display: none;
}

.ad-banner-link {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.ad-banner-link img {
  display: block;
  width: 100%;
  height: auto;
}

.reader-work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}

.reader-card {
  position: relative;
  border: 1px solid rgba(200, 155, 60, 0.2);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(12, 17, 25, 0.9), rgba(9, 12, 18, 0.95));
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.reader-card:hover,
.reader-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(200, 155, 60, 0.45);
}

/* The clickable "작품 읽기" area — a sibling of .reader-card-favorite below,
   not a parent, so the favorite button is never nested inside this <a>. */
.reader-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.reader-card-favorite {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 12, 20, 0.66);
  color: rgba(247, 243, 236, 0.85);
  font-size: 0.68rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.reader-card-favorite:hover,
.reader-card-favorite:focus-visible {
  border-color: rgba(200, 155, 60, 0.5);
}

.reader-card-favorite:disabled {
  opacity: 0.6;
  cursor: default;
}

.reader-card-favorite-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.reader-card-favorite.is-favorited {
  border-color: rgba(200, 155, 60, 0.55);
  background: rgba(200, 155, 60, 0.18);
  color: var(--gold-soft);
}

.reader-main-nav a.active {
  color: var(--gold-soft);
}

.reader-favorite-status {
  margin: 0 0 18px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(224, 122, 95, 0.35);
  background: rgba(224, 122, 95, 0.08);
  color: #e6a58c;
  font-size: 0.85rem;
  text-align: center;
}

.reader-favorite-status[hidden] {
  display: none;
}

.reader-favorites-login-required,
.reader-favorites-empty {
  padding: 60px 20px;
  text-align: center;
}

.reader-favorites-login-required .cta-row {
  justify-content: center;
  margin-top: 20px;
}

@media (max-width: 560px) {
  .reader-card-favorite-label {
    display: none;
  }
}

.reader-card-poster {
  aspect-ratio: 3 / 4;
  background: rgba(255, 255, 255, 0.03);
}

.reader-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reader-card-body {
  padding: 18px 20px 22px;
}

.reader-card-body h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--ivory);
}

.reader-card-genre {
  margin: 0 0 8px;
  color: var(--gold-soft);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reader-card-hook {
  margin: 0 0 14px;
  color: rgba(247, 243, 236, 0.72);
  font-size: 0.85rem;
  line-height: 1.6;
}

.reader-card-status {
  margin: 0 0 14px;
  color: rgba(247, 243, 236, 0.55);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
}

.reader-card-cta {
  color: var(--gold-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

@media (max-width: 560px) {
  .reader-work-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
  }
}

/* ==========================================================================
   Buyer site (buyer.html) — business-facing portfolio overview
   ========================================================================== */

.buyer-hero {
  padding: clamp(56px, 8vw, 100px) 0 40px;
}

.buyer-hero-inner h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.03em;
}

.buyer-hero-text {
  max-width: 640px;
  margin: 0 0 32px;
  color: rgba(247, 243, 236, 0.78);
  font-size: 1.02rem;
  line-height: 1.8;
}

.buyer-company-section {
  padding: 10px 0 70px;
}

.buyer-company-text {
  max-width: 760px;
  margin: 0;
  color: rgba(247, 243, 236, 0.8);
  line-height: 1.8;
}

.buyer-portfolio-section {
  padding: 10px 0 100px;
}

#buyer-feature-container:not(:empty) {
  margin-bottom: 40px;
}

/* .buyer-feature-card (single-column poster+text card) removed — the
   is_featured work now reuses index.html's .feature-card flip design
   directly (see app.js buildBuyerFeatureCardHtml()), styled by the
   .feature-card rules above. */

.buyer-work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.buyer-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  padding: 20px;
  border: 1px solid rgba(200, 155, 60, 0.2);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(12, 17, 25, 0.9), rgba(9, 12, 18, 0.95));
}

.buyer-card-poster {
  width: 120px;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.buyer-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.buyer-card-genre {
  margin: 0 0 6px;
  color: var(--gold-soft);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.buyer-card-body h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  color: var(--ivory);
}

.buyer-card-hook {
  margin: 0 0 10px;
  color: rgba(247, 243, 236, 0.75);
  font-size: 0.85rem;
  line-height: 1.6;
}

.buyer-card-meta {
  margin: 0 0 6px;
  color: rgba(247, 243, 236, 0.62);
  font-size: 0.78rem;
  line-height: 1.5;
}

.buyer-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.buyer-card-btn {
  min-height: 40px;
  padding: 0 18px;
  font-size: 0.74rem;
}

.buyer-materials-section {
  padding: 60px 0;
  background: linear-gradient(180deg, rgba(9, 12, 17, 1), rgba(11, 18, 27, 1));
}

.buyer-materials-inner {
  max-width: 640px;
  text-align: center;
}

.buyer-materials-inner h3 {
  margin: 0 0 14px;
  font-size: 1.4rem;
}

.buyer-materials-inner p {
  margin: 0 0 24px;
  color: rgba(247, 243, 236, 0.75);
  line-height: 1.8;
}

.buyer-materials-inner .btn {
  margin: 0 auto;
}

.buyer-contact-cta-section {
  padding: 80px 0 110px;
  text-align: center;
}

.buyer-contact-cta-inner h2 {
  margin: 0 0 14px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.buyer-contact-cta-inner p {
  max-width: 560px;
  margin: 0 auto 28px;
  color: rgba(247, 243, 236, 0.75);
  line-height: 1.8;
}

.buyer-contact-cta-inner .btn {
  margin: 0 auto;
}

@media (max-width: 560px) {
  .buyer-card {
    grid-template-columns: 1fr;
  }

  .buyer-card-poster {
    width: 100%;
  }
}

/* ==========================================================================
   Reader header auth widget (reader.html topbar) — "로그인 · 회원가입" when
   signed out, "{닉네임} · 로그아웃" when signed in. Populated by
   reader-auth.js. Does not affect any other page's header.
   ========================================================================== */

.reader-header-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.reader-header-auth-btn {
  min-height: 40px;
  padding: 0 16px;
  font-size: 0.72rem;
}

.reader-header-auth-name {
  color: var(--gold-soft);
  font-size: 0.82rem;
  white-space: nowrap;
}

/* 알림 아이콘(편지봉투=공지, 종=새 회차) — 아이콘 wrapper는 relative, 배지는
   그 오른쪽 위 모서리에 absolute로 겹쳐 붙인다. 로그인 상태일 때만
   reader-auth.js가 이 버튼들을 #reader-header-auth 안에 렌더링한다.
   .reader-notif-group은 드롭다운(새 공지/새 회차 목록)의 위치 기준점. */
.reader-notif-group {
  position: relative;
  display: inline-flex;
}

.reader-notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: -8px;
  width: 280px;
  max-width: calc(100vw - 32px);
  max-height: 340px;
  overflow-y: auto;
  background: var(--bg-strong, #0b1220);
  border: 1px solid rgba(200, 155, 60, 0.25);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  padding: 12px;
  z-index: 60;
}

.reader-notif-dropdown[hidden] {
  display: none;
}

.reader-notif-dropdown-title {
  margin: 0 0 8px;
  color: var(--gold-soft);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reader-notif-dropdown-empty {
  margin: 0;
  padding: 16px 4px;
  color: rgba(247, 243, 236, 0.5);
  font-size: 0.82rem;
  text-align: center;
}

.reader-notif-dropdown-footer-link {
  display: block;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--gold-soft);
  text-decoration: none;
  font-size: 0.8rem;
  text-align: center;
}

.reader-notif-dropdown-footer-link:hover {
  text-decoration: underline;
}

.reader-notif-dropdown-item {
  display: block;
  padding: 8px 8px;
  border-radius: 8px;
  color: var(--ivory, #f3efe5);
  text-decoration: none;
  font-size: 0.82rem;
  line-height: 1.4;
}

.reader-notif-dropdown-item:hover,
.reader-notif-dropdown-item:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}

.reader-notif-dropdown-item-sub {
  display: block;
  margin-top: 2px;
  color: rgba(247, 243, 236, 0.5);
  font-size: 0.72rem;
}

.reader-notif-dropdown-item-read {
  opacity: 0.45;
}

@media (max-width: 560px) {
  .reader-notif-dropdown {
    right: -40px;
    width: 260px;
  }
}

.reader-notif-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ivory, #f3efe5);
  cursor: pointer;
  flex-shrink: 0;
}

.reader-notif-icon-btn svg {
  width: 20px;
  height: 20px;
}

.reader-notif-icon-btn:hover,
.reader-notif-icon-btn:focus-visible {
  color: var(--gold-soft);
}

/* '공지' 텍스트 버튼(편지봉투 아이콘 대체) — 위치 기준점(relative)과 배지
   호스트 역할은 .reader-notif-icon-btn과 그대로 공유하고, 정사각형
   아이콘 크기 대신 텍스트에 맞춘 너비로만 바꾼다. */
.reader-notif-icon-btn.reader-notif-text-btn {
  width: auto;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(200, 155, 60, 0.3);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.reader-notif-icon-btn.reader-notif-text-btn:hover,
.reader-notif-icon-btn.reader-notif-text-btn:focus-visible {
  border-color: var(--gold-soft);
  background: rgba(255, 255, 255, 0.05);
}

.reader-notif-badge {
  position: absolute;
  top: -4px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: #2ecc71;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg, #070b14);
  pointer-events: none;
}

.reader-notif-badge[hidden] {
  display: none;
}

@media (max-width: 560px) {
  .reader-notif-icon-btn {
    width: 32px;
    height: 32px;
  }

  .reader-notif-icon-btn svg {
    width: 18px;
    height: 18px;
  }

  .reader-notif-icon-btn.reader-notif-text-btn {
    width: auto;
    height: 32px;
    padding: 0 10px;
    font-size: 0.7rem;
  }

  .reader-notif-badge {
    top: -3px;
    right: -3px;
    min-width: 15px;
    height: 15px;
    font-size: 9px;
    line-height: 15px;
  }
}

@media (max-width: 560px) {
  .reader-header-auth-name {
    display: none;
  }
}

/* ==========================================================================
   Reader-only mobile header layout (reader.html / chapter-read.html only —
   these two pages share this exact header markup: logo + KO/EN + 홈·
   관심작품·내 서재 nav + login/logout widget). Rebuilds the cramped generic
   3-row phone wrap (.header-inner/.brand/.main-nav base rules above) into 2
   compact rows using CSS Grid, scoped strictly to .reader-page/
   .chapter-read-page so no other page — including index.html/buyer.html/
   admin, or reader-work-detail.html's own simpler 2-link header (no KO/EN,
   no 3-link nav) — is affected:
     row 1 — small KO/EN (left) · logo (center) · small 로그아웃 (right)
     row 2 — 홈 · 관심작품 · 내 서재, centered and evenly spaced
   ========================================================================== */

@media (max-width: 560px) {
  .reader-page .header-inner,
  .chapter-read-page .header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "lang brand auth"
      "nav nav nav";
    align-items: center;
    column-gap: 8px;
    row-gap: 6px;
    min-height: unset;
    padding: 8px 0 10px;
  }

  .reader-page .brand,
  .chapter-read-page .brand {
    grid-area: brand;
  }

  .reader-page .brand img,
  .chapter-read-page .brand img {
    width: 100px;
  }

  .reader-page .reader-brand-tag {
    display: none;
  }

  .reader-page .lang-switch,
  .chapter-read-page .lang-switch {
    grid-area: lang;
    justify-self: start;
    padding: 3px;
  }

  .reader-page .lang-btn,
  .chapter-read-page .lang-btn {
    min-height: 40px;
    padding: 0 8px;
    font-size: 0.62rem;
  }

  .reader-page .reader-header-auth,
  .chapter-read-page .reader-header-auth {
    grid-area: auth;
    justify-self: end;
  }

  .reader-page .reader-header-auth-btn,
  .chapter-read-page .reader-header-auth-btn {
    min-height: 40px;
    padding: 0 10px;
    font-size: 0.62rem;
    letter-spacing: 0.02em;
  }

  .reader-page .reader-main-nav,
  .chapter-read-page .reader-main-nav {
    grid-area: nav;
    width: 100%;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .reader-page .reader-main-nav a,
  .chapter-read-page .reader-main-nav a {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
    font-size: 0.81rem;
    letter-spacing: 0.02em;
    padding: 4px 2px;
  }
}

/* ==========================================================================
   Reader auth pages (reader-login.html / reader-signup.html /
   reader-reset-password.html) — reuses the same tokens and form patterns
   as the rest of the public site (--gold/--navy/--ivory, .btn, .container,
   .topbar, the .contact-field input look). Scoped entirely under
   .reader-auth-* class names; does not touch admin.css or any admin-*
   class, and does not affect index.html / buyer.html / work-detail.html /
   chapter-read.html.
   ========================================================================== */

.reader-auth-section {
  min-height: calc(100vh - 88px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
}

.reader-auth-card {
  width: min(440px, 100%);
  padding: 44px 36px 36px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(15, 21, 31, 0.96), rgba(9, 12, 18, 0.98));
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.5), 0 0 60px rgba(200, 155, 60, 0.08);
}

.reader-auth-eyebrow {
  margin: 0 0 10px;
  color: var(--gold-soft);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-align: center;
}

.reader-auth-title {
  margin: 0 0 28px;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--ivory);
}

.reader-auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* .reader-auth-form과 브라우저 기본 [hidden] 규칙은 둘 다 단일 클래스/속성
   선택자라 우선순위가 같다 — 동률이면 작성자 스타일시트가 이기므로, 이
   규칙이 없으면 signupForm.hidden = true를 해도 display:flex가 계속
   이겨서 폼이 화면에서 사라지지 않는다(그 안의 상태 문구도 같이 남음). */
.reader-auth-form[hidden] {
  display: none;
}

.reader-auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reader-auth-field > span:first-child {
  color: var(--gold-soft);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
}

.reader-auth-field input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.reader-auth-field input:focus {
  outline: none;
  border-color: rgba(200, 155, 60, 0.55);
  background: rgba(255, 255, 255, 0.05);
}

.reader-auth-hint {
  margin: -4px 0 0;
  color: rgba(247, 243, 236, 0.5);
  font-size: 0.74rem;
}

.reader-auth-consent {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: -4px;
}

.reader-auth-consent-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.reader-auth-consent-item input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
}

.reader-auth-consent-item a {
  color: var(--ivory);
  text-decoration: underline;
}

.reader-auth-consent-item a:hover {
  color: var(--gold-soft);
}

.reader-auth-consent-required {
  color: var(--gold-soft);
  font-size: 0.74rem;
}

.reader-auth-submit {
  width: 100%;
  margin-top: 4px;
}

.reader-auth-status {
  min-height: 1.2em;
  margin: 4px 0 0;
  color: var(--gold-soft);
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.6;
}

.reader-auth-toggle-link {
  display: block;
  width: 100%;
  margin: 18px auto 0;
  background: none;
  border: 0;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.82rem;
  text-align: center;
}

.reader-auth-toggle-link:hover,
.reader-auth-toggle-link:focus-visible {
  color: var(--gold-soft);
}

.reader-auth-reset-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.reader-auth-reset-panel[hidden] {
  display: none;
}

.reader-auth-reset-panel form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reader-auth-links {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}

.reader-auth-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.reader-auth-links a:hover,
.reader-auth-links a:focus-visible {
  color: var(--gold-soft);
}

.reader-auth-success[hidden] {
  display: none;
}

.reader-auth-success p {
  margin: 0 0 20px;
  color: rgba(247, 243, 236, 0.85);
  line-height: 1.7;
  text-align: center;
}

.reader-auth-success .btn {
  width: 100%;
}

@media (max-width: 560px) {
  .reader-auth-card {
    padding: 34px 22px 28px;
  }
}

/* ==========================================================================
   Reader-only work detail (reader-work-detail.html) — compact "confirm the
   work, then start reading" layout. Deliberately NOT the large full-bleed
   .work-detail-hero used by the business-facing work-detail.html (that page
   is untouched). Reuses .eyebrow/.tagline/.cta-row/.btn and the existing
   .work-detail-chapter-list / .chapter-free-badge / .chapter-lock-badge
   chapter-row styles as-is so the chapter rows look identical to before.
   ========================================================================== */

.work-author-notice {
  padding: 18px 0 0;
}

.work-author-notice[hidden] {
  display: none;
}

.work-author-notice .container {
  padding: 16px 20px;
  border-radius: 14px;
  border-left: 3px solid var(--gold, #c89b3c);
  background: rgba(255, 255, 255, 0.03);
}

.work-author-notice-label {
  margin: 0 0 6px;
  color: var(--gold, #c89b3c);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.work-author-notice-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--ivory, #f3efe5);
}

.work-author-notice-body {
  margin: 0 0 8px;
  white-space: pre-wrap;
  color: rgba(247, 243, 236, 0.86);
  font-size: 0.95rem;
  line-height: 1.7;
}

.work-author-notice-date {
  margin: 0;
  color: rgba(247, 243, 236, 0.5);
  font-size: 0.78rem;
}

@media (max-width: 560px) {
  .work-author-notice .container {
    padding: 14px 16px;
  }
}

.reader-detail-hero {
  padding: clamp(40px, 6vw, 72px) 0 36px;
}

.reader-detail-hero[hidden] {
  display: none;
}

.reader-detail-hero-inner {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: clamp(22px, 4vw, 44px);
  align-items: center;
}

.reader-detail-poster {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(200, 155, 60, 0.22);
}

.reader-detail-poster[hidden] {
  display: none;
}

.reader-detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reader-detail-info h1 {
  margin: 10px 0 14px;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ivory);
}

.reader-detail-hook {
  margin: 0 0 24px;
  max-width: 640px;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.6;
}

.reader-detail-status {
  margin: 0;
  color: rgba(247, 243, 236, 0.6);
  font-size: 0.9rem;
}

.reader-detail-chapters {
  padding: 6px 0 100px;
}

.reader-detail-chapters[hidden] {
  display: none;
}

.reader-detail-page-body {
  padding: 6px 0 40px;
}

.reader-detail-page-body[hidden] {
  display: none;
}

.reader-detail-page-body h2,
.reader-detail-page-body h3 {
  color: var(--ivory);
  letter-spacing: -0.01em;
}

.reader-detail-page-body p,
.reader-detail-page-body li {
  color: rgba(247, 243, 236, 0.82);
  line-height: 1.7;
}

.reader-detail-chapters-title {
  margin: 0 0 20px;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  letter-spacing: -0.02em;
  color: var(--ivory);
}

.reader-detail-chapters-empty {
  list-style: none;
  color: rgba(247, 243, 236, 0.6);
  font-size: 0.92rem;
}

/* ==========================================================================
   작품 상세 — "회차로 읽기 / 전자책 / 종이책" 탭 + 전자책·종이책 카드
   ========================================================================== */

.reader-detail-tabs {
  border-bottom: 1px solid var(--line);
}

.reader-category-tabs {
  margin: 8px 0 28px;
}

.reader-category-tabs .reader-detail-tabs-inner {
  justify-content: center;
}

.reader-detail-tabs[hidden] {
  display: none;
}

.reader-detail-tabs-inner {
  display: flex;
  gap: 4px;
}

.reader-detail-tab {
  padding: 14px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.reader-detail-tab[hidden] {
  display: none;
}

.reader-detail-tab:hover {
  color: var(--ivory);
}

.reader-detail-tab.active {
  color: var(--gold-soft);
  border-bottom-color: var(--gold-soft);
}

.reader-detail-books {
  padding: 32px 0 100px;
}

.reader-detail-books[hidden] {
  display: none;
}

.reader-book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
}

.reader-book-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reader-book-card-link {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.reader-book-card-link:hover h3,
.reader-book-card-link:focus-visible h3 {
  color: var(--gold-soft);
}

.reader-book-cover {
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.reader-book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reader-book-cover-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, rgba(200, 155, 60, 0.12), rgba(255, 255, 255, 0.02));
}

.reader-book-info h3 {
  margin: 6px 0 4px;
  font-size: 1rem;
  color: var(--ivory);
}

.reader-book-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(200, 155, 60, 0.14);
  border: 1px solid var(--line);
  color: var(--gold-soft);
  font-size: 0.72rem;
}

.reader-book-meta {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.reader-book-desc {
  margin: 0 0 10px;
  color: rgba(247, 243, 236, 0.75);
  font-size: 0.86rem;
  line-height: 1.6;
}

.reader-book-buy-btn {
  width: 100%;
}

.reader-book-buy-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .reader-detail-hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .reader-detail-poster {
    max-width: 200px;
    margin: 0 auto;
  }

  .reader-detail-info .cta-row {
    justify-content: center;
  }

  .reader-detail-tab {
    padding: 12px 14px;
    font-size: 0.84rem;
  }

  .reader-book-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
  }
}

/* ==========================================================================
   도서 상세 페이지 (reader-book-detail.html) — .reader-detail-hero /
   .reader-detail-poster / .reader-detail-info / .reader-detail-page-body를
   그대로 재사용하고, 가격/구매 버튼/목차/홍보 이미지에 필요한 만큼만
   이 블록에서 보탠다.
   ========================================================================== */

.book-detail-price-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 20px;
  flex-wrap: wrap;
}

.book-detail-price {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 700;
  color: var(--ivory);
}

.book-detail-buy-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* .btn sets display:inline-flex at the same specificity as the [hidden]
   attribute selector, so the author rule beats the UA default and a
   hidden .btn would otherwise still render — this element toggles hidden
   at runtime (no preview_url registered), so it needs an explicit override. */
#bd-preview-link[hidden],
#bd-read-link[hidden] {
  display: none;
}

.book-detail-section {
  margin-bottom: 40px;
}

.book-detail-section[hidden] {
  display: none;
}

.book-detail-section h2 {
  margin: 0 0 14px;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
}

.book-detail-multiline {
  white-space: pre-line;
}

.book-detail-promo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.book-detail-promo-gallery img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: cover;
}

@media (max-width: 720px) {
  .book-detail-price-box {
    justify-content: center;
  }
}

/* ==========================================================================
   전자책 뷰어 (book-reader.html) — PDF(pdf.js)·EPUB(epub.js) 공용 레이아웃.
   회사 공통 헤더(.topbar) 대신 이 페이지 전용의 간결한 헤더(.br-header)를
   쓴다. .work-detail-notfound류 상태 박스는 기존 CSS(work-detail-page
   스코프)를 그대로 재사용한다.
   ========================================================================== */

html:has(.br-body) {
  height: 100%;
}

.br-body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.br-page {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.br-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}

.br-close-btn {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.br-close-btn:hover {
  border-color: var(--gold-soft);
  color: var(--gold-soft);
}

.br-header-title {
  flex: 1;
  min-width: 80px;
  color: var(--ivory);
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.br-header-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.br-header-controls[hidden] {
  display: none;
}

.br-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 12px;
  border-right: 1px solid var(--line);
}

.br-control-group:last-child {
  border-right: none;
  padding-right: 0;
}

.book-reader-status {
  padding: 80px 20px;
  text-align: center;
  color: var(--muted);
}

.br-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.br-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.br-shell[hidden] {
  display: none;
}

.book-reader-tool-btn {
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.book-reader-tool-btn:hover {
  border-color: var(--gold-soft);
  color: var(--gold-soft);
}

.book-reader-tool-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.book-reader-tool-btn[aria-pressed="true"] {
  border-color: var(--gold-soft);
  color: var(--gold-soft);
  background: rgba(231, 203, 124, 0.1);
}

/* PDF — 한 쪽씩 읽기 */

.br-pdf-single {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.br-pdf-single[hidden] {
  display: none;
}

.br-page-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

.br-page-nav[hidden] {
  display: none;
}

.br-page-nav-bottom {
  border-bottom: none;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.br-nav-btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.br-nav-btn:hover:not(:disabled) {
  border-color: var(--gold-soft);
  color: var(--gold-soft);
}

.br-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.br-page-indicator {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.br-page-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #0c1220;
  display: flex;
  flex-direction: column;
}

.br-page-surface {
  min-height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  box-sizing: border-box;
}

.br-page-surface.br-clickable {
  cursor: pointer;
}

.br-cover-img,
#br-pdf-canvas {
  display: block;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.br-cover-img[hidden],
#br-pdf-canvas[hidden] {
  display: none;
}

/* PDF — 연속 보기 */

.br-pdf-continuous {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.br-pdf-continuous[hidden] {
  display: none;
}

.br-continuous-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #0c1220;
  padding: 20px 20px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.br-continuous-scroll canvas,
.br-continuous-scroll img {
  display: block;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  max-width: 100%;
}

/* EPUB — 기존 레이아웃 유지, 헤더만 교체 */

.book-reader-body {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
}

.book-reader-body[hidden] {
  display: none;
}

.book-reader-toc {
  width: 280px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
}

.book-reader-toc[hidden] {
  display: none;
}

.book-reader-toc h3 {
  margin: 0 0 12px;
  color: var(--ivory);
  font-size: 1rem;
}

.book-reader-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.book-reader-toc a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
}

.book-reader-toc a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--gold-soft);
}

.book-reader-epub-view {
  flex: 1;
  min-width: 0;
  overflow: auto;
  background: var(--ivory);
}

@media (max-width: 720px) {
  .br-header {
    gap: 8px;
    padding: 8px 12px;
  }

  .br-header-title {
    flex-basis: 100%;
    order: 3;
  }

  .br-header-controls {
    flex-basis: 100%;
    order: 4;
    justify-content: flex-start;
  }

  .br-control-group {
    padding-right: 8px;
  }

  .br-page-nav {
    padding: 8px 10px;
  }

  .br-nav-btn {
    padding: 0 12px;
    font-size: 0.78rem;
    min-height: 40px;
  }

  .br-page-surface {
    padding: 10px;
  }

  .br-continuous-scroll {
    padding: 10px 10px 50px;
  }

  .book-reader-toc {
    position: absolute;
    inset: 0;
    z-index: 15;
    width: 100%;
  }
}

/* ==========================================================================
   Login-required gate (chapter-read.html) — reuses .work-detail-notfound /
   .work-detail-notfound-box (already scoped under .work-detail-page, which
   chapter-read.html's page-shell already carries) for the same look as the
   existing "회차를 찾을 수 없습니다" panel. Only the wider box and the
   3-button row below are new.
   ========================================================================== */

.reader-login-required-box {
  max-width: 560px;
}

.reader-login-required-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

/* ==========================================================================
   Reader home (reader.html) — v2: reader-only header (no ABOUT/IP
   PORTFOLIO/BUSINESS/CONTACT company menu) + STORIAN PICK hero + "전체
   작품" grid. Reuses .eyebrow/.tagline/.cta-row/.btn/.reader-work-grid/
   .reader-card* as-is. Does not touch .hero/.hero-inner (company homepage)
   or any buyer-* class.
   ========================================================================== */

.reader-brand-tag {
  margin-left: 2px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(200, 155, 60, 0.4);
  color: var(--gold-soft);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}

/* 관심작품 / 내 서재 — DB 기능은 아직 없으므로 클릭 가능한 링크가 아니라
   비활성 표시로만 자리를 잡는다(사용자가 동작하는 버튼으로 착각하지 않도록
   "준비 중" 배지와 흐린 텍스트, cursor:default 사용). */
.reader-nav-soon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(247, 243, 236, 0.35);
  font-size: 0.71rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: default;
  user-select: none;
}

.reader-nav-soon em {
  font-style: normal;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(247, 243, 236, 0.4);
  font-size: 0.58rem;
  letter-spacing: 0.03em;
  text-transform: none;
}

.reader-pick {
  padding: clamp(44px, 7vw, 88px) 0 52px;
}

.reader-pick[hidden] {
  display: none;
}

.reader-pick-inner {
  display: grid;
  grid-template-columns: minmax(200px, 300px) 1fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}

.reader-pick-poster {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(200, 155, 60, 0.3);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
}

.reader-pick-poster[hidden] {
  display: none;
}

.reader-pick-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reader-pick-kicker {
  margin: 0 0 14px;
  color: var(--gold-soft);
  font-size: 0.8rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 700;
}

.reader-pick-info h2 {
  margin: 6px 0 16px;
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ivory);
}

.reader-pick-hook {
  margin: 0 0 26px;
  max-width: 620px;
}

@media (max-width: 780px) {
  .reader-nav-soon {
    display: none;
  }

  .reader-pick-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .reader-pick-poster {
    max-width: 260px;
    margin: 0 auto;
  }

  .reader-pick-info .cta-row {
    justify-content: center;
  }
}

/* ---------------------------------------------------------------------------
   Legal pages (terms / privacy / refund policy)
--------------------------------------------------------------------------- */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.legal-page-back {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--muted);
  text-decoration: underline;
  font-size: 0.9rem;
}

.legal-page-back:hover {
  color: var(--gold-soft);
}

.legal-page h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2rem;
  color: var(--gold-soft);
  margin: 0 0 8px;
}

.legal-page .legal-meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 32px;
}

.legal-draft-notice {
  background: rgba(200, 155, 60, 0.12);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 32px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--ivory);
}

.legal-page h2 {
  font-size: 1.15rem;
  color: var(--ivory);
  margin: 32px 0 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.8;
}

.legal-page ul,
.legal-page ol {
  padding-left: 22px;
}

.legal-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  font-size: 0.9rem;
}

.legal-page th,
.legal-page td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
  color: var(--muted);
}

.legal-page th {
  color: var(--ivory);
  background: rgba(255, 255, 255, 0.03);
}

.legal-fill-in {
  color: var(--gold-soft);
  font-weight: 600;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: 28px 24px 40px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: underline;
}

.site-footer a:hover {
  color: var(--gold-soft);
}

/* ==========================================================================
   공지 전용 화면 (notices.html)
   ========================================================================== */

.notices-page-section {
  padding: clamp(32px, 5vw, 56px) 0 100px;
}

.notices-page-title {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--ivory);
}

.notices-page-subtext {
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 0.92rem;
}

.notices-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}

.notices-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.notices-item-link {
  display: block;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.notices-item-link:hover {
  border-color: var(--gold-soft);
}

.notices-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.notices-item-work {
  color: var(--gold-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.notices-item-date {
  color: var(--muted);
  font-size: 0.78rem;
}

.notices-item-title {
  margin: 0 0 8px;
  color: var(--ivory);
  font-size: 1.05rem;
}

.notices-item-body {
  margin: 0;
  color: rgba(247, 243, 236, 0.78);
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-line;
}

.site-footer span {
  color: var(--muted);
}
