/* ==================================================
   V2 - dark builder (시안 D). base/components 위에 덮는다.
   토큰: 다크 기본 + 라이트 대응. 포인트 색 1개(라임). 모서리 16px 계열 하나.
   ================================================== */
:root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
  --bg: #0b0d10; --bg-soft: #0f1216; --surface: #12161c; --surface-2: #161b22;
  --text: #e9edf3; --text2: #a3adbb; --text3: #8a94a3; --border: #222833;
  --accent: #c6f432; --accent-dk: #d7ff63; --accent-ink: #0b0d10; --accent-soft: rgba(198,244,50,.10);
  --radius-lg: 20px; --radius: 16px; --radius-sm: 10px;
  --shadow: 0 0 0 1px var(--border);
  --font-en: 'Space Grotesk', 'Pretendard', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f5f2; --bg-soft: #eceee9; --surface: #ffffff; --surface-2: #f7f8f5;
  --text: #121417; --text2: #4d5560; --text3: #646c76; --border: #dde1d8;
  --accent: #4d7c0f; --accent-dk: #3f6a08; --accent-ink: #ffffff; --accent-soft: rgba(77,124,15,.10);
  color-scheme: light;
}

body { background: var(--bg); }
/* 고정 배경: 아주 옅은 격자 + 우상단 라임 빛. 스크롤 컨테이너가 아니라 고정 의사요소에만 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 85% -10%, var(--accent-soft), transparent 65%),
    linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, var(--border) 1px, transparent 1px) 0 0 / 64px 64px;
  opacity: .35;
  mask-image: linear-gradient(to bottom, #000 0, transparent 900px);
}

h1, h2, h3, h4 { font-family: var(--font-en); letter-spacing: -.03em; }

/* ---------- NAV: 얇은 유리 막대 ---------- */
.nav {
  background: color-mix(in srgb, var(--bg) 72%, transparent) !important;
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border) !important; height: 64px;
}
.nav-logo { font-family: var(--font-mono); letter-spacing: .02em; }
.nav-logo::after { content: "_"; color: var(--accent); animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.progress-bar { background: var(--accent) !important; height: 2px !important; }

/* ---------- HERO: 비대칭 분할, 단어 순차 등장 ---------- */
.hero { min-height: 100dvh; display: flex; align-items: center; padding: 96px 24px 56px !important; }
.hero-inner { max-width: 1240px; margin: 0 auto; width: 100%;
  display: grid !important; grid-template-columns: 1.35fr .65fr; gap: 56px; align-items: center; }
.hero-eyebrow { font-family: var(--font-mono) !important; color: var(--text3) !important; letter-spacing: .08em; }
.hero-title { font-family: var(--font-mono) !important; color: var(--accent) !important; font-size: 14px !important; font-weight: 600 !important; }
.hero-headline { font-family: var(--font-en) !important; font-size: clamp(46px, 6.2vw, 92px) !important;
  line-height: 1.02 !important; font-weight: 700 !important; letter-spacing: -.045em !important; color: var(--text) !important; margin: 18px 0 26px !important; }
.hero-headline .w { display: inline-block; opacity: 0; transform: translateY(.45em); filter: blur(6px);
  animation: wordIn .9s cubic-bezier(.16,1,.3,1) forwards; animation-delay: calc(var(--i) * 90ms + 150ms); }
.hero-headline .w-accent { color: var(--accent); }
@keyframes wordIn { to { opacity: 1; transform: none; filter: none; } }
.hero-desc { color: var(--text2) !important; font-size: 17px !important; max-width: 34ch; }
.hero-cta { margin-top: 30px; }
.scroll-cue { display: none !important; }

.hero-media { position: relative; }
.hero-photo { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius-lg) !important; overflow: hidden;
  border: 1px solid var(--border); box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.25) contrast(1.05); }
