/* 디자인 토큰
 - 색: 흰 바탕, 강조색 #0070CC(흰 바탕 대비 5.0:1), 보조색 딥 블루 #004886, 잉크, 회색 3단계, 얇은 선
 - 글꼴: IBM Plex Sans KR 1종
 - 모서리: 버튼 8px, 상자 12px
 - 간격: 4px 단위 */
:root {
  --ink: #171717;
  --accent: #0070cc;
  --accent-hover: #004886;
  --accent-2: #004886;
  --accent-soft: #e8f2fb;
  --body: #525252;
  --mute: #6b6b6b;
  --line: #ececec;
  --line-strong: #d4d4d4;
  --soft: #f5f5f5;
  --canvas: #ffffff;
  --gutter: 32px;
  --max: 1080px;
  --font: "IBM Plex Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.75; word-break: keep-all; overflow-wrap: break-word; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, dl, dd, figure, table { margin: 0; }
ul { padding-left: 1.1em; }
strong, b { font-weight: 700; }
code { font-size: 0.88em; background: var(--soft); padding: 1px 6px; border-radius: 4px; white-space: nowrap; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* 상단 바 */
.nav { position: sticky; top: 0; z-index: 10; background: #ffffff; border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 60px; }
.logo { display: inline-flex; align-items: center; }
.logo img { height: 30px; width: auto; }
.nav-links { display: flex; gap: 24px; margin-left: auto; font-size: 14px; }
.nav-links a { text-decoration: none; color: var(--body); }
.nav-links a:hover { color: var(--accent); }
.nav-links a.active { color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); padding-bottom: 4px; }

/* 버튼
 - 주 버튼: 잉크 채움
 - 보조 버튼: 얇은 테두리 */
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--line-strong); font-size: 14px; font-weight: 600; line-height: 1.3; text-decoration: none; white-space: nowrap; background: var(--canvas); color: var(--ink); }
.pill svg { width: 16px; height: 16px; flex: none; }
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.pill-sm { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* 첫 화면 */
.hero { padding: 88px 0 88px; }
/* 사진 카드: 본문과 폭 1:2, 원본과 같은 1:1 비율 고정(잘림 없음), 본문 높이 기준 가운데 정렬 */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 48px; align-items: center; }
.hero-photo { aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--soft); }
.hero-photo img { width: 100%; height: 100%; object-fit: contain; }
.hero-title { font-size: clamp(28px, 3.6vw, 42px); font-weight: 700; line-height: 1.28; letter-spacing: -0.025em; }
.hero-title .accent { color: var(--accent); }
.hero-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.hero-facts dt { font-size: 12px; font-weight: 600; color: var(--mute); }
.hero-facts dd { margin-top: 4px; font-size: 15px; line-height: 1.6; }
.hero-facts a { text-decoration: none; }
.hero-facts a:hover { text-decoration: underline; color: var(--accent); }
.hero .pill-row { margin-top: 32px; }

/* 구역 */
.section { padding: 0 0 96px; }
.h-section { font-size: 28px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; padding-top: 72px; border-top: 1px solid var(--line); margin-bottom: 36px; }
.h-sub { font-size: 18px; font-weight: 700; line-height: 1.4; margin-bottom: 18px; }
.h-card { font-size: 17px; font-weight: 700; line-height: 1.45; }
.block + .block { margin-top: 64px; }

/* 핵심 수치 */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.kpi { border-top: 2px solid var(--accent); padding-top: 16px; }
.kpi-value { color: var(--accent); font-size: clamp(30px, 3.4vw, 40px); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 0.45em; font-weight: 500; margin-left: 3px; letter-spacing: 0; color: var(--body); }
.kpi-label { margin-top: 8px; font-size: 14px; color: var(--body); line-height: 1.5; }
.kpi-note { margin-top: 2px; font-size: 12px; color: var(--mute); line-height: 1.5; }
.kpis.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 24px; }

