@font-face {
  font-family: 'Ria';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2410-1@1.0/RiaSans-ExtraBold.woff2') format('woff2');
  font-weight: normal;
  font-display: swap;
}

/* ── base variables (dark + mint defaults, overridden by JS applyThemeColors) */
:root {
  --bg: #0d1a14;
  --surface: #152b1f;
  --surface-hover: #1c3828;
  --primary: #34d399;
  --primary-soft: rgba(52, 211, 153, 0.12);
  --secondary: #6ee7b7;
  --secondary-soft: rgba(110, 231, 183, 0.12);
  --text: #ecfdf5;
  --muted: rgba(236, 253, 245, 0.5);
  --border: rgba(236, 253, 245, 0.1);
  --shadow: 0 0 24px rgba(52, 211, 153, 0.12);
  --gnb-bg: rgba(13, 26, 20, 0.75);
  --header-h: 70px;
  --page-nav-h: 46px;
}

/* light mode fallback (bg always #fff, JS sets everything else) */
[data-mode="light"] {
  --bg: #ffffff;
  --surface: #f8f8f8;
  --surface-hover: #f0f0f0;
  --gnb-bg: rgba(255, 255, 255, 0.85);
}

/* ── reset & base ─────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Pretendard", "Noto Sans KR", sans-serif;
  line-height: 1.6;
}

body[data-page="profile"] {
  letter-spacing: -0.03em;
}

/* ── page nav — sticky top bar for page navigation ───────────────────────── */
.page-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--page-nav-h);
  z-index: 200;
  display: flex;
  align-items: center;
  background: var(--gnb-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.page-nav-inner {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-nav-brand {
  text-decoration: none;
  color: var(--primary);
  font-weight: 800;
  font-size: 0.88rem;
  font-family: 'Ria', 'Inter', sans-serif;
  margin-right: 10px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.page-nav-links { display: flex; align-items: center; gap: 2px; }

.page-nav-link {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.page-nav-link:hover  { color: var(--text); background: var(--primary-soft); }
.page-nav-link.active { color: var(--primary); background: var(--primary-soft); }

/* ── site header — floating pill for in-page TOC ──────────────────────────── */
.site-header {
  position: fixed;
  top: 60px; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.32s, transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-header.scrolled {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ── GNB pill ─────────────────────────────────────────────────────────────── */
.gnb-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--gnb-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 4px 28px rgba(0,0,0,0.14);
}

/* ── page icon buttons (left) ─────────────────────────────────────────────── */
.gnb-icons { display: flex; align-items: center; gap: 2px; }

.gnb-icon-btn {
  display: flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px;
  border-radius: 999px;
  padding: 0 8px;
  color: var(--primary);
  text-decoration: none;
  transition: background 0.15s;
  flex-shrink: 0;
}

.gnb-icon-btn svg { flex-shrink: 0; }

.gnb-icon-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  margin-left: 0;
  transition: max-width 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.18s,
              margin-left 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gnb-icon-btn:hover,
.gnb-icon-btn.active { background: var(--primary-soft); }

.gnb-icon-btn:hover .gnb-icon-label {
  max-width: 70px;
  opacity: 1;
  margin-left: 5px;
}

/* ── divider ──────────────────────────────────────────────────────────────── */
.gnb-divider {
  width: 1px; height: 18px;
  background: var(--border);
  margin: 0 6px;
  flex-shrink: 0;
}

/* ── sub-nav (section TOC, inside pill, profile page only) ────────────────── */
.sub-nav { display: flex; align-items: center; gap: 2px; }

.sub-nav a {
  text-decoration: none;
  color: var(--secondary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.sub-nav a:hover  { color: var(--text); background: var(--secondary-soft); }
.sub-nav a.active { background: var(--secondary); color: var(--bg); }

/* ── hero section ─────────────────────────────────────────────────────────── */
.hero {
  padding: 48px 0 32px;
  text-align: left;
  margin-bottom: 0;
}

.hero small {
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 6px;
}

.hero h1 {
  margin: 8px 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-family: 'Ria', 'Inter', sans-serif;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

/* ── wrap (content container) ─────────────────────────────────────────────── */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--page-nav-h) 20px 72px;
}

body[data-page="blog"] .wrap,
body[data-page="projects"] .wrap {
  padding-top: calc(var(--page-nav-h) + 20px);
}

/* ── more link ────────────────────────────────────────────────────────────── */
.more-link-wrap { margin-top: 20px; }

.more-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.more-link:hover { background: var(--primary); color: var(--bg); }

/* ── sections ─────────────────────────────────────────────────────────────── */
section {
  margin-bottom: 56px;
  padding: 24px 0;
  text-align: left;
  scroll-margin-top: calc(var(--page-nav-h) + var(--header-h) + 12px);
}

.section-desc {
  margin: 4px 0 24px;
  color: var(--muted);
}

h2 {
  margin-top: 0;
  color: var(--primary);
  text-align: left;
}

/* ── intro ────────────────────────────────────────────────────────────────── */
.intro-text {
  color: var(--muted);
}

/* ── core skills grid ─────────────────────────────────────────────────────── */
.core-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.core-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: left;
}

.core-img {
  height: 130px;
  border-radius: 10px;
  background: var(--primary-soft);
  margin-bottom: 10px;
  overflow: hidden;
}

.core-img-pic {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.core-img-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.core-description {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
}

/* ── skill tabs & grid ────────────────────────────────────────────────────── */
.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tab-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  font-weight: 700;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.86rem;
}

.tab-btn.active {
  background: var(--primary);
  color: #1a1830;
  border-color: var(--primary);
}

.skill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-card {
  display: inline-flex;
  align-items: center;
  gap: 0;
  width: 150px;
  height: 50px;
  border-radius: 12px;
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.skill-card:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

#skill-list.is-filtered .skill-card.on {
  background: color-mix(in srgb, var(--primary) 10%, var(--surface, #fff));
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
}

[data-mode="dark"] #skill-list.is-filtered .skill-card.on {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
}

[data-mode="dark"] .skill-card {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.skill-card.inactive {
  opacity: 0.45;
}

.skill-card.inactive .skill-name {
  color: var(--muted);
}
.skill-card.inactive .skill-icon-img {
  filter: grayscale(100%);
}

.skill-icon-area {
  width: 46px;
  min-width: 46px;
  height: 50px;
  border-radius: 0;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.04);
  border-right: 1px solid var(--border);
}

[data-mode="dark"] .skill-icon-area {
  background: rgba(255, 255, 255, 0.05);
}

.skill-icon-img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
}

.skill-icon-fallback {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
}

.skill-name {
  flex: 1;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
  white-space: normal;
  word-break: keep-all;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── career / education section dividers ──────────────────────────────────── */
.career-sub,
.edu-sub {
  max-width: 100%;
}

.career-sub > h3,
.edu-sub > h3 {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--secondary);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 40px 0;
}

.career-sub > h3::after,
.edu-sub > h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── experience rows ──────────────────────────────────────────────────────── */
.exp-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.exp-row:first-of-type { border-top: 0; padding-top: 0; }
.exp-row > div:last-child { text-align: left; }
.period { color: var(--muted); font-weight: 400; }
.period-duration { font-size: .8em; opacity: .75; }

/* ── timeline ─────────────────────────────────────────────────────────────── */
.tl-wrap { display: flex; flex-direction: column; }
.tl-row { display: flex; gap: 0; }
.tl-left {
  width: 52px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: 16px;
  padding-top: 3px;
}
.tl-year {
  font-size: .72rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.tl-line {
  width: 1px;
  flex: 1;
  background: var(--border);
  margin-top: 6px;
  min-height: 16px;
}
.tl-right {
  flex: 1;
  min-width: 0;
  padding-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  transition: border-color .15s;
}
.tl-card-proj { display: flex; gap: 12px; }
.tl-card-proj:hover { border-color: var(--primary); }
.tl-card-body { flex: 1; min-width: 0; }
.tl-thumb {
  width: 76px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 7px;
  overflow: hidden;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  color: var(--primary);
  font-weight: 700;
}
.tl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tl-badge {
  display: inline-block;
  font-size: .72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, #f59e0b 14%, transparent);
  color: #b45309;
  margin-bottom: 5px;
}
[data-mode="light"] .tl-badge { color: #92400e; }
.tl-title {
  font-size: .95rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.4;
}
.tl-meta { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.tl-desc { font-size: .8rem; color: var(--muted); margin-bottom: 6px; line-height: 1.5; }
.tl-period-row { font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.tl-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}
.tl-period { font-size: .75rem; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.tl-details { margin-top: 8px; }
.tl-details summary {
  font-size: .78rem;
  color: var(--primary);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tl-details summary::before { content: '▸'; font-size: .65rem; }
.tl-details[open] summary::before { content: '▾'; }
.tl-details ul {
  margin-top: 8px;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tl-details li { font-size: .8rem; color: var(--muted); }
.tl-sec-title { font-size: .82rem; font-weight: 600; color: var(--text); margin: 10px 0 4px; }

.skill-tooltip {
  position: fixed;
  z-index: 9999;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: .8rem;
  max-width: 260px;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.skill-tooltip.visible { opacity: 1; }

.edu-name-row { display: flex; align-items: baseline; gap: 8px; }
.edu-level { color: var(--muted); font-size: 0.88rem; }
.meta { margin: 0 0 6px; color: var(--muted); }

/* ── stack chips ──────────────────────────────────────────────────────────── */
.stack {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  align-items: center;
}

.stack-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  background: white;
  flex-shrink: 0;
  display: inline-flex;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
}

.stack-icon-img { width: 28px; height: 28px; object-fit: cover; display: block; }

.stack-text {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  font-size: 0.8rem;
  padding: 3px 10px;
  color: var(--text);
}

details {
  border-radius: 10px;
  padding: 8px 10px;
}

details summary { cursor: pointer; color: var(--primary); font-weight: 700; }

/* ── project gallery ──────────────────────────────────────────────────────── */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-card {
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.gallery-card:hover { transform: translateY(-2px); box-shadow: 0 4px 24px rgba(0,0,0,0.15); }

/* 이미지 영역 16:9 */
.proj-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--primary-soft);
}
.proj-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.proj-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 800;
  font-size: 1.4rem;
}
.proj-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #f59e0b;
  color: #78350f;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 5px;
  line-height: 1.4;
}

/* 카드 바디 */
.proj-card-body {
  padding: 11px 13px 8px;
  flex: 1;
}
.proj-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}
.proj-card-period {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: -0.02em;
}
.proj-card-domain {
  font-size: 11px;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.proj-card-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 5px;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -0.03em;
}
.proj-card-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  letter-spacing: -0.02em;
}

/* 스택 바 (하단) */
.proj-card-stack {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 13px 10px;
  border-top: 1px solid var(--border);
}
.proj-card-stack-item {
  position: relative;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.proj-card-stack-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}
.proj-card-stack-text {
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  width: auto;
  padding: 0 5px;
  height: 20px;
  font-weight: 500;
}
/* 호버 툴팁 */
.proj-card-stack-item::after {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.72);
  color: #fff;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 20;
}
.proj-card-stack-item:hover::after { opacity: 1; }

/* ── blog ─────────────────────────────────────────────────────────────────── */
.blog-section-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 14px;
}
.blog-section-desc {
  font-size: .88rem;
  color: var(--muted);
  margin: -8px 0 14px;
}
.blog-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}
.blog-card {
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 190px;
  border: 1px solid var(--border);
  background: var(--surface);
  position: relative;
  text-decoration: none;
  color: inherit;
  transition: transform .18s, box-shadow .18s;
}
.blog-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); background: var(--primary); border-color: var(--primary); }
.blog-card:hover .blog-card-title,
.blog-card:hover .blog-card-date,
.blog-card:hover .blog-card-note,
.blog-card:hover .blog-card-link { color: #000; }
[data-mode="light"] .blog-card:hover .blog-card-title,
[data-mode="light"] .blog-card:hover .blog-card-date,
[data-mode="light"] .blog-card:hover .blog-card-note,
[data-mode="light"] .blog-card:hover .blog-card-link { color: #fff; }
.blog-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(5px) brightness(1.1);
  transform: scale(1.1);
  opacity: 0.35;
  transition: filter .18s;
}
.blog-card:hover .blog-card-bg { filter: blur(12px) brightness(1.1); }
.blog-card-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 18px 16px;
}
.blog-card-title {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.45;
  flex: 1;
  margin: 0 0 14px;
}
.blog-card-date {
  font-size: .72rem;
  color: var(--muted);
  margin: 0 0 3px;
}
.blog-card-note {
  font-size: .7rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0 0 12px;
}
.blog-card-link {
  font-size: .72rem;
  color: var(--muted);
  margin-top: auto;
}

.button-link {
  display: inline-block;
  margin-top: 14px;
  text-decoration: none;
  color: #1a1830;
  background: var(--primary);
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(0,0,0,0.15);
}

/* ── education ────────────────────────────────────────────────────────────── */
.edu-grid { max-width: 100%; }

/* ── footer note ──────────────────────────────────────────────────────────── */
.footer-note {
  margin-bottom: 0;
  text-align: left;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

/* ── notion btn ───────────────────────────────────────────────────────────── */
.notion-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  background: var(--surface-hover);
}

.notion-btn:hover { color: var(--text); border-color: rgba(136,128,204,0.5); }

/* ── lightbox ─────────────────────────────────────────────────────────────── */
.lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.88);
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.lb-overlay.open { display: flex; }
.lb-body { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 90vw; }

