/* ==================================================
   1. RESET
================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: #111;
  font-family: "Pretendard", "Noto Sans KR", sans-serif;
  line-height: 1.6;
}

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  outline: none;
}

/* ==================================================
   2. HEADER
================================================== */

.header {
  position: relative;
  width: 100%;
  border-bottom: 1px solid #111;
  background: #f7f6f2 !important;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1400px, calc(100% - 80px));
  height: 90px;
  margin: 0 auto;
}

.logo {
  font-family: "Dongle", sans-serif;
  font-size: 2.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* PC 메뉴 */

.gnb {
  display: block;
}

.gnb__list {
  display: flex;
  align-items: center;
  gap: 36px;
}

.gnb__item {
  font-size: 1.5rem;
  letter-spacing: 0.03em;
}

.gnb__item a {
  position: relative;
}

.gnb__item a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0;
  height: 1px;
  background: #111;
  transition: width 0.25s ease;
}

.gnb__item a:hover::after {
  width: 100%;
}

/* ==================================================
   3. COMMON
================================================== */

main {
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 30px;
}

.section-header__label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-header__title {
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.04em;
}

/* ==================================================
   4. FOOTER
================================================== */

.footer {
  margin-top: 100px;
  padding: 60px 0;
  border-top: 1px solid #111;
}

.footer__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: min(1400px, calc(100% - 80px));
  margin: 0 auto;
}

.footer__name {
  font-family: Georgia, serif;
  font-size: 14px;
}

.footer__copyright {
  font-size: 10px;
  opacity: 0.5;
}

/* ==================================================
   5. GUESTBOOK
   방명록
================================================== */

.guestbook {
  width: min(1100px, calc(100% - 48px));
  margin: 30px auto 0;
  color: #222;
}

/* 방명록 제목 */

.guestbook__header {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  margin-bottom: 34px;
}

.guestbook__rightWrap {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-end;
  column-gap: 25px;
}

.guestbook__eyebrow,
.guestbook__title {
  font:
    400 clamp(28px, 4vw, 42px) / 1.2 "Noto Serif KR",
    Georgia,
    serif;
}

.guestbook__title {
  letter-spacing: -0.06em;
}

/* 말풍선 */

.guestbook__intro {
  position: relative;
  bottom: 15px;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 10px;
  color: #333;
  font-size: 12px;
  line-height: 1.2;
}

.guestbook__intro::before,
.guestbook__intro::after {
  content: "";
  position: absolute;
  border: 1px solid #ccc;
  border-radius: 50%;
}

.guestbook__intro::before {
  right: -14px;
  bottom: 19px;
  width: 10px;
  height: 10px;
}

.guestbook__intro::after {
  right: -23px;
  bottom: 15px;
  width: 6px;
  height: 6px;
}

/* 거북이 등장 애니메이션 */

.guestbook__eyebrow {
  display: inline-block;
  transform-origin: center bottom;
  animation: turtleWalk 2.4s cubic-bezier(0.25, 0.7, 0.3, 1) both;
}

@keyframes turtleWalk {
  0% {
    opacity: 0;
    transform: translateX(65px) rotate(8deg);
  }

  15% {
    opacity: 1;
    transform: translateX(52px) rotate(-5deg);
  }

  35% {
    transform: translateX(35px) rotate(5deg);
  }

  55% {
    transform: translateX(20px) rotate(-4deg);
  }

  75% {
    transform: translateX(7px) rotate(3deg);
  }

  90% {
    transform: translateX(-2px) rotate(-2deg);
  }

  100% {
    opacity: 1;
    transform: translateX(0) rotate(0);
  }
}

/* 말풍선 등장 애니메이션 */

.guestbook__intro {
  opacity: 0;
  transform: translateY(8px) scale(0.92);
  transform-origin: top center;
  animation: bubbleAppear 0.65s ease-out 2s both;
}

