/* ============================================================
   layout.css — 템플릿 페이지 (info ~ event)
   ============================================================ */

.page-root {
  position: relative;
  min-height: 100vh;
  padding: 120px 20px 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- 진입 애니메이션 ----------
   베일이 내려간 뒤 컨텐츠가 스태거로 드러나는 방식.
   스태거 총 시간을 짧게 (~800ms) 해서 배경-컨텐츠 지연 깜빡임 최소화.
   베일은 JS 에서 애니메이션 완료와 맞춰 페이드아웃.
*/
@keyframes reveal-up {
  0%   { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes reveal-up-small {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.logo-title  { animation: reveal-up 600ms cubic-bezier(0.22, 1, 0.3, 1) 0ms backwards; }
.book-menu   { animation: reveal-up 600ms cubic-bezier(0.22, 1, 0.3, 1) 120ms backwards; }
.contents    { animation: reveal-up 700ms cubic-bezier(0.22, 1, 0.3, 1) 240ms backwards; }
.copy        { animation: reveal-up-small 500ms cubic-bezier(0.22, 1, 0.3, 1) 400ms backwards; }
.side        { animation: reveal-up-small 500ms cubic-bezier(0.22, 1, 0.3, 1) 500ms backwards; }

@keyframes book-item-in {
  0%   { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 1; transform: translateY(0); }
}
.book-item {
  animation: book-item-in 450ms cubic-bezier(0.22, 1, 0.3, 1) backwards;
}
.book-item:nth-child(1) { animation-delay: 180ms; }
.book-item:nth-child(2) { animation-delay: 240ms; }
.book-item:nth-child(3) { animation-delay: 300ms; }
.book-item:nth-child(4) { animation-delay: 360ms; }
.book-item:nth-child(5) { animation-delay: 420ms; }

/* ---------- Title / Logo ---------- */
.logo-title {
  display: inline-block;
  margin: 0 auto 22px;
  transition: transform 300ms var(--ease-out), opacity 300ms var(--ease-out);
  position: relative;
  z-index: 2;
}
.logo-title:hover { transform: translateY(-2px); opacity: 0.9; }
.logo-title-img {
  width: auto;
  max-width: 480px;
  height: auto;
  display: block;
}

/* ---------- Book Menu ----------
   - 전체 사이즈 축소
   - 모든 책 같은 ivory 배경
   - 시작부터 x축으로 살짝씩 엇갈림
   - 글자 볼드 + 주황
   - 현재 페이지: 책갈피
*/
.book-menu {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 160px;
  margin: 0 auto 28px;
  position: relative;
  z-index: 2;
}

.book-item {
  position: relative;
  display: block;
  padding: 7px 14px 7px 16px;
  background: var(--ivory);
  color: var(--orange);
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  border: 1px solid rgba(0,0,0,0.14);
  border-bottom: none;
  transition: transform 220ms var(--ease-out), background 220ms var(--ease-out);
}
.book-item:last-child { border-bottom: 1px solid rgba(0,0,0,0.14); }

/* 미리 살짝씩 엇갈려 있는 초기 오프셋 — margin-left 로 처리(animation 과 안 충돌) */
.book-item:nth-child(1) { margin-left: 0; }
.book-item:nth-child(2) { margin-left: 6px; }
.book-item:nth-child(3) { margin-left: 2px; }
.book-item:nth-child(4) { margin-left: 9px; }
.book-item:nth-child(5) { margin-left: 4px; }
.book-item:hover { transform: translateX(10px); }

/* spine strip */
.book-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: linear-gradient(90deg, rgba(0,0,0,0.16), rgba(0,0,0,0) 100%);
}

/* Bookmark on current */
.book-item.is-current .bookmark { display: block; }
.bookmark {
  display: none;
  position: absolute;
  top: -2px;
  right: 14px;
  width: 12px;
  height: 22px;
  background: var(--orange);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
  z-index: 3;
  animation: bookmark-drop 420ms var(--ease-out) both;
}
@keyframes bookmark-drop {
  0%   { transform: translateY(-12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* ---------- Contents ---------- */
.contents {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.text-box {
  background: #fff;
  padding: 50px;
  position: relative;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 10pt;
  line-height: 1.6;
  letter-spacing: -0.035em;
  color: #1a1a1a;
  text-align: justify;
  word-break: keep-all;
}
.text-box p {
  padding: 4px 0;
  text-indent: 10.5px;
}
.text-box p + p { margin-top: 2px; }
.text-box img {
  z-index: 2;
  position: relative;
  margin: 8px 0;
}
.text-box h2, .text-box h3 {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin: 20px 0 8px;
  font-weight: 700;
  text-indent: 0;
}
.text-box h2 { font-size: 18pt; }
.text-box h3 { font-size: 13pt; }
.text-box a {
  color: var(--orange);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease-out);
}
.text-box a:hover { border-bottom-color: var(--orange); }
.text-box ul, .text-box ol {
  margin: 8px 0 14px 18px;
  padding-left: 0;
}
.text-box li { list-style: disc; margin-bottom: 4px; }

/* ---------- Copyright ---------- */
.copy {
  position: relative;
  z-index: 2;
  margin-top: 36px;
  width: 100%;
  text-align: center;
  color: var(--orange);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  font-size: 9px;
  letter-spacing: -0.04em;
  line-height: 1.6;
}
.copy a { color: var(--orange); }
.copy a:hover { text-decoration: underline; }

/* ---------- Side Buttons (context form) ---------- */
.side {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 50;
  font-size: 0;
}
.side .twt,
.side .top {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--ivory);
  color: var(--orange);
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(30, 50, 100, 0.15);
  transition: transform 200ms var(--ease-out), background 200ms var(--ease-out), color 200ms var(--ease-out);
  cursor: pointer;
}
.side .twt:hover { transform: translateY(-2px); }
.side .top {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}
.side .top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.side .top:hover { background: var(--orange); color: #fff; }
.side svg { width: 18px; height: 18px; }
.side .top svg { width: 20px; height: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 699px) {
  .page-root { padding: 75px 14px 100px; }
  .logo-title-img { max-width: 320px; }
  .book-menu { width: 146px; margin-bottom: 22px; }
  .book-item { padding: 6px 12px 6px 14px; font-size: 11px; }
  .text-box { padding: 30px 20px; }
  .side { right: 12px; bottom: 12px; }
  .side .twt, .side .top { width: 38px; height: 38px; }
  .copy { font-size: 9px; padding: 0 10px; }
}