.lb-img-wrap {
  width: min(1170px, 92vw);
  aspect-ratio: 16 / 9;
  background: #0a091a;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-img-wrap img { width: 100%; height: 100%; object-fit: contain; }
.lb-counter { color: rgba(255,255,255,0.5); font-size: 0.8rem; }

.lb-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.4rem;
  cursor: pointer;
}

.lb-arr {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}

.lb-arr:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ── mode toggle ──────────────────────────────────────────────────────────── */
.mode-toggle {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 50;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  transition: background 0.15s;
  line-height: 1;
  padding: 0;
}

.mode-toggle:hover { background: var(--surface-hover); }

/* ── page hero (blog / miniprojects) ─────────────────────────────────────── */
.page-hero {
  padding: 40px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.page-hero h1 {
  font-family: 'Ria', 'Inter', sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin: 0 0 6px;
}

.page-hero p { color: var(--muted); margin: 0; }

/* ── project detail modal ─────────────────────────────────────────────────── */
.proj-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  align-items: flex-start;
  justify-content: center;
  padding: 0;
  overflow-y: auto;
}

.proj-modal-overlay.open { display: flex; }

.proj-modal {
  position: relative;
  background: var(--bg);
  width: min(900px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 0 80px;
  box-shadow: 0 0 60px rgba(0,0,0,0.3);
}

.proj-modal-close {
  position: sticky;
  top: 16px;
  float: right;
  margin: 16px 16px 0 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  color: var(--text);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.proj-modal-close:hover { background: var(--surface-hover); }

.proj-modal-inner { padding: 0 32px; }

.proj-modal-head {
  padding: 48px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.proj-modal-head h1 {
  font-family: 'Ria', 'Inter', sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin: 0;
  color: var(--text);
  letter-spacing: -0.03em;
}

.proj-modal-head p { color: var(--muted); margin: 0 0 12px; }

/* ── project props ────────────────────────────────────────────────────────── */

/* 비고: 제목 위 */
.proj-note-badge {
  display: inline-block;
  font-size: .78rem;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}
.proj-note-emph {
  background: color-mix(in srgb, #f59e0b 14%, transparent);
  color: #b45309;
}
[data-mode="light"] .proj-note-emph { color: #92400e; }
.proj-note-desc {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

/* 제목 + 키워드 칩 같은 줄 */
.proj-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.proj-title-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.proj-sec { margin-bottom: 16px; letter-spacing: -0.03em; }
.proj-sec-label {
  display: block;
  font-size: .72rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 5px;
}
.proj-sec p { color: var(--text); margin: 0; }

/* 기여내용 행 */
.proj-contrib-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  line-height: 1.7;
}

/* 가로 컬럼 속성 */
.proj-col-props {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin: 4px 0 12px;
  letter-spacing: -0.03em;
}
.proj-col {
  flex: 1;
  min-width: 80px;
  padding-right: 16px;
}
.proj-col:not(:last-child) {
  border-right: 1px solid var(--border);
  margin-right: 16px;
}
.proj-col-label {
  display: block;
  font-size: .72rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.proj-col-val {
  font-size: .88rem;
  color: var(--text);
  line-height: 1.5;
}
.proj-col-val a { color: var(--primary); text-decoration: none; }
.proj-col-val a:hover { text-decoration: underline; }

.proj-prop-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--text);
  font-size: .9rem;
  letter-spacing: -0.03em;
}

/* ── project image slider ─────────────────────────────────────────────────── */
.proj-slider-wrap { position: relative; }
.proj-slider-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  z-index: 2;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.proj-slider-btn:hover { background: rgba(0,0,0,0.7); }
.proj-slider-prev { left: 10px; }
.proj-slider-next { right: 10px; }

.proj-img-slider {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  gap: 10px;
  padding: 28px 32px 20px;
  scrollbar-width: none;
}
.proj-img-slider::-webkit-scrollbar { display: none; }

.proj-img-slide {
  scroll-snap-align: start;
  flex-shrink: 0;
  width: min(85%, 680px);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: opacity .25s ease;
}

.proj-img-slide img {
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: cover;
  display: block;
}

/* ── project TOC ──────────────────────────────────────────────────────────── */
.proj-toc {
  display: inline-flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 28px;
  min-width: 180px;
  max-width: 100%;
}
.proj-toc-title {
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 8px;
}
.proj-toc-item {
  display: block;
  text-decoration: none;
  color: var(--text);
  font-size: .82rem;
  padding: 3px 0 3px 10px;
  border-left: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.proj-toc-item:hover { color: var(--primary); border-left-color: var(--primary); }
.proj-toc-h2 { padding-left: 20px; font-size: .78rem; color: var(--muted); }

/* ── project modal body ───────────────────────────────────────────────────── */
.proj-modal-body { line-height: 1.8; letter-spacing: -0.03em; }

.proj-modal-body p { color: #3a3a3a; margin-bottom: 16px; }
[data-mode="dark"] .proj-modal-body p { color: rgba(236,253,245,0.8); }

.proj-modal-body h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin: 28px 0 10px;
  scroll-margin-top: 80px;
}
.proj-modal-body h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 22px 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 80px;
}
.proj-modal-body h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 16px 0 6px;
}

.proj-modal-body h4 {
  font-size: .92rem;
  font-weight: 600;
  color: var(--primary);
  margin: 16px 0 6px;
}

.proj-modal-body ul,
.proj-modal-body ol { padding-left: 22px; margin-bottom: 14px; }
.proj-modal-body li { color: #3a3a3a; margin-bottom: 4px; }
[data-mode="dark"] .proj-modal-body li { color: rgba(236,253,245,0.8); }

.proj-modal-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.proj-modal-body code {
  font-family: monospace;
  font-size: .84em;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
}

/* notion callout */
.proj-modal-body .notion-callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.proj-modal-body .notion-callout-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  line-height: 1.6;
}
.proj-modal-body .notion-callout-body { flex: 1; line-height: 1.7; color: var(--text); }

/* notion quote */
.proj-modal-body .notion-quote {
  border-left: 3px solid var(--primary);
  padding: 4px 0 4px 16px;
  margin-bottom: 16px;
  color: var(--muted);
  font-style: italic;
}

/* notion code block */
.proj-modal-body .notion-code {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
  overflow-x: auto;
  font-family: monospace;
  font-size: .82rem;
  line-height: 1.6;
}
.proj-modal-body .notion-code[data-lang]:not([data-lang=""])::before {
  content: attr(data-lang);
  display: block;
  font-size: .68rem;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  font-family: inherit;
}

/* notion toggle */
.proj-modal-body .notion-toggle {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.proj-modal-body .notion-toggle summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--text);
  user-select: none;
}
.proj-modal-body .notion-toggle-body {
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* notion table */
.proj-modal-body .notion-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
  font-size: .84rem;
}
.proj-modal-body .notion-table th,
.proj-modal-body .notion-table td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  color: var(--text);
  text-align: left;
  vertical-align: top;
  line-height: 1.6;
}
.proj-modal-body .notion-table th {
  background: var(--surface);
  font-weight: 600;
  color: var(--primary);
}

.proj-modal-body figure.proj-fig {
  margin: 0 0 16px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.proj-modal-body figure.proj-fig img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── password gate ────────────────────────────────────────────────────────── */
.pw-gate {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--bg);
  align-items: center;
  justify-content: center;
}

.pw-gate.hidden { display: none; }

.pw-box { text-align: center; width: min(320px, 90vw); }

.pw-label {
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 0 0 6px;
}

.pw-title {
  font-family: 'Ria', 'Inter', sans-serif;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin: 0 0 16px;
}

.pw-sub { color: var(--muted); font-size: 0.86rem; margin: 0 0 16px; }

.pw-row { display: flex; gap: 8px; justify-content: center; }

.pw-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 1rem;
  width: 160px;
  outline: none;
  text-align: center;
  letter-spacing: 0.2em;
  font-family: inherit;
}

.pw-input:focus { border-color: var(--primary); }

.pw-btn {
  background: var(--primary);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

.pw-btn:hover { opacity: 0.85; }

.pw-err {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 10px;
  min-height: 1.2em;
}

/* ── cursor orb ───────────────────────────────────────────────────────────── */
#cursor-orb {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  width: 19.5px;
  height: 19.5px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.45;
  transform: translate(-50%, -50%);
  will-change: left, top;
}

/* ── responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .core-grid,
  .gallery {
    grid-template-columns: 1fr;
  }

  /* 태블릿: B안 — 80px 기간 컬럼 유지 */
  .exp-row {
    grid-template-columns: 80px 1fr;
    gap: 10px;
  }

  .page-nav-link { font-size: 0.8rem; padding: 5px 9px; }
}

@media (max-width: 600px) {
  /* 모바일: A안 — 단일 컬럼, 기간+소요 인라인 */
  .exp-row {
    grid-template-columns: 1fr;
  }

  .period br { display: none; }
  .period-duration { display: inline; margin-left: 4px; }
}