/* 표 */
.table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.6; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--mute); padding: 0 14px 10px 0; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.table td { padding: 14px 14px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td:first-child { font-weight: 700; white-space: nowrap; }
.table .num { font-variant-numeric: tabular-nums; }
.summary-table a { text-decoration: none; color: var(--accent); }
.summary-table a:hover { text-decoration: underline; }

/* 업무 방식 상자 */
.approach { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.approach-card { border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.approach-lead { margin-top: 8px; font-size: 14px; color: var(--body); line-height: 1.7; }
.evidence { list-style: none; padding: 0; margin-top: 16px; }
.evidence li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.7; }
.evidence b { white-space: nowrap; }
.evidence a { font-weight: 600; color: var(--accent); }
.evidence .chip { justify-self: start; }

/* 칩 */
.chip { display: inline-block; padding: 2px 9px; border-radius: 6px; background: var(--soft); color: var(--body); font-size: 12px; font-weight: 500; line-height: 1.6; }
.stack { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px 20px; align-items: start; }
.stack dt { font-size: 13px; font-weight: 600; color: var(--body); padding-top: 2px; }
.stack dd { display: flex; flex-wrap: wrap; gap: 6px; }

/* 프로젝트 머리 */
.project-head { padding: 0 0 64px; }
.project-head > .wrap { padding-top: 72px; background: linear-gradient(var(--line), var(--line)) no-repeat var(--gutter) 0 / calc(100% - 2 * var(--gutter)) 1px; }
.project-title { display: flex; align-items: center; gap: 14px; font-size: 32px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.p-icon { width: 44px; height: 44px; border-radius: 11px; border: 1px solid var(--line); object-fit: cover; flex: none; }
.project-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-top: 28px; }
.project-meta dt { font-size: 12px; font-weight: 600; color: var(--mute); }
.project-meta dd { margin-top: 2px; font-size: 14px; line-height: 1.55; }
.project-intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 44px; margin-top: 44px; align-items: start; }
.project-intro.portrait { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
.video-frame { border-radius: 12px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.video-frame video { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.video-frame.portrait video { aspect-ratio: 9 / 21.4; object-fit: contain; object-position: top; }
.video-cap { margin-top: 10px; font-size: 13px; color: var(--mute); line-height: 1.6; }
.intro-block + .intro-block { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.intro-label { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.lead { font-size: 15px; line-height: 1.8; color: var(--body); }
.lead p + p { margin-top: 10px; }

/* 기여도 막대 */
.contrib { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; }
.meters { list-style: none; padding: 0; }
.meter { display: grid; grid-template-columns: 130px minmax(0, 1fr) 120px; gap: 14px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.meter-name { font-size: 14px; font-weight: 600; }
.meter-track, .meter-fill { display: block; }
.meter-track { height: 6px; border-radius: 3px; background: #efefef; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 3px; background: var(--accent); }
.meter-fig { font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; }
.meter-fig b { color: var(--accent); }
.meter-fig span { display: block; font-size: 12px; color: var(--mute); line-height: 1.3; }
.meter-note { margin-top: 12px; font-size: 13px; color: var(--mute); line-height: 1.6; }
.did { list-style: none; padding: 0; }
.did li { position: relative; padding: 10px 0 10px 16px; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.7; }
.did li::before { content: ""; position: absolute; left: 2px; top: 20px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* 트러블슈팅 상자 */
.cases { display: grid; gap: 16px; }
.case { border: 1px solid var(--line); border-radius: 12px; padding: 28px; display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 36px; }
.case-side { position: sticky; top: 84px; align-self: start; }
.case-no { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-2); font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.case-side .h-card { margin-bottom: 12px; }
.case-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.case-result { margin-top: 20px; }
.case-result table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.45; table-layout: fixed; }
.case-result th:nth-child(1) { width: 42%; }
.case-result th:nth-child(2) { width: 26%; }
.case-result th { text-align: left; font-weight: 600; font-size: 12px; color: var(--mute); padding: 0 6px 6px 0; border-bottom: 1px solid var(--line-strong); }
.case-result td { padding: 7px 6px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; font-variant-numeric: tabular-nums; }
.case-result td.after { font-weight: 700; color: var(--accent); }
.case-body { display: grid; grid-template-columns: 84px minmax(0, 1fr); }
.case-body dt { font-size: 13px; font-weight: 700; padding: 12px 0; border-top: 1px solid var(--line); }
.case-body dd { font-size: 14px; line-height: 1.75; color: var(--body); padding: 12px 0; border-top: 1px solid var(--line); }
.case-body dt:first-of-type, .case-body dt:first-of-type + dd { border-top: 0; padding-top: 0; }

/* 이력 */
.resume-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
.h-sub.h-gap { margin-top: 40px; }
.awards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; }
.awards li { font-weight: 600; }
.awards li span { font-weight: 400; }
.arch { margin: 0; }
.arch svg { display: block; width: 100%; height: auto; }
.arch .arch-tall { display: none; }
.arch-img { overflow-x: auto; }
.arch-img img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; }
.project-links { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 24px; align-items: start; }
.project-links .intro-label { margin: 8px 0 0; }
.project-links .video-cap { grid-column: 2; margin-top: 0; }
.list-rows { list-style: none; padding: 0; }
.list-rows li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.6; }
.list-rows li span { display: block; font-size: 12px; color: var(--mute); }

/* 연락처 */
.footer { padding: 0 0 48px; }
.contact-box { display: flex; justify-content: space-between; align-items: center; gap: 32px; border: 1px solid var(--line); border-radius: 16px; padding: 40px; }
.contact-title { font-size: 20px; font-weight: 700; line-height: 1.5; }
.contact-list { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 16px; }
.contact-list dt { font-size: 12px; font-weight: 600; color: var(--mute); }
.contact-list dd { font-size: 14px; }
.contact-list a { text-decoration: none; }
.contact-list a:hover { text-decoration: underline; color: var(--accent); }
.contact-actions { display: flex; flex-direction: column; gap: 8px; min-width: 220px; }
.contact-actions .pill { justify-content: center; }
.footer-base { margin-top: 56px; text-align: center; font-size: 12px; color: var(--mute); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.num b, td.after { color: var(--accent); }
::selection { background: var(--accent-soft); }

/* 반응형
 - 1024px 미만: 2열, 상단 링크는 헤더 아래 가로 스크롤 줄, 요약 표는 줄마다 블록
 - 720px 미만: 1열, 간격 16px */
@media (max-width: 1023px) {
  .hero-grid { gap: 32px; }
  html { scroll-padding-top: 104px; }
  .nav .wrap { flex-wrap: wrap; height: auto; row-gap: 0; padding-top: 10px; }
  .nav .pill { margin-left: auto; }
  .nav-links { order: 3; width: 100%; margin-left: 0; gap: 20px; overflow-x: auto; white-space: nowrap; padding: 10px 0 8px; scrollbar-width: none; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a.active { box-shadow: inset 0 -2px 0 var(--accent); }
  .case-side { position: static; }
  .awards { grid-template-columns: minmax(0, 1fr); }
  .project-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .project-intro, .project-intro.portrait, .contrib { grid-template-columns: minmax(0, 1fr); }
  .project-intro.portrait .video-frame { max-width: 300px; margin-inline: auto; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .resume-grid, .approach { grid-template-columns: minmax(0, 1fr); }
  .resume-grid { gap: 32px; }
  .contact-box { flex-direction: column; align-items: flex-start; }
  .contact-actions { width: 100%; }
  .summary-table thead { display: none; }
  .summary-table, .summary-table tbody, .summary-table tr, .summary-table td { display: block; width: 100%; }
  .summary-table tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .summary-table td, .summary-table td.num, .summary-table td:first-child { border: 0; padding: 2px 0; white-space: normal; }
  .summary-table td[data-label] { display: grid; grid-template-columns: 60px minmax(0, 1fr); }
  .summary-table td[data-label]::before { content: attr(data-label); font-size: 12px; font-weight: 600; color: var(--mute); }
  .summary-table tr:last-child { border-bottom: 0; }
  .summary-table td:first-child { font-size: 17px; margin-bottom: 4px; }
}
@media (max-width: 719px) {
  :root { --gutter: 16px; }
  .hero { padding: 72px 0 64px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .hero-photo { width: 144px; }
  .hero-facts { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .project-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
  .hero .pill-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hero .pill-row .pill { justify-content: center; padding: 10px 12px; }
  .arch .arch-wide { display: none; }
  .arch .arch-tall { display: block; max-width: 420px; margin: 0 auto; }
  .resume-grid { grid-template-columns: minmax(0, 1fr); }
  .section { padding-bottom: 64px; }
  .h-section, .project-head > .wrap { padding-top: 52px; }
  .project-title { font-size: 26px; }
  .case { padding: 16px; }
  .approach-card { padding: 20px; }
  .case-body { grid-template-columns: minmax(0, 1fr); }
  .case-body dt { padding-bottom: 2px; }
  .case-body dd { border-top: 0; padding-top: 0; }
  .meter { grid-template-columns: minmax(0, 1fr) 120px; }
  .meter-track { grid-column: 1 / -1; grid-row: 2; }
  .stack { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .stack dd { margin-bottom: 10px; }
  .pill { white-space: normal; }
  .contact-box { padding: 24px; }
  .arch-img img { width: 860px; max-width: none; }
  .project-links { grid-template-columns: minmax(0, 1fr); }
  .project-links .intro-label { margin: 0; }
  .project-links .video-cap { grid-column: 1; }
}

/* 움직임
 - 등장: 24px 아래에서 위로 0.62초(넉터 마케팅 sequence-copy-rise 곡선), 형제 요소 60ms 간격
 - 타이핑: 글자 칸을 먼저 잡고 투명도만 전환. 쓰기와 지우기를 반복하고, 커서는 멈춘 동안에만 깜빡임
 - 커서: 절대 위치로 줄바꿈 계산에서 제외. 인라인 블록이면 커서 위치마다 줄바꿈이 바뀌어 320px 폭에서 제목이 3줄과 4줄을 반복함(CLS 0.176)
 - 숫자: 고정폭 숫자, 최종 폭을 스크립트가 min-width로 고정
 - html[data-motion]은 머리 스크립트가 설정. 동작 줄이기 설정이나 JS 미동작이면 효과 없음 */
html[data-motion] [data-reveal] { transition: opacity .62s cubic-bezier(.2, .78, .2, 1), transform .62s cubic-bezier(.2, .78, .2, 1); transition-delay: calc(var(--i, 0) * 60ms); }
html[data-motion] [data-reveal]:not([data-revealed]) { opacity: 0; transform: translateY(24px); }
html[data-typing] .hero-title { visibility: hidden; }
.tw-char { opacity: 0; }
.tw-char.on { opacity: 1; }
.tw-caret { position: absolute; width: 0; height: 0.95em; margin-top: 0.17em; border-left: 3px solid var(--accent); }
.tw-caret.idle { animation: tw-blink 1s steps(1) infinite; }
@keyframes tw-blink { 50% { opacity: 0; } }
.count { display: inline-block; font-variant-numeric: tabular-nums; }

@media print {
  html[data-motion] [data-reveal] { opacity: 1 !important; transform: none !important; }
  .tw-char { opacity: 1 !important; }
  .tw-caret { display: none; }
  .nav { display: none; }
  video { display: none; }
}
