:root {
  --text: #1d2327;
  --muted: #6a737b;
  --line: #e3e6e8;
  --accent: #fc9d0d;          /* 주황 (테마색) — 선, 점, 테두리 */
  --link: #a85f00;            /* 같은 주황의 진한 버전 — 글자용 (흰 배경에서 잘 읽히게) */
  --accent-soft: #fff3e0;
  --bg: #ffffff;
  --font: "Outfit", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 18px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.8 var(--font);
  word-break: keep-all;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
b, strong { font-weight: 600; }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 24px; }

/* ===== 상단 ===== */
.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: baseline; gap: 28px; padding-top: 24px; padding-bottom: 18px; }
.brand { font-size: 1.25rem; font-weight: 600; color: var(--text); }
.brand:hover { text-decoration: none; }
.lang {                              /* ENG / KOR 스위치 (i18n.js) */
  align-self: center; margin-top: -10px; flex: none; position: relative; display: inline-flex; padding: 2px;
  border: 0; border-radius: 999px; background: var(--accent-soft); color: var(--link);
  font: 600 .72rem/1 var(--font); letter-spacing: .03em; cursor: pointer;
}
.lang::before {                    /* 움직이는 주황 알약 */
  content: ""; position: absolute; left: 2px; top: 2px; bottom: 2px; width: calc(50% - 2px); border-radius: 999px;
  background: var(--accent); transition: transform .2s ease;
}
.lang[aria-checked="true"]::before { transform: translateX(100%); }
.lang span { position: relative; width: 44px; padding: 7px 0; text-align: center; transition: color .2s; }
.lang[aria-checked="false"] span:first-child, .lang[aria-checked="true"] span:last-child { color: var(--text); }
.lang:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
html.i18n-wait body { visibility: hidden; }   /* 한국어로 열 때 영어가 번쩍이지 않게 */
@media (prefers-reduced-motion: reduce) { .lang::before { transition: none; } }

.menu { margin-left: auto; display: flex; gap: 30px; font-size: 1rem; }
.menu a { color: var(--muted); padding-bottom: 18px; border-bottom: 2px solid transparent; }
.menu a:hover { color: var(--text); text-decoration: none; }
.menu a.active { color: var(--text); border-bottom-color: var(--accent); }

