:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-soft: #edf1f8;
  --ink: #111827;
  --muted: #5f6b7a;
  --faint: #526071;
  --line: rgba(17, 24, 39, 0.12);
  --line-strong: rgba(17, 24, 39, 0.22);
  --accent: #2457ff;
  --accent-strong: #1538bd;
  --accent-soft: #dfe7ff;
  --signal: #a8f0cc;
  --signal-ink: #07583c;
  /* 작업 단계 색: 설계 → 구현 → 배포 순으로 옮겨 간다. */
  --step-1: #2457ff;
  --step-2: #6d28d9;
  --step-3: #0b7a5e;
  /* 강조색 위에 올리는 글자색. 다크에서는 강조색이 밝아지므로 뒤집는다. */
  --on-accent: #ffffff;
  --warning: #fff0bf;
  --warning-ink: #704b00;
  --shadow: 0 24px 70px rgba(30, 42, 70, 0.1);
  --sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', sans-serif;
  --mono: 'Cascadia Code', 'SFMono-Regular', Consolas, monospace;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0b1020;
  --surface: rgba(20, 29, 52, 0.82);
  --surface-solid: #141d34;
  --surface-soft: #19243f;
  --ink: #f5f7ff;
  --muted: #b4bed0;
  --faint: #7f8ba3;
  --line: rgba(226, 232, 255, 0.13);
  --line-strong: rgba(226, 232, 255, 0.25);
  --accent: #7d9cff;
  --accent-strong: #b4c4ff;
  --accent-soft: #25365f;
  --signal: #2e7058;
  --signal-ink: #c4f9e4;
  --warning: #4c3b12;
  --warning-ink: #ffdf84;
  --step-1: #7d9cff;
  --step-2: #b79cff;
  --step-3: #5fd7ab;
  --on-accent: #0b1020;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 32px;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 8% 5%, color-mix(in srgb, var(--accent) 12%, transparent) 0, transparent 30rem),
    radial-gradient(circle at 95% 48%, color-mix(in srgb, var(--signal) 18%, transparent) 0, transparent 32rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  word-break: keep-all;
  overflow-wrap: anywhere;
  transition: background-color 220ms ease, color 220ms ease;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: '';
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.22;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
  pointer-events: none;
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

a:hover { text-decoration-color: transparent; }

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

p { margin: 0; }

.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.spacer { flex-grow: 1; }

.skip-link {
  position: fixed;
  left: 20px;
  top: -80px;
  z-index: 100;
  padding: 12px 16px;
  border-radius: 0 0 10px 10px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
}

.skip-link:focus { top: 0; }

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  height: 3px;
  background: transparent;
}

.scroll-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #7c3aed, var(--signal));
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

@keyframes scroll-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@supports (animation-timeline: scroll()) {
  .scroll-progress span {
    animation: scroll-progress linear both;
    animation-timeline: scroll(root block);
  }
}

.draft-banner {
  margin: 0;
  padding: 10px 20px;
  background: var(--warning);
  border-bottom: 1px solid color-mix(in srgb, var(--warning-ink) 35%, transparent);
  color: var(--warning-ink);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.todo {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--warning);
  color: var(--warning-ink);
}

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 356px) minmax(0, 1fr) minmax(164px, 192px);
  gap: clamp(24px, 3vw, 48px);
  max-width: 1540px;
  margin: 0 auto;
  padding: 40px 48px 80px;
}

.side-column {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-self: stretch;
}

.side {
  --pointer-x: 50%;
  --pointer-y: 18%;
  position: static;
  display: flex;
  flex-direction: column;
  align-self: start;
  min-width: 0;
  gap: 26px;
  padding: 30px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  isolation: isolate;
}

.side::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(260px circle at var(--pointer-x) var(--pointer-y), color-mix(in srgb, var(--accent) 13%, transparent), transparent 72%);
  content: '';
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.side.is-pointer-active::before { opacity: 1; }
.side > * { position: relative; z-index: 1; }

.build-reel {
  display: flex;
  min-height: 0;
  margin-top: 42px;
  padding: 0 6px;
  flex: 1;
  flex-direction: column;
}

.build-reel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
  color: var(--accent-strong);
}

