:root {
  color-scheme: light;
  --ink: #161a16;
  --paper: #f4ecde;
  --green: #123d30;
  --accent: #a82d1b;
  --masthead-height: max(57px, 3.6vw);
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #bf662e; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  z-index: 2;
  top: .75rem;
  left: .75rem;
  padding: .75rem;
  background: var(--paper);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--masthead-height);
  padding-inline: 1.65vw max(1.65vw, .75rem);
  border-bottom: 1px solid #c9baa3;
  background: linear-gradient(105deg, #f7f0e5, #f2e8db 60%, #f8efe2);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: clamp(.6rem, 1.25vw, 1.35rem);
  text-decoration: none;
  letter-spacing: -.064em;
  font-size: clamp(1.7rem, 2.55vw, 3.25rem);
  line-height: 1;
  font-weight: 850;
  color: #171616;
}

.brand-mark {
  display: grid;
  width: clamp(1.65rem, 3.1vw, 3.6rem);
  gap: .19em;
  transform: skewY(-14deg);
  font-size: clamp(.65rem, .9vw, 1.15rem);
}

.brand-mark i { display: block; width: 60%; height: .33em; margin-left: 36%; background: #e55238; }
.brand-mark i:nth-child(2) { width: 69%; margin-left: 18%; }
.brand-mark i:nth-child(3) { width: 73%; margin-left: 0; }
.edition-nav { display: flex; align-self: stretch; gap: clamp(.7rem, 2.1vw, 2.8rem); }
.edition-nav a {
  display: grid;
  place-items: center;
  position: relative;
  min-width: max-content;
  padding: 0 .38em;
  font-size: clamp(.875rem, 1.35vw, 1.55rem);
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.edition-nav a[aria-current] { color: var(--accent); }
.edition-nav a[aria-current]::after {
  position: absolute;
  height: max(3px, .23vw);
  inset: auto 0 8px;
  background: currentColor;
  content: "";
}

.scene {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  inline-size: 100%;
  aspect-ratio: 1672 / 881;
  background: var(--green);
}

.scene::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url("./vibetrend-stand.webp") center top / 100% auto no-repeat;
  content: "";
}

.sidewalk { display: none; }

.sign {
  position: absolute;
  inset: 6.77cqw 5.15% auto 7.24%;
  min-height: 3.49cqw;
  display: flex;
  align-items: center;
  gap: 1.65cqw;
  padding-inline: 1.8cqw;
  color: #fff5de;
  white-space: nowrap;
}

.sign h1 {
  padding-inline-end: 1.55cqw;
  border-inline-end: 1px solid #e6d1a6;
  font-weight: 850;
  font-size: clamp(1.1rem, 2.04cqw, 2.8rem);
  line-height: 1.07;
  letter-spacing: -.055em;
}

.filters { display: flex; align-items: center; gap: 1.4cqw; }
.filters button {
  position: relative;
  border: 0;
  background: transparent;
  padding: .55em .22em;
  color: #fff5e2;
  font-size: clamp(.875rem, 1.26cqw, 1.5rem);
  line-height: 1.05;
  font-weight: 760;
  letter-spacing: -.03em;
  white-space: nowrap;
}

.filters button[aria-pressed="true"], .filters button:hover { color: #ffe2a8; }
.filters button[aria-pressed="true"]::after {
  position: absolute;
  inset: auto 0 .1em;
  height: 3px;
  background: #f58455;
  content: "";
}

.search-form {
  display: flex;
  min-width: 0;
  width: 15.7cqw;
  margin-left: auto;
  align-items: center;
  height: clamp(31px, 2.18cqw, 44px);
  background: #fff5df;
  border: 1px solid #cab28b;
  border-radius: 7px;
  box-shadow: inset 0 1px 4px #765f2a36;
  color: #171916;
}

.search-form input {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 4px 0 4px .65em;
  background: transparent;
  font-size: 1rem;
  font-weight: 650;
}

.search-form input::placeholder { color: #3d3830; opacity: 1; }
.search-form button { flex: none; width: 2.2em; height: 100%; border: 0; background: transparent; display: grid; place-items: center; }
.search-icon { position: relative; width: 12px; height: 12px; border: 1.6px solid currentColor; border-radius: 50%; }
.search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 1.6px;
  transform: rotate(45deg);
  background: currentColor;
  content: "";
}

.shelf {
  position: absolute;
  inset-inline: 3.85% 5.1%;
  top: 11.35cqw;
  height: 12.46cqw;
  display: grid;
  grid-template-columns: 5.1cqw minmax(0, 1fr);
  gap: .35cqw;
  align-items: start;
}

.shelf[data-level="1"] { top: 25.77cqw; height: 10.33cqw; }
.shelf[data-level="2"] { top: 38.17cqw; height: 9.71cqw; }
.shelf-date {
  justify-self: start;
  margin-top: -.29em;
  padding: .13em .24em;
  border: 1px solid #e6d1ac;
  border-radius: .17em;
  color: #a02517;
  background: #fcf1db;
  box-shadow: 2px 3px 6px #0c100dcc;
  font-size: clamp(.9rem, 1.76cqw, 2.25rem);
  font-weight: 880;
  line-height: 1.02;
  letter-spacing: -.055em;
}

.publications { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: 100%; gap: .66cqw; align-items: stretch; }
.cover {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 1px solid #cbb891;
  border-radius: 2px 3px 1px 2px;
  background: #faefd9;
  box-shadow: 0 2px 0 #e8d9b9, 0 4px 0 #b7a586, 2px 7px 10px #0a1614d9;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.cover:hover, .cover:focus-visible {
  z-index: 1;
  transform: translateY(-.45cqw);
  box-shadow: 0 2px 0 #e8d9b9, 0 4px 0 #b7a586, 3px 12px 17px #09110ad9;
}

/* The right clip edge meets the front upright in the photograph. Leave room
   below the paper so its contact shadow travels along the shelf as well. */
.turning .publications {
  isolation: isolate;
  overflow: clip;
  overflow-clip-margin: 16px;
  clip-path: inset(-8px 0 -12px -8px);
}
.turning .cover {
  z-index: var(--front-layer);
  transform-origin: 50% 100%;
  transition: none;
}
.turning .cover:hover, .turning .cover:focus-visible { transform: none; }
.turning .arriving { z-index: var(--sheet-layer); }
.turning .departing {
  position: absolute;
  z-index: calc(var(--front-layer) - 1);
  cursor: default;
}
.turning .departing:hover .cover-label:not(.always) { opacity: 0; }

.cover-art { display: block; width: 100%; height: 100%; overflow: hidden; }
.print { background-image: var(--print-image); background-size: var(--print-size); background-position: var(--print-position); background-repeat: no-repeat; }
.type-cover {
  display: grid;
  align-content: center;
  gap: .5em;
  padding: .65rem;
  overflow-wrap: anywhere;
  background: linear-gradient(145deg, #efe6cf, #fcf4e4);
  color: #132d22;
  font-family: Georgia, "Malgun Gothic", serif;
  font-size: clamp(.875rem, 1.32vw, 1.5rem);
  text-align: left;
}

.type-cover[data-category="global"] { background: linear-gradient(155deg, #c5d0da, #e5f1ee); color: #1d344f; }
.type-cover[data-category="learn"] { background: linear-gradient(155deg, #f2c7b6, #f6e9d2); color: #492113; }
.type-cover[data-category="reference"] { background: linear-gradient(155deg, #dfd6ec, #fdf5db); color: #402850; }
.type-cover span { font: 750 .8125rem/1.1 system-ui, sans-serif; }
.cover-label {
  position: absolute;
  bottom: 1%;
  right: 1%;
  padding: .28em .48em .25em .85em;
  background: #fff7e7;
  clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%);
  color: #201c15;
  font-size: clamp(.63rem, .78cqw, .9rem);
  font-weight: 850;
  line-height: 1.2;
  opacity: 0;
}

.cover:hover .cover-label, .cover:focus-visible .cover-label, .cover-label.always { opacity: 1; }
.empty {
  position: absolute;
  inset: 25% auto auto 50%;
  translate: -50%;
  width: max-content;
  max-width: calc(100% - 2rem);
  padding: 1rem 1.25rem;
  color: var(--ink);
  background: var(--paper);
  text-align: center;
  box-shadow: 1px 4px 12px #101a13a8;
}

.empty button, .pagination button {
  border: 1px solid #997958;
  border-radius: 3px;
  padding: .5rem .8rem;
  background: #fff6e7;
}

.empty button { margin-top: .6rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 1rem; }
.pagination button:disabled { opacity: .5; }

.intro {
  width: min(62rem, 72vw);
  max-height: calc(100% - 2rem);
  padding: 0;
  overflow: auto;
  border: 1px solid #bda689;
  border-radius: 3px;
  color: var(--ink);
  background: #f6ecda;
  box-shadow: 0 4px #dbccaf, 0 7px #bfa984, 0 26px 70px #161b15b8;
}

.intro::backdrop { background: #1b1c16a6; }
.book { position: relative; display: grid; grid-template-columns: minmax(0, .91fr) minmax(0, 1.09fr); padding: 8px; }
.book-art {
  display: grid;
  align-items: center;
  min-width: 0;
  background: #e7d7ba;
  padding: 1.25rem;
}

.book-art .cover-art { height: auto; aspect-ratio: var(--art-ratio, 4/3); box-shadow: 0 5px 0 #cfc1a2, 0 9px 20px #2d281d45; }
.book-art.full-bleed { padding: 0; }
.book-art.full-bleed .cover-art { height: 100%; box-shadow: none; }
.book-copy {
  padding: clamp(1rem, 2.6vw, 2.6rem);
  background:
    radial-gradient(ellipse at top right, #fbf2e2, transparent 57%),
    linear-gradient(92deg, #e8dac0, #f8efe0 5%, #f7edda);
}

.close-form { position: absolute; top: .9rem; right: .95rem; }
.close-button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 1.8rem; line-height: 1; }
.book-meta { margin-right: 2rem; color: var(--accent); font-size: .9375rem; font-weight: 850; }
.book h2 {
  margin-block: .58rem .95rem;
  font: 750 clamp(1.8rem, 5vw, 3.8rem)/1.02 Georgia, "Malgun Gothic", serif;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}

.book-copy p { line-height: 1.63; word-break: keep-all; }
.takeaway { margin-top: 1.15rem; padding-top: 1rem; border-top: 1px solid #b6a88d; }
.takeaway h3 { margin-bottom: .3rem; font-size: 1.13rem; }
.book-links { display: flex; flex-wrap: wrap; gap: .6rem 1.15rem; align-items: center; margin-top: 1.3rem; }
.book-links a { padding-block: .65rem; font-weight: 750; text-underline-offset: 3px; }
.book-links .visit {
  padding-inline: 1.14rem;
  border-radius: 3px;
  background: #ac3922;
  color: #fff7eb;
  text-decoration: none;
}

.book-links .visit:hover { background: #87301e; }

@media (min-width: 901px) {
  main {
    display: flex;
    flex-direction: column;
    min-height: calc(100svh - var(--masthead-height));
  }
  .scene {
    flex: 1 0 auto;
    /* The photo is 1448 × 1086. The header covers the first 52 pixels. */
    --photo-top: -3.591cqw;
    --sidewalk-top: 50.552cqw;
  }
  .scene::before {
    bottom: auto;
    height: var(--sidewalk-top);
    background-position: center var(--photo-top);
  }
  .sidewalk {
    position: absolute;
    z-index: -1;
    inset: var(--sidewalk-top) 0 0;
    display: block;
    overflow: hidden;
  }
  .sidewalk::before {
    position: absolute;
    inset-inline: 0;
    /* Keep the same join at photo row 784. Only the remaining 302 rows can expand. */
    top: min(-54.144cqw, -259.603%);
    height: max(75cqw, 359.603%);
    background: url("./vibetrend-stand.webp") center / 100% 100% no-repeat;
    content: "";
  }
}

@media (max-width: 900px) {
  .site-header { height: auto; min-height: 55px; padding-inline: 1rem; }
  .scene { aspect-ratio: auto; min-height: calc(100svh - 55px); padding: 50px .8rem .75rem; }
  .scene::before {
    height: 115px;
    background-position: center -24px;
    background-size: max(100%, 900px) auto;
    box-shadow: inset 0 -11px 12px #15382d80;
  }
  .sign {
    position: relative;
    inset: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(132px, .58fr);
    gap: .55rem;
    justify-content: space-between;
    padding: .65rem .7rem;
    border: 1px solid #bdab79;
    background: #173d30;
    box-shadow: 0 3px 5px #09171391;
    white-space: normal;
  }
  .sign h1 { padding: 0; border: 0; font-size: clamp(1rem, 4vw, 1.4rem); }
  .search-form { grid-row: 1; grid-column: 2; width: 100%; height: 34px; }
  .search-form input { font-size: 1rem; }
  .search-form button { width: 1.9em; }
  .filters { flex-wrap: wrap; grid-column: 1 / -1; gap: .15rem .65rem; }
  .filters button { padding-block: .55rem; font-size: .875rem; }
  .shelf, .shelf[data-level] {
    position: relative;
    inset: auto;
    display: block;
    height: auto;
    margin-top: 1rem;
    padding: .75rem .55rem .65rem;
    border-inline: 3px solid #163628;
    border-bottom: 5px solid #efddb8;
    background: linear-gradient(105deg, #153727, #24513f 50%, #16392d);
    box-shadow: 0 5px 8px #091713a6;
  }
  .shelf-date { width: fit-content; margin-top: 0; margin-bottom: .6rem; font-size: 1.1rem; }
  .publications { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; height: auto; }
  .turning .publications { align-content: start; clip-path: inset(-5px -.55rem -8px -5px); }
  .cover { aspect-ratio: var(--cover-ratio, 1.43); }
  .empty { position: relative; inset: auto; translate: none; width: auto; margin: 1rem auto; }
  .intro { width: min(62rem, calc(100% - 2rem)); }
}

@media (max-width: 560px) {
  .edition-nav { gap: .38rem; }
  .publications { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .book { grid-template-columns: minmax(0, 1fr); }
  .book-art, .book-art.full-bleed { padding: .55rem; }
  .book-art.full-bleed .cover-art { height: 10rem; aspect-ratio: auto; background-size: 386% 210%; background-position: 29.9% 52%; }
  .book-art .cover-art { max-height: 10rem; }
  .close-button { border-radius: 50%; background: #fff5e4; }
}

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