main.wrap { padding-top: 80px; padding-bottom: 40px; }
h1 { font-weight: 600; font-size: 2.7rem; line-height: 1.2; margin: 0 0 12px; }
h2 {
  font-weight: 600; font-size: 1.6rem;
  margin: 80px 0 24px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
p { margin: 0 0 22px; }
ul { margin: 0 0 22px; padding-left: 20px; }
.muted { color: var(--muted); }

/* ===== About: 사진 + 이름 ===== */
.intro { display: grid; grid-template-columns: 200px 1fr; gap: 48px; align-items: center; }
/* 프로필 사진 (누르면 찰칵) */
.photo {
  position: relative; width: 200px; height: 240px; padding: 0; border: 0;
  border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--line); display: block;
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.photo .cam {
  position: absolute; right: 8px; bottom: 8px; font-size: .8rem; color: #fff;
  background: rgba(0, 0, 0, .45); width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; opacity: 0; transition: opacity .15s;
}
.photo:hover .cam, .photo:focus-visible .cam { opacity: 1; }
.photo:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.photo.snap { animation: snap .28s ease-out; }
.photo.snap .flash { animation: flash .35s ease-out; }
@keyframes snap { 0% { transform: scale(1); } 30% { transform: scale(.97); } 100% { transform: scale(1); } }
@keyframes flash { 0% { opacity: 0; } 20% { opacity: .95; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .photo.snap { animation: none; } }

/* 이름 + 도트 캐릭터 */
.name-row { display: flex; align-items: flex-end; gap: 10px; margin: 0 0 12px; }
.name-row h1 { margin: 0; }
.pixel-me {
  position: relative; flex: none; width: 80px; height: 80px; padding: 0; border: 0;
  background: none; cursor: pointer;
}
.pixel-me canvas {
  width: 100%; height: 100%; display: block;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
.pixel-me:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.pixel-me:hover canvas { transform: translateY(-2px); }
.pixel-me.hop canvas { animation: hop .6s steps(4) 2; }
@keyframes hop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.bubble {
  position: absolute; right: 26px; bottom: calc(100% - 4px); z-index: 2;
  background: #fff; color: var(--text); border: 2px solid var(--text); border-radius: 0;
  font: 500 .82rem/1.3 var(--font); white-space: nowrap; padding: 4px 9px;
  box-shadow: 3px 3px 0 var(--text);
  opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; pointer-events: none;
}
.bubble::after {
  content: ""; position: absolute; right: 10px; bottom: -8px;
  width: 8px; height: 8px; background: #fff;
  border-right: 2px solid var(--text); border-bottom: 2px solid var(--text);
  transform: skewX(30deg);
}
.bubble.show { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .pixel-me:hover canvas { transform: none; }
}
.intro .role { color: var(--muted); margin: 0 0 20px; }
.contact { display: flex; flex-wrap: wrap; gap: 10px 24px; font-size: .95rem; }
.contact a { display: inline-flex; align-items: center; gap: 6px; }
.contact i { font-size: .95em; }

.interests { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; padding: 0; }
.interests li { background: var(--accent-soft); color: var(--link); padding: 6px 16px; border-radius: 999px; font-size: .92rem; }
.interests li[data-anim] { cursor: default; transition: background .15s, color .15s, transform .15s; }
.interests li[data-anim]:hover, .interests li[data-anim]:focus-visible {
  background: var(--accent); color: #fff; transform: translateY(-2px); outline: none;
}

/* 관심 분야 이스터 에그 팝업 */
.kw-pop {
  position: absolute; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .09); padding: 10px 10px 8px;
  opacity: 0; visibility: hidden; transform: translateY(4px); pointer-events: none;
  transition: opacity .15s, transform .15s, visibility .15s;
}
.kw-pop.show { opacity: 1; visibility: visible; transform: none; }
.kw-pop canvas { display: block; }
.kw-cap { width: 220px; font-size: .72rem; color: var(--muted); text-align: center; margin-top: 4px; line-height: 1.3; }
.kw-pop::after {
  content: ""; position: absolute; left: var(--ax, 50%); bottom: -6px; width: 10px; height: 10px; background: #fff;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: translateX(-50%) rotate(45deg);
}
.kw-pop.below::after { bottom: auto; top: -6px; transform: translateX(-50%) rotate(225deg); }

.news { list-style: none; padding: 0; }
.news li { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 4px 0; }
.news time { color: var(--muted); font-size: .9rem; padding-top: 1px; }

/* ===== Off the Clock (이스터 에그) ===== */
.crack-zone { margin-top: 140px; text-align: center; }
.crack {
  position: relative; display: inline-block; padding: 10px 18px; border: 0; background: none;
  font: 400 .8rem var(--font); color: #b9bfc4; letter-spacing: .02em; cursor: pointer;
}
.crack:hover { color: var(--muted); }
.crack:focus-visible { outline: 1px dashed var(--line); outline-offset: 2px; }
.crack-text { position: relative; display: inline-block; }
.crack-text .ch { display: inline-block; white-space: pre; transition: transform .7s cubic-bezier(.2, .7, .3, 1), opacity .7s; }
.crack-lines {
  position: absolute; left: 50%; top: 50%; width: 220px; height: 44px; transform: translate(-50%, -50%);
  pointer-events: none; fill: none; stroke: #9aa1a7; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round;
}
.crack-lines path { stroke-dasharray: 200; stroke-dashoffset: 200; transition: stroke-dashoffset .25s ease-out; }
.crack[data-hits="1"] .c1, .crack[data-hits="2"] .c1, .crack[data-hits="2"] .c2,
.crack[data-hits="3"] .c1, .crack[data-hits="3"] .c2, .crack[data-hits="3"] .c3,
.crack[data-hits="4"] path, .crack.broken path { stroke-dashoffset: 0; }
.crack.broken .crack-lines { opacity: 0; transition: opacity .4s .1s; }
.crack.shake { animation: shake .3s; }
@keyframes shake {
  20% { transform: translateX(-3px) rotate(-1deg); } 40% { transform: translateX(3px) rotate(1deg); }
  60% { transform: translateX(-2px); } 80% { transform: translateX(2px); }
}
.otc.reveal { animation: reveal .7s ease-out both; }
@keyframes reveal { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

.hobbies { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 8px; }
.hobby {
  display: block; color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.hobby:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.hobby-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.hobby-icon { width: 40px; height: 40px; object-fit: contain; }
.hobby-icon.round { border-radius: 8px; object-fit: cover; }
.hobby-title { font-weight: 600; line-height: 1.3; }
.hobby-sub { font-size: .82rem; color: var(--muted); line-height: 1.3; }
.hobby-big { font-size: 1.9rem; font-weight: 600; line-height: 1.2; color: var(--link); }
.hobby-label { font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
.hobby-stats { list-style: none; padding: 12px 0 0; margin: 0; border-top: 1px solid var(--line); font-size: .9rem; }
.hobby-stats li { display: flex; justify-content: space-between; padding: 3px 0; }
.hobby-stats span { color: var(--muted); }
.hobby-stats b { font-weight: 600; }

/* 방명록 (giscus) */
.guestbook { margin-top: 48px; }
.guestbook h3 { font-size: 1.2rem; font-weight: 600; margin: 0 0 4px; }
#gb-giscus { margin-top: 16px; }
.gb-empty { color: var(--muted); font-size: .92rem; }

/* ===== Publications ===== */
.legend { font-size: .85rem; color: var(--muted); }
.pub-year { display: grid; grid-template-columns: 90px 1fr; gap: 28px; margin-top: 44px; }
.pub-year > span { font-size: 1.3rem; color: var(--muted); line-height: 1.4; }
.pubs { list-style: none; padding: 0; margin: 0; }
.pub { padding: 0 0 36px; }
.pub .title { font-weight: 600; font-size: 1.1rem; margin-bottom: 4px; }
.pub .title-ko { display: none; font-weight: 600; margin-bottom: 4px; }
html[lang="ko"] .pub .title-ko { display: block; }
.pub .author b { color: var(--link); }
.pub .venue { color: var(--muted); }
.pub .award { font-size: .88rem; color: var(--link); font-weight: 500; }
.tag {
  display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  border: 1px solid var(--accent); color: var(--link);
  border-radius: 4px; padding: 0 6px; margin-right: 6px; vertical-align: 2px;
}
.pub .links { font-size: .88rem; }
.pub .links a + a::before { content: "·"; color: var(--muted); margin: 0 8px; }

/* ===== CV ===== */
.entries { list-style: none; padding: 0; margin: 0; }
.entry { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; }
.entry .what { font-weight: 600; }
.entry .sub { display: block; color: var(--muted); font-size: .92rem; }
.entry time { color: var(--muted); font-size: .9rem; white-space: nowrap; padding-top: 1px; }

/* CV 셀: 항목마다 상자. 사진/링크가 있는 셀(.has-more)은 마우스를 올리면 펼쳐짐 */
.entries:has(.cell) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.entry.cell {
  display: block; position: relative; padding: 16px 20px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.cell-main { display: flex; justify-content: space-between; gap: 20px; }
.cell.has-more { cursor: pointer; }
.cell.has-more::after {            /* 펼칠 게 있다는 작은 표시 */
  content: ""; position: absolute; top: 12px; right: 12px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent); opacity: .55; transition: transform .2s, opacity .2s;
}
.cell.has-more:hover, .cell.has-more:focus-within, .cell.has-more.open {
  border-color: var(--accent); outline: none;
}
.cell.has-more:hover::after, .cell.has-more:focus-within::after, .cell.has-more.open::after { transform: scale(0); opacity: 0; }
.cell-more { max-height: 0; overflow: hidden; opacity: 0; transition: max-height .4s ease, opacity .25s ease, margin-top .3s; }
.cell.has-more:hover .cell-more, .cell.has-more:focus-within .cell-more, .cell.has-more.open .cell-more {
  max-height: 560px; opacity: 1; margin-top: 14px;
}
.cell-media { display: flex; gap: 10px; margin-bottom: 12px; overflow-x: auto; }
.cell-media img { height: 220px; width: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; display: block; }
.cell-media img.wide { aspect-ratio: 4 / 3; }
.cell-links { display: flex; flex-wrap: wrap; gap: 8px; }
.cell-links a {
  font-size: .85rem; font-weight: 500; padding: 4px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--link);
}
.cell-links a:hover { background: var(--accent); color: #fff; text-decoration: none; }

.skills td { padding: 10px 32px 10px 0; vertical-align: top; }
.skills td:first-child { font-weight: 600; white-space: nowrap; }

/* 타임라인 */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 24px; bottom: 24px; width: 1px; background: var(--line); }
.timeline li { position: relative; display: grid; grid-template-columns: 116px 1fr; gap: 16px; padding: 12px 0 12px 34px; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 23px;
  width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent);
}
.timeline li:first-child::before { background: var(--accent); }
.timeline time { color: var(--muted); font-size: .9rem; }

/* ===== 푸터 ===== */
footer { border-top: 1px solid var(--line); margin-top: 110px; }
footer .wrap { padding-top: 26px; padding-bottom: 56px; font-size: .85rem; color: var(--muted); }

/* ===== 모바일 ===== */
@media (max-width: 600px) {
  .top .wrap { flex-wrap: wrap; gap: 4px; padding-bottom: 0; }
  .menu { margin-left: 0; width: 100%; order: 3; }
  .lang { margin: 0 0 0 auto; }
  .hobbies { grid-template-columns: 1fr; }
  .crack-zone { margin-top: 100px; }
  html { font-size: 17px; }
  main.wrap { padding-top: 44px; }
  .intro { grid-template-columns: 1fr; gap: 20px; }
  .photo { width: 140px; height: 168px; }
  .pixel-me { width: 60px; height: 60px; }
  .bubble { right: 18px; }
  h1 { font-size: 1.95rem; }
  .name-row h1 { font-size: min(1.95rem, 8.2vw); white-space: nowrap; }
  h2 { margin-top: 60px; }
  .pub-year { grid-template-columns: 1fr; gap: 4px; }
  .entry { flex-direction: column-reverse; gap: 0; }
  .cell-main { flex-direction: column-reverse; gap: 0; }
  .entry.cell { padding: 14px 16px; }
  .cell-media img { height: 180px; }
  .news li, .timeline li { grid-template-columns: 1fr; gap: 0; }
}

/* 이름에서 "SeongHyun"만 주황색 */
.given { color: var(--accent); }
