:root {
  --paper: #fff;
  --tile: #f7f7f9;
  --ink: #000;
  --text: #707070;
  --quiet: #8a8a8a;
  --line: rgb(0 0 0 / .1);
  --blue: #0a84ff;
  --cell: 328px;
  --gap: 16px;
  --bounce: cubic-bezier(.34, 1.56, .64, 1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 40px 16px 120px;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 "Wanted Sans Variable", "Wanted Sans", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.nav {
  position: sticky; top: 40px; z-index: 10;
  display: flex; width: max-content; margin: 0 auto 64px; padding: 4px;
  background: rgb(255 255 255 / .8);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 56px;
  box-shadow: 0 10px 10px -5px var(--line);
}
.nav a {
  display: grid; place-items: center; width: 96px; height: 44px;
  border-radius: 44px; color: #767676; font-weight: 500; text-decoration: none;
  transition: color .2s;
}
.nav a:hover { color: var(--ink); }

/* 메뉴를 누르면 그 메뉴와 해당 카드를 강조한다. 아무것도 누르지 않았으면 홈,
   다른 페이지(프로젝트·수상)에서는 aria-current가 표시를 맡는다 */
body:not(:has(.card:target)) .nav a[href="#intro"],
body:has(#intro:target) .nav a[href="#intro"],
body:has(#contact:target) .nav a[href="#contact"],
.nav a[aria-current] { background: #f2f2f2; color: var(--ink); }
.card:target { box-shadow: 0 0 0 2px var(--ink); animation: spotlight 1.8s ease-out; }
@keyframes spotlight { from { box-shadow: 0 0 0 2px var(--ink), 0 0 0 14px rgb(0 0 0 / .12); } }
@media (prefers-reduced-motion: reduce) { .card:target { animation: none; } }

.grid {
  display: grid; justify-content: center; gap: var(--gap);
  grid-template-columns: repeat(4, var(--cell));
  grid-auto-rows: var(--cell);
  grid-auto-flow: dense;
}
.card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 24px; border-radius: 32px; background: var(--tile);
  scroll-margin-top: 120px;
}
.wide { grid-column: span 2; }
.tall { grid-row: span 2; }
.card > h2 { margin-bottom: 16px; font-size: 14px; font-weight: 600; color: var(--text); }

/* 소개 */
.intro { padding: 32px; }
.intro h1 {
  margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line);
  font-size: 28px; font-weight: 600; line-height: 1.25; letter-spacing: -.02em; color: var(--quiet);
}
.intro h1 b { font-weight: inherit; color: var(--ink); }
.intro p { font-size: 17px; line-height: 1.55; color: var(--text); }
.intro h2 { margin-top: auto; padding-top: 16px; }

/* 홈의 프로젝트 목록: 쌓인 줄을 누르면 프로젝트 페이지로 들어간다 */
.projects { padding: 32px; }
.stacklist { flex: 1; min-height: 0; display: grid; grid-auto-rows: minmax(96px, 1fr); gap: 10px; }
.stacklist > li { display: grid; }
.prow {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1fr auto 160px; align-items: center; gap: 16px;
  padding: 18px; border-radius: 20px; background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
  text-decoration: none;
  transition: box-shadow .2s;
}
.prow:not(:has(.thumb)) { grid-template-columns: 1fr auto; }
.prow:hover { box-shadow: inset 0 0 0 1px rgb(0 0 0 / .25), 0 12px 24px -14px rgb(0 0 0 / .4); }
.prow b { font-size: 19px; font-weight: 600; }
.prow .sub { margin: 2px 0 10px; font-size: 14px; line-height: 1.45; color: var(--text); }
.prow .sub:last-child { margin-bottom: 0; }
.prow .tags li { padding: 4px 10px; font-size: 12px; }
.arrow {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background .2s, color .2s;
}
.arrow svg { width: 14px; height: 14px; }
.prow:hover .arrow { background: var(--ink); color: #fff; }
.thumb { align-self: stretch; overflow: hidden; border-radius: 14px; background: #eceef1; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb.lumo { background: radial-gradient(circle at 50% 38%, #fdfde2 0 13%, #e2edd2 14% 25%, #454b53 26%, #2b3036); }
.cta {
  display: grid; place-items: center; margin-top: 12px; height: 52px; border-radius: 52px;
  background: var(--ink); color: #fff; font-weight: 600; text-decoration: none;
  transition: opacity .2s;
}
.cta:hover { opacity: .82; }

/* 카드 오른쪽 위에서 해당 페이지로 보내는 버튼 */
.more {
  position: absolute; top: 24px; right: 24px;
  display: grid; place-items: center; height: 36px; padding: 0 16px;
  border-radius: 36px; background: #fff; box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background .2s, color .2s;
}
.more:hover { background: var(--ink); color: #fff; }

/* 프로젝트 카드 */
.project { padding: 32px; text-decoration: none; }
.project h3 { margin-bottom: 8px; padding-right: 56px; font-size: 28px; font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
.project .desc { max-width: 34em; margin-bottom: 16px; font-size: 17px; line-height: 1.55; color: var(--text); }
.go {
  position: absolute; top: 24px; right: 24px;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: #fff; box-shadow: inset 0 0 0 1px var(--line);
  transition: background .2s, color .2s;
}
.go svg { width: 16px; height: 16px; }
.project:hover .go { background: var(--ink); color: #fff; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 5px 12px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 500; }

/* Lumo: 마우스를 올리면 램프에 불이 켜진다 */
.stage { position: relative; flex: 1; min-height: 300px; margin: 8px -32px -32px; }
.lamp { position: absolute; right: 48px; bottom: 0; height: 100%; overflow: visible; }
.lamp .frame { fill: #3c424a; stroke: #2b3036; stroke-width: 1.5; stroke-linejoin: round; }
.lamp .joint { fill: #8a929c; stroke: #3c424a; stroke-width: 1; }
.lamp .wire  { fill: none; stroke: #3c424a; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.lamp .pin   { fill: #fff; stroke: #3c424a; stroke-width: 1.5; }
.lamp .light, .lamp .glow { opacity: 0; transition: opacity .5s ease; }
.project:hover .lamp .light, .project:focus-visible .lamp .light,
.project:hover .lamp .glow, .project:focus-visible .lamp .glow { opacity: 1; }

/* Auto Plot Agent: 마우스를 올리면 화면이 올라온다 */
.screen {
  flex-shrink: 0; margin: auto 0 -32px; overflow: hidden;
  border-radius: 16px 16px 0 0; background: #fff;
  box-shadow: 0 0 0 1px var(--line), 0 20px 40px -16px rgb(0 0 0 / .25);
  transform: translateY(48px);
  transition: transform .5s var(--bounce);
}
.screen img { display: block; width: 100%; height: auto; }
.project:hover .screen { transform: none; }

/* 수상 목록 */
.rows { display: grid; gap: 14px; max-width: 58%; }
.rows li { display: grid; justify-items: start; }
.rows b { font-weight: 600; }
.rows span { font-size: 14px; color: var(--text); }

/* 수상 페이지의 카드 */
.awardcard { padding: 32px; }
.awardcard h3 { margin-bottom: 14px; font-size: 26px; font-weight: 600; line-height: 1.3; letter-spacing: -.02em; }
.awardcard.big h3 { font-size: 32px; }
.prize {
  display: inline-grid; place-items: center; align-self: start; height: 32px; padding: 0 14px;
  border-radius: 32px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600;
}
.facts { display: grid; gap: 10px; margin-top: 20px; max-width: 30em; }
.facts > div { display: grid; grid-template-columns: 64px 1fr; gap: 12px; font-size: 14px; line-height: 1.5; }
.facts dt { color: var(--quiet); }
.facts dd { margin: 0; color: var(--text); }

/* 상장: 기울어져 있다가 마우스를 올리면 바로 선다 */
.paper {
  position: absolute; right: 36px; top: 72px;
  width: 188px; height: 236px; padding: 22px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: #fff; border-radius: 4px;
  outline: 1px solid #e3d5a8; outline-offset: -8px;
  box-shadow: 0 23px 48px -12px rgb(0 0 0 / .24);
  transform: translateY(48px) rotate(8deg);
  transition: transform .5s var(--bounce);
}
.paper strong {
  margin-bottom: 8px; color: #2b2b2b;
  font: 700 24px/1 AppleMyungjo, Batang, "Nanum Myeongjo", serif;
  letter-spacing: .4em; text-indent: .4em;
}
.paper span { width: 100%; height: 6px; border-radius: 3px; background: #ececec; }
.paper span:last-of-type { width: 60%; }
.paper i { width: 48px; height: 48px; margin-top: auto; border-radius: 50%; background: #d9a441; box-shadow: inset 0 0 0 4px #f2c96b; }
.awards:hover .paper, .awards:focus-within .paper { transform: none; }
.awardcard .paper { top: auto; bottom: -84px; right: 44px; }
.awardcard:hover .paper, .awardcard:focus-within .paper { transform: none; }

/* 자격증: 지갑 속 카드처럼 겹쳐 있다가 펼쳐진다 */
.wallet { --open: 176px; position: relative; flex: 1; min-height: 172px; }
.wallet:has(> :nth-child(4)) { --open: 128px; }
.pass {
  --i: 0;
  position: absolute; left: 0; right: 0; bottom: 0; height: 172px;
  display: grid; grid-template-rows: auto auto 1fr; justify-items: start;
  padding: 16px 18px; border-radius: 16px; color: #fff; background: #1c1c1e;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .15), 0 10px 24px -8px rgb(0 0 0 / .3);
  transform: translateY(calc(var(--i) * -64px));
  transition: transform .5s var(--bounce);
}
.pass:nth-last-child(2) { --i: 1; background: #6366f1; }
.pass:nth-last-child(3) { --i: 2; background: #ff5a5f; }
.pass:nth-last-child(4) { --i: 3; background: #0f9d76; }
.pass b { font-size: 17px; font-weight: 600; }
.pass span { font-size: 14px; opacity: .85; }
.pass time { align-self: end; font-size: 13px; opacity: .75; font-variant-numeric: tabular-nums; }
.certs:hover .pass, .certs:focus-within .pass { transform: translateY(calc(var(--i) * -1 * var(--open))); }

/* 학력과 교육: 넓은 카드에 두 칸으로 나눠 담고, 넘치면 카드 안에서 스크롤한다 */
.timeline {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 12px 28px;
  scrollbar-width: thin; scrollbar-color: rgb(0 0 0 / .25) transparent;
}
.timeline li { display: grid; justify-items: start; align-content: start; }
.timeline div { display: grid; justify-items: start; }
.timeline time { font-size: 13px; color: var(--quiet); font-variant-numeric: tabular-nums; }
.timeline b { font-size: 15px; font-weight: 600; line-height: 1.35; }
.timeline span { font-size: 13px; line-height: 1.4; color: var(--text); }

/* 연락: 마우스를 올리면 답장이 올라온다 */
.bubble { max-width: 88%; padding: 10px 14px; border-radius: 18px; background: #e9e9eb; font-size: 15px; line-height: 1.4; }
.bubble.me {
  align-self: flex-end; margin-top: 8px; background: var(--blue); color: #fff;
  opacity: 0; transform: translateY(8px);
  transition: opacity .25s, transform .4s var(--bounce);
}
.contact:hover .me, .contact:focus-within .me { opacity: 1; transform: none; }
.actions { display: flex; gap: 8px; margin-top: auto; }
.actions a {
  flex: 1; display: grid; place-items: center; height: 44px; border-radius: 44px;
  background: #fff; box-shadow: inset 0 0 0 1px var(--line);
  font-size: 15px; font-weight: 600; text-decoration: none;
}
.actions a:hover { box-shadow: inset 0 0 0 1px rgb(0 0 0 / .3); }

/* 터치 화면에는 hover가 없으니 켜지고 펼쳐진 상태로 보여준다 */
@media (hover: none) {
  .lamp .light, .lamp .glow { opacity: 1; }
  .project .screen { transform: none; }
  .certs .pass { transform: translateY(calc(var(--i) * -1 * var(--open))); }
  .contact .me { opacity: 1; transform: none; }
}
@media (max-width: 1420px) {
  .grid { grid-template-columns: repeat(2, var(--cell)); }
}
@media (max-width: 720px) {
  body { padding-top: 24px; }
  .grid { grid-template-columns: minmax(0, 400px); grid-auto-rows: auto; }
  .wide, .tall { grid-column: auto; grid-row: auto; }
  .card { min-height: var(--cell); }
  .intro h1 { font-size: 24px; }
  .intro p { font-size: 16px; }
  .projects { padding: 24px; }
  .prow { grid-template-columns: 1fr auto; padding: 16px; }
  .thumb { display: none; }
  .more { top: 16px; right: 16px; height: 32px; padding: 0 12px; }
  .project { padding: 24px; }
  .project h3 { font-size: 24px; }
  .go { top: 16px; right: 16px; }
  .stage { min-height: 280px; margin: 8px -24px -24px; }
  .lamp { right: 24px; }
  .screen { margin-bottom: -24px; }
  .awardcard { padding: 24px; }
  .awardcard h3, .awardcard.big h3 { font-size: 22px; }
  .facts > div { grid-template-columns: 56px 1fr; gap: 10px; }
  .rows { max-width: none; }
  .paper { display: none; }
  .timeline { grid-template-columns: 1fr; gap: 14px; }
  .nav { position: fixed; top: auto; bottom: 16px; left: 50%; margin: 0; transform: translateX(-50%); }
  .nav a { width: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  html { scroll-behavior: auto; }
}
