/* 조유민 포트폴리오 · 로컬 시안 (2026-10-28 2차)
   정체성: '주요 개발' — 강조는 히어로 아래 주요 개발 한 곳에만 쓴다. */

:root {
  --font: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --maxw: 1040px;
  --measure: 720px;
  --gutter: 24px;
}

/* 포트폴리오: 슬레이트 다크 */
.theme-dark {
  --bg: #1a2027;      /* Slate */
  --panel: #212932;   /* Panel */
  --rule: #2e3843;    /* Rule */
  --text: #e7ecf0;    /* Paper */
  --muted: #9aa6b2;   /* Fog */
  --faint: #8794a0;
  --accent: #7aa7ff;  /* Verified Blue: 신호 단어·강조·링크 */
  --accent-weak: rgba(122, 167, 255, 0.1);
  --accent-line: rgba(122, 167, 255, 0.32);
}

/* 이력서: 종이 */
.theme-light {
  --bg: #ffffff;
  --panel: #f5f7f9;
  --rule: #e3e7eb;
  --text: #1a2027;
  --muted: #56616c;
  --faint: #66717c;
  --accent: #2f63d1;
  --accent-weak: rgba(47, 99, 209, 0.08);
  --accent-line: rgba(47, 99, 209, 0.28);
}

* { box-sizing: border-box; }
html { scroll-padding-top: 72px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 50; background: var(--panel); padding: 6px 12px; }

/* 상단 메뉴 */
.nav { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--rule); }
.nav .container { display: flex; align-items: center; gap: 24px; height: 60px; }
.nav .brand { color: var(--text); font-weight: 700; white-space: nowrap; }
.nav .brand:hover { text-decoration: none; }
.nav nav { min-width: 0; margin-left: auto; }
.nav ul { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.nav ul::-webkit-scrollbar { display: none; }
.nav a.link { color: var(--muted); font-size: 15px; white-space: nowrap; }
.nav a.link:hover { color: var(--text); text-decoration: none; }

/* 섹션 */
.section { padding: 88px 0; border-top: 1px solid var(--rule); }
.section > .container > h2 { font-size: 26px; line-height: 1.35; font-weight: 700; margin-bottom: 36px; }

/* 히어로 */
.hero { padding: 96px 0 0; }
.hero h1 { font-size: clamp(30px, 4.2vw, 44px); line-height: 1.32; font-weight: 700; letter-spacing: -0.02em; max-width: 880px; }
.hero .lead { color: var(--muted); max-width: var(--measure); margin-top: 22px; font-size: 17px; }
.links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; font-size: 15px; }

/* 주요 개발 — 페이지의 유일한 강조 */
.ledger { margin: 64px 0 96px; }
.ledger h2 { font-size: 15px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
.ledger ol { border-top: 1px solid var(--accent-line); }
.ledger li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 14px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.ledger .what { display: grid; gap: 2px; }
.ledger .what strong { font-size: clamp(17px, 2vw, 20px); line-height: 1.5; font-weight: 600; }
.ledger .how { color: var(--muted); font-size: 15px; line-height: 1.6; }
.ledger .where { font-size: 14px; white-space: nowrap; }
.ledger li:hover .mark, .ledger li:focus-within .mark { box-shadow: 0 0 0 4px var(--bg), 0 0 0 8px var(--accent-line); }
.ledger li:hover .where, .ledger li:focus-within .where { transform: translateX(3px); }

/* 경력 */
.career-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 24px; }
.career-head h3 { font-size: 22px; font-weight: 700; }
.career-head .tenure { font-size: 15px; color: var(--text); }
.career-head .tenure span { color: var(--muted); }
.career .role { color: var(--muted); font-size: 15px; margin-top: 2px; }
.career .sum { margin-top: 14px; max-width: var(--measure); }
.timeline { margin-top: 28px; border-top: 1px solid var(--rule); }
.timeline li { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.t-when { color: var(--faint); font-size: 14px; }
.t-what a { color: var(--text); font-weight: 600; }
.t-what a:hover { color: var(--accent); }
.t-role { color: var(--muted); font-size: 14px; }

/* 사례 — 면(panel)을 쓰는 유일한 블록 */
.cases { display: grid; gap: 20px; }
.case { position: relative; background: var(--panel); border-radius: 10px; padding: 30px 32px; }
.case-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 20px; }
.case-head h3 { font-size: 21px; line-height: 1.4; font-weight: 700; }
.case-meta { color: var(--muted); font-size: 14px; white-space: nowrap; }
.case-meta .sep { display: inline-block; width: 1px; height: 11px; background: var(--rule); margin: 0 10px; vertical-align: -1px; }
.case .context { color: var(--muted); margin-top: 4px; font-size: 15px; }
.facets { display: grid; grid-template-columns: 1fr 1.35fr 1fr; gap: 28px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--rule); }
.facet h4 { font-size: 13px; font-weight: 600; color: var(--faint); margin-bottom: 6px; }
.facet p { font-size: 15px; line-height: 1.7; color: var(--muted); }
.facet.key h4 { color: var(--accent); }
.facet.key p { color: var(--text); }
.tags { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 22px; font-size: 13px; color: var(--faint); }
.case details { margin-top: 20px; }
.case summary { cursor: pointer; color: var(--accent); font-size: 15px; font-weight: 500; list-style: none; display: inline-flex; align-items: center; gap: 8px; }
.case summary::-webkit-details-marker { display: none; }
.case summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.case details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.more { margin-top: 18px; display: grid; gap: 18px; max-width: 820px; font-size: 15px; }
.more h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.more p, .more li { color: var(--muted); }
.more ul { display: grid; gap: 6px; }
.more li { padding-left: 14px; position: relative; }
.more li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 5px; height: 1px; background: var(--faint); }
.more li b { color: var(--text); font-weight: 600; }

