@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

/* =============================================
   이서정 — lunaticwhale.de Inspired
   Cream bg · Left fixed sidebar · 4-col grid
   ============================================= */

:root {
  --cream: #FAFAF8;
  --cream2: #f5f5f5;
  --text: #0e1a28;
  --text-mid: #2c3e50;
  --text-light: #6a8099;
  --blue: #0047fd;
  --blue-light: #2e75cc;
  --border: rgba(14, 26, 40, 0.10);
  --sidebar-w: 230px;
  --font-kr: 'Noto Sans KR', sans-serif;
  --font-serif: 'Noto Sans KR', sans-serif;
  --font-mono: 'Noto Sans KR', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Noto Sans KR', 'Noto Sans', sans-serif;
}

html {
  scroll-behavior: smooth;
  font-size: 17px;
}

body {
  background: var(--cream);
  color: var(--text);
  font-family: var(--font-kr);
  font-weight: 300;
  line-height: 1.8;
  overflow-x: hidden;
  border-top: 44px solid transparent;
  border-left: 44px solid transparent;
  border-right: 44px solid transparent;
  box-sizing: border-box;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

ul {
  list-style: none;
}

/* =============================================
   LAYOUT
   ============================================= */
.layout {
  display: block;
  min-height: 100vh;
  padding-top: 44px;
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}

/* =============================================
   TOP NAVBAR
   ============================================= */

.topnav {
  position: fixed;
  top: 0;
  left: 44px;
  right: 44px;
  height: 44px;
  z-index: 900;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  transition: opacity 0.3s ease, transform 0.3s ease;
  will-change: transform;
}

.topnav.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
}

.tn-link {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0047fd;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: font-weight 0.1s;
  padding: 0.2rem 0;
}

.tn-link:hover {
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: #0047fd;
}

.tn-link.active {
  font-weight: 900;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main {
  padding: 0;
  min-height: 100vh;
}

/* =============================================
   SITE LOGO
   ============================================= */
.site-logo {
  position: fixed;
  top: 19px;
  left: 60px;
  z-index: 1100;
  display: block;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.4s ease;
  will-change: transform;
}

.site-logo img {
  width: 151px;
  height: 151px;
  object-fit: contain;
  display: block;
  transition: opacity 0.2s;
}

.site-logo:hover img {
  opacity: 0.8;
}


.side-ticker {
  position: fixed;
  top: 0;
  left: 0;
  width: 44px;
  bottom: 0;
  z-index: 1000;
  background: transparent;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
}

.side-ticker-track {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  gap: 0;
  will-change: transform;
}

.side-ticker-track span {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fb4600;
  letter-spacing: 0.1em;
  line-height: 1;
  writing-mode: vertical-lr;
  display: block;
  padding: 1.5rem 0;
}

/* =============================================
   RIGHT SIDEBAR NAME
   ============================================= */
.side-name {
  position: fixed;
  top: 0;
  right: 0;
  width: 44px;
  bottom: 0;
  z-index: 1000;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
}

.side-name-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
}

.side-name-kr {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fb4600;
  writing-mode: vertical-lr;
  letter-spacing: 0.1em;
}

.side-name-en {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fb4600;
  writing-mode: vertical-lr;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.side-name-link:hover .side-name-kr,
.side-name-link:hover .side-name-en {
  opacity: 1;
  text-decoration: none;
}

/* =============================================
   HERO
   ============================================= */
.hero-section {
  padding: 2rem 2.5rem 4rem;
  max-width: 860px;
  margin: 0 auto;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  font-style: italic;
  color: #fb4600;
  line-height: 1;
  letter-spacing: -0.02em;
}

/* =============================================
   CONTENT SECTIONS
   ============================================= */
.content-section {
  padding: 1.2rem 2.5rem;
  max-width: 860px;
  margin: 0 auto;
  text-align: left;
}

.section-title {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 0.9rem;
  padding-bottom: 0.3rem;
}

.title-count {
  font-weight: 400;
  color: var(--text-light);
  font-size: 0.7em;
}

/* =============================================
   ABOUT LAYOUT — 2/3 + 1/3
   ============================================= */
.about-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  align-items: stretch;
}

.about-left {
  display: flex;
  flex-direction: column;
}

.about-right {
  display: flex;
  flex-direction: column;
}

.about-right .contact-block {
  flex: 0 0 auto;
}

.about-right .writing-links {
  margin-top: 3rem;
  padding-top: 0;
}

/* =============================================
   HOME: 통합 2-column 그리드 (about + edu 공유)
   ============================================= */
.content-section--home {
  display: grid;
  grid-template-columns: 2fr 1fr;
  column-gap: 4rem;
  row-gap: 0;
}

#articles {
  margin-top: 3rem;
}

.content-section--home > section:not(#articles) {
  display: contents;
}

/* ── Articles 헤더 (타이틀 + 필터 한 줄) ── */
.articles-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.articles-header .section-title {
  margin-bottom: 0;
  padding-bottom: 0;
}

/* ── 카테고리 필터 탭 ── */
.articles-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
}

