/* =====================================================================
   강의/캠프 고도화 레이어 (2026-11-21) — pocket-ds/camp-upgrade.css
   - 대상: /camp/* 네 페이지의 main#main[data-up="camp"] 안쪽. data-up 을 지우면 이 파일의 규칙과 camp-upgrade.js 가 함께 꺼진다.
     범위 밖 규칙은 둘뿐이다: mark.hl 중립값(2장)과 모바일 메뉴 버튼 보정(11장).
   - 캠프 페이지는 인라인 style 로 그려지므로 규칙은 !important 로 덮는다(site.css 와 같은 방식).
     훅은 페이지가 이미 가진 것만 쓴다: data-screen-label · id · data-fx · 클래스 · 인라인 style 값.
     지원사업 캠프(pk-* 클래스)와 나머지 세 캠프(cp-* 클래스)는 같은 구획의 마크업이 달라, 둘 다 잡히도록 구조 기준으로 썼다.
   - 템플릿에 더한 마크업: <mark class="hl">(핵심 구절), 투자유치 캠프 제목의 white-space:nowrap 하나.
   - 움직임의 시작 상태는 html.cu-motion(스크립트가 붙인다) 아래에만 둔다. 스크립트가 없거나 움직임 줄이기 설정이면 끝 상태로 보인다.
     화면 폭 보정(7-1 · 10 · 11 · 12장)은 스크립트와 무관하게 늘 적용된다.
   - 화면 폭: 1280 이상 PC / 1024~1279 태블릿 가로 / 768~1023 태블릿 세로 / 767 이하 모바일.
   ===================================================================== */

