@font-face {
  font-family: "Pretendard";
  src: url("./font/Pretendard-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard";
  src: url("./font/Pretendard-SemiBold.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Paperlogy";
  src: url("./font/Paperlogy-4Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Paperlogy";
  src: url("./font/Paperlogy-6SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Paperlogy";
  src: url("./font/Paperlogy-7Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --purple-950: #21005f;
  --purple-900: #2d057b;
  --purple-800: #3a0aa1;
  --purple-700: #2d44d9a0;
  --ink: #1c1b22;
  --muted: #6c6874;
  --white: #fff;
  --shadow: 0 18px 42px rgba(20, 11, 40, 0.18);
  --header-h: clamp(76px, 8.4vh, 100px);
  color-scheme: light;
  --surface: #ffffff;
  --primary: #1c6bbd;
  --focus: #d76718;

}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; padding: 0;  margin: 0;}
body { padding: 0;  margin: 0;
  font-family: "Pretendard", "Malgun Gothic", Arial, sans-serif;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
}
html.archive-return-pending .page-header,
html.archive-return-pending .monitor-deck { visibility: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
button, input { font: inherit; }
button { touch-action: manipulation; }

.page-header { position: fixed; top: 0; left: 0; z-index: 100;
  display: flex;
  width: 100%;
  min-height: var(--header-h);
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(36px, 5vw, 50px);
  background: url("../img/bg.jpg") no-repeat; background-size: 100%;}
h1 { margin: 0; font-size: clamp(2.15rem, 2.1vw, 4.4rem); line-height: 1.25; }
.intro { max-width: 72ch; margin: clamp(10px, 0.7vw, 22px) 0 0; color: var(--muted); }

.page-header-left { flex: 0 0 clamp(165px, 12vw, 235px); }
.page-header-actions { display: flex; align-items: center; gap: clamp(18px, 2vw, 38px); }
.header-search { display: flex; justify-content: flex-end; }
.header-search-toggle, .header-search-submit, .header-search-close {
  display: inline-flex; min-width: 56px; min-height: 56px; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--ink); cursor: pointer;
}
.header-search-toggle { color: #fff; }
.header-search svg { width: 36px; height: 36px; fill: none; stroke: currentcolor; stroke-linecap: round; stroke-width: 2; }
.header-search-form {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  align-content: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: clamp(24px, 5vw, 80px);
  background: #192433f0;
}
.header-search[data-search-state="open"] .header-search-toggle { display: none; }
.header-search[data-search-state="open"] .header-search-form { display: flex; }
#search-input { min-width: 0; flex: 0 1 50%; min-height: 72px; margin-left: 5%; padding: 0 24px; border: 0; border-radius: 8px; color: var(--ink); font-size: clamp(22px, 2.2vw, 35px); }
.header-search-form .header-search-submit, .header-search-form .header-search-close { color: #fff; }
.header-search-form .header-search-submit svg { width: 50px; height: 50px; }
.header-search-form .header-search-close svg { width: 50px; height: 50px; }
.header-search-form .header-search-close { position: absolute; top: clamp(24px, 5vw, 80px); right: clamp(24px, 5vw, 80px); }
.search-modal-guide { flex-basis: 100%; margin: 0; color: rgb(255 255 255 / 88%); font-size: clamp(18px, 1.38vw, 22px); line-height: 1.6; text-align: center; font-weight: 400; padding: 10px 0; }
.search-modal-tags { display: flex; flex: 0 0 100%; flex-wrap: wrap; justify-content: center; gap: 10px; }
.search-modal-tag { min-height: 48px; padding: 0 22px; border: 1px solid rgb(255 255 255 / 70%); border-radius: 999px; background: transparent; color: #fff; cursor: pointer; font-size: clamp(18px, 1.21vw, 22px); }
.search-modal-tag:focus-visible, .search-modal-tag:hover { background: rgb(255 255 255 / 16%); }
#search-input:focus, button:focus-visible { outline: 4px solid rgb(240 161 43 / 45%); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }


.monitor-deck {
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
}
.monitor-deck::-webkit-scrollbar { width: 0; }

.screen {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 650px;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.16;
}
.brand-logo {
  display: block;
  width: 90%;
  height: auto;
  padding: 1em 0 0.5em;
}


.topnav {
  display: flex;
  align-items: center;
  gap: clamp(24px, 3vw, 52px);
  color: rgba(255,255,255,0.96);
  font-family: "Paperlogy", "Malgun Gothic", Arial, sans-serif;
  font-size: clamp(14px, 3.2vw, 30px);
  font-weight: 600;
}
.topnav a { padding: 12px 2px; letter-spacing: 2px; }
.topnav a.is-active { border-bottom: 2px solid currentColor; }

/* 1면 */
.screen-hero {
  font-family: "Paperlogy", "Malgun Gothic", Arial, sans-serif;
  color: var(--white);
  background: var(--purple-950) url("../img/bg.jpg") center / cover no-repeat;
}
.screen-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.13;
  background-image:
    linear-gradient(90deg, transparent 49.6%, rgba(255,255,255,.18) 50%, transparent 50.4%),
    linear-gradient(transparent 49.6%, rgba(255,255,255,.12) 50%, transparent 50.4%);
  background-size: 42px 42px;
  mix-blend-mode: overlay;
}
.hero-copy {
  position: relative;
  z-index: 5;
  width: fit-content;
  max-width: 82vw;
  margin: calc(var(--header-h) + 7vh) auto 3.5vh;
  text-align: left;
}
.eyebrow {
  margin: 0 0 10px;
  font-size: clamp(12px, .85vw, 16px);
  letter-spacing: .12em;
  font-weight: 700;
  color: #ffffff;
}
.hero-eyebrow { letter-spacing: 0; font-weight: 500; }
.hero-copy h1 {
  margin: 0;
  font-size: clamp(42px, min(4.5vw, 7.6vh), 140px);
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.hero-copy .hero-eyebrow {
  font-size: clamp(20px, min(1.25vw, 2.5vh), 40px);
}

.gallery {
  position: relative;
  z-index: 7;
  width: 100%;
  margin-top: 4vh;
  box-shadow: 0 -18px 30px rgba(12, 0, 40, .24), 0 18px 30px rgba(12, 0, 40, .6);
}
.gallery-window {
  overflow: hidden;
 
}
.gallery-card {
  height: 45vh;
  margin: 0;
  overflow: hidden;
  border: 0;
}
.gallery-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
}

.hero-caption {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: clamp(70px, 4vh, 130px);
  left: 0;
  margin: 0;
  text-align: center;
  font-size: clamp(12px, min(.9vw, 1.8vh), 26px);
  line-height: 1.8;
  letter-spacing: .04em;
  color: rgba(255,255,255,.94);
  
}
.screen-hero .hero-caption {
  opacity: 0;
  transition: opacity .6s ease;
}
.screen-hero.caption-visible .hero-caption { opacity: 1; }

.scroll-cue {
  position: absolute;
  z-index: 12;
  left: 50%;
  bottom: clamp(18px, 2.6vh, 34px);
  width: 54px;
  height: 38px;
  transform: translateX(-50%);
}
.scroll-cue span,
.scroll-cue::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 22px;
  height: 22px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateX(-50%) rotate(45deg);
}
.scroll-cue span { top: 0; }
.scroll-cue::after { top: 10px; opacity: .48; }
.scroll-cue--dark { color: var(--purple-800); }

/* 2면 */
.screen-featured {
  padding-top: var(--header-h);
  background:
    linear-gradient(rgba(246,245,243,.90), rgba(246,245,243,.96)),
    url("../img/bg_p2.jpg") center / cover no-repeat;
}
.featured-inner {
  width: min(1500px, 82vw);
  margin: clamp(40px, 7vh, 86px) auto 0;
}
.featured-heading { width: 55%; font-family: "Paperlogy", "Malgun Gothic", Arial, sans-serif; }
.featured-heading .eyebrow { color: #27222f; }
.featured-heading h2 {
  margin: 0;
  color: #300d8c;
  font-size: clamp(26px, 2.35vw, 46px);
  line-height: 1.23;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.featured-heading strong {font-weight: 600; color : var(--focus); }
.featured-books {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(28px, 4.4vw, 74px);
  margin-top: clamp(50px, 8vh, 96px);
  align-items: end;
}
.featured-books .book-card:first-child { justify-self: start; }


.book-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transition: transform 220ms ease, opacity 220ms ease;
  touch-action: manipulation;
}
.book-card img {
  display: block;
  width: min(100%, 220px);
  aspect-ratio: 0.67;
  object-fit: cover;
  background: #fff;
  box-shadow: var(--shadow);
      border: 3px solid #f5f5f540;
    border-radius: 23px;
}
.book-card span {
  max-width: 100%;
  text-align: center;
  font-size: clamp(14px, 1.2vw, 26px);
  line-height: 1.5;
  font-weight: 600;
}
.book-card:hover { transform: translateY(-8px); }
.book-card--featured img { width: min(100%, 280px); }
.book-thumbnail { position: relative; display: block; }
.book-thumbnail .ai-medal {
  position: absolute;
  top: -12px;
  left: -12px;
  z-index: 1;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 50%;
  background: #f76641;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 3px 8px rgb(0 0 0 / 22%);
}

/* 2면 학교연사 도서 진입 효과: 기존 .book-card hover transform과 분리한다. */
.screen-featured .book-card--featured {
  opacity: 0;
  translate: 0 70px;
  transition-property: transform, opacity, translate;
  transition-duration: 500ms, 1500ms, 1500ms;
  transition-timing-function: ease, cubic-bezier(0.22, 1, 0.36, 1), cubic-bezier(0.22, 1, 0.36, 1);
}
.screen-featured.books-enter .book-card--featured {
  opacity: 1;
  translate: 0 0;
}
.screen-featured.books-enter .book-card--featured:nth-child(2) { transition-delay: 0ms, 400ms, 400ms; }
.screen-featured.books-enter .book-card--featured:nth-child(3) { transition-delay: 0ms, 800ms, 800ms; }
.screen-featured.books-enter .book-card--featured:nth-child(4) { transition-delay: 0ms, 1200ms, 1200ms; }
.screen-featured.books-enter .book-card--featured:nth-child(5) { transition-delay: 0ms, 1600ms, 1600ms; }

/* 3면 */
.screen-library { padding-top: var(--header-h); background: #f2f1ef; }
.library-body {
  display: grid;
  grid-template-columns: clamp(210px, 18vw, 320px) 1fr;
  height: 100%;
  min-height: 0;
}
.decade-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 2.8vh, 36px) clamp(18px, 2.2vw, 36px);
  background:   url("../img/bg_aside.png") center / cover no-repeat;
  font-family: "Paperlogy", "Malgun Gothic", Arial, sans-serif;
}
.decade-panel h2 {
  position: relative;
  z-index: 2;
  margin: clamp(12px, 3vh, 15px) 0 20px;
  color: var(--purple-900);
  font-size: clamp(22px, 1.8vw, 32px);
  font-weight: 600;
  text-align: center;
}
.decade-list {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 1.8vh, 22px);
}
.decade-button {
  width: min(100%, clamp(140px, 11vw, 164px));
  min-width: 0;
  height: clamp(46px, 5vh, 56px);
  padding: 0 20px;
  border: 1px solid #aaa5ad;
  border-radius: 999px;
  color: #4b4650;
  background: rgba(255,255,255,.86);
  font-size: clamp(16px, 1.15vw, 20px);
  cursor: pointer;
  touch-action: manipulation;
  transition: scale 120ms ease-out;
}
.decade-button.is-active,
.decade-button:hover {
  color: var(--white);
  background: var(--purple-800);
  border-color: var(--purple-800);
}
.library-content {
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  min-height: 0;
  padding: clamp(34px, 5vh, 64px) clamp(36px, 5vw, 84px);
  background-color: #e8e8e8 ;
}
.book-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: clamp(48px, 7vh, 86px) clamp(44px, 6vw, 96px);
  align-items: start;
}
.book-grid .book-card img {
  width: 100%;
  max-width: clamp(210px, 16vw, 320px);
  margin: 0 auto;
  aspect-ratio: .75;
  object-fit: cover;
  object-position: center top;
  border: 5px solid #f4f4f4e2;
  border-radius: 30px;
}

/* 3면 동창회보 카드 진입 및 터치 피드백 */
.screen-library .book-grid .book-card {
  --library-card-delay: 0ms;
  --library-card-duration: 1100ms;
  --library-card-offset: 25px;
  opacity: 0;
  translate: 0 var(--library-card-offset);
  transition-property: transform, opacity, translate, scale;
  transition-duration: 220ms, var(--library-card-duration), var(--library-card-duration), 120ms;
  transition-timing-function: ease, cubic-bezier(0.22, 1, 0.36, 1), cubic-bezier(0.22, 1, 0.36, 1), ease-out;
  transition-delay: 0ms, var(--library-card-delay), var(--library-card-delay), 0ms;
}
.screen-library.library-books-enter .book-grid:not(.book-grid--staging):not(.book-grid--leaving) .book-card {
  opacity: 1;
  translate: 0 0;
}
.screen-library .book-grid.book-grid--filter-enter {
  --library-card-duration: 500ms;
  --library-card-offset: 18px;
}
.screen-library .book-grid.book-grid--leaving .book-card {
  opacity: 0;
  transition-duration: 220ms, 150ms, 150ms, 120ms;
  transition-delay: 0ms;
}
.decade-button:active { scale: 0.97; }
.screen-library .book-grid .book-card:active { scale: 0.985; }

@media (max-aspect-ratio: 4/3) {
  .gallery-card { flex-basis: 50%; }
  .featured-inner { width: 88vw; }
  .featured-books { gap: 28px; }
  .book-grid { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
}

@media (max-width: 900px) {
  :root { --header-h: 74px; }
  .page-header { padding: 0 22px; }
  .topnav { gap: 15px; font-size: 13px; }
  .page-header-left { flex-basis: 165px; }
  .hero-copy { width: 86vw; }
  .featured-heading { width: 100%; }
  .featured-books { grid-template-columns: repeat(2, 1fr); }
  .library-body { grid-template-columns: 168px 1fr; }
  .decade-panel { padding: 20px 18px; }
  .decade-button { padding: 0 14px; }
  .book-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
}

/* First-screen archive exhibition sequence. */
.screen-hero .hero-copy {
  opacity: 0;
  transform: translate3d(var(--intro-title-x, 0), var(--intro-title-y, 0), 0) scale(.96);
  transform-origin: center center;
  transition: opacity 1.15s cubic-bezier(.22, .75, .28, 1), transform 1.05s cubic-bezier(.22, .75, .28, 1);
  will-change: opacity, transform;
}

/* Keep the exhibition screen at the full viewport width inside any host layout. */
.monitor-deck,
.screen.screen-hero {
  width: 100vw !important;
  min-width: 100vw;
  max-width: none;
}
/* Set the hidden title at the centre before its first visible frame. */
.screen-hero.intro:not(.title-visible) .hero-copy { transition: none; }
.screen-hero.title-visible .hero-copy {
  opacity: 1;
  transform: translate3d(var(--intro-title-x, 0), var(--intro-title-y, 0), 0) scale(1);
}
.screen-hero.title-up .hero-copy {
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: left top;
}
@media (prefers-reduced-motion: reduce) {
  .screen-hero .hero-copy,
  .swiper-wrapper { transition-duration: .01ms !important; }

  .screen-featured .book-card--featured {
    opacity: 1;
    translate: 0 0;
    transition: none;
  }

  .screen-library .book-grid .book-card {
    opacity: 1;
    translate: 0 0;
    transition: none;
  }
}

/* Swiper gallery: touch-driven, continuous cards without custom gallery states. */
.gallery {
  display: block;
}
.gallery-window.swiper {
  width: 100%;
  overflow: hidden;
  backface-visibility: hidden;
  will-change: transform;
}
.screen-hero .gallery {
  backface-visibility: hidden;
  perspective: 1000px;
}
.screen-hero .gallery-window {
  opacity: 0;
  transition: opacity .2s ease;
}
.screen-hero.gallery-film-complete .gallery-window { opacity: 1; }
.screen-hero.gallery-film-pending .gallery-window,
.screen-hero.gallery-film-running .gallery-window {
  opacity: 0;
  pointer-events: none;
}
.screen-hero.gallery-film-pending .gallery,
.screen-hero.gallery-film-running .gallery {
  box-shadow: none;
}
.screen-hero:not(.gallery-film-complete) .gallery { box-shadow: none; }
.gallery-film-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
  opacity: 1;
  transition: opacity .2s ease;
}
.gallery-film-overlay.is-ready { visibility: visible; }
.gallery-film-overlay.is-handing-off { opacity: 0; }
.gallery-film-track {
  display: flex;
  width: max-content;
  height: 45vh;
  will-change: transform;
}
.gallery-film-card {
  flex: 0 0 auto;
  width: auto;
  height: 45vh;
  margin: 0;
  overflow: hidden;
  border: 0;
  opacity: .7;
}
.gallery-film-card img {
  display: block;
  width: auto;
  max-width: none;
  height: 100%;
  object-fit: contain;
  transform: scale(1.01);
  filter: grayscale(1);
}
.screen-hero .gallery-card {
  height: 45vh;
  width: auto;
  flex: 0 0 auto;
  opacity: .42;
  transform: none;
  transition: opacity .65s ease;
  z-index: auto;
}
.gallery-window.swiper .gallery-card img {
  width: auto;
  max-width: none;
  height: 100%;
  object-fit: contain;
  transition: filter .65s ease;
}
.gallery-window.swiper .swiper-slide-active { opacity: 1; }
.gallery-window.swiper .swiper-slide-prev,
.gallery-window.swiper .swiper-slide-next { opacity: .7; }
.gallery-window.swiper .swiper-slide-prev img,
.gallery-window.swiper .swiper-slide-next img { filter: grayscale(1); }

/* 모바일/태블릿 메인 화면: 대형 터치스크린 레이아웃에는 영향을 주지 않는다. */
.menu-toggle,
.mobile-home,
.mobile-library-link,
.library-mobile-heading { display: none; }

@media (max-width: 1024px) {
  :root { --header-h: 64px; }
  .archive-main-page { --header-h: 72px; }

  .archive-main-page { overflow-x: hidden; overflow-y: auto; }
  .archive-main-page.mobile-menu-open { overflow: hidden; }

  .page-header { min-height: var(--header-h); padding: 0 8px 0 16px; }
  .page-header-left { flex: 1 1 auto; min-width: 0; }
  .brand-logo { width: auto; max-width: min(190px, 53vw); max-height: 46px; padding: 0; transform: translateY(2px); }
  .page-header-actions { gap: 0; }
  .menu-toggle {
    display: inline-flex;
    width: 56px;
    min-width: 56px;
    height: 56px;
    padding: 14px 2px 14px 26px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    margin-right: -6px;
  }
  .menu-toggle span { display: block; width: 26px; height: 2px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
  .menu-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle.is-open span:nth-child(2) { opacity: 0; }
  .menu-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .topnav {
    position: fixed;
    top: var(--header-h);
    right: 16px;
    z-index: 110;
    display: none;
    width: min(260px, calc(100vw - 32px));
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-radius: 12px;
    background: #25134f;
    box-shadow: 0 12px 28px rgb(12 0 40 / 36%);
    font-size: 17px;
  }
  .topnav.is-open { display: flex; }
  .topnav a { min-height: 56px; padding: 15px 18px; letter-spacing: 0; }
  .topnav a.is-active { border-bottom: 0; background: rgb(255 255 255 / 12%); }
  .mobile-home { display: block; }
  .topnav .desktop-library-link { display: none; }
  .topnav .mobile-library-link { display: block; }
  .header-search-toggle { min-width: 56px; min-height: 56px; }
  .header-search svg { width: 29px; height: 29px; }
  .header-search-form { padding: 24px 18px; }
  #search-input { flex-basis: calc(100% - 64px); min-height: 58px; margin-left: 0; padding: 0 16px; font-size: 18px; }
  .header-search-form .header-search-submit { min-width: 56px; min-height: 56px; }
  .header-search-form .header-search-submit svg { width: 32px; height: 32px; }
  .header-search-form .header-search-close { top: 12px; right: 12px; min-width: 56px; min-height: 56px; }
  .header-search-form .header-search-close svg { width: 32px; height: 32px; }
  .search-modal-guide { font-size: 15px; }
  .search-modal-tag { min-height: 44px; padding: 0 16px; font-size: 15px; }

  .page-header .topnav {
    position: static;
    display: flex;
    width: auto;
    padding: 0;
    flex-direction: row;
    align-items: center;
    gap: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 15px;
  }
  .page-header .topnav .mobile-home { display: none; }
  .page-header .topnav a { min-height: 56px; padding: 17px 12px; }
  .book-thumbnail .ai-medal {
    top: -7px;
    left: -7px;
    width: 30px;
    height: 30px;
    font-size: 11px;
  }

  .archive-main-page .monitor-deck { width: 100vw; height: auto; overflow: visible; scroll-snap-type: none; overscroll-behavior-y: auto; }
  .archive-main-page .screen { width: 100vw; height: auto; min-height: 0; overflow: visible; scroll-snap-align: none; scroll-snap-stop: normal; scroll-margin-top: var(--header-h); }
  .archive-main-page .screen-hero {
    display: flex;
    height: 100vh;
    min-height: 100vh;
    height: 100svh;
    min-height: 100svh;
    flex: 0 0 auto;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    padding: calc(var(--header-h) + 12px) 0 104px;
    overflow: hidden;
  }
  .hero-copy { width: min(86vw, 520px); max-width: none; margin: 0 auto; }
  .hero-copy h1 { font-size: clamp(29px, 8vw, 42px); line-height: 1.15; }
  .hero-copy .hero-eyebrow { font-size: clamp(17px, 5vw, 24px); }
  .gallery { margin-top: clamp(28px, 4dvh, 44px); }
  .gallery-card,
  .screen-hero .gallery-card,
  .gallery-film-track,
  .gallery-film-card { height: min(32dvh, 260px); }
  .hero-caption { right: 16px; bottom: 66px; left: 16px; font-size: 12px; line-height: 1.65; }
  .scroll-cue { bottom: 16px; }

  .screen-featured { padding: 84px 20px 56px; }
  .featured-inner { width: min(100%, 720px); margin: 0 auto; }
  .featured-heading { width: 100%; }
  .featured-heading h2 { font-size: clamp(24px, 6.4vw, 34px); }
  .featured-books { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 18px; margin-top: 38px; align-items: start; }
  .featured-books .book-card:first-child { justify-self: stretch; }
  .featured-books .book-card--featured img { width: 100%; max-width: 210px; }
  .featured-books .book-card { justify-self: stretch; gap: 10px; }
  .featured-books .book-card span { font-size: 15px; }
  .screen-featured .book-card--featured { opacity: 1; translate: 0 0; transition-duration: 220ms, 0ms, 0ms; }

  .screen-library { padding: 84px 20px 56px; }
  .library-body { display: block; height: auto; }
  .decade-panel { display: none; }
  .library-content { overflow: visible; padding: 0; background: transparent; }
  .library-mobile-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; font-family: "Paperlogy", "Malgun Gothic", Arial, sans-serif; }
  .library-mobile-heading h2 { margin: 0; color: var(--purple-900); font-size: clamp(26px, 7vw, 34px); line-height: 1.2; }
  .library-all-link { min-height: 48px; display: inline-flex; align-items: center; color: var(--purple-800); font-size: 15px; font-weight: 700; white-space: nowrap; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 18px; }
  .book-grid .book-card img { max-width: 210px; border-width: 3px; border-radius: 16px; }
  .book-grid .book-card { gap: 10px; }
  .book-grid .book-card span { font-size: 15px; }
  .screen-library .book-grid .book-card { opacity: 1; translate: 0 0; transition-duration: 220ms, 0ms, 0ms, 120ms; }
}



.viewer-home-page {
  --viewer-line: #cdd6df;
  --viewer-surface: #fff;
  --viewer-surface-soft: #e9eef3;
  min-width: 320px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--viewer-surface-soft);
  color: var(--ink);
  font-family: "Malgun Gothic", Arial, sans-serif;
}
.viewer-home-page a { touch-action: manipulation; }
.viewer-home-page .viewer-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh;
}
.viewer-home-page .btn_home,
.viewer-search-page .btn_home {
  position: absolute;
  z-index: 20;
  top: 0px;
  right: 24px;
  background: var(--primary);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 0 0 14px 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    min-width: 40px;
}
.viewer-home-page .btn_home:focus-visible,
.viewer-search-page .btn_home:focus-visible {
  outline: 5px solid rgb(240 161 43 / 55%);
  outline-offset: 3px;
}
.viewer-home-page .btn_home svg,
.viewer-search-page .btn_home svg { width: 30px; height: 30px; }
.viewer-home-page .viewer-content {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #252a30;
}
.viewer-home-page #ebook-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--viewer-surface);
}
.viewer-home-page .viewer-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  background: var(--viewer-surface-soft);
  text-align: center;
}
.viewer-home-page .viewer-error[hidden] { display: none; }
.viewer-home-page .viewer-error-card {
  width: min(620px, 100%);
  padding: 42px 32px;
  border: 1px solid var(--viewer-line);
  border-radius: 18px;
  background: var(--viewer-surface);
  box-shadow: 0 8px 28px rgb(24 36 51 / 14%);
}
.viewer-home-page .viewer-error h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); }
.viewer-home-page .viewer-error p { margin: 14px 0 28px; font-size: 20px; }
.viewer-home-page .viewer-error .btn_home { position: static; }
@media (max-width: 700px) {
  .viewer-home-page .btn_home,
  .viewer-search-page .btn_home { top: 0; right: 10px; width: 54px; height: 54px; }
  .viewer-home-page .btn_home { right: auto; left: 10px; }
  .viewer-home-page .btn_home svg,
  .viewer-search-page .btn_home svg { width: 23px; height: 23px; }
}