.filter-btn {
  background: none;
  border: none;
  padding: 0;
  margin-right: 0.3rem;
  cursor: pointer;
  color: var(--text-light);
  font: inherit;
  letter-spacing: inherit;
}

.filter-btn.active {
  color: var(--text);
  font-weight: 700;
}

.filter-sep {
  color: var(--border);
  margin-right: 0.3rem;
  pointer-events: none;
}

.content-section--home .about-layout,
.content-section--home .edu-exp-layout {
  display: contents;
}

.content-section--home .about-left {
  grid-column: 1;
  align-self: start;
}

.content-section--home .about-right {
  grid-column: 2;
  align-self: start;
}

.content-section--home .edu-col {
  grid-column: 1;
  align-self: start;
  margin-top: 3rem;
}

.content-section--home .exp-col {
  grid-column: 2;
  align-self: start;
  margin-top: 3rem;
}

/* =============================================
   EDU + EXP SIDE BY SIDE (standalone fallback)
   ============================================= */
.edu-exp-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  align-items: start;
}

.edu-col {}
.exp-col {}

.text-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.text-item {
  padding-bottom: 0.3rem;
}

.ti-cat {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  color: #0047fd;
  letter-spacing: 0.08em;
  margin-bottom: 0.1rem;
}

.ti-cat a {
  color: #0047fd;
  text-decoration: none;
}

.ti-cat a:hover {
  text-decoration: underline;
}

.ti-title {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.1rem;
}

.ti-sub {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.72rem;
  color: var(--text-mid);
  line-height: 1.5;
  margin-bottom: 0.1rem;
}

.ti-date {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.62rem;
  color: var(--text-light);
  letter-spacing: 0.04em;
}

.ti-thesis {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.65rem;
  color: var(--text-mid);
  font-style: italic;
  margin-top: 0.25rem;
  line-height: 1.45;
}

.ti-thesis a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* =============================================
   ABOUT ARTICLE
   ============================================= */
.about-article {
  display: block;
}

.about-text p {
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-mid);
  margin-bottom: 0.7rem;
  word-break: keep-all;
  overflow-wrap: break-word;
}


.about-text p strong {
  color: var(--text);
  font-weight: 500;
}

.about-text p em {
  font-style: italic;
  color: var(--text-light);
}

/* =============================================
   CARD GRID — 4 columns
   ============================================= */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 1rem;
  row-gap: 0.3rem;
  background: transparent;
}

.card {
  background: var(--cream);
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: background 0.25s;
  cursor: default;
}

.card:hover {
  background: var(--cream2);
}

/* Card image area */
.card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-mid);
  text-align: center;
  line-height: 1.4;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ── Footnote ── */
.site-footnote {
  border-top: 1px solid var(--border);
  padding-top: 0.8rem;
  margin: 0 auto 1rem;
  max-width: calc(860px - 5rem);
  text-align: left;
}
.site-footnote p {
  font-size: 0.68rem;
  color: var(--text-mid);
  line-height: 1.4;
}

.card-body {
  padding: 0.9rem 0 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.card-cat {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.62rem;
  color: var(--blue);
  letter-spacing: 0.06em;
}

.card-title {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1.35;
  margin: 0.1rem 0 0;
}

.card-date {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.62rem;
  color: var(--text-light);
  margin-top: 0.05rem;
  letter-spacing: 0.04em;
}

/* =============================================
   CONTACT
   ============================================= */
.contact-block {
  display: flex;
  flex-direction: column;
}

.contact-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1rem;
  padding: 0.12rem 0;
  align-items: baseline;
}

.ci-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--text-light);
  text-transform: uppercase;
}

.ci-value {
  font-family: var(--font-kr);
  font-size: 0.85rem;
  color: var(--text-mid);
}

a.ci-value {
  color: var(--blue);
}

a.ci-value:hover {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  padding: 1.5rem 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-light);
  letter-spacing: 0.08em;
}

/* =============================================
   WRITING LINKS
   ============================================= */
.writing-links {
  margin-top: 1rem;
}

.writing-links-title {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 0.8rem;
}

.writing-link-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.1rem 0;
  text-decoration: none;
  color: var(--blue);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.82rem;
  transition: opacity 0.2s;
}

.writing-link-item:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--blue);
}

.wl-arrow {
  color: var(--blue);
  font-size: 0.8rem;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1100px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .layout {
    padding-left: 36px;
    padding-right: 36px;
    padding-top: 44px;
  }

  .topnav {
    left: 36px;
    right: 36px;
  }

  .side-ticker {
    width: 36px;
  }

  .side-name {
    width: 36px;
  }

  .lang-switcher-fixed {
    right: 44px;
    top: 10px;
  }

  .tn-nav {
    padding: 0 1rem;
  }
  .tn-link {
    font-size: 0.75rem;
  }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .content-section--home {
    grid-template-columns: 1fr;
  }

  .content-section--home .about-left,
  .content-section--home .about-right,
  .content-section--home .edu-col,
  .content-section--home .exp-col {
    grid-column: 1;
  }

  .content-section--home .about-right,
  .content-section--home .edu-col,
  .content-section--home .exp-col {
    margin-top: 3rem;
  }

  #articles {
    margin-top: 3rem;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-section {
    padding: 2rem 1.2rem;
  }

  .hero-section {
    padding: 2rem 1.2rem;
  }
}