.build-reel h2 {
  max-width: 310px;
  margin: 18px 0 0;
  font-size: clamp(23px, 2.5vw, 30px);
  font-weight: 680;
  letter-spacing: -0.045em;
  line-height: 1.28;
}

.build-reel-intro {
  max-width: 290px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.build-stack {
  display: flex;
  min-height: calc(100% - 150px);
  padding-top: 28px;
  padding-bottom: 40px;
  flex: 1;
  flex-direction: column;
  /* 카드 사이는 margin이 아니라 gap으로 벌린다. margin은 sticky가 멈추는 자리를 함께
     끌어올려, 맨 아래에서 가운데 카드 여럿이 같은 높이에 겹쳐 섰다. */
  gap: clamp(300px, 52vh, 520px);
}

.build-card {
  --card-accent: #2457ff;
  position: sticky;
  top: var(--stack-top);
  z-index: calc(10 + var(--stack-order));
  display: flex;
  min-height: 330px;
  padding: 14px;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--card-accent) 28%, var(--line));
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface-solid) 94%, var(--card-accent) 6%);
  box-shadow: 0 24px 60px color-mix(in srgb, var(--card-accent) 13%, transparent);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.build-card:nth-child(2) { --card-accent: #7c3aed; }
.build-card:nth-child(3) { --card-accent: #0f9f74; }
.build-card:nth-child(4) { --card-accent: #d97706; }
.build-card:nth-child(5) { --card-accent: #be123c; }
.build-card:nth-child(6) { --card-accent: #0e7490; }

.build-card:hover {
  border-color: color-mix(in srgb, var(--card-accent) 62%, var(--line));
  box-shadow: 0 30px 72px color-mix(in srgb, var(--card-accent) 20%, transparent);
  transform: translateY(-4px);
}

.build-card-visual {
  position: relative;
  display: block;
  height: 190px;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(circle at 76% 18%, rgba(255, 255, 255, 0.34), transparent 28%),
    linear-gradient(145deg, var(--card-accent), #101828);
}

.build-card-visual::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 12, 28, 0.04), rgba(6, 12, 28, 0.72));
  content: '';
}

.build-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 500ms cubic-bezier(.2, .8, .2, 1);
}

.build-card:hover .build-card-visual img { transform: scale(1.055); }

.build-card-number,
.build-card-mark {
  position: absolute;
  z-index: 1;
  color: #fff;
  font-family: var(--mono);
}

.build-card-number {
  left: 14px;
  bottom: 11px;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.08em;
}

.build-card-mark {
  right: 12px;
  top: 12px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  background: rgba(8, 15, 34, 0.54);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  backdrop-filter: blur(8px);
}

.build-card-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}

.build-card-meta span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.build-card strong {
  display: block;
  font-size: 18px;
  letter-spacing: -0.03em;
  line-height: 1.42;
}

.content {
  display: flex;
  min-width: 0;
  padding: 44px 0 0;
  flex-direction: column;
  gap: 112px;
}

.content > section {
  position: relative;
  scroll-margin-top: 36px;
}

.profile-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

/* 이름 위 한 줄: 장식 대신 지금 하고 있는 일을 적는다. */
.profile-context { color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.4; }

.intro { display: flex; flex-direction: column; }

.intro h1 {
  margin: 14px 0 2px;
  font-size: clamp(38px, 4.6vw, 54px);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
}

.role {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.tagline {
  margin-top: 22px;
  font-size: clamp(20px, 2.2vw, 25px);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.42;
}

/* 채용 담당자의 다음 행동: 이력서 PDF가 주 버튼, GitHub이 보조 버튼 */
.cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.cta a {
  display: inline-flex;
  min-height: 44px;
  padding: 0 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease;
}
.cta a:hover { transform: translateY(-2px); }
.cta .cta-primary { border-color: var(--accent); background: var(--accent); color: var(--surface-solid); }
.cta .cta-secondary { background: var(--surface-solid); color: var(--ink); }
.cta .cta-text { padding: 0 2px; border-color: transparent; color: var(--accent); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.contact .cta .cta-text { color: var(--bg); }
.cta .cta-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* 일하는 방식: 단계 이름과 한 문장, 근거 작업을 목록으로 적는다. */
.how-i-work { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.how-title { margin: 0 0 12px; color: var(--muted); font-size: 13px; font-weight: 650; }
.how-i-work ol { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.how-i-work li { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 2px 10px; font-size: 13px; line-height: 1.55; }
.how-step { grid-row: span 2; color: var(--ink); font-weight: 700; }
.how-proof { grid-column: 2; color: var(--faint); font-size: 12px; }

.entrances a {
  font-size: 13px;
  font-weight: 600;
}

.entrance-copy { min-width: 0; }

.entrances {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-soft) 66%, transparent);
}

.entrances-rail {
  position: sticky;
  top: 40px;
  align-self: start;
  margin-top: 44px;
  box-shadow: 0 18px 48px color-mix(in srgb, var(--ink) 8%, transparent);
  backdrop-filter: blur(16px);
}

.is-ready .entrances-rail {
  transition: opacity 200ms ease, visibility 200ms ease, transform 200ms ease;
}

.is-ready .entrances-rail:not(.is-shown) {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
}

.entrances-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.entrances ol {
  margin: 0;
  padding: 6px;
  list-style: none;
}

.entrances li {
  position: relative;
  z-index: 1;
}

/* 활성 표시가 항목 사이를 미끄러진다. 위치와 크기는 app.js가 활성 항목에 맞춰 넣는다. */
.entrance-indicator {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 0;
  height: 0;
  border-radius: 10px;
  background: var(--surface-solid);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 320ms cubic-bezier(0.22, 0.61, 0.36, 1),
    width 320ms cubic-bezier(0.22, 0.61, 0.36, 1),
    height 320ms cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 200ms ease;
}

/* 표시가 도는 동안에는 항목 자신의 배경을 비운다. JS가 없으면 기존 배경이 그대로 남는다. */
.entrances.has-indicator a.is-active { background: transparent; }

.entrances li + li { border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent); }

.entrances a {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 52px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.entrances .nav-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--faint);
  font-size: 12px;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.entrances .arrow { color: var(--faint); font-size: 13px; }

.entrances a:hover,
.entrances a.is-active {
  background: var(--surface-solid);
  color: var(--ink);
  transform: translateX(2px);
}

.entrances a.is-active .nav-index {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

.entrances a.is-active .arrow { color: var(--accent); }

.facts {
  display: flex;
  margin: 0;
  flex-direction: column;
}

.facts > div {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.facts dt {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 21px;
  text-transform: uppercase;
}

.facts dd { margin: 0; font-size: 12px; line-height: 1.72; }
/* 혼자 선 링크는 누르는 자리를 24px로 넓힌다. 문장 속 링크가 아니라 예외에 안 든다.
   바깥 여백을 같은 만큼 빼서 보이는 자리는 그대로 둔다. */
.facts dd > a:only-child {
  display: inline-block;
  padding-block: 5px;
  margin-block: -5px;
}
.stack { display: flex; flex-direction: column; gap: 4px; }
.stack { gap: 8px; }
/* 분야 이름을 위에 두어 좁은 카드에서도 기술 이름이 한 줄에 더 많이 들어가게 한다. */
.stack > span { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; min-width: 0; }
.stack-used { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.stack > span > span { min-width: 0; overflow-wrap: anywhere; }
.stack .mono { font-size: 12px; }

.theme-toggle {
  display: grid;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 600 12px var(--mono);
}

.theme-toggle:hover { background: var(--surface-soft); color: var(--ink); }
.theme-icon { color: var(--accent); font-size: 18px; }
.theme-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.section-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px 32px;
  align-items: end;
  margin-bottom: 30px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-strong);
}

.section-head h2 { white-space: nowrap; }
.section-head p { justify-self: end; }

.section-head h2 {
  margin: 0;
  font-size: clamp(28px, 4.4vw, 46px);
  font-weight: 680;
  letter-spacing: -0.055em;
  line-height: 1;
}

.section-head p {
  max-width: 580px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.ability {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.pair { color: var(--accent-strong); font: 500 12px var(--mono); }

.lead {
  max-width: 760px;
  font-size: clamp(20px, 2.8vw, 29px);
  font-weight: 570;
  letter-spacing: -0.035em;
  line-height: 1.55;
}

.lead-opening {
  position: relative;
  margin: 6px 0 34px;
  padding-left: 22px;
}

.lead-opening::before {
  position: absolute;
  inset: 7px auto 6px 0;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(var(--accent), #7c3aed);
  content: '';
}

.lead.closing {
  margin-top: 34px;
  padding: 30px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent-soft), transparent 75%);
}

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-left: 15px;
  padding: 28px 0 28px 48px;
  border-left: 1px solid var(--line-strong);
}

.stage::before {
  position: absolute;
  left: -6px;
  top: 36px;
  width: 11px;
  height: 11px;
  border: 3px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
  content: '';
}

.stage-index {
  position: absolute;
  left: 14px;
  top: 31px;
  color: var(--faint);
  font: 500 12px var(--mono);
}

.stage-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; }
.stage-meta .date { color: var(--muted); }
.stage-name { font-size: 12px; font-weight: 700; }
.summary { max-width: 760px; font-size: 18px; font-weight: 650; line-height: 1.5; }
.body { max-width: 780px; color: color-mix(in srgb, var(--ink) 88%, var(--muted)); font-size: 15px; line-height: 1.9; }

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  position: relative;
  display: flex;
  min-height: 290px;
  padding: 24px;
  overflow: hidden;
  flex-direction: column;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.metric:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 18px 40px color-mix(in srgb, var(--accent) 9%, transparent);
  transform: translateY(-4px);
}

.metric-index { margin-bottom: 14px; color: var(--faint); }
.metric .value { font-size: clamp(28px, 3.8vw, 40px); font-weight: 680; letter-spacing: -0.055em; }
.metric .label { min-height: 40px; font-size: 13px; font-weight: 650; line-height: 1.5; }
.metric .label-detail { color: var(--muted); font-size: 12px; }
.metric .source { margin-top: 8px; padding-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.65; }
/* 막대는 장식이라(aria-hidden) 큰 숫자 바로 아래로 옮겨 세 카드의 막대 높이를 맞춘다. */
.metric .value { order: 1; }
.metric-bar { order: 2; }
.metric .label { order: 3; }
.metric .label-detail { order: 4; }
.metric .source { order: 5; }
.metric .pair { order: 6; }
.metric .pair { margin-top: 3px; }

.metric-bar {
  display: block;
  height: 5px;
  margin: 6px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.metric-bar > span {
  display: block;
  width: var(--progress);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #7c3aed);
}

.works {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.work {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  min-height: 390px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 10px 36px rgba(30, 42, 70, 0.05);
  transition: transform 240ms ease, box-shadow 240ms ease;
}

.work:nth-child(even) { grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.05fr); }
.work:nth-child(even) .work-visual { order: 2; }
.work:nth-child(even) .work-copy { order: 1; }
.work:hover { box-shadow: var(--shadow); transform: translateY(-4px); }

.work-visual {
  position: relative;
  display: block;
  min-height: 390px;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 25%, rgba(255, 255, 255, 0.24), transparent 28%),
    linear-gradient(135deg, #173bb8, #2457ff 55%, #6c40e8);
  color: #fff;
}

.work.pending .work-visual {
  background:
    repeating-linear-gradient(135deg, transparent 0 12px, rgba(255, 255, 255, 0.04) 12px 24px),
    linear-gradient(135deg, #344054, #101828);
}

.work-visual.has-image {
  isolation: isolate;
  background: #0b1020;
}

.work-visual.has-image::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(8, 15, 34, 0) 55%, rgba(8, 15, 34, 0.55));
  content: "";
}

.work-visual.has-image img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 400ms ease;
}