@keyframes bubbleAppear {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.92);
  }

  70% {
    opacity: 1;
    transform: translateY(-2px) scale(1.03);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==================================================
   6. GUESTBOOK FORM
   방명록 작성 폼
================================================== */

.guestbook__form {
  padding: 20px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #fff;
}

.guestbook__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.guestbook__form label {
  display: block;
  font-size: 13px;
}

.guestbook__fields input,
.guestbook__form textarea {
  width: 100%;
  margin-top: 7px;
  padding: 12px 13px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #fff;
  color: #222;
  font: inherit;
  font-size: 14px;
}

.guestbook__message-label {
  margin-top: 18px;
}

.guestbook__form textarea {
  display: block;
  min-height: 112px;
  resize: vertical;
  line-height: 1.7;
}

/* 비밀글 체크 */

.guestbook__private {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  color: #666;
}

.guestbook__private input {
  margin: 0;
}

/* 작성 폼 하단 */

.guestbook__form-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 18px;
}

.guestbook__hint {
  color: #888;
  font-size: 12px;
  line-height: 1.6;
}

.guestbook__submit,
.guestbook__action {
  padding: 10px 16px;
  border: 1px solid #222;
  border-radius: 3px;
  background: #222;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.guestbook__submit:disabled {
  opacity: 0.55;
  cursor: wait;
}

.guestbook__cancel {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: none;
  text-decoration: underline;
  cursor: pointer;
}

.guestbook__status {
  display: none;
  min-height: 1em;
  margin: 12px 0 0;
  color: #5b7657;
  font-size: 13px;
}

/* ==================================================
   7. GUESTBOOK LIST
   방명록 목록
================================================== */

.guestbook__list-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 34px 0 12px;
}

.guestbook__list-header h3 {
  font-size: 18px;
  font-weight: 500;
}

#guestbook-count {
  color: #888;
  font-size: 12px;
}

.guestbook__list {
  display: flex;
  flex-direction: column;
  row-gap: 1rem;
}

.guestbook__item {
  padding: 0.6rem 1.5rem;
  border: 1px solid #ddd;
  background-color: #fff;
}

/* 답글 */

.guestbook__item--reply {
  position: relative;
  margin-left: 30px !important;
  border: 1px solid #5b7657;
}

.guestbook__item--reply::before {
  content: "↳";
  position: absolute;
  left: -18px;
  display: inline-block;
  margin-right: 6px;
  color: #888;
}

/* 작성자 및 날짜 */

.guestbook__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  color: #777;
  font-size: 12px;
}

.guestbook__name {
  color: #222;
  font-size: 14px;
  font-weight: 600;
}

.guestbook__private-badge {
  color: #7a6a51;
}

/* 댓글 내용 */

.guestbook__content {
  margin: 10px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.8;
}

/* 수정 및 삭제 버튼 */

.guestbook__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.guestbook__action {
  padding: 0;
  border: 0;
  background: transparent;
  color: #777;
  text-decoration: underline;
  font-size: 12px;
}

.guestbook__empty {
  padding: 22px 0;
  color: #888;
  font-size: 14px;
}

/* ==================================================
   8. GUESTBOOK LOADING
   로딩 애니메이션
================================================== */

.guestbook__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 22px 0;
  background: transparent;
  color: #888;
  font-size: 14px;
}

.guestbook__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.guestbook__dots span {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #888;
  opacity: 0.2;
  animation: guestbookDotPulse 1.2s infinite ease-in-out;
}

.guestbook__dots span:nth-child(1) {
  animation-delay: 0s;
}

.guestbook__dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.guestbook__dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes guestbookDotPulse {
  0%,
  60%,
  100% {
    opacity: 0.2;
    transform: scale(0.8);
  }

  30% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* ==================================================
   9. HAMBURGER MENU
   햄버거 버튼
================================================== */

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 42px;
  height: 42px;
  padding: 8px;
  border: 1px solid #111;
  background: transparent;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 1px;
  background: #111;
  transition: 0.3s ease;
}

/* ==================================================
   10. SIDEBAR
   사이드바
================================================== */

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  width: min(380px, 85%);
  height: 100dvh;
  padding: 30px;
  border-left: 1px solid #111;
  background: #f7f6f2;
  transform: translateX(100%);
  transition: transform 0.4s ease;
}

.sidebar.is-open {
  transform: translateX(0);
}

/* 사이드바 상단 */

.sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid #111;
  font-size: 12px;
  letter-spacing: 0.15em;
}

