:root {
  color-scheme: light;
  --paper: #f5f5f2;
  --surface: #ffffff;
  --ink: #171717;
  --muted: #696964;
  --line: #d8d8d2;
  --leaf: #5f705f;
  --leaf-pale: #e6eae2;
  --sans: "Pretendard Variable", Pretendard, SUIT, "Noto Sans KR", "Apple SD Gothic Neo", Inter, Arial, sans-serif;
  --serif: MaruBuri, "Noto Serif KR", "KoPub Batang", "AppleMyungjo", Georgia, serif;
  --page: min(1240px, calc(100vw - 64px));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 430;
  letter-spacing: -0.012em;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

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

[hidden] {
  display: none !important;
}

::selection {
  background: #dce3d7;
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--leaf);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  transform: translateY(-160%);
  background: var(--ink);
  color: white;
  font-size: 14px;
}

.skip-link:focus {
  transform: none;
}

.site-header,
.catalog,
.reading-note,
.about,
.site-footer {
  width: var(--page);
  margin-inline: auto;
}

.site-header {
  min-height: 94px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 44px;
  border-bottom: 1px solid var(--ink);
}

.wordmark {
  width: max-content;
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.wordmark__name {
  font-size: 19px;
  font-weight: 720;
  letter-spacing: -0.035em;
}

.wordmark__note {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: -0.005em;
}

.site-nav {
  display: flex;
  gap: 30px;
  font-size: 14px;
}

.site-nav a {
  position: relative;
  padding-block: 7px;
}

.site-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 1px;
  transform: scaleX(0);
  transform-origin: right;
  background: var(--ink);
  transition: transform 180ms ease;
}

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

.language-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.language-switch span {
  color: var(--line);
}

.language-switch button {
  min-width: 28px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.language-switch button[aria-pressed="true"] {
  color: var(--ink);
  font-weight: 750;
}

.catalog {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  min-height: 720px;
  border-bottom: 1px solid var(--ink);
}

.catalog__intro {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 74px 46px 64px 0;
}

.kicker {
  margin: 0 0 30px;
  color: var(--leaf);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.catalog h1 {
  max-width: 7.4em;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(48px, 4.45vw, 68px);
  font-weight: 520;
  letter-spacing: -0.055em;
  line-height: 1.16;
  word-break: keep-all;
}

.catalog h1::after {
  content: "";
  display: block;
  width: 42px;
  height: 2px;
  margin-top: 34px;
  background: var(--leaf);
}

.catalog__dek {
  max-width: 34ch;
  margin: 42px 0 0;
  font-size: 18px;
  line-height: 1.68;
}

.catalog__note {
  max-width: 39ch;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.72;
}

.free-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding-top: 44px;
  color: var(--leaf);
  font-size: 12px;
}

.free-status > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--leaf);
}

.free-status strong {
  font-weight: 700;
}

.catalog__shelf {
  grid-column: span 8;
  min-width: 0;
  padding: 32px 0 64px 48px;
  border-left: 1px solid var(--line);
}

.shelf-heading {
  min-height: 42px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}

.shelf-heading h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.shelf-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 330px));
  justify-content: space-between;
  gap: 36px;
}

.book-card {
  min-width: 0;
}

.book-card__cover-link {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: #ecece8;
  border: 1px solid #cecec8;
}

.book-card__cover-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms cubic-bezier(.2, .8, .2, 1), filter 300ms ease;
}

.book-card:hover .book-card__cover-link img {
  transform: scale(1.012);
  filter: saturate(1.035);
}

.book-card__body {
  padding-top: 20px;
}

.book-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.book-card__meta span:first-child {
  color: var(--leaf);
  font-weight: 700;
}

.book-card h3 {
  min-height: 2.5em;
  margin: 15px 0 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 560;
  letter-spacing: -0.035em;
  line-height: 1.27;
  word-break: keep-all;
}

.book-card__author {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.book-card__description {
  min-height: 3.8em;
  margin: 14px 0 18px;
  color: #4f4f4b;
  font-size: 13px;
  line-height: 1.72;
}

.read-button {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-size: 14px;
  font-weight: 730;
  transition: color 160ms ease, padding 160ms ease, background 160ms ease;
}

.read-button strong {
  color: var(--leaf);
  font-size: 18px;
  font-weight: 500;
  transition: transform 160ms ease;
}

.read-button:hover,
.read-button:focus-visible {
  padding-inline: 10px;
  background: var(--leaf-pale);
}

.read-button:hover strong,
.read-button:focus-visible strong {
  transform: translateX(3px);
}

.read-button--disabled {
  color: var(--muted);
  border-color: var(--line);
}

.cover-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  background: var(--surface);
}

.cover-placeholder small {
  color: var(--muted);
  font-size: 11px;
}

.cover-placeholder strong {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 550;
  line-height: 1.25;
  word-break: keep-all;
}

.book-card--loading .skeleton {
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
}