.work:hover .work-visual.has-image img { transform: scale(1.035); }

.work-number { position: absolute; left: 22px; bottom: 18px; z-index: 1; font: 500 40px/1 var(--mono); letter-spacing: -0.08em; opacity: 0.9; }

.work-copy {
  display: flex;
  min-width: 0;
  padding: 34px 30px 30px;
  flex-direction: column;
}

.work-kind { line-height: 1.65; }
.work-title { margin: 18px 0 0; font-size: clamp(22px, 2.1vw, 28px); font-weight: 680; letter-spacing: -0.045em; line-height: 1.28; }
.work-desc { margin-top: 18px; color: var(--muted); font-size: 15px; line-height: 1.78; }
/* 기술보다 판단이 먼저 기억에 남도록 카드 겉면에 한 줄 */
.work-decision {
  margin-top: 16px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
}
.work-decision .mono { display: block; margin-bottom: 3px; color: var(--accent); font-size: 12px; letter-spacing: 0.06em; }
.work-related { margin-top: 12px; font-size: 13px; }
.work-related a { color: var(--accent); font-weight: 650; }
.work .links { margin-top: auto; padding-top: 24px; }

.work-case {
  grid-column: 1 / -1;
  order: 3;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-soft) 56%, transparent);
}

.work-case summary {
  display: flex;
  min-height: 70px;
  padding: 18px 28px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  cursor: pointer;
  list-style: none;
}