.hero-photo::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, color-mix(in srgb, var(--bg) 70%, transparent)); }
.hero-chips { position: absolute; left: -36px; right: -20px; bottom: 22px; display: flex; flex-wrap: wrap; gap: 8px; list-style: none; z-index: 2; }
.hero-chips li { font-family: var(--font-mono); font-size: 12px; padding: 7px 11px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--border); color: var(--text);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; animation: chipIn .7s cubic-bezier(.16,1,.3,1) forwards; animation-delay: calc(var(--i) * 110ms + 700ms); }
.hero-chips li:first-child { border-color: var(--accent); color: var(--accent); }
@keyframes chipIn { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- BUTTONS (알약 = 상호작용 요소만) ---------- */
.btn { border-radius: 999px !important; transition: transform .25s cubic-bezier(.16,1,.3,1), background .25s, border-color .25s, color .25s; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primary { background: var(--accent) !important; color: var(--accent-ink) !important; font-weight: 700; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px var(--accent); }
.btn-outline { border: 1px solid var(--border) !important; color: var(--text) !important; background: transparent !important; }
.btn-outline:hover { border-color: var(--text) !important; }

/* ---------- STATS: 숫자 띠 (신설) ---------- */
.stats { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.stats-inner { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 36px 28px; border-left: 1px solid var(--border); }
.stat:first-child { border-left: 0; }
.stat-num { display: block; font-family: var(--font-en); font-weight: 700; font-size: clamp(40px, 4.6vw, 64px); line-height: 1; letter-spacing: -.04em; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-num .unit { font-size: .45em; margin-left: 4px; color: var(--accent); letter-spacing: 0; }
.stat-label { display: block; margin-top: 12px; color: var(--text2); font-size: 14px; }
.stats-note { max-width: 1240px; margin: 0 auto; padding: 10px 28px 14px; font-family: var(--font-mono); font-size: 11px; color: var(--text3); }

/* ---------- MARQUEE: 도구 흐름 띠 (페이지에 1개) ---------- */
.marquee { overflow: hidden; border-bottom: 1px solid var(--border); padding: 18px 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 44px; width: max-content; animation: marquee 38s linear infinite; }
.marquee-track span { font-family: var(--font-en); font-size: clamp(22px, 2.4vw, 32px); font-weight: 600; color: var(--text3); white-space: nowrap; letter-spacing: -.02em; }
.marquee-track span:nth-child(3n+1) { color: var(--text); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- SECTIONS ---------- */
.section { padding: 112px 24px !important; }
.section-inner { max-width: 1240px !important; }
.section-eyebrow { font-family: var(--font-mono) !important; color: var(--accent) !important; letter-spacing: .04em !important; }
.section-title-lg { font-size: clamp(36px, 4.4vw, 60px) !important; line-height: 1.08 !important; letter-spacing: -.04em !important; }

/* ABOUT: 사진 자리 대신 큰 인용 */
.about-quote { border-left: 2px solid var(--accent) !important; background: var(--surface) !important; border-radius: 0 var(--radius) var(--radius) 0 !important; padding: 12px 20px; }

/* TIMELINE: 빛나는 진행선 */
.timeline-line { background: var(--border) !important; }
.timeline-progress { background: var(--accent) !important; box-shadow: 0 0 12px var(--accent); }
.timeline-year { font-family: var(--font-mono) !important; color: var(--accent) !important; }
.timeline-item h3 { font-size: 22px !important; }

/* WHAT I DO: 카드 대신 번호 + 선 */
.do-card { background: transparent !important; border: 0 !important; border-top: 1px solid var(--border) !important; border-radius: 0 !important; box-shadow: none !important; padding-left: 0 !important; }
.do-num { font-family: var(--font-mono) !important; color: var(--accent) !important; }

/* ---------- PROJECTS: 벤토 + 커서 따라 빛나는 테두리 ---------- */
.case-card-grid { display: grid !important; grid-template-columns: repeat(6, 1fr) !important; gap: 18px !important; }
.case-card-grid > .case-card { grid-column: span 3; }
.case-card-grid > .case-card:first-child { grid-column: span 6; display: grid; grid-template-columns: 1.4fr 1fr; align-items: stretch; }
.case-card-grid > .case-card:first-child .case-card-thumb { aspect-ratio: auto; height: 100%; min-height: 320px; }
.case-card, .bundle-card {
  position: relative; background: var(--surface) !important; border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important; box-shadow: none !important; overflow: hidden;
  transition: transform .35s cubic-bezier(.16,1,.3,1), border-color .35s;
}
.case-card::before, .bundle-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 1;
  background: radial-gradient(360px circle at var(--mx, -500px) var(--my, -500px), var(--accent), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .3s;
}
.case-card:hover::before, .bundle-card:hover::before { opacity: 1; }
.case-card:hover { transform: translateY(-4px); }
.case-card-thumb img, .bundle-card .img-shot img { transition: transform .8s cubic-bezier(.16,1,.3,1); }
.case-card:hover .case-card-thumb img { transform: scale(1.04); }
.case-meta { font-family: var(--font-mono) !important; font-size: 12px !important; color: var(--text3) !important; }
.case-title { font-size: 22px !important; }
.case-rating { color: var(--accent) !important; }
.img-placeholder.case-card-thumb { background:
    radial-gradient(400px 200px at 30% 0%, var(--accent-soft), transparent 70%),
    linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--border) 1px, transparent 1px) 0 0 / 28px 28px, var(--surface-2) !important;
  border: 0 !important; }
.img-placeholder.case-card-thumb strong { font-family: var(--font-en); font-size: 22px !important; color: var(--text) !important; }
.homepage-bundle { border-top: 1px solid var(--border) !important; }
.bundle-grid { gap: 14px !important; }
.flow-step { font-family: var(--font-mono) !important; border-color: var(--border) !important; background: var(--surface) !important; color: var(--text2) !important; }
.flow-step-final { background: var(--accent) !important; color: var(--accent-ink) !important; border-color: var(--accent) !important; }

/* AI WORKFLOW: 단계가 차례로 켜지는 파이프라인 */
.ai-workflow .flow-diagram .flow-step { opacity: .35; transition: opacity .4s, color .4s, border-color .4s; }
.ai-workflow .flow-diagram.is-on .flow-step { opacity: 1; color: var(--text) !important; border-color: color-mix(in srgb, var(--accent) 45%, var(--border)) !important;
  transition-delay: calc(var(--i) * 120ms); }
/* note: 위 규칙의 글자색이 마지막(초록 배경) 단계까지 덮어 글자가 안 보였다 */
.ai-workflow .flow-diagram.is-on .flow-step-final { color: var(--accent-ink) !important; border-color: var(--accent) !important; }

/* SKILLS */
.skill-group h3 { font-family: var(--font-mono) !important; font-size: 13px !important; color: var(--accent) !important; letter-spacing: .02em; }

/* CONTACT: 화면을 채우는 메일 */
.contact-mail .btn { font-family: var(--font-en); font-size: clamp(18px, 2.2vw, 26px) !important; padding: 22px 30px !important; width: 100%; }
.footer { border-top: 1px solid var(--border) !important; }

/* ---------- MOBILE ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr !important; gap: 36px; }
  .hero-media { order: -1; max-width: 300px; }
  .hero-chips { left: 0; right: 0; bottom: -16px; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
  .case-card-grid > .case-card, .case-card-grid > .case-card:first-child { grid-column: span 6; display: block; }
  .case-card-grid > .case-card:first-child .case-card-thumb { min-height: 0; aspect-ratio: 16 / 9; }
}
@media (max-width: 640px) {
  .hero { padding-top: 84px !important; }
  .stat { padding: 26px 18px; }
}

/* ---------- 움직임 줄이기 설정이면 전부 정지 ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-headline .w, .hero-chips li { animation: none !important; opacity: 1 !important; transform: none !important; filter: none !important; }
  .marquee-track, .nav-logo::after { animation: none !important; }
  .case-card, .case-card-thumb img { transition: none !important; }
  .ai-workflow .flow-diagram .flow-step { opacity: 1; }
}

/* ---------- 1차 점검 반영 ---------- */
.hero { min-height: 88dvh; }
.hero-inner { grid-template-columns: 1.25fr .75fr !important; }
.hero-desc { max-width: 46ch !important; }
.hero-chips { left: -28px; right: auto; bottom: -22px; max-width: 120%; }
/* About: 사진이 없으면 빈 상자 대신 글을 넓게 */
.about-photo { display: none !important; }
.about-grid { grid-template-columns: 1fr !important; max-width: 860px; }
/* 섹션 제목은 두 줄 안에 */
.projects .section-title-lg { max-width: none !important; }
/* 벤토: 마지막 카드도 가로 전체(첫 카드와 좌우 반대) - 빈 칸이 생기지 않게 */
.case-card-grid > .case-card:last-child:nth-child(even) { grid-column: span 6; display: grid; grid-template-columns: 1fr 1.4fr; }
.case-card-grid > .case-card:last-child:nth-child(even) .case-card-thumb { order: 2; aspect-ratio: auto; height: 100%; min-height: 280px; }
/* 긴 전체 화면 캡처는 위쪽만 보이게 */
.case-card-thumb { overflow: hidden; max-height: 440px; }
.case-card-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
@media (max-width: 900px) {
  .hero-chips { left: 0; bottom: -18px; }
  .case-card-grid > .case-card:last-child:nth-child(even) { display: block; }
  .case-card-grid > .case-card:last-child:nth-child(even) .case-card-thumb { min-height: 0; aspect-ratio: 16 / 9; }
  /* note: 넓은 카드의 데스크톱용 height:100% 가 남으면 사진이 카드 높이를 다 차지해 아래 글이 잘린다(2026-10-21) */
  .case-card-grid > .case-card:first-child .case-card-thumb,
  .case-card-grid > .case-card:last-child:nth-child(even) .case-card-thumb { height: auto; }
}

/* ---------- 모바일 첫 화면: 위 데스크톱 규칙보다 뒤에 둬야 이긴다 ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr !important; justify-items: center; text-align: center; }
  .hero-media { order: -1; width: min(200px, 55vw); max-width: none; }
  .hero-chips { position: static; justify-content: center; margin-top: 14px; max-width: none; }
  .hero-desc { margin-left: auto; margin-right: auto; }
}
@media (max-width: 640px) {
  .hero { padding-top: 64px !important; padding-bottom: 32px !important; min-height: auto; }
  .hero-media { width: min(150px, 42vw); }
  .hero-chips { margin-top: 10px; gap: 6px; }
  .hero-chips li:nth-child(n+4) { display: none; }
  .hero-headline { font-size: 38px !important; margin: 8px 0 14px !important; }
  .hero-eyebrow { display: none; }
  .hero-cta { margin-top: 20px; }
}

/* ---------- 칩은 사진 위에 겹치지 않는다 (폭에 따라 줄 수가 달라져 얼굴을 덮었음, 2026-10-20 피드백) ---------- */
.hero-chips { position: static !important; margin-top: 16px; max-width: none !important; justify-content: center; }
.hero-photo::after { display: none; }
@media (max-width: 900px) { .hero-chips { justify-content: center; } }
@media (max-width: 900px) and (min-width: 641px) {
  .hero { padding-top: 72px !important; min-height: auto; }
  .hero-media { width: 170px; }
  .hero-chips li:nth-child(n+4) { display: none; }
  .hero-eyebrow { display: none; }
}

/* ---------- 재구성(채용 담당자용 첫 화면·경력 2단·역량) ---------- */
body { word-break: keep-all; overflow-wrap: break-word; }
.hero-headline-ko { font-family: 'Pretendard', var(--font-en) !important; font-size: clamp(36px, 4.4vw, 62px) !important;
  font-weight: 700 !important; letter-spacing: -.035em; line-height: 1.18 !important; }
.hero-years { font-family: var(--font-mono); font-size: 14px; color: var(--accent); margin: 4px 0 14px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: var(--text2); font-size: 16px; }
.hero-points li { position: relative; padding-left: 18px; }
.hero-points li::before { content: ""; position: absolute; left: 0; top: .62em; width: 8px; height: 2px; background: var(--accent); }
.case-key { margin: 2px 0 6px; font-size: 14px; color: var(--text); }
.case-key strong { font-weight: 700; }
.career-cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; }
.career-col-title { font-size: 15px !important; font-family: var(--font-mono) !important; color: var(--text3); margin: 0 0 22px; letter-spacing: .02em; }
.timeline-sub .timeline-item { padding-bottom: 28px; }
.timeline-sub .timeline-item h3 { font-size: 17px !important; }
.skill-group > p { font-size: 14px; color: var(--text2); margin: -6px 0 14px; line-height: 1.55; }
@media (max-width: 900px) {
  .career-cols { grid-template-columns: 1fr; gap: 24px; }
  .hero-points { text-align: left; max-width: 34em; margin: 0 auto; }
}
@media (max-width: 480px) {
  .hero-headline-ko { font-size: 30px !important; }
  .hero-points { font-size: 14.5px; }
}
/* 좁은 화면: 사진 칸이 좁아 칩이 한 줄에 하나씩 쌓인다 - 도구는 아래 흐름 띠에 있으니 숨김 */
@media (max-width: 600px) { .hero-chips { display: none !important; } }
.career-col-title { font-family: 'Pretendard', sans-serif !important; letter-spacing: 0 !important; font-weight: 600; }
@media (min-width: 1025px) { .bundle-grid { grid-template-columns: repeat(4, 1fr) !important; } }
/* 첫 화면 PDF 받기 줄 */
.hero-pdf { margin-top: 18px; font-size: 13px; color: var(--text3); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.hero-pdf a { color: var(--text2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent); }
.hero-pdf a:hover { color: var(--accent); }
@media (max-width: 900px) { .hero-pdf { justify-content: center; } }
/* 상세 사례 - 결제 흐름·결정 기록 */
.case-extra { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border); }
.step-flow { list-style: none; padding: 0; margin: 12px 0 14px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; counter-reset: step; }
.step-flow li { position: relative; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; color: var(--text2); line-height: 1.5; }
.step-flow li b { display: block; color: var(--text); font-size: 14px; margin-bottom: 4px; }
.step-flow li b::before { counter-increment: step; content: counter(step) ". "; color: var(--accent); font-family: var(--font-mono); }
.step-edge { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; color: var(--text2); }
.step-edge li { padding-left: 14px; position: relative; }
.step-edge li::before { content: ""; position: absolute; left: 0; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: #ff6b5e; }
.step-edge b { color: var(--text); margin-right: 6px; }
.decision { padding: 16px 0; border-bottom: 1px dashed var(--border); }
.decision:last-child { border-bottom: 0; }
.decision h5 { font-size: 16px; margin: 0 0 10px; color: var(--text); }
.decision dl { display: grid; grid-template-columns: 44px 1fr; gap: 6px 12px; margin: 0; font-size: 14px; line-height: 1.6; }
.decision dt { font-family: var(--font-mono); font-size: 12px; color: var(--accent); padding-top: 2px; }
.decision dd { margin: 0; color: var(--text2); }
@media (max-width: 760px) { .step-flow { grid-template-columns: 1fr; } }
.workflow-note { margin-top: 22px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text2); font-size: 15px; line-height: 1.7; }
.workflow-note b { color: var(--accent); margin-right: 8px; }

/* 사진 자리 표시(사진을 잠시 뺀 동안): 빈 칸이지만 사진 칸으로 읽히게 점선 테두리 + 작은 라벨 */
.photo-slot { aspect-ratio: 4 / 5; background: var(--surface-2); border: 1.5px dashed var(--text3) !important; box-shadow: none !important;
  display: flex; align-items: center; justify-content: center; }
.photo-slot::after { display: none; }
.photo-slot .photo-fallback-label { font-family: var(--font-mono); font-size: 13px; font-weight: 600; letter-spacing: .2em; color: var(--text3); }
/* 대표 프로젝트 배지: 초록 배경 위 흰 글자가 다크에서 안 보였다 */
.case-tag { color: var(--accent-ink) !important; }

/* 그 밖의 프로젝트: 한 줄 목록(대표가 아닌 프로젝트, 상세 창 없음) */
.case-card-grid > .case-card.case-brief { grid-column: span 6; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 20px; align-items: baseline; padding: 16px 22px; }
.case-card.case-brief:hover { transform: none; }
.case-brief .case-title { font-size: 16px !important; margin: 0; }
.case-brief .case-key { grid-column: 1; margin: 0; color: var(--text2); font-size: 14px; }
.case-brief .case-meta { grid-column: 2; grid-row: 1 / span 2; margin: 0; text-align: right; white-space: nowrap; }
.case-brief .case-summary { display: none; }
.bundle-card.bundle-text { padding: 18px 20px; }
.bundle-card.bundle-text h4 { margin-top: 0; }
@media (max-width: 640px) {
  .case-card-grid > .case-card.case-brief { grid-template-columns: 1fr; }
  .case-brief .case-meta { grid-column: 1; grid-row: auto; text-align: left; white-space: normal; }
}
/* 상호를 잘라 낸 가로로 긴 캡처는 왼쪽 위부터 보이게 */
.case-card-thumb img { object-position: left top; }
