@import url("https://fonts.googleapis.com/css2?family=Handlee&display=swap");

@font-face {
  font-family: 'MaruBuri';
  src: url('https://hangeul.pstatic.net/hangeul_static/webfont/MaruBuri/MaruBuri-Regular.woff2') format('woff2'),
       url('https://hangeul.pstatic.net/hangeul_static/webfont/MaruBuri/MaruBuri-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'MaruBuri';
  src: url('https://hangeul.pstatic.net/hangeul_static/webfont/MaruBuri/MaruBuri-Bold.woff2') format('woff2'),
       url('https://hangeul.pstatic.net/hangeul_static/webfont/MaruBuri/MaruBuri-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ========================================
   CSS 변수
======================================== */
:root {
  --text-dark: #1C2833;
  --text-secondary: #566573;
  --line-height: 31px;
}

/* ========================================
   기본 요소
======================================== */
html {
  font-size: 20px;
  scroll-behavior: smooth;
}

body {
  font-family: "Handlee", "MaruBuri", sans-serif;
  background-color: transparent;
  margin: 0;
  color: var(--text-secondary);
  font-weight: 400;
  line-height: var(--line-height);
  letter-spacing: 0.01em;
}

img {
  -webkit-user-drag: none;
  user-select: none;
}

/* ========================================
   언어 전환 버튼
======================================== */
.lang-switch {
  position: fixed;
  top: 10px;
  right: 20px;
  z-index: 1000;
}

.lang-switch a,
.lang-switch button {
  padding: 4px 8px;
  border: none;
  background: transparent;
  color: rgba(60, 50, 40, 0.4);
  cursor: pointer;
  border-radius: 0;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  gap: 5px;
  transition: all 0.2s ease;
  font-family: "Source Sans 3", "MaruBuri", sans-serif;
  letter-spacing: 0.02em;
}

.lang-switch a:hover,
.lang-switch button:hover {
  color: rgba(60, 50, 40, 0.75);
}

.lang-switch .lang-text {
  font-size: 0.72rem;
}

/* ========================================
   공통 유틸리티
======================================== */
.hidden {
  display: none;
}

/* ========================================
   Cover 섹션
======================================== */
#cover {
  padding: 0;
}

.cover-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 25px;
}

.note-header {
  display: inline-block;
  margin-bottom: 0.6em;
  position: relative;
}

.cover-content {
  flex: 1;
  min-width: 280px;
}

.cover-media {
  flex: 0 0 200px;
  max-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 0;
}

.cover-image-wrapper {
  position: relative;
  display: inline-block;
}

.cover-image {
  width: 190px;
  height: auto;
  border-radius: 2px;
  box-shadow: 2px 3px 10px rgba(0, 0, 0, 0.15);
  transform: none;
}

.contact-email {
  font-weight: 400;
  color: rgba(140, 110, 75, 0.5);
  background: transparent;
  padding: 6px 0 0;
  border-radius: 0;
  display: block;
  margin-top: 1.2em;
  font-size: 0.7rem;
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, sans-serif !important;
  letter-spacing: 0.01em;
}

.contact-email::selection,
.contact-email *::selection {
  background: rgba(100, 150, 255, 0.3) !important;
}

/* ========================================
   News 섹션
======================================== */
.news-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 15px;
  margin-bottom: 0.8em;
}

.news-header h2 {
  margin: 0 !important;
  border-bottom: none;
  padding-bottom: 0;
}

#news .exp-list {
  margin-top: 0;
  padding-top: 0;
}

#news .exp-date {
  flex: 0 0 80px;
}

#news .exp-role {
  color: #3c3228;
}

.year-toggle {
  display: flex;
  gap: 4px;
}

.year-toggle button {
  padding: 4px 10px;
  border: none;
  background: transparent;
  color: rgba(60, 50, 40, 0.45);
  cursor: pointer;
  border-radius: 0;
  font-weight: 500;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  transition: all 0.2s ease;
  box-shadow: none;
  position: relative;
}

.year-toggle button:hover {
  color: rgba(60, 50, 40, 0.7);
}

.year-toggle button.active {
  color: #3c3228;
  font-weight: 600;
}