.work-case summary::-webkit-details-marker { display: none; }

.work-case summary > span:first-child {
  display: flex;
  align-items: center;
  gap: 16px;
}

.work-case summary .case-label {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 650;
}

.case-summary-open,
.case-summary-close {
  font-size: 13px;
  font-weight: 650;
}

.case-summary-close { display: none; }
.work-case[open] .case-summary-open { display: none; }
.work-case[open] .case-summary-close { display: inline; }

.case-icon {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  transition: transform 220ms ease, background-color 220ms ease;
}

/* 글자(＋)는 글꼴 기준선 때문에 원 가운데서 조금 내려앉는다. 막대 두 개로 정확히 가운데에 그린다. */
.case-icon::before,
.case-icon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent-strong);
  content: "";
  transform: translate(-50%, -50%);
}
.case-icon::after { transform: translate(-50%, -50%) rotate(90deg); }

.work-case[open] .case-icon {
  background: var(--accent-soft);
  transform: rotate(45deg);
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 28px 28px;
  animation: case-reveal 260ms ease both;
}

.case-step {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-solid) 86%, transparent);
}

.case-step-index {
  color: var(--faint);
  letter-spacing: 0.04em;
}

.case-step h4 {
  margin: 14px 0 8px;
  font-size: 17px;
  letter-spacing: -0.025em;
}

