:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #111827;
  --muted: #667085;
  --line: #e8ebf0;
  --soft: #f5f7f9;
  --green: #067647;
  --accent: #08b86b;
  --mint: #78edb4;
  --night: #09131f;
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    'Noto Sans KR', 'Malgun Gothic', sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body { display: flex; min-height: 100vh; flex-direction: column; margin: 0; background: radial-gradient(circle at 12% 0%, #08b86b09, transparent 24rem), var(--paper); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
[hidden] { display: none !important; }

#app { display: flex; flex: 1; flex-direction: column; }
.container { width: min(100% - 40px, 1240px); margin-inline: auto; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 20; padding: 14px; background: white; transform: translateY(-140%); }
.skip-link:focus { transform: translateY(0); }
.loading { padding-block: 56px; color: var(--muted); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 6;
  border-bottom: 1px solid #11182714;
  background: #ffffffef;
  backdrop-filter: blur(18px) saturate(150%);
}
.header-row { display: flex; min-height: 58px; align-items: center; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 44px; }
.brand-mark { display: block; width: auto; height: 34px; user-select: none; }
.wordmark { color: var(--night); font: 400 23px/1 Georgia, 'Times New Roman', serif; letter-spacing: -.055em; }
.site-switcher {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
}
.site-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding-inline: 11px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}
.site-tab:hover { background: #eef2f5; color: var(--ink); }
.site-tab.current { background: #e8f7ef; color: var(--green); }
.site-tab:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.site-footer { margin-top: auto; border-top: 1px solid var(--line); color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; align-items: center; min-height: 86px; font-size: 12px; }
.footer-brand { color: var(--ink); font-size: 15px; font-weight: 850; }

.banner {
  overflow: hidden;
  margin-block-start: 28px;
  border-radius: 22px;
  background: radial-gradient(ellipse at 80% 70%, #123a37 0, transparent 61%), #07121e;
  box-shadow: 0 18px 55px #07121e2e;
  color: var(--paper);
}
.banner-inner {
  display: grid;
  min-height: 340px;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 64px);
  padding: 30px clamp(22px, 3.6vw, 44px);
}
.banner-kicker { margin-bottom: 13px; color: var(--mint); font-size: 12px; font-weight: 850; }
.banner h1 { max-width: 100%; word-break: keep-all; overflow-wrap: anywhere; font-size: clamp(32px, 3.3vw, 46px); line-height: 1.12; font-weight: 900; letter-spacing: -.055em; }
.banner-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 32rem; margin: 15px 0 0; color: #ffffffbf; font-size: 15px; line-height: 1.75; word-break: keep-all; overflow-wrap: anywhere; }
.banner .button { margin-top: 22px; }
.banner :focus-visible { outline-color: var(--mint); }
.banner-artwork.cover { width: min(100%, 180px); justify-self: center; border-color: #ffffff3d; box-shadow: 0 18px 42px #040b1480; }

.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 9px 18px; border: 1px solid transparent; border-radius: 9px; font-size: 14px; font-weight: 800; }
.button-primary { background: var(--green); color: #fff; }
.button-primary:hover { background: #055f3a; }
.button-outline { border-color: #d1d6dd; background: #fff; color: var(--green); }
.button-outline:hover { background: #e8f7ef; }
.button-accent { background: var(--accent); color: #081a12; }
.button-accent:hover { background: #31d98d; }

.catalog-list { padding-block: 42px 66px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-heading h1, .section-heading h2 { font-size: clamp(21px, 2.6vw, 27px); font-weight: 850; letter-spacing: -.05em; }
.search, .episode-sort { min-height: 42px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); padding: 0 12px; font-size: 14px; }
.search { width: min(45%, 244px); }
.empty-state { display: grid; min-height: 105px; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); color: var(--muted); padding: 18px; text-align: center; font-size: 14px; }
.series-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: clamp(12px, 2vw, 23px); row-gap: 28px; margin: 0; padding: 0; list-style: none; }
.series-card { min-width: 0; }
.series-card-link { display: block; }
.cover { overflow: hidden; display: block; aspect-ratio: 2 / 3; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.series-card-link:hover .cover { border-color: #08b86b80; }
.series-card-title { margin-block: 10px 0; font-size: 16px; font-weight: 850; letter-spacing: -.045em; line-height: 1.35; overflow-wrap: anywhere; }
.latest-link { display: inline-flex; align-items: center; min-height: 36px; color: var(--muted); font-size: 13px; }
.latest-link:hover { text-decoration: underline; }

.series-detail { max-width: 920px; padding-block: 18px 64px; }
.back-link { display: inline-flex; align-items: center; min-height: 42px; color: var(--muted); font-size: 14px; font-weight: 740; }
.back-link:hover { text-decoration: underline; }
.series-intro { display: grid; grid-template-columns: minmax(110px, 225px) minmax(0, 1fr); align-items: center; gap: clamp(26px, 5vw, 58px); padding: clamp(16px, 3vw, 35px); border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.series-intro .cover { aspect-ratio: auto; }
.series-intro .cover img { aspect-ratio: auto; height: auto; }
.series-summary h1 { font-size: clamp(26px, 4vw, 49px); font-weight: 900; letter-spacing: -.065em; overflow-wrap: anywhere; }
.series-description { margin-top: 13px; color: var(--muted); font-size: 15px; line-height: 1.72; white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.series-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.episode-section { margin-top: 38px; }
.episode-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.episode-row { display: grid; min-height: 65px; grid-template-columns: auto minmax(0, 1fr) auto 14px; align-items: center; gap: 15px; border-bottom: 1px solid var(--line); padding: 10px 9px; }
.episode-row:hover { background: var(--soft); }
.episode-number { min-width: 50px; color: var(--green); font-size: 14px; font-weight: 850; }
.episode-title { font-size: 15px; font-weight: 730; overflow-wrap: anywhere; }
.episode-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.episode-arrow { color: var(--muted); font-size: 22px; }

.reading { color-scheme: dark; background: #121719; }
.reading .site-header { display: none; }
.reader-header { position: sticky; z-index: 5; top: 0; padding-top: env(safe-area-inset-top, 0px); background: #121719; color: #edf5ed; border-bottom: 1px solid #354540; }
.reader-header-row { display: flex; min-width: 0; max-width: 1060px; margin-inline: auto; min-height: 61px; padding-inline: 20px; align-items: center; gap: 12px; }
.reader-back { display: grid; width: 42px; height: 42px; flex: none; place-items: center; border-radius: 7px; border: 1px solid #354540; font-size: 27px; line-height: 1; }
.reader-back:hover { background: #273430; }
.reader-heading { flex: 1; min-width: 0; }
.reader-heading p, .reader-heading h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reader-heading p { color: #b9c9c0; font-size: 12px; }
.reader-heading h1 { font-size: 16px; font-weight: 850; }
.reading-progress { height: 2px; transform: scaleX(0); transform-origin: left; background: var(--mint); }
.reader-nav { display: flex; flex: none; align-items: stretch; justify-content: center; gap: 7px; }
.reader-nav-button { display: inline-flex; justify-content: center; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid #495753; border-radius: 7px; background: #1c2825; color: #e6f0ea; font-size: 13px; font-weight: 740; white-space: nowrap; }
a.reader-nav-button:hover, button.reader-nav-button:hover { background: #2d433a; }
.reader-nav-button.disabled { opacity: .58; }
.reader-nav-button.reader-next { border-color: #89aa87; }
.reader-pages { width: min(100% - 64px, 720px); margin-inline: auto; background: #fff; container-type: inline-size; }
.reader-page { display: block; }
.reader-page-cut::before { display: block; height: calc(100cqi * 1.5 / 390); background: #151820; content: ''; }
.reader-page-body { position: relative; }
.page-image { display: block; width: 100%; height: auto; color: #39463e; }
.page-error { position: absolute; inset: 0; color: white; text-align: center; background: #19231f; }
.page-error p { margin-top: 36px; margin-bottom: 10px; padding: 0 9px; }
.reader-end { display: grid; justify-items: center; row-gap: 18px; color: #e6f0ea; padding: 28px 14px max(36px, env(safe-area-inset-bottom, 0px)); }
.reader-top { min-height: 44px; border: 0; background: transparent; color: #d6e4da; font-size: 14px; }
.reader-top:hover { text-decoration: underline; }
.reader :focus-visible, .reader-header :focus-visible { outline-color: #d4f4b3; }

.unavailable { padding-block: 60px; }
.unavailable h1 { margin-bottom: 22px; font-size: 23px; }
.unavailable .button { margin-right: 8px; }

@media (max-width: 920px) {
  .series-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .container { width: min(100% - 32px, 760px); }
  .site-header::after { position: absolute; top: 46px; left: 0; right: 0; height: 1px; background: #f1f3f5; content: ''; }
  .site-header .header-row { display: grid; width: min(100% - 32px, 760px); min-height: 0; grid-template-rows: 46px minmax(38px, auto); justify-items: start; gap: 0; }
  .brand { min-height: 40px; }
  .brand-mark { height: 30px; }
  .wordmark { font-size: 22px; }
  .site-switcher { padding: 2px; }
  .site-tab { min-height: 28px; padding-inline: 8px; font-size: 11px; }
  .banner { margin-block-start: 16px; }
}

@media (max-width: 600px) {
  .container { width: min(100% - 28px, 560px); }
  .banner { border-radius: 16px; }
  .banner-inner { min-height: 220px; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 13px; padding: 18px; }
  .banner-kicker { margin-bottom: 10px; font-size: 11px; }
  .banner h1 { font-size: clamp(24px, 6vw, 32px); }
  .banner-description { margin-top: 10px; font-size: 13px; }
  .banner .button { margin-top: 15px; }
  .banner-artwork.cover { width: min(100%, 132px); }
  .catalog-list { padding-block: 29px 54px; }
  .section-heading { margin-bottom: 14px; }
  .series-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
  .series-detail { padding-block: 9px 44px; }
  .series-intro { grid-template-columns: minmax(96px, 30%) minmax(0, 1fr); gap: 13px; align-items: start; padding: 14px; }
  .series-summary h1 { font-size: 23px; }
  .series-description { margin-top: 7px; font-size: 13px; }
  .series-actions { margin-top: 13px; }
  .series-actions .button { padding-inline: 12px; }
  .episode-row { gap: 9px; padding-inline: 2px; }
  .episode-number { min-width: 36px; font-size: 13px; }
  .episode-title { font-size: 14px; }
  .episode-date { font-size: 11px; }
  .reader-header-row { min-height: 54px; padding-inline: 7px; gap: 7px; }
  .reader-back { width: 38px; }
  .reader-heading h1 { font-size: 14px; }
  .reader-header .reader-nav { gap: 4px; }
  .reader-header .reader-nav-button { padding-inline: 6px; font-size: 11px; }
  .reader-header .reader-nav-button:nth-child(2) { display: none; }
  .reader-pages { width: 100%; }
}

@media (max-width: 360px) {
  .series-intro { grid-template-columns: minmax(0, 1fr); }
  .series-intro .cover { width: 115px; }
}
