:root {
  color-scheme: light;
  --page: #faf8f2;
  --paper: #fffdf8;
  --ink: #232521;
  --quiet: #565b51;
  --line: #d9d7cb;
  --deep: #1d2f26;
  --deep-text: #faf8ef;
  --light-action: #dce8b8;
  --brand: #a24535;
  --serif: "Noto Serif KR", "Nanum Myeongjo", Batang, 바탕, serif;
  font-family: system-ui, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  line-height: 1.55;
  background: var(--page);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { display: flex; min-height: 100vh; flex-direction: column; margin: 0; }
main { flex: 1; }
body, h1, h2, h3, h4, p, figure { margin: 0; }
a { color: inherit; text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid #8d4231; outline-offset: 4px; }
img { display: block; max-width: 100%; height: auto; }
.shell { width: min(100% - 3rem, 71rem); margin-inline: auto; }
.skip { position: absolute; z-index: 2; inset: .75rem auto auto .75rem; padding: .625rem 1rem; background: var(--paper); }
.skip:not(:focus) { clip-path: inset(50%); }

.site-header { border-bottom: 1px solid var(--line); }
.site-header-inner { display: flex; min-height: 4.55rem; align-items: center; justify-content: space-between; gap: 1rem; }
.site-header nav a, .brand { display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: none; }
.site-header nav a { color: var(--quiet); font-size: .9375rem; font-weight: 700; }
.site-header nav a:hover { color: var(--deep); text-decoration: underline; }
.brand { gap: .55rem; font-size: 1.275rem; font-weight: 850; letter-spacing: -.04em; }
.brand-mark { display: grid; width: 1.875rem; height: 1.875rem; place-items: center; border-radius: .375rem; background: var(--brand); color: #fff8f1; font-family: var(--serif); font-size: 1rem; }
.site-footer { margin-top: 5rem; border-top: 1px solid var(--line); color: var(--quiet); font-size: .875rem; }
.site-footer .shell { display: flex; min-height: 4.75rem; align-items: center; gap: 1rem; }
.site-footer a { color: var(--ink); font-weight: 760; text-decoration: none; }

.home-shell { padding-top: 2rem; }
.feature { display: grid; grid-template-columns: 1.12fr .88fr; position: relative; overflow: hidden; isolation: isolate; min-height: 24rem; border-radius: 1.25rem; background: var(--deep); color: var(--deep-text); }
.feature-copy { z-index: 1; align-self: center; padding: clamp(2.3rem, 5.35vw, 4.5rem); padding-right: clamp(1.25rem, 3vw, 2.5rem); }
.feature-label { color: #d8e29b; font-weight: 700; font-size: .9rem; }
.feature h1, .work-intro h1 { max-width: 13em; font-family: var(--serif); font-size: clamp(2.35rem, 5.2vw, 4.7rem); line-height: 1.17; letter-spacing: -.07em; word-break: keep-all; overflow-wrap: anywhere; }
.feature h1, .work-intro h1 { margin-top: .875rem; }
.feature-excerpt, .work-excerpt { max-width: 28rem; margin-top: 1.18rem; line-height: 1.8; word-break: keep-all; overflow-wrap: anywhere; }
.feature-excerpt { color: #e0e8dc; }
.feature-art { position: relative; min-height: 100%; }
.feature-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 47%; }
.feature-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--deep), transparent 38%); pointer-events: none; }
.feature a:focus-visible { outline-color: #e2eeae; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-top: 1.45rem; }
.button { display: inline-flex; min-height: 2.75rem; align-items: center; justify-content: center; padding: .58rem 1.05rem; border: 1px solid transparent; border-radius: .55rem; font-size: .9375rem; font-weight: 740; line-height: 1.4; text-align: center; text-decoration: none; }
.primary { color: var(--paper); background: var(--deep); }
.primary:hover { background: #324d3e; }
.feature .primary { color: #243120; background: var(--light-action); }
.feature .primary:hover { background: #e9f1ce; }
.ghost { color: var(--deep-text); border-color: #839588; }
.ghost:hover { background: #304439; }
.outline { border-color: var(--line); color: var(--deep); background: var(--paper); }
.outline:hover { border-color: #7d897a; background: #f4f2ea; }

.library { margin-top: 3.35rem; scroll-margin-top: 1rem; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.1rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.section-head h2, .chapter-index h2 { font-size: clamp(1.55rem, 3.5vw, 2.06rem); letter-spacing: -.045em; line-height: 1.25; }
.section-head p { margin-top: .38rem; color: var(--quiet); font-size: .9375rem; }
.genre-tabs { display: flex; flex-wrap: wrap; gap: .36rem; }
.genre-tab { display: inline-flex; min-height: 2.75rem; align-items: center; gap: .4rem; padding: .48rem .83rem; border: 1px solid var(--line); border-radius: 99px; background: var(--paper); color: var(--quiet); font-size: .875rem; font-weight: 700; text-decoration: none; }
.genre-tab span { font-variant-numeric: tabular-nums; }
.genre-tab:hover { border-color: #7d897a; color: var(--ink); }
.genre-tab[aria-current="true"] { border-color: var(--deep); background: var(--deep); color: var(--paper); }
.genre-section { scroll-margin-top: 1rem; margin-top: 1.7rem; }
.genre-section + .genre-section { margin-top: 2.25rem; }
.genre-section h3 { margin-bottom: .9rem; font-size: 1.15rem; font-weight: 760; letter-spacing: -.035em; }
.book-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(.65rem, 2vw, 1.25rem); margin: 0; padding: 0; list-style: none; }
.book-card { min-width: 0; }
.book-card-link { display: block; height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: .8rem; background: var(--paper); text-decoration: none; }
.book-card-link:hover { border-color: #787c6e; }
.book-card-link:hover h4 { text-decoration: underline; }
.card-cover { overflow: hidden; aspect-ratio: 2 / 2.48; background: #deded5; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center 46%; }
.card-info { display: grid; align-content: start; gap: .5rem; padding: .88rem .95rem 1rem; }
.card-info h4 { font-size: 1rem; font-weight: 770; line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere; }
.card-info p { font-size: .875rem; color: var(--quiet); }

.work-shell { padding-top: 1.1rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .55rem; margin: 0; padding: 0; list-style: none; color: var(--quiet); font-size: .875rem; }
.breadcrumbs li { display: flex; align-items: center; gap: .55rem; }
.breadcrumbs li + li::before { content: "/"; color: #73776c; }
.breadcrumbs a, .breadcrumbs span { display: inline-flex; min-height: 2.75rem; align-items: center; overflow-wrap: anywhere; }
.breadcrumbs [aria-current] { color: var(--ink); }
.work-intro { display: grid; grid-template-columns: minmax(10rem, 16.5rem) minmax(0, 1fr); align-items: center; gap: clamp(1.25rem, 5.5vw, 4.2rem); margin-top: .55rem; padding: clamp(1.25rem, 4vw, 3.1rem); border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); }
.work-cover img { width: 100%; border-radius: .55rem; }
.work-intro h1 { font-size: clamp(1.9rem, 5vw, 3.72rem); }
.meta-label { color: #4e6243; font-size: .9rem; font-weight: 740; }
.work-excerpt { color: var(--quiet); }
.chapter-index { max-width: 54rem; margin: 2.7rem auto 0; scroll-margin-top: 1.25rem; }
.chapter-index h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; margin-bottom: 1rem; }
.chapter-index h2 span { color: var(--quiet); font-size: .9375rem; font-weight: 600; letter-spacing: 0; }
.chapter-index ol { margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.chapter-row { display: grid; min-height: 3.35rem; grid-template-columns: minmax(2.5rem, 3.25rem) 1fr auto; align-items: center; gap: .65rem; padding: .52rem .65rem; border-bottom: 1px solid var(--line); text-decoration: none; }
.chapter-row:hover { background: var(--paper); }
.chapter-row:hover .chapter-title { text-decoration: underline; }
.chapter-num { color: var(--quiet); font-size: .9375rem; font-weight: 700; }
.chapter-title { font-weight: 650; word-break: keep-all; overflow-wrap: anywhere; }
.complete-label { border-radius: .25rem; padding: .14rem .38rem; background: #e4ead7; color: #395436; font-size: .875rem; font-weight: 740; }

.reader-page { background: var(--paper); }
.reader-shell { width: min(100% - 3rem, 42rem); margin-inline: auto; padding-top: 1rem; }
.reader-heading { margin: 2.25rem 0 1.75rem; text-align: center; }
.reader-heading h1 { margin-top: .56rem; font: 750 clamp(1.8rem, 4vw, 2.95rem) / 1.24 var(--serif); letter-spacing: -.055em; word-break: keep-all; overflow-wrap: anywhere; }
.reader-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: .35rem; align-items: center; padding: .85rem 0; border-block: 1px solid var(--line); }
.reader-nav > div:last-child { text-align: right; }
.reader-nav .button { padding-inline: .85rem; }
.manuscript { margin: 2.45rem 0; color: #252521; font-family: var(--serif); font-size: clamp(1.12rem, 2vw, 1.25rem); line-height: 1.95; }
.manuscript p { word-break: keep-all; overflow-wrap: anywhere; white-space: pre-line; }
.manuscript p + p { margin-top: 1.21em; }
.manuscript figure { margin: 2.15rem 0; }
.manuscript img { width: 100%; border-radius: .55rem; }
.story-break { width: 4rem; margin: 2.3rem auto; border: 0; border-top: 1px solid #9c9b90; }
.work-end { margin: 1rem 0 1.5rem; color: var(--quiet); font-weight: 720; text-align: center; }
.error-content { padding-top: 3rem; }
.error-content .button { margin-top: 1rem; }

@media (max-width: 47rem) {
  .shell, .reader-shell { width: min(100% - 2.5rem, 71rem); }
  .feature { min-height: 22rem; }
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-info { padding-inline: .72rem; }
}

@media (max-width: 36rem) {
  .shell, .reader-shell { width: calc(100% - 2rem); }
  .site-header-inner { min-height: 3.75rem; }
  .home-shell { padding-top: .9rem; }
  .feature { grid-template-columns: minmax(0, 1fr); min-height: 0; border-radius: .9rem; }
  .feature-copy { padding: 1.6rem 1.25rem 1rem; }
  .feature h1 { max-width: 10em; font-size: clamp(2.1rem, 9vw, 2.7rem); }
  .feature-art { min-height: 12rem; }
  .feature-art::after { background: linear-gradient(180deg, var(--deep), transparent 41%); }
  .feature-art img { object-position: center 44%; }
  .library { margin-top: 2.35rem; }
  .section-head { align-items: flex-start; flex-direction: column; gap: .8rem; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-intro { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding: 1rem; }
  .work-cover { max-width: 10rem; }
  .work-intro h1 { margin-top: .55rem; }
  .work-excerpt { margin-top: .75rem; }
  .chapter-index { margin-top: 1.95rem; }
  .chapter-row { gap: .45rem; padding-inline: .27rem; }
  .reader-shell { padding-top: .55rem; }
  .reader-heading { margin: 1.6rem 0 1.4rem; }
  .manuscript { margin-block: 2rem; }
  .site-footer { margin-top: 3.15rem; }
}

@media (prefers-contrast: more) {
  :root { --line: #726f65; }
}