.case-step p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.72;
}

@keyframes case-reveal {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a { padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-solid); font-size: 12px; font-weight: 700; text-decoration: none; }
.links a:hover { border-color: var(--accent); color: var(--accent); }

.exp {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  margin-top: 14px;
  padding: 28px 30px 28px 72px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  transition: border-color 220ms ease, transform 220ms ease;
}

.exp:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); transform: translateX(4px); }
.exp-index { position: absolute; left: 26px; top: 31px; color: var(--accent); }
.exp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.exp-title { margin: 4px 0 0; font-size: 20px; font-weight: 680; letter-spacing: -0.025em; }
.exp-role { color: var(--muted); font-size: 12px; }
.exp-result { max-width: 780px; margin-top: 6px; font-size: 14px; line-height: 1.75; }

.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}

.gallery-item {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 350ms ease;
}

.gallery-item:hover img { transform: scale(1.025); }

.gallery-item figcaption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(11, 16, 32, 0.76);
  color: #fff;
  font: 600 12px var(--mono);
  letter-spacing: 0.03em;
  backdrop-filter: blur(8px);
}

.star {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 7px 14px;
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.72;
}

.star dt { color: var(--faint); font: 500 12px/22px var(--mono); }
.star dd { margin: 0; }
.exp-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.exp-foot > .mono { color: var(--muted); line-height: 1.7; }

