:root {
  color-scheme: dark;
  --ink: #111316;
  --ink-soft: #1b1d20;
  --paper: #eee8dc;
  --paper-deep: #ded3c0;
  --gold: #bba474;
  --gold-dim: #776846;
  --text: #e8e1d4;
  --muted: #a9a194;
  --serif: "Noto Serif KR", "Batang", serif;
  --sans: "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-family: var(--sans);
  background: var(--ink);
  color: var(--text);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--ink); }
body { margin: 0; min-width: 320px; background: var(--ink); }
img { display: block; max-width: 100%; }
a { color: inherit; }
.skip-link { position: fixed; z-index: 20; top: 10px; left: 10px; padding: 10px 14px; color: #151515; background: var(--paper); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.masthead {
  min-height: min(650px, 88svh);
  padding: 7vh 24px 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #332b25;
  background: radial-gradient(ellipse at 50% 42%, #d6c2a9 0, #c5ad92 58%, #a88e75 100%);
  border-bottom: 1px solid rgba(92,68,49,.28);
}
.eyebrow { margin: 0 0 20px; color: var(--gold); font-size: 11px; font-weight: 600; letter-spacing: .25em; }
.masthead .eyebrow { color: #765a43; }
.masthead-logo { width: min(860px, 94vw); height: auto; mix-blend-mode: multiply; }
.scroll-cue { margin-top: 38px; color: #765a43; font-size: 11px; letter-spacing: .16em; text-decoration: none; }
.scroll-cue span { display: block; margin-top: 9px; font-size: 20px; }

.webtoon { padding: 0 18px 100px; background: #121315; }
.section-heading { margin: 0 auto 48px; text-align: center; }
.section-heading .eyebrow { margin-bottom: 12px; }
.section-heading h2, .archive-intro h2 { margin: 0; font-family: var(--serif); font-size: clamp(27px, 4vw, 42px); font-weight: 500; letter-spacing: .08em; }
.section-heading > p:last-child { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.webtoon-stream { width: min(100%, 760px); margin: 0 auto; padding-top: clamp(180px, 28vw, 320px); }
.comic-panel { position: relative; display: flex; flex-direction: column; width: 100%; margin: 0 auto; overflow: visible; isolation: isolate; background: transparent; }
.comic-panel + .comic-panel { margin-top: clamp(104px, 12vw, 156px); }
.comic-panel + .comic-panel.gap-tight { margin-top: clamp(80px, 9vw, 112px); }
.comic-panel + .comic-panel.gap-normal { margin-top: clamp(112px, 13vw, 168px); }
.comic-panel + .comic-panel.gap-breath { margin-top: clamp(156px, 18vw, 224px); }
.comic-panel + .comic-panel.gap-hold { margin-top: clamp(208px, 24vw, 300px); }
.comic-panel img { width: 100%; height: auto; object-fit: contain; }
.comic-panel[data-shape="portrait"] { width: min(100%, 650px); }
.comic-panel[data-shape="detail"] { width: min(100%, 570px); }
.comic-panel[data-shape="wide"] { width: 100%; }
.comic-panel[data-shape="narrow"] { width: min(76%, 500px); }
.comic-panel[data-shape="blackout"] { min-height: 135svh; display: grid; place-items: center; overflow: visible; isolation: isolate; background: linear-gradient(180deg, #070809, #020304 22%, #020304 78%, #070809); }
.comic-panel[data-shape="blackout"]::before { content: ""; position: absolute; z-index: -1; inset: -110svh auto; left: 50%; width: 100vw; transform: translateX(-50%); pointer-events: none; background: linear-gradient(180deg, transparent, #090a0b 26%, #020304 46%, #020304 54%, #090a0b 74%, transparent); }
.panel-number { display: none; }
.panel-caption { width: min(100%, 650px); margin: 0 auto; padding: 17px 22px 19px; border: 1px solid rgba(187,164,116,.28); border-top: 0; background: #1b1d20; color: #eee7db; font-family: var(--serif); text-align: center; }
.panel-caption p { margin: 0; font-size: clamp(16px, 2vw, 21px); line-height: 1.8; word-break: keep-all; }
.caption-speaker { display: block; margin-bottom: 5px; color: var(--gold); font-family: var(--sans); font-size: 10px; letter-spacing: .16em; }
.panel-caption.narration { background: #171819; border-color: rgba(187,164,116,.2); }
.panel-caption.narration p { color: #d6cdbd; }
.panel-caption.sound-effect { border: 0; background: transparent; color: #e3c98f; }
.panel-caption.sound-effect .caption-speaker { display: none; }
.panel-caption.sound-effect p { font-size: clamp(21px, 3vw, 30px); font-weight: 700; }
.blackout-text { position: absolute; inset: 0; display: grid; place-items: center; color: #847b70; font-family: var(--serif); font-size: 13px; letter-spacing: .45em; }

.archive { position: relative; padding: 112px 24px 130px; overflow: hidden; color: #e8e1d4; background: radial-gradient(ellipse at 50% 0, #242323 0, #171819 45%, #111316 100%); border-top: 1px solid rgba(187,164,116,.38); }
.archive::before, .archive::after { content: ""; position: absolute; pointer-events: none; width: 360px; height: 360px; border: 1px solid rgba(187,164,116,.1); border-radius: 50%; }
.archive::before { top: 70px; left: -250px; box-shadow: 0 0 0 18px rgba(121,99,55,.025), 0 0 0 38px rgba(121,99,55,.02); }
.archive::after { right: -250px; bottom: 55px; box-shadow: 0 0 0 18px rgba(121,99,55,.025), 0 0 0 38px rgba(121,99,55,.02); }
.archive-intro { position: relative; z-index: 1; max-width: 700px; margin: 0 auto 58px; text-align: center; }
.archive-intro .eyebrow { margin-bottom: 13px; color: var(--gold); }
.archive-intro h2 { color: #eee7db; }
.archive-subtitle { margin: 9px 0 0; color: #aaa194; font-size: 11px; letter-spacing: .22em; }
.gold-rule { display: flex; align-items: center; gap: 13px; width: min(190px, 42%); margin: 24px auto; color: var(--gold); }
.gold-rule::before, .gold-rule::after { content: ""; height: 1px; flex: 1; background: var(--gold-dim); }
.gold-rule span { font-size: 13px; }
.archive-description { margin: 0; color: #aaa194; font-family: var(--serif); font-size: 14px; letter-spacing: .04em; }
.character-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 24px; width: min(1220px,100%); margin: 0 auto; }
.character-card { --accent: #bba474; display: grid; grid-template-rows: auto 1fr; min-width: 0; padding: 11px; border: 1px solid rgba(187,164,116,.48); background: linear-gradient(145deg, #202122, #171819 70%); box-shadow: 0 12px 28px rgba(0,0,0,.2), inset 0 0 0 2px rgba(255,255,255,.025); transition: border-color .2s ease, box-shadow .2s ease; }
.character-card:hover, .character-card:focus-within { border-color: var(--accent); box-shadow: 0 16px 32px rgba(0,0,0,.34), inset 0 0 0 2px rgba(255,255,255,.04); }
.portrait-frame { position: relative; aspect-ratio: 832 / 1216; overflow: hidden; background: #242322; border: 1px solid rgba(187,164,116,.34); }
.portrait-frame::after { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(255,255,255,.25); pointer-events: none; }
.portrait-frame img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.card-body { display: flex; flex-direction: column; padding: 20px 15px 13px; }
.card-index { margin: 0 0 8px; color: var(--accent); font-size: 10px; letter-spacing: .2em; }
.character-card h3 { margin: 0; color: #eee7db; font-family: var(--serif); font-size: clamp(19px, 2vw, 24px); font-weight: 600; letter-spacing: .04em; }
.card-role { min-height: 42px; margin: 8px 0 16px; color: #b7ae9f; font-family: var(--serif); font-size: 12px; line-height: 1.7; }
.info-table { margin: 0; border-top: 1px solid rgba(112,94,59,.25); }
.info-row { display: grid; grid-template-columns: 62px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px solid rgba(187,164,116,.18); font-size: 11px; line-height: 1.55; }
.info-row dt { color: #bba474; }
.info-row dd { margin: 0; color: #e3dccf; }
.character-bio { min-height: 0; margin: 15px 0 0; color: #c2bbaf; font-size: 12px; line-height: 1.8; word-break: keep-all; }
.card-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 18px; color: var(--accent); }
.card-foot::before, .card-foot::after { content: ""; height: 1px; flex: 1; background: rgba(187,164,116,.38); }
.card-foot span { font-size: 11px; }
.site-footer { padding: 42px 20px 50px; text-align: center; color: #aaa293; background: #101113; }
.footer-mark { margin-bottom: 12px; color: var(--gold); font-size: 17px; }
.site-footer p { margin: 0; font-family: var(--serif); font-size: 14px; }
.site-footer span { display: block; margin-top: 10px; color: #716c62; font-size: 9px; letter-spacing: .2em; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .character-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
  .card-body { padding-inline: 12px; }
}
@media (max-width: 560px) {
  .masthead { min-height: 70svh; padding-inline: 14px; }
  .masthead-logo { width: min(96vw, 620px); }
  .scroll-cue { margin-top: 30px; }
  .webtoon { padding: 0 8px 68px; }
  .section-heading { margin-bottom: 30px; }
  .comic-panel[data-shape="narrow"] { width: 82%; }
  .comic-panel + .comic-panel { margin-top: 104px; }
  .comic-panel + .comic-panel.gap-tight { margin-top: 76px; }
  .comic-panel + .comic-panel.gap-normal { margin-top: 112px; }
  .comic-panel + .comic-panel.gap-breath { margin-top: 152px; }
  .comic-panel + .comic-panel.gap-hold { margin-top: 204px; }
  .panel-caption { padding: 13px 15px 15px; }
  .panel-caption p { font-size: 16px; }
  .archive { padding: 76px 14px 88px; }
  .archive-intro { margin-bottom: 36px; }
  .character-grid { grid-template-columns: 1fr; gap: 18px; width: min(520px,100%); }
  .character-card { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 0; padding: 9px; }
  .portrait-frame { min-height: 0; aspect-ratio: 832 / 1216; }
  .portrait-frame img { object-fit: contain; object-position: center; }
  .card-body { padding: 16px 12px 10px; }
  .card-index { margin-bottom: 5px; font-size: 9px; }
  .character-card h3 { font-size: 20px; }
  .card-role { min-height: 30px; margin: 6px 0 12px; font-size: 12px; }
  .info-row { grid-template-columns: 52px 1fr; gap: 6px; padding: 7px 0; font-size: 12px; }
  .character-bio { min-height: 0; margin-top: 10px; font-size: 12px; line-height: 1.7; }
  .card-foot { padding-top: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .reveal { opacity: 1; transform: none; }
}