/* 흐름도 */
.flow { display: grid; gap: 10px; margin-top: 4px; }
.flow ol { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.flow li { font-size: 14px; color: var(--text); border: 1px solid var(--rule); border-radius: 6px; padding: 6px 12px; background: var(--bg); }
.flow li.arrow { border: 0; background: none; padding: 0 2px; color: var(--faint); }
.flow li.end { border-color: var(--accent-line); color: var(--accent); }
.flow .lane { font-size: 13px; color: var(--faint); margin-bottom: 4px; }
.flow .note { font-size: 13px; color: var(--faint); }

/* 기술 */
.skills { border-top: 1px solid var(--rule); }
.skill { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.skill h3 { font-size: 15px; font-weight: 600; padding-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; padding: 3px 11px 3px 4px; border-radius: 999px; border: 1px solid var(--rule); }
.chip i { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #f4f6f9; font-size: 13px; line-height: 1; }
.chip i img { display: block; width: 14px; height: 14px; }
.chip i.ico-generic { background: transparent; border: 1px solid var(--rule); }
.chip i.ico-generic::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.skill .used { grid-column: 2; color: var(--muted); font-size: 14px; margin-top: -6px; }

/* 그 밖의 경험 */
.others { border-top: 1px solid var(--rule); }
.other { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.other h3 { font-size: 15px; font-weight: 600; }
.other p { color: var(--muted); font-size: 15px; }

/* 연락 */
.contact p { max-width: var(--measure); color: var(--muted); }
.contact .links { font-size: 17px; margin-top: 16px; }
.footer { padding: 32px 0 48px; color: var(--faint); font-size: 13px; border-top: 1px solid var(--rule); }
.footer .container { display: flex; flex-wrap: wrap; gap: 4px 24px; }

/* 이력서 페이지 */
.resume { max-width: 880px; margin: 0 auto; padding: 64px var(--gutter) 96px; }
.resume-top { display: flex; justify-content: flex-end; gap: 20px; font-size: 14px; margin-bottom: 40px; }
.resume-top button { font: inherit; font-size: 14px; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
.resume-top button:hover { text-decoration: underline; text-underline-offset: 3px; }
.resume h1 { font-size: clamp(40px, 7vw, 58px); line-height: 1.1; font-weight: 700; letter-spacing: -0.03em; }
.dot { color: var(--accent); }
.resume .intro { font-size: 19px; line-height: 1.6; margin-top: 20px; max-width: var(--measure); }
.resume .links { color: var(--muted); }
.r-section { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; padding: 40px 0; border-top: 1px solid var(--rule); }
.r-section:first-of-type { margin-top: 48px; }
.r-section > h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; }
.r-body p + p { margin-top: 8px; }
.r-body ul.dash li { position: relative; padding-left: 14px; }
.r-body ul.dash li + li { margin-top: 6px; }
.r-body ul.dash li::before { content: ""; position: absolute; left: 0; top: 0.85em; width: 6px; height: 1px; background: var(--faint); }
.r-item + .r-item { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--rule); }
.r-item h3 { font-size: 18px; font-weight: 700; line-height: 1.4; }
.r-item .when { color: var(--faint); font-size: 14px; margin: 2px 0 10px; }
.r-item .stack { color: var(--muted); font-size: 14px; margin-top: 10px; }
.r-body strong { font-weight: 600; }

/* 반응형 */
@media (max-width: 860px) {
  .facets { grid-template-columns: 1fr; gap: 16px; }
  .timeline li { grid-template-columns: 1fr auto; gap: 2px 12px; }
  .t-when { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .nav .container { gap: 16px; }
  .nav ul { gap: 12px; }
  .hero { padding-top: 56px; }
  .ledger { margin: 44px 0 64px; }
  .ledger li { grid-template-columns: 24px minmax(0, 1fr); }
  .ledger .where { grid-column: 2; white-space: normal; }
  .section { padding: 60px 0; }
  .section > .container > h2 { font-size: 23px; margin-bottom: 24px; }
  .case { padding: 22px 20px; }
  .skill, .other { grid-template-columns: 1fr; gap: 8px; }
  .skill .used { grid-column: 1; margin-top: 0; }
  .resume { padding-top: 40px; }
  .r-section { grid-template-columns: 1fr; gap: 12px; padding: 32px 0; }
}
@media (max-width: 374px) {
  .nav .container { gap: 12px; }
  .nav ul { gap: 10px; }
  .nav a.link { font-size: 14px; }
}

/* 인쇄 (이력서 PDF 저장용) */
@media print {
  @page { size: A4; margin: 16mm 14mm; }
  .no-print { display: none !important; }
  body { font-size: 10.5pt; line-height: 1.55; background: #fff; color: #111; }
  a { color: #111; }
  .resume { padding: 0; max-width: none; }
  .resume h1 { font-size: 30pt; }
  .resume .intro { font-size: 12pt; }
  .r-section { grid-template-columns: 110px minmax(0, 1fr); padding: 14pt 0; break-inside: avoid-page; }
  .r-section > h2 { font-size: 14pt; }
  .r-item { break-inside: avoid; }
  .r-item + .r-item { margin-top: 12pt; padding-top: 12pt; }
}

/* ───────── 모션 (2026-10-28) ─────────
   한 번의 연출(첫 화면 파이프라인)과 사용자 조작에 반응하는 움직임만 쓴다.
   .motion 클래스는 동작 줄이기 설정이 꺼져 있을 때만 붙는다. JS가 없으면 모든 내용이 그대로 보인다. */

/* 주요 개발: 파이프라인 노드 */
.ledger ol { position: relative; }
.ledger ol::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 30px; width: 2px; background: var(--accent-line); transform-origin: top; }
.ledger li { align-items: start; position: relative; }
.ledger .mark { display: block; width: 12px; height: 12px; margin: 9px 0 0 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--bg); position: relative; z-index: 1; }

/* 메뉴 현재 위치 */
.nav a.link.is-active { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }

/* 사례 도착 표시: 링크로 이동해 온 카드의 테두리에 신호가 한 번 돈다 */
@property --sweep { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.case::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none; opacity: 0;
  background: conic-gradient(var(--accent) var(--sweep), transparent 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }

/* 경력 타임라인: 첫 경력(아래)에서 현재(위)로 이어지는 선 */
.timeline { position: relative; padding-left: 20px; }
.timeline::before, .timeline::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--rule); }
.timeline::after { background: var(--accent); transform-origin: bottom; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -24px; top: 23px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--bg); }
.timeline li.now::after { content: ""; position: absolute; left: -27px; top: 20px; width: 16px; height: 16px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; }

/* 첫 화면: 사진과 신호 단어. 이름 옆 체크 표시는 장식(aria-hidden)이다. */
.hero-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 56px; align-items: center; }
.portrait { position: relative; margin: 0; width: 212px; height: 262px; padding: 6px; }
.portrait img { display: block; width: 200px; height: 250px; object-fit: cover; border-radius: 12px; }
.portrait .frame { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.portrait .frame rect { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.hero .nowrap { white-space: nowrap; }
.hero .kw { position: relative; color: var(--accent); }
.hero .kw::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0.02em; height: 2px; background: var(--accent); clip-path: inset(0 100% 0 0); }
.hero .tick { display: inline-block; width: 0.5em; height: 0.5em; margin: 0 0.06em 0 0.08em; vertical-align: 0.6em; overflow: visible; }
.hero .tick circle { fill: var(--accent); }
.hero .tick path { fill: none; stroke: var(--bg); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 860px) {
  .timeline li::before { top: 21px; }
  .timeline li.now::after { top: 18px; }
  .hero-top { gap: 32px; }
  .portrait { width: 164px; height: 202px; padding: 5px; }
  .portrait img { width: 154px; height: 192px; border-radius: 10px; }
  .portrait .frame rect { stroke-width: 1.9; }
}
@media (max-width: 640px) {
  .hero-top { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .portrait { order: -1; width: 124px; height: 152px; padding: 4px; }
  .portrait img { width: 116px; height: 144px; border-radius: 9px; }
  .portrait .frame rect { stroke-width: 2.5; }
}

/* 페이지 전환 */
@view-transition { navigation: auto; }
.nav .brand, .resume h1 { view-transition-name: who; }

@media (prefers-reduced-motion: no-preference) {
  .motion .hero h1 { animation: mo-reveal 900ms cubic-bezier(.2, .7, .2, 1) both; }
  .motion .hero .lead, .motion .hero .links { animation: mo-fade 700ms ease-out 300ms both; }
  /* 설계·연동·배포·검증·이름 순서의 신호. 이름의 체크 표시와 사진 테두리 완성은 같은 순간(2220ms)이다.
     체크 자리는 처음에 비어 있지 않고, 체크가 나타날 때 너비가 생기며 '입니다.'가 밀려난다. */
  .motion .hero .kw { animation: mo-kw 500ms ease-out var(--d, 0ms) both; }
  .motion .hero .kw::after { animation: mo-sweep 600ms cubic-bezier(.4, 0, .2, 1) var(--d, 0ms) both; }
  .motion .hero .tick { transform-origin: 50% 50%; animation: mo-tick-space 320ms cubic-bezier(.2, .7, .2, 1) 2220ms both, mo-pop 450ms cubic-bezier(.3, 1.6, .5, 1) 2220ms both; }
  .motion .portrait img { animation: mo-fade 700ms ease-out 200ms both; }
  .motion .portrait .frame rect { stroke-dasharray: 100; animation: mo-frame 1770ms cubic-bezier(.45, 0, .25, 1) 450ms both; }
  .motion .ledger ol::before { animation: mo-draw 1300ms cubic-bezier(.4, 0, .2, 1) 2270ms both; }
  .motion .ledger .mark { animation: mo-lit 600ms ease-out calc(2320ms + var(--i, 0) * 330ms) backwards; }

  /* 경력: 칸이 보이면 아래(첫 업무)에서 위(현재)로 한 번 그린다. is-armed·is-drawn은 motion.js가 붙인다. */
  .motion .timeline.is-armed::after { transform: scaleY(0); }
  .motion .timeline.is-armed li::before { background: var(--rule); }
  .motion .timeline.is-drawn::after { animation: mo-draw 1500ms cubic-bezier(.45, 0, .25, 1) 100ms both; }
  .motion .timeline.is-drawn li::before { animation: mo-node 400ms ease-out calc(150ms + var(--r, 0) * 270ms) both; }
  .motion .timeline.is-drawn li.now::after { animation: mo-ring 1400ms ease-out 1650ms 2 forwards; }

  :root { interpolate-size: allow-keywords; }
  .case details::details-content { block-size: 0; overflow: clip; transition: block-size 380ms cubic-bezier(.2, .7, .2, 1), content-visibility 380ms allow-discrete; }
  .case details[open]::details-content { block-size: auto; }
  .case details[open] .flow li:not(.arrow) { animation: mo-step 700ms ease-out calc(250ms + var(--i, 0) * 240ms) both; }
  .chip i { transition: transform 200ms ease-out; }
  .chip:hover i { transform: rotate(-8deg) scale(1.08); }

  /* 사례 도착 표시와 작은 반응: 화살표 회전, 메뉴 현재 위치 전환, 주요 개발 줄 호버 */
  .motion .case:target::after { animation: mo-arrive 1500ms cubic-bezier(.45, 0, .25, 1) 450ms both; }
  .case summary::after { transition: transform 380ms cubic-bezier(.2, .7, .2, 1); }
  .nav a.link { transition: color 200ms ease-out, box-shadow 250ms ease-out; }
  .ledger .mark { transition: box-shadow 250ms ease-out; }
  .ledger .where { transition: transform 250ms ease-out; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
@keyframes mo-reveal { from { clip-path: inset(0 0 100% 0); transform: translateY(16px); } to { clip-path: inset(0 0 0 0); transform: none; } }
@keyframes mo-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes mo-draw { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes mo-lit { 0% { background: var(--rule); box-shadow: 0 0 0 4px var(--bg); } 60% { background: var(--accent); box-shadow: 0 0 0 4px var(--bg), 0 0 0 9px var(--accent-weak); } 100% { background: var(--accent); box-shadow: 0 0 0 4px var(--bg); } }
@keyframes mo-kw { from { color: var(--text); } to { color: var(--accent); } }
@keyframes mo-sweep { 0% { clip-path: inset(0 100% 0 0); } 50% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 0 100%); } }
@keyframes mo-tick-space { from { width: 0; margin-left: 0; margin-right: 0; } }
@keyframes mo-pop { 0% { transform: scale(0); } 70% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes mo-frame { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes mo-node { 0% { background: var(--rule); } 60% { background: var(--accent); box-shadow: 0 0 0 3px var(--bg), 0 0 0 7px var(--accent-weak); } 100% { background: var(--accent); box-shadow: 0 0 0 3px var(--bg); } }
@keyframes mo-arrive { 0% { --sweep: 0deg; opacity: 1; } 65% { --sweep: 360deg; opacity: 1; } 100% { --sweep: 360deg; opacity: 0; } }
@keyframes mo-ring { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.9); } }
@keyframes mo-step { 0% { border-color: var(--rule); } 45% { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-weak); } 100% { box-shadow: 0 0 0 0 transparent; } }