/* ========================================
   Publications 섹션
======================================== */
.research-topic {
  margin-top: 0.5em;
  margin-bottom: 1.5em;
}

.paper-entry {
  margin-bottom: 10px;
  font-size: 0.8rem;
  list-style: none;
  background: transparent;
  padding: 10px 0;
  border-radius: 0;
  border-left: none;
  border-bottom: 1px solid rgba(60, 50, 40, 0.08);
  box-shadow: none;
  position: relative;
}

.paper-entry:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.paper-entry:has(.paper-venue strong)::before {
  content: '🏆';
  position: absolute;
  top: 8px;
  right: 0;
  font-size: 0.9rem;
}

.paper-title {
  font-weight: 500;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #2a2520;
  margin-bottom: 3px;
  font-family: "Source Sans 3", "MaruBuri", sans-serif;
}

.paper-authors {
  font-style: normal;
  font-size: 0.72rem;
  line-height: 1.4;
  color: rgba(60, 50, 40, 0.55);
  margin-bottom: 2px;
  font-family: "Source Sans 3", sans-serif;
}

.paper-venue {
  font-size: 0.68rem;
  line-height: 1.4;
  color: rgba(60, 50, 40, 0.45);
  font-family: "Source Sans 3", sans-serif;
}

.paper-venue strong {
  color: rgba(180, 80, 40, 0.8);
  font-weight: 600;
}

.pdf-btn {
  display: inline-block;
  margin-left: 0;
  margin-right: 4px;
  margin-top: 5px;
  padding: 1px 6px;
  border: 1px solid rgba(60, 50, 40, 0.15);
  background: transparent;
  color: rgba(60, 50, 40, 0.6);
  border-radius: 1px;
  font-weight: 500;
  text-decoration: none;
  font-size: 0.62rem;
  font-family: "Source Sans 3", sans-serif;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  transition: all 0.2s ease;
  box-shadow: none;
}

.pdf-btn:hover {
  background: rgba(60, 50, 40, 0.06);
  color: #3c3228;
  border-color: rgba(60, 50, 40, 0.3);
  transform: none;
  box-shadow: none;
  text-decoration: none;
}

/* ========================================
   Education/About 섹션
======================================== */
.edu-detail {
  font-size: 0.78rem;
  color: rgba(60, 50, 40, 0.6);
  line-height: 1.5;
  display: block;
  margin-top: 3px;
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, sans-serif;
}

.edu-detail a {
  color: inherit;
  text-decoration: none;
}

.edu-detail a:hover {
  text-decoration: underline;
}

/* ========================================
   Experience / Services / Talks / Awards / Heritage 공통
======================================== */
.exp-group {
  margin-bottom: 1.5em;
}

.exp-group:last-child {
  margin-bottom: 0;
}

.exp-group h3,
#experience > h3,
#services > h3 {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(60, 50, 40, 0.45);
  margin: 0 0 0.8em;
  font-family: "Source Sans 3", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.exp-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.exp-item {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 5px 0;
  border-bottom: 1px solid rgba(60, 50, 40, 0.05);
}

.exp-item:last-child {
  border-bottom: none;
}

.exp-date {
  flex: 0 0 120px;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  color: rgba(60, 50, 40, 0.45);
  padding-top: 1px;
  white-space: nowrap;
}

.exp-body {
  flex: 1;
  min-width: 0;
}

.exp-org {
  display: block;
  font-family: "Source Sans 3", "MaruBuri", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.4;
}

.exp-org a {
  color: inherit;
  text-decoration: none;
}

.exp-org a:hover {
  text-decoration: underline;
}

.exp-role a {
  color: inherit;
  text-decoration: none;
}

.exp-role a:hover {
  text-decoration: underline;
}

.exp-desc a {
  color: inherit;
}

.exp-desc a:hover {
  text-decoration: underline;
}

.exp-role {
  display: block;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  color: rgba(60, 50, 40, 0.6);
  margin-top: 1px;
}

.exp-desc {
  display: block;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.7rem;
  font-style: italic;
  color: rgba(60, 50, 40, 0.45);
  margin-top: 2px;
  line-height: 1.4;
}