.skeleton,
.skeleton-line {
  background: linear-gradient(100deg, #e8e8e3 20%, #f0f0ec 38%, #e8e8e3 56%);
  background-size: 220% 100%;
  animation: loading 1.6s ease-in-out infinite;
}

.skeleton-line {
  display: block;
  width: 74%;
  height: 9px;
  margin-top: 18px;
}

.skeleton-line--short {
  width: 38%;
}

@keyframes loading {
  to { background-position-x: -220%; }
}

.catalog-state {
  min-height: 300px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.catalog-state button {
  min-height: 44px;
  margin-left: 16px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
}

.reading-note {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.reading-note article {
  min-height: 170px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 20px;
  padding: 42px 34px 34px 0;
}

.reading-note article + article {
  padding-left: 34px;
  border-left: 1px solid var(--line);
}

.reading-note article > span {
  color: var(--leaf);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.reading-note h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 720;
}

.reading-note p {
  max-width: 29ch;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.about {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  padding-block: 104px 116px;
  border-bottom: 1px solid var(--ink);
}

.about__heading {
  grid-column: span 5;
}

.about__heading .kicker {
  margin-bottom: 28px;
}

.about h2 {
  max-width: 8em;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(40px, 4.1vw, 58px);
  font-weight: 520;
  letter-spacing: -0.045em;
  line-height: 1.16;
}

.about__body {
  grid-column: 7 / span 6;
}

.about__body > p {
  max-width: 47ch;
  margin: 0;
  font-size: 18px;
  line-height: 1.75;
}

.about dl {
  margin: 54px 0 0;
  border-top: 1px solid var(--line);
}

.about dl > div {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.about dt {
  color: var(--muted);
}

.about dd {
  margin: 0;
}

.site-footer {
  min-height: 150px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
  color: var(--muted);
  font-size: 12px;
}

.site-footer p {
  margin: 0;
}

.site-footer > p:nth-child(2) {
  text-align: center;
}

.site-footer nav {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
}

.site-footer nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-footer a {
  border-bottom: 1px solid transparent;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  border-color: currentColor;
}

.noscript-note {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 12px 16px;
  background: var(--ink);
  color: white;
  text-align: center;
}

@media (max-width: 1040px) {
  :root {
    --page: min(100% - 48px, 1240px);
  }

  .catalog__intro {
    padding-right: 32px;
  }

  .catalog__shelf {
    padding-left: 34px;
  }

  .books-grid {
    gap: 26px;
  }

  .book-card h3 {
    font-size: 21px;
  }
}

@media (max-width: 820px) {
  :root {
    --page: calc(100% - 40px);
  }

  .site-header {
    gap: 24px;
  }

  .wordmark__note {
    display: none;
  }

  .catalog {
    display: block;
    min-height: 0;
  }

  .catalog__intro {
    min-height: 510px;
    padding: 56px 0 48px;
  }

  .catalog h1 {
    max-width: 8em;
  }

  .catalog__dek {
    max-width: 45ch;
  }

  .catalog__note {
    max-width: 52ch;
  }

  .catalog__shelf {
    padding: 30px 0 58px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .reading-note {
    grid-template-columns: 1fr;
  }

  .reading-note article {
    min-height: 0;
    padding: 28px 0;
  }

  .reading-note article + article {
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .reading-note p {
    max-width: 48ch;
  }

  .about {
    display: block;
    padding-block: 78px 86px;
  }

  .about__body {
    margin-top: 58px;
  }

  .site-footer {
    grid-template-columns: 1fr auto;
    padding-block: 38px;
  }

  .site-footer > p:nth-child(2) {
    display: none;
  }
}

@media (max-width: 560px) {
  :root {
    --page: calc(100% - 32px);
  }

  body {
    font-size: 15px;
  }

  .site-header {
    min-height: 74px;
    grid-template-columns: 1fr auto;
    gap: 14px;
  }

  .wordmark__name {
    font-size: 17px;
  }

  .site-nav {
    display: none;
  }

  .catalog__intro {
    min-height: 470px;
    padding: 43px 0 38px;
  }

  .kicker {
    margin-bottom: 21px;
  }

  .catalog h1 {
    max-width: 7.2em;
    font-size: clamp(43px, 13.4vw, 58px);
    letter-spacing: -0.06em;
  }

  .catalog h1::after {
    margin-top: 24px;
  }

  .catalog__dek {
    margin-top: 27px;
    font-size: 16px;
    line-height: 1.62;
  }

  .catalog__note {
    margin-top: 13px;
    font-size: 13px;
  }

  .free-status {
    padding-top: 28px;
  }

  .shelf-heading {
    margin-bottom: 18px;
  }

  .shelf-heading p {
    display: none;
  }

  .books-grid {
    gap: 14px;
  }

  .book-card__body {
    padding-top: 13px;
  }

  .book-card__meta {
    display: block;
    font-size: 10px;
    line-height: 1.5;
  }

  .book-card__meta span {
    display: block;
  }

  .book-card h3 {
    min-height: 3.8em;
    margin-top: 10px;
    font-size: 17px;
    line-height: 1.28;
  }

  .book-card__author {
    display: none;
  }

  .book-card__description {
    display: none;
  }

  .read-button {
    min-height: 46px;
    margin-top: 13px;
    font-size: 13px;
  }

  .read-button:hover,
  .read-button:focus-visible {
    padding-inline: 6px;
  }

  .reading-note article {
    grid-template-columns: 27px 1fr;
    gap: 13px;
  }

  .about {
    padding-block: 64px 72px;
  }

  .about h2 {
    font-size: 42px;
  }

  .about__body {
    margin-top: 44px;
  }

  .about__body > p {
    font-size: 16px;
  }

  .about dl {
    margin-top: 38px;
  }

  .site-footer {
    display: block;
  }

  .site-footer nav {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 14px;
  }
}

@media (max-width: 350px) {
  .books-grid {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .book-card h3 {
    min-height: 0;
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