@media (max-width: 480px) {
  /* ── 1. 좌우 테두리 제거 ── */
  body {
    border-left-width: 0;
    border-right-width: 0;
  }

  /* ── 사이드 장식 요소 숨김 ── */
  .side-ticker,
  .side-name {
    display: none;
  }

  /* ── 2. 상단 네브바 ── */
  .topnav {
    left: 0;
    right: 0;
    padding: 0 1rem;
  }

  .tn-nav {
    gap: 1.5rem;
    padding: 0;
  }

  .tn-link {
    font-size: 0.78rem;
  }

  /* ── 3. 로고 ── */
  .site-logo {
    left: 0;
    top: 0;
  }

  .site-logo img {
    width: calc(50vw - 60px);
    height: calc(50vw - 60px);
  }

  /* ── 언어 전환 버튼 ── */
  .lang-switcher-fixed {
    right: 1rem !important;
    top: 13px !important;
  }

  /* ── 레이아웃 패딩 ── */
  .layout {
    padding-left: 0;
    padding-right: 0;
  }

  /* ── 섹션 간격 통일 (소개/CV/글/학력/경력) ── */
  .content-section--home {
    row-gap: 3rem;
  }

  .content-section--home .about-right,
  .content-section--home .edu-col,
  .content-section--home .exp-col {
    margin-top: 0;
  }

  .about-text p:last-of-type {
    margin-bottom: 0;
  }

  .about-right .writing-links {
    margin-top: 3rem;
  }

  /* ── 경력 → Articles 간격 (6rem → 5rem) ── */
  #articles {
    margin-top: 1rem;
  }
}
/* =============================================
   LANGUAGE SWITCHER (inside topnav)
   ============================================= */
.lang-link {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color 0.2s;
}

.lang-link:hover {
  color: #ffffff;
  text-decoration: none;
}

.lang-link.active {
  color: #ffffff;
  font-weight: 700;
}

.lang-sep {
  color: rgba(255,255,255,0.3);
}

/* =============================================
   LANGUAGE SWITCHER — fixed, always visible
   ============================================= */
.lang-switcher-fixed {
  position: fixed;
  top: 14px;
  right: 52px;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  will-change: transform;
}

.lang-switcher-fixed .lang-link {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
}

.lang-switcher-fixed .lang-link:hover {
  color: var(--text);
}

.lang-switcher-fixed .lang-link.active {
  color: var(--text);
  font-weight: 700;
}

.lang-switcher-fixed .lang-sep {
  color: var(--border);
}

@media (max-width: 900px) {
  .tn-nav {
    padding: 0 1rem;
  }
  .tn-link {
    font-size: 0.72rem;
  }
}

.article-page-logo {
  position: fixed;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1200;
  display: block;
  text-decoration: none;
}

.article-page-logo img {
  width: 1cm;
  height: 1cm;
  object-fit: contain;
  display: block;
  opacity: 0.85;
  transition: opacity 0.3s;
}

.article-page-logo:hover img {
  opacity: 0.5;
}

#article-toc-container.logo-open {
  transform: translateX(0);
}


#article-toc-container {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 320px;
  transform: translateX(-300px); /* Hide 300px of the 320px width, leaving a 20px trigger area */
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  z-index: 9999;
}

#article-toc-container:hover {
  transform: translateX(0);
}

#article-toc-trigger {
  display: none;
}

.toc-trigger-logo {
  display: none;
}

#article-toc-sidebar {
  width: 300px;
  height: 100%;
  background-color: var(--cream);
  border-right: 1px solid var(--border);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  font-family: 'Noto Sans KR', sans-serif;
}

.toc-header {
  padding: 1rem 1.5rem 0.8rem;
}

.toc-header h3 {
  display: none;
}

.toc-list {
  flex-grow: 1;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list::-webkit-scrollbar {
  width: 6px;
}
.toc-list::-webkit-scrollbar-track {
  background: transparent;
}
.toc-list::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 10px;
}

.toc-list li {
  border-bottom: none;
}

.toc-list li a {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  text-decoration: none;
  transition: background-color 0.2s;
}

.toc-img {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
  border: none;
}

.toc-content {
  display: flex;
  flex-direction: column;
}

.toc-list li a:hover {
  background-color: #eef4ff;
}

.toc-list li.active a {
  background-color: transparent;
  border-left: 6px solid #fb4600;
}

.toc-title {
  font-size: calc(0.95rem * 0.7 * 1.2);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.3rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.toc-date {
  font-size: calc(0.75rem * 0.7 * 1.2);
  color: var(--text-light);
}

/* 저작권 보호 — 아티클 카드 텍스트 선택 방지 */
.card-body,
.card-title,
.card-cat,
.card-date {
  user-select: none;
  -webkit-user-select: none;
}