/* ---------- 0. 토큰 ---------- */
#main[data-up]{
  --cu-ease:cubic-bezier(.2,.8,.2,1);
  --cu-ease-out:cubic-bezier(.16,1,.3,1);
  --cu-sheet-r:28px;
  --cu-hl:rgba(9,85,249,.2);
  --cu-hl:color-mix(in srgb,var(--brand-primary,#0955F9) 22%,transparent);
  --cu-hl-ink:var(--text-primary,#15171C);
  /* 제목 척도: 1280 이상은 원래 값(clamp(32px,3.6vw,56px))을 그대로 두고, 그 아래에서 태블릿이 모바일 크기까지 줄지 않게 잇는다 */
  --cu-h2:clamp(32px,1.76vw + 23.5px,46px);   /* 768 → 37 · 1024 → 41.5 · 1279 → 46 */
  --cu-h1:clamp(40px,3.2vw + 20px,66px);      /* 768 → 44.6 · 1024 → 52.8 · 1440 → 66 */
}
@media(max-width:767px){#main[data-up]{--cu-sheet-r:20px}}

/* ---------- 1. 글자 ---------- */
#main[data-up] h1,#main[data-up] h2{text-wrap:balance}
#main[data-up] h2{letter-spacing:-.04em!important}
@media(max-width:1279px){#main[data-up] h2{font-size:var(--cu-h2)!important;line-height:1.24!important}}
/* 숫자는 자리 폭을 맞춘다(세는 동안 흔들리지 않게) */
#main[data-up] > [data-screen-label="현장"] [data-fx="stagger"],#main[data-up] #pricing,#main[data-up] [data-camp-timeline]{font-variant-numeric:tabular-nums lining-nums}

/* ---------- 2. 핵심 문구 하이라이팅 ----------
   문구를 <mark class="hl"> 로 감싼다. 글자 아래에 브랜드 색 띠가 깔리고 글자색은 본문보다 한 단계 진하다. 굵기는 그대로 둔다.
   어두운 바탕에서는 hl--inv 를 함께 쓴다. 띠는 화면에 들어올 때 왼쪽에서 오른쪽으로 한 번 그어진다 */
/* 스위치(data-up)를 꺼도 <mark> 가 브라우저 기본 노란 바탕으로 보이지 않게, 범위 밖에서 먼저 본문과 같게 돌려 둔다 */
mark.hl{background:none;color:inherit}
#main[data-up] .hl,#main[data-up] ~ [data-screen-label="하단 신청바"] .hl{padding:0 .14em;margin:0 -.14em;color:var(--cu-hl-ink,inherit);background:linear-gradient(var(--cu-hl),var(--cu-hl)) 0 90% / 100% 50% no-repeat;-webkit-box-decoration-break:clone;box-decoration-break:clone}
#main[data-up] .hl--inv,#main[data-up] ~ [data-screen-label="하단 신청바"] .hl--inv{--cu-hl:rgba(9,85,249,.78);--cu-hl-ink:#fff}
/* hl--tone: 색이 있는 제목 안에서는 둘레 글자색을 그대로 따른다 */
#main[data-up] .hl--tone{color:inherit}
html.cu-motion #main[data-up] .hl{background-size:0% 50%;transition:background-size .9s var(--cu-ease-out) .35s}
html.cu-motion #main[data-up] .hl[data-cu-in]{background-size:100% 50%}

/* ---------- 3. 섹션 제목: 바닥선 아래에서 올라온다 ----------
   기존 확대(zoom)·떠오르기(reveal · data-pm)는 제목에 한해 끄고 하나로 통일한다. 스크립트가 data-cu-in 을 달 때 올라온다 */
html.cu-motion #main[data-up] h2{transform:none!important;opacity:1!important;transition:clip-path .95s var(--cu-ease-out),translate .95s var(--cu-ease-out)!important}
html.cu-motion #main[data-up] h2:not([data-cu-in]){clip-path:inset(0 -1em 100% -1em);translate:0 .42em}
html.cu-motion #main[data-up] h2[data-cu-in]{clip-path:inset(-.3em -1em -.4em -1em);translate:0 0}

/* ---------- 4. 첫 화면 ---------- */
/* 제목: 태블릿에서 32px 까지 줄던 것을 잇고(모바일 46px 보다 작아지는 역전을 없앤다), 넓은 화면에서는 66px 까지 키운다. 767 이하는 site.css 값을 따른다 */
@media(min-width:768px){
  #main[data-up] > [data-pk-hero] h1{font-size:var(--cu-h1)!important;line-height:1.16!important;letter-spacing:-.045em!important}
}
/* 화면이 뜰 때 한 번: 제목이 먼저 올라오고, 버튼 · 공고 · 낱말 줄이 차례로 떠오른다.
   첫 화면 제목에는 clip-path 를 쓰지 않는다: 여기에 clip-path 키프레임을 걸면 애니메이션이 끝난 뒤에도 첫 스크롤의 첫 프레임이
   33~50ms 로 늘어났다(원본 17ms, 390 · 1440 폭에서 5회씩 측정). opacity + translate 로 바꾸면 원본과 같다 */
@keyframes cu-rise{from{opacity:0;translate:0 .42em}to{opacity:1;translate:0 0}}
@keyframes cu-up{from{opacity:0;translate:0 18px}}
@media(prefers-reduced-motion:no-preference){
  #main[data-up] > [data-pk-hero] h1{animation:cu-rise 1.05s var(--cu-ease-out) .05s backwards}
  #main[data-up] > [data-pk-hero] [data-fx~="hero"] > h1 ~ *{animation:cu-up .8s var(--cu-ease) backwards}
  #main[data-up] > [data-pk-hero] [data-fx~="hero"] > h1 + *{animation-delay:.32s}
  #main[data-up] > [data-pk-hero] [data-fx~="hero"] > h1 + * + *{animation-delay:.46s}
  #main[data-up] > [data-pk-hero] [data-fx~="hero"] > h1 + * + * ~ *{animation-delay:.6s}
}

/* 첫 화면 덮기: 히어로는 화면에 붙어 있고 다음 구획이 종이처럼 그 위로 올라온다.
   히어로가 화면보다 길면 아래 끝이 화면 아래에 닿은 뒤에 붙는다(--cu-hero-h 는 스크립트가 잰다). 다 덮이면 흐름으로 돌려보낸다 */
html.cu-motion #main[data-up] > [data-pk-hero][data-cu-cover]{position:sticky!important;z-index:0;top:min(var(--cu-gh,69px),calc(100vh - var(--cu-hero-h,0px)));top:min(var(--cu-gh,69px),calc(100svh - var(--cu-hero-h,0px)))}
html.cu-motion #main[data-up] > [data-pk-hero][data-cu-cover][data-cu-covered]{position:relative!important;top:auto}
/* 어두워지는 덮개. 덮인 만큼의 불투명도는 스크립트가 이 ::after 에 건 애니메이션의 진행 시간으로 옮긴다.
   (덮인 정도를 히어로에 CSS 변수로 매 프레임 쓰면 히어로 전체를 다시 칠해 프레임이 떨어진다.)
   그 방식을 쓸 수 없는 브라우저에서는 절반쯤 덮였을 때 data-cu-covering 으로 한 번 어두워진다 */
html.cu-motion #main[data-up] > [data-pk-hero][data-cu-cover]::after{content:"";position:absolute;inset:0;z-index:5;pointer-events:none;background:#000;opacity:0;transition:opacity .7s var(--cu-ease)}
html.cu-motion #main[data-up] > [data-pk-hero][data-cu-cover][data-cu-covering]::after{opacity:.5}
html.cu-motion #main[data-up] > [data-pk-hero][data-cu-cover] ~ *{position:relative;z-index:1}
html.cu-motion #main[data-up] > [data-pk-hero][data-cu-cover] + *{border-radius:var(--cu-sheet-r) var(--cu-sheet-r) 0 0}

/* ---------- 5. 강조 구절: 이미 강조하던 구절을 형광펜 띠로 ----------
   모듈 제목 · 커리큘럼 제목의 강조 구절은 캠프마다 표기가 다르다: 지원사업은 파란 글자 + 밑줄(모듈 2px · 커리큘럼 1.5px), 투자유치는 파란 글자만,
   마케팅 · AI 개발은 강조가 없어 <mark class="hl"> 로 새로 지정했다. 셋 다 같은 띠 + 파란 글자로 맞춘다(밑줄은 띠로 바꾼다).
   자주 묻는 질문의 답과 안내 문장에서 굵게 쓴 구절도 같은 띠를 받는다 */
#main[data-up] span[style*="color: var(--brand-primary)"][style*="px solid var(--border-brand)"],
#main[data-up] #solve .cp-acc > span:nth-child(2) > span[style*="color: var(--brand-primary)"]{padding:0 .12em;margin:0 -.12em;background:linear-gradient(var(--cu-hl),var(--cu-hl)) 0 92% / 100% 46% no-repeat;-webkit-box-decoration-break:clone;box-decoration-break:clone}
#main[data-up] span[style*="color: var(--brand-primary)"][style*="px solid var(--border-brand)"]{border-bottom-color:transparent!important}
#main[data-up] #solve .cp-acc .hl,#main[data-up] #solve .pk-exp .hl{color:var(--brand-primary,#0955F9)}
#main[data-up] #faq button + div strong,#main[data-up] #faq button + div span[style*="font-weight: 700"],#main[data-up] #pocketbiz strong{padding:0 .12em;margin:0 -.12em;background:linear-gradient(var(--cu-hl),var(--cu-hl)) 0 90% / 100% 50% no-repeat;-webkit-box-decoration-break:clone;box-decoration-break:clone}
html.cu-motion #main[data-up] span[style*="color: var(--brand-primary)"][style*="px solid var(--border-brand)"],
html.cu-motion #main[data-up] #solve .cp-acc > span:nth-child(2) > span[style*="color: var(--brand-primary)"],
html.cu-motion #main[data-up] #faq button + div strong,html.cu-motion #main[data-up] #faq button + div span[style*="font-weight: 700"],html.cu-motion #main[data-up] #pocketbiz strong{background-size:0% 50%;transition:background-size .9s var(--cu-ease-out) .3s}
html.cu-motion #main[data-up] span[style*="color: var(--brand-primary)"][style*="px solid var(--border-brand)"][data-cu-in],
html.cu-motion #main[data-up] #solve .cp-acc > span:nth-child(2) > span[style*="color: var(--brand-primary)"][data-cu-in],
html.cu-motion #main[data-up] #faq button + div strong[data-cu-in],html.cu-motion #main[data-up] #faq button + div span[style*="font-weight: 700"][data-cu-in],html.cu-motion #main[data-up] #pocketbiz strong[data-cu-in]{background-size:100% 50%}

/* ---------- 6. 이미지 비율 ----------
   width · height 속성만 있고 높이 스타일이 없는 이미지는 폭이 줄어도 높이가 속성 값(예: 1067px)에 묶여 가로로 눌려 보였다.
   높이를 폭에 맞춰 원래 비율로 그린다(포켓비즈 화면 캡처가 해당한다) */
#main[data-up] img[width][height]:not([style*="height"]){height:auto!important}

/* ---------- 7. 하루 8시간 막대 · 모듈 줄 (#solve) ----------
   보이는 동안 되풀이되던 막대 채움을 스크롤 진행으로 바꾼다: 막대가 화면에 들어오면 모듈 칸이 차례로 차고, 아래 모듈 줄은 지나가는 만큼 켜진다 */
html.cu-motion #main[data-up] [data-camp-timeline][data-cu-scrub] [data-grow]{transform:scaleX(0)!important;transform-origin:0 50%!important;transition:transform .7s var(--cu-ease-out)!important}
html.cu-motion #main[data-up] [data-camp-timeline][data-cu-scrub] [data-cu-lit] > [data-grow]{transform:scaleX(1)!important}
html.cu-motion #main[data-up] [data-camp-timeline][data-cu-scrub] [data-grow] + span{transition:color .4s linear .1s}
html.cu-motion #main[data-up] [data-camp-timeline][data-cu-scrub] :not([data-cu-lit]) > [data-grow] + span{color:var(--pk-text-tertiary,#626D7B)!important}
/* 모듈 줄: 지원사업 캠프는 .scp4, 나머지 세 캠프는 .scp3 */
html.cu-motion #main[data-up] #solve [data-cu-scrub] > .scp4,html.cu-motion #main[data-up] #solve [data-cu-scrub] > .scp3{transition:opacity .5s var(--cu-ease),translate .6s var(--cu-ease-out)}
html.cu-motion #main[data-up] #solve [data-cu-scrub] > .scp4:not([data-cu-lit]),html.cu-motion #main[data-up] #solve [data-cu-scrub] > .scp3:not([data-cu-lit]){opacity:.36;translate:0 10px}

/* 7-1. 막대의 이름표가 잘리던 폭(원본 보정)
   막대 = [data-camp-timeline] 의 마지막 div, 칸 = 그 자식, 칸 안 = [data-grow](색) + span(이름 · 시간).
   · 768~959px: 1시간 칸이 80px 안팎이라 이름이 "합…"처럼 잘렸다 → 칸 안을 두 줄(이름 / 시간)로 쌓는다. 비율은 그대로 둔다
   · 767px 이하: 지원사업 캠프에만 있던 2×2 격자 규칙을 네 캠프 모두에 준다(나머지 셋은 1시간 칸에 이름이 한 글자도 안 들어갔다) */
@media(min-width:768px) and (max-width:959px){
  #main[data-up] [data-camp-timeline] > div:last-child{height:62px!important}
  #main[data-up] [data-camp-timeline] [data-grow] + span{flex-direction:column!important;align-items:flex-start!important;justify-content:center!important;gap:3px!important;padding:0 10px!important}
  #main[data-up] [data-camp-timeline] [data-grow] + span > span:first-child{max-width:100%;font-size:14px!important;line-height:1.2}
  #main[data-up] [data-camp-timeline] [data-grow] + span > span:last-child{font-size:12.5px!important;line-height:1.1}
}
@media(max-width:767px){
  #main[data-up] [data-camp-timeline] > div:last-child{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-rows:56px!important;height:auto!important}
}

/* ---------- 8. 커리큘럼 (#curriculum): 항목이 읽는 위치를 따라 차례로 또렷해진다 ---------- */
html.cu-motion #main[data-up] #curriculum [data-cu-scrub] > *{transition:opacity .45s var(--cu-ease),translate .5s var(--cu-ease-out)}
html.cu-motion #main[data-up] #curriculum [data-cu-scrub] > :not([data-cu-lit]){opacity:.3;translate:8px 0}

/* ---------- 9. 자주 묻는 질문: 답이 열릴 때 내려앉는다 ---------- */
@keyframes cu-open{from{opacity:0;translate:0 -8px}}
html.cu-motion #main[data-up] #faq button + div{animation:cu-open .45s var(--cu-ease) backwards}

/* 9-1. 포켓비즈 화면은 스크롤에 맞춰 다가온다 — 스크립트가 그 카드의 transform 만 직접 쓴다(규칙 없음) */

/* ---------- 9-2. 후기 영상(검증된 강의): 바탕을 영상의 검정에 맞춘다 ----------
   영상(GIF)의 바탕은 #000 인데 구획 바탕은 #15171C 라, 넓은 화면에서 양옆에 이음매가 보였다 */
#main[data-up] > [data-screen-label="검증된 강의"]{background:#000!important}

/* ---------- 10. 태블릿(768~1023) ----------
   지원사업 캠프의 카드 3장(#persona)은 2 + 1 로 떨어져 오른쪽 반이 비었다.
   · 900~1023px: 3단을 유지한다(카드 안 도식이 잘리지 않는 폭)
   · 768~899px: 3단이면 도식의 이름표가 잘린다 → 2단 + 셋째 카드를 가로형으로 펼쳐 줄을 채운다(도식 글자 크기는 줄이지 않는다) */
@media(min-width:900px) and (max-width:1023px){
  #main[data-up] #persona [style*="auto-fit"]{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px!important}
  #main[data-up] #persona [style*="auto-fit"] > div > div:first-child{padding:20px 14px!important;min-height:200px!important}
  #main[data-up] #persona [style*="auto-fit"] > div > div:nth-child(2){padding:18px 16px 20px!important;gap:10px!important}
  #main[data-up] #persona [style*="auto-fit"] > div > div:nth-child(2) > span:last-child{font-size:17px!important}
}
@media(min-width:768px) and (max-width:899px){
  #main[data-up] #persona [style*="auto-fit"]{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px!important}
  #main[data-up] #persona [style*="auto-fit"] > div:nth-child(3):last-child{grid-column:1 / -1;flex-direction:row!important}
  #main[data-up] #persona [style*="auto-fit"] > div:nth-child(3):last-child > div:first-child{flex:0 0 50%;box-sizing:border-box;min-height:208px!important}
  #main[data-up] #persona [style*="auto-fit"] > div:nth-child(3):last-child > div:nth-child(2){flex:1 1 0;min-width:0;align-items:center!important;padding:24px 28px!important}
}
/* 모듈 줄: 제목이 세 줄로 꺾이지 않게 산출물 칩을 제목 아래 줄로 내린다.
   지원사업 캠프(.pk-exp)는 767px 이하, 나머지 세 캠프(.cp-acc)는 640px 이하에 자체 규칙이 있어 그 위 구간만 맡는다 */
@media(min-width:768px) and (max-width:1023px){
  #main[data-up] #solve .pk-exp{grid-template-columns:74px minmax(0,1fr) 30px!important;row-gap:14px!important}
  #main[data-up] #solve .pk-exp > :nth-child(3){grid-column:2 / 3!important;grid-row:2!important;justify-self:start}
  #main[data-up] #solve .pk-exp > :nth-child(4){grid-column:3!important;grid-row:1!important}
}
@media(min-width:641px) and (max-width:1023px){
  #main[data-up] #solve .cp-acc{grid-template-columns:74px minmax(0,1fr) 30px!important;row-gap:14px!important}
  #main[data-up] #solve .cp-acc > :nth-child(3){grid-column:2 / 3!important;grid-row:2!important;justify-self:start}
  #main[data-up] #solve .cp-acc > :nth-child(4){grid-column:3!important;grid-row:1!important}
}

/* ---------- 11. 모바일 메뉴 버튼(원본 보정) ----------
   버튼이 내비 전체 높이(top:0; bottom:0)를 따라가서, 목차 줄이 붙어 내비가 122px 로 커지면 줄 세 개 아이콘이 두 줄 사이로 내려왔다.
   첫 줄 높이(68px)에 묶는다. 이 규칙만 #main 밖(상단 메뉴)을 건드린다. 같은 보정은 공용 tokens.css 의 .pk-mnav-btn 에 넣는 것이 맞다 */
nav.pk-gnav > .pk-mnav-btn{bottom:auto!important;height:68px!important}

/* ---------- 12. 모바일(767 이하) 보정 ----------
   지원사업 캠프는 pk-* 규칙으로 모바일을 이미 챙기지만, 나머지 세 캠프(cp-* 구조)는 640px 규칙 하나뿐이라 같은 자리가 깨져 있었다.
   네 캠프가 같은 모양이 되도록 빠진 자리만 채운다(원본 보정) */
@media(max-width:767px){
  /* 포켓비즈 단계 탭: 4칸 한 줄이라 "강의 → 실"처럼 글자가 옆 칸으로 넘쳤다 → 2 × 2 (지원사업 캠프의 .pk-steps4 와 같다) */
  #main[data-up] #pocketbiz [data-fx~="stagger"][style*="repeat(4"]{grid-template-columns:repeat(2,minmax(0,1fr))!important}

  /* 수강료 카드: 두 단이 한 단으로 쌓일 때 오른쪽 단의 세로 구분선 · 왼쪽 여백 48px 이 그대로 남아 목록이 좁게 밀려 있었다.
     구분선을 가로로 돌리고 카드 안 여백을 화면에 맞춘다(네 캠프 공통) */
  #main[data-up] #plan-online{padding:30px 24px 32px!important;gap:26px!important}
  #main[data-up] #plan-online > div:nth-child(2){padding-left:0!important;border-left:0!important;padding-top:26px;border-top:1px solid var(--divider,#E5E8EC)}
  #main[data-up] #plan-ebook{padding:24px!important}

  /* 투자유치 캠프 첫 화면의 원 다섯 개: 84px 고정이라 390px 아래에서 양끝이 잘리고, 겹친 원이 옆 원의 이름표 첫 글자를 가렸다.
     화면에 맞춰 원을 줄이고(5개 - 겹침 36px = 화면 - 16px), 가려지는 왼쪽 9px 만큼 이름표를 밀고, 긴 이름표는 두 줄로 꺾는다 */
  #main[data-up] > [data-pk-hero] span[style*="width: clamp(84px"]{width:min(84px,calc((100vw + 20px) / 5))!important;height:min(84px,calc((100vw + 20px) / 5))!important;box-sizing:border-box}
  #main[data-up] > [data-pk-hero] span[style*="width: clamp(84px"] + span[style*="width: clamp(84px"]{padding-left:9px}
  #main[data-up] > [data-pk-hero] span[style*="width: clamp(84px"] > span{max-width:5.2em}
}
@media(max-width:640px){
  /* 모듈 줄(세 캠프): 시간 배지가 칸 폭만큼 늘어나 버튼처럼 보였다 → 제 크기로 */
  #main[data-up] #solve .cp-acc > :nth-child(1){justify-self:start}
}