.doc-list {
  display: grid;
  /* 한국어 문서 셋, 영문 문서 셋이 한 줄씩. 휴대폰 폭에서만 한 줄에 하나로 접힌다. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.doc-card,
.document-pending {
  display: flex;
  min-height: 126px;
  padding: 20px;
  align-items: flex-start;
  justify-content: space-between;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
  text-decoration: none;
  transition: transform 220ms ease, border-color 220ms ease;
}

.doc-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.doc-card::before,
.document-pending::before { content: '↧'; color: var(--accent); font: 400 26px var(--mono); }
.document-pending::before { content: '…'; color: var(--faint); }
.doc-list .fmt { color: var(--muted); font: 500 12px var(--mono); }

/* 같은 문서를 형식별로 내려받는 단추. 워드가 없으면 PDF로 연다. */
/* 웹에서 보기를 첫 줄에, PDF·DOCX를 둘째 줄에 둔다. 칸 폭과 상관없이 모든 카드가 같은 모양이다. */
.doc-formats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-top: 14px; }
.doc-formats a:first-child { grid-column: 1 / -1; }
/* 웹에서 바로 읽는 단추가 먼저 눈에 띄게 */
.doc-formats a:first-child { border-color: var(--accent); color: var(--accent); }

.doc-formats a {
  padding: 6px 12px;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  font: 600 12px var(--mono);
  text-decoration: none;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.doc-formats a:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.contact {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 24px;
  padding: 40px;
  border-radius: 26px;
  background: var(--ink);
  color: var(--bg);
}

.contact .name { font-size: clamp(25px, 4vw, 38px); font-weight: 680; letter-spacing: -0.05em; }
.contact .cta { align-self: center; margin-top: 0; }
.contact .cta .cta-secondary { border-color: color-mix(in srgb, var(--bg) 35%, transparent); background: transparent; color: var(--bg); }
.contact .note { grid-column: 1 / -1; margin-top: 24px; color: color-mix(in srgb, var(--bg) 74%, var(--ink)); font-size: 12px; line-height: 1.6; }

.reveal { opacity: 1; transform: none; }
.is-ready .reveal { opacity: 0; transform: translateY(18px); transition: opacity 500ms ease, transform 500ms ease; }
.is-ready .reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 1280px) {
  .layout { grid-template-columns: 280px minmax(0, 1fr) 68px; gap: 24px; padding-inline: 24px; }
  .side { padding: 24px; }
  .entrances-rail { width: 68px; justify-self: end; }
  .entrances-rail .entrances-head { display: none; }
  .entrances-rail a { grid-template-columns: 1fr; justify-items: center; gap: 0; padding-inline: 7px; }
  .entrances-rail .entrance-copy,
  .entrances-rail .arrow { display: none; }
  .metrics { grid-template-columns: 1fr; }
  .metric { min-height: 220px; }
  /* 카드가 한 줄에 하나일 때는 제목 줄 높이를 맞출 이웃이 없다. 빈 줄이 남지 않게 푼다. */
  .metric .label { min-height: 0; }
  .work,
  .work:nth-child(even) { grid-template-columns: 1fr; min-height: 0; }
  .work:nth-child(even) .work-visual,
  .work:nth-child(even) .work-copy { order: initial; }
  .work-visual { min-height: 300px; }
}