.viewer-search-page {
  --viewer-line: #cdd6df;
  --viewer-surface: #fff;
  --viewer-surface-soft: #e9eef3;
  min-width: 320px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--viewer-surface-soft);
  color: var(--ink);
  font-family: "Malgun Gothic", Arial, sans-serif;
}
.viewer-search-page a { touch-action: manipulation; }
.viewer-search-page .viewer-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh;
}
.viewer-search-page #back-button { right: 96px; }
.viewer-search-page .viewer-content {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #252a30;
}
.viewer-search-page #ebook-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--viewer-surface);
}
.viewer-search-page .viewer-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  background: var(--viewer-surface-soft);
  text-align: center;
}
.viewer-search-page .viewer-error[hidden] { display: none; }
.viewer-search-page .viewer-error-card {
  width: min(620px, 100%);
  padding: 42px 32px;
  border: 1px solid var(--viewer-line);
  border-radius: 18px;
  background: var(--viewer-surface);
  box-shadow: 0 8px 28px rgb(24 36 51 / 14%);
}
.viewer-search-page .viewer-error h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); }
.viewer-search-page .viewer-error p { margin: 14px 0 28px; font-size: 20px; }
.viewer-search-page .viewer-error .btn_home { position: static; }
@media (max-width: 700px) {
  .viewer-search-page #back-button { right: auto; left: 10px; }
  .viewer-search-page .btn_home:not(#back-button) { right: auto; left: 68px; }
}