.sidebar__close {
  border: 0;
  background: none;
  font-size: 32px;
  font-weight: 200;
  cursor: pointer;
}

/* 사이드바 메뉴 */

.sidebar__nav {
  display: flex;
  flex-direction: column;
  margin-top: 60px;
}

.sidebar__nav a {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid #ddd;
  color: #111;
  font-family: Georgia, serif;
  font-size: 32px;
  transition: 0.25s ease;
}

.sidebar__nav a span {
  color: #739b73;
  font-family: sans-serif;
  font-size: 11px;
}

.sidebar__nav a:hover {
  padding-left: 12px;
  color: #739b73;
}

/* 사이드바 하단 */

.sidebar__footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid #111;
}

.sidebar__footer p {
  font-family: "Noto Serif KR", serif;
  font-size: 14px;
}

.sidebar__footer span {
  color: #888;
  font-size: 10px;
  letter-spacing: 0.1em;
}

/* 배경 오버레이 */

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: 0.4s ease;
}

.sidebar-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* 메뉴가 열렸을 때 배경 스크롤 방지 */

body.menu-open {
  overflow: hidden;
}

/* ==================================================
   11. RESPONSIVE
   반응형 설정
================================================== */

/* 태블릿 */

@media (max-width: 900px) {
  .header__inner,
  .hero__inner,
  .latest-works,
  .about__inner,
  .interview,
  .footer__inner {
    width: calc(100% - 40px);
  }

  .header__inner {
    height: 70px;
  }

  .latest-works {
    padding: 100px 0;
  }

  .about__inner {
    min-height: 500px;
  }

  .interview {
    margin-top: 50px !important;
  }

  /* PC 메뉴 숨기기 */

  .gnb {
    display: none;
  }

  /* 햄버거 버튼 보이기 */

  .menu-toggle {
    display: flex;
  }
}

/* 모바일 */

@media (max-width: 600px) {
  .header__inner,
  .hero__inner,
  .latest-works,
  .about__inner,
  .interview,
  .footer__inner {
    width: calc(100% - 40px);
  }

  /* 인터뷰 */

  .interview-item a {
    display: block !important;
    padding: 20px 0;
  }

  .interview-item a .interview-item__category {
    margin-left: 10px;
    padding: 5px 10px;
    font-size: 14px;
  }

  .interview-item__title {
    margin-top: 15px;
    font-size: 16px;
  }

  /* 히어로 */

  .hero__link {
    margin-top: 50px;
  }

  .hero__title {
    font-size: 2rem;
  }

  /* 섹션 제목 */

  .section-header {
    display: block;
    margin-bottom: 40px;
  }

  .section-header__title {
    margin-top: 15px;
  }

  /* 작가 소개 */

  .about__inner {
    display: block;
    padding: 100px 0;
  }

  .about__content {
    margin-top: 70px;
    font-size: 16px;
  }

  /* 작품 상세 */

  .work-detail {
    width: calc(100% - 40px);
    padding: 100px 0;
  }

  .work__header {
    padding-bottom: 50px;
  }

  .work__body {
    padding: 70px 0;
  }

  .work__text {
    font-size: 16px;
    line-height: 2.2;
  }

  .work__credits {
    grid-template-columns: 1fr;
  }

  /* 푸터 */

  .footer__inner {
    display: block;
  }

  .footer__copyright {
    margin-top: 15px;
  }

  /* 방명록 */

  .guestbook {
    width: calc(100% - 36px);
  }

  .guestbook__form {
    padding: 16px;
  }

  .guestbook__fields {
    grid-template-columns: 1fr;
  }

  .guestbook__form-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .guestbook__submit {
    align-self: flex-end;
  }

  .guestbook__item--reply {
    margin-left: 12px !important;
    padding-left: 12px;
  }
}

/* 작은 모바일 */

@media (max-width: 500px) {
  .hero__title {
    font-size: 2rem;
  }

  .gnb__item {
    font-size: 0.8rem;
  }
}

/* ==================================================
   12. ACCESSIBILITY
   움직임 최소화 설정
================================================== */

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

  .guestbook__eyebrow,
  .guestbook__intro {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .sidebar,
  .sidebar-overlay,
  .sidebar__nav a,
  .menu-toggle span {
    transition: none;
  }
}