@media (max-width: 880px) {
  html { scroll-padding-top: 82px; }
  body { padding-bottom: 78px; }
  body::before { background-size: 44px 44px; }

  .layout {
    display: flex;
    padding: 18px 16px 48px;
    flex-direction: column;
    gap: 62px;
  }

  /* 하단 고정 바는 프로필 카드(.side, isolation: isolate) 안에 있어 카드의 쌓임 순서를 따른다.
     카드 열을 본문보다 위에 두어야 뒤에 오는 본문 글자가 바 위로 그려지지 않는다. */
  .side-column { z-index: 20; width: 100%; }
  .build-reel { display: none; }


  .side {
    position: static;
    width: 100%;
    max-width: 100%;
    max-height: none;
    padding: 24px;
    overflow: visible;
    border-radius: 22px;
    /* backdrop-filter가 남아 있으면 이 요소가 하단 고정 내비게이션의 기준 상자가 되어
       내비게이션이 화면이 아니라 프로필 카드 끝에 붙는다. */
    backdrop-filter: none;
  }

  .intro h1 { font-size: 42px; }
  .tagline { font-size: 22px; }

  .entrances {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 30;
    display: block;
    width: min(calc(100% - 24px), 560px);
    background: var(--surface-solid);
    box-shadow: 0 -6px 28px rgba(17, 24, 39, 0.12);
    backdrop-filter: blur(16px);
    transform: translateX(-50%);
  }

  .entrances-head { display: none; }

  .entrances ol {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 5px;
  }

  .entrances li + li {
    border-top: 0;
    border-left: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  }

  .entrances a {
    display: flex;
    min-height: 52px;
    padding: 5px 2px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 12px;
    text-align: center;
  }

  .entrances .nav-index { width: 22px; height: 22px; }
  .entrances a:hover,
  .entrances a.is-active { transform: none; }
  .entrances .arrow { display: none; }

  /* 하단 고정 바 하나면 충분하므로 오른쪽 레일은 접는다.
     레일도 .entrances라서 위 규칙을 그대로 받으니 순서와 명시도를 함께 올린다. */
  .entrances.entrances-rail { display: none; }
  .nav-index { font-size: 12px; }

  .content { order: 3; padding: 0; gap: 84px; }
  .section-head { grid-template-columns: 1fr; }
  .section-head p { justify-self: start; }
  .section-head h2 { font-size: 36px; }
  .lead { font-size: 21px; }

  .stage { margin-left: 6px; padding-left: 34px; }
  .stage-index { display: none; }
  .stage .spacer { display: none; }
  .stage-meta { align-items: flex-start; }
  .ability { width: fit-content; }
  .summary { font-size: 17px; }
  .body { font-size: 14px; line-height: 1.82; }
  .lead.closing { padding: 24px; }

  .metrics { gap: 10px; }
  .metric { min-height: 230px; }
  .work { min-height: 0; border-radius: 22px; }
  .work-visual { min-height: 260px; }
  .work-copy { padding: 26px 24px 24px; }
  .work-title { font-size: 26px; }
  .work-case summary { padding: 16px 22px; }
  .case-grid { grid-template-columns: 1fr; padding: 0 22px 22px; }

  .exp { padding: 24px 22px; }
  .exp-index { position: static; margin-bottom: 6px; }
  .exp:hover { transform: translateY(-3px); }
  .exp-meta .spacer { display: none; }
  .star { grid-template-columns: 38px minmax(0, 1fr); }
  .exp-foot { align-items: flex-start; flex-direction: column; }

  .project-gallery {
    display: flex;
    margin-inline: -22px;
    padding: 0 22px 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }

  .gallery-item {
    flex: 0 0 82%;
    scroll-snap-align: center;
  }

  .contact { grid-template-columns: 1fr; padding: 28px; }
  .contact .cta { margin-top: 8px; }
}

@media (max-width: 640px) {
  .doc-list { grid-template-columns: 1fr; gap: 10px; }
  /* 카드 여섯 장이 한 줄씩 쌓이므로 아이콘을 빼고 단추를 한 줄에 둔다. 단추는 손가락으로 누르기 좋게 40px. */
  .doc-card { min-height: 0; padding: 16px; }
  .doc-card::before { display: none; }
  .doc-formats { grid-template-columns: 2fr 1fr 1fr; margin-top: 12px; }
  .doc-formats a:first-child { grid-column: auto; }
  .doc-formats a { display: flex; min-height: 40px; align-items: center; justify-content: center; padding: 0 8px; }
}

@media (max-width: 390px) {
  .layout { padding-inline: 12px; }
  .side { padding: 20px; }
  .intro h1 { font-size: 38px; }
  .facts > div { grid-template-columns: 56px minmax(0, 1fr); }
  .metric { padding: 15px; }
  .work-visual { min-height: 220px; }
  .work-copy { padding: 22px 18px 20px; }
  .work-case summary { padding-inline: 18px; }
  .work-case summary > span:first-child { align-items: flex-start; flex-direction: column; gap: 4px; }
  .case-grid { padding: 0 18px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .is-ready .reveal { opacity: 1; transform: none; }
}

@media print {
  body { background: #fff; color: #111; }
  body::before, .scroll-progress, .theme-toggle, .entrances, .draft-banner, .build-reel, .work-case { display: none; }
  .layout { display: block; max-width: none; padding: 0; }
  .side { position: static; max-height: none; margin-bottom: 28px; box-shadow: none; }
  .content { gap: 48px; padding: 0; }
  .metric, .work, .exp, .doc-list a, .document-pending { break-inside: avoid; box-shadow: none; }
}