/* ========================================
   버튼 스타일
======================================== */
.section-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  background: none;
  color: rgba(60, 50, 40, 0.5) !important;
  font-size: 0.74rem;
  font-weight: 500;
  font-family: "Source Sans 3", "MaruBuri", sans-serif;
  text-decoration: none;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid rgba(60, 50, 40, 0.15);
  transition: all 0.2s ease;
}

.section-link::after {
  content: '→';
  display: inline-block;
  font-size: 0.74rem;
  transition: transform 0.2s ease;
}

.section-link:hover {
  color: #3c3228 !important;
  border-bottom-color: rgba(60, 50, 40, 0.4);
  text-decoration: none;
  transform: none;
  box-shadow: none;
  background: none;
}

.section-link:hover::after {
  transform: translateX(3px);
}

.section-link--footer {
  display: inline-flex;
  margin-top: 1.5em;
}

/* ========================================
   Gallery
======================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px 30px;
  margin-top: calc(var(--line-height) * 1.5);
  padding-top: 15px;
}

.gallery-card {
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  padding-top: 18px;
  transition: transform 0.3s ease;
}

.gallery-card:nth-child(4n+1) { transform: rotate(-2deg); }
.gallery-card:nth-child(4n+2) { transform: rotate(1.5deg); }
.gallery-card:nth-child(4n+3) { transform: rotate(-1deg); }
.gallery-card:nth-child(4n+4) { transform: rotate(2.5deg); }

.gallery-card:hover {
  transform: rotate(0deg) scale(1.03);
  z-index: 10;
}

.gallery-card::before {
  content: '';
  position: absolute;
  width: 50px;
  height: 20px;
  top: 5px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  background: linear-gradient(180deg, rgba(213, 232, 247, 0.85) 0%, rgba(184, 212, 232, 0.75) 100%);
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(93, 109, 126, 0.2);
}

.gallery-card:nth-child(3n+2)::before {
  background: linear-gradient(180deg, rgba(224, 230, 237, 0.85) 0%, rgba(212, 226, 236, 0.75) 100%);
  transform: translateX(-50%) rotate(2deg);
}

.gallery-card:nth-child(3n+3)::before {
  background: linear-gradient(180deg, rgba(226, 224, 236, 0.85) 0%, rgba(212, 210, 224, 0.75) 100%);
  transform: translateX(-50%) rotate(-1deg);
}

.gallery-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 3px;
  display: block;
  box-shadow: 3px 4px 10px rgba(0, 0, 0, 0.2);
  border: 4px solid #fff;
}

.gallery-card-title {
  margin-top: 10px;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.9rem;
  font-family: "Handlee", "MaruBuri", "NanumSquare", sans-serif;
  text-align: center;
}

/* ========================================
   갤러리 상세 페이지 (2열 그리드)
======================================== */
.gallery-grid--two {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.gallery-grid--two .gallery-card {
  padding-top: 0;
  transform: none;
}

.gallery-grid--two .gallery-card:hover {
  transform: none;
}

.gallery-grid--two .gallery-card::before {
  display: none;
}

.gallery-grid--two .gallery-card img {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: 3px;
  display: block;
  box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.12);
  border: 3px solid #fff;
}

.gallery-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 30px;
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.78rem;
  color: rgba(60, 50, 40, 0.55);
  text-decoration: none;
  transition: all 0.2s ease;
}

.gallery-back::before {
  content: '\2190';
}

.gallery-back:hover {
  color: #3c3228;
}

@media (max-width: 768px) {
  .gallery-grid--two {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

/* ========================================
   기타 컴포넌트
======================================== */
.footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 16px 0 24px;
}

/* ========================================
   반응형 - 태블릿
======================================== */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 35px 25px;
  }
}

/* ========================================
   반응형 - 모바일
======================================== */
@media (max-width: 768px) {
  .lang-switch {
    top: 8px;
    right: 12px;
  }

  .footer {
    padding-bottom: 70px;
  }

  #cover {
    text-align: center;
  }

  .cover-body {
    flex-direction: column;
    align-items: center;
  }

  .cover-media {
    order: -1;
    margin-bottom: 20px;
  }

  .cover-content {
    min-width: auto;
  }

  .note-header {
    text-align: center;
  }

  .header-keywords {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px 20px;
  }

  .gallery-card::before {
    width: 40px;
    height: 16px;
  }
}
