/* KIWY 홈페이지 — 움직임과 메인 새 구성 (2026-10-15 대표님 「홈페이지 모션그래픽으로 전체 변경,
 * 서브페이지도 같이」 「메인 정보 보강·스토리감 있는 모션」, 시안 claude.ai/artifact/NU9Sg245AK9sT92MUkGDG4).
 *
 * motion.js 와 짝이다. 글은 스크립트 없이도 다 보인다 — 숨겼다 드러내기는 <html class="js"> 일 때만.
 * 「동작 줄이기」를 켠 사람에게는 site.css 의 공통 규칙이 모든 움직임을 끄고, 여기서 숨긴 것을 다 드러낸다.
 */

/* 화면 낭독기에만 읽히는 글(움직이는 장면의 같은 내용) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------------------------------------------------------- 떠오르기(모든 페이지) */
.js .rv {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .75s cubic-bezier(.2,.8,.2,1) var(--d, 0s),
              transform .75s cubic-bezier(.2,.8,.2,1) var(--d, 0s);
}
.js .rv.in { opacity: 1; transform: none; }

/* 단계 목록 — 숫자 사이를 잇는 선이 위에서 아래로 찬다 */
.how-timeline.draw { position: relative; }
.how-timeline.draw::after {
  content: ""; position: absolute; left: 14px; top: 16px; bottom: 16px; width: 2px;
  background: var(--kiwi-green); transform-origin: top; transform: scaleY(0);
  transition: transform 1.6s cubic-bezier(.3,.7,.2,1) .2s; z-index: 0;
}
.how-timeline.draw li::before { position: relative; z-index: 1; }
.how-timeline.draw.drawn::after { transform: scaleY(1); }

/* 서브페이지 첫 화면 — 사진이 아주 천천히 다가오고 글이 떠오른다(열릴 때 한 번) */
@keyframes kwZoom { from { transform: scale(1.08); } to { transform: none; } }
@keyframes kwUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.js .ph-hero picture img { animation: kwZoom 6s cubic-bezier(.2,.7,.2,1) both; }
.js .ph-hero .wrap > *,
.js .hero:not(.slides) .wrap > div > * { animation: kwUp .8s cubic-bezier(.2,.8,.2,1) both; }
.js .ph-hero .wrap > :nth-child(2),
.js .hero:not(.slides) .wrap > div > :nth-child(2) { animation-delay: .1s; }
.js .ph-hero .wrap > :nth-child(3),
.js .hero:not(.slides) .wrap > div > :nth-child(3) { animation-delay: .2s; }
.js .ph-hero .wrap > :nth-child(n+4),
.js .hero:not(.slides) .wrap > div > :nth-child(n+4) { animation-delay: .3s; }
.js .hero:not(.slides) .art { animation: kwUp 1s cubic-bezier(.2,.8,.2,1) .15s both; }

/* 메인 슬라이드 — 지금 장의 사진이 천천히 다가오고 글이 떠오른다 */
.hero.slides .slide.is-on picture img { animation: kwZoom 7s cubic-bezier(.2,.7,.2,1) both; }
.hero.slides .slide.is-on .copy > * { animation: kwUp .9s cubic-bezier(.2,.8,.2,1) .15s both; }
.hero.slides .slide.is-on .copy > :nth-child(2) { animation-delay: .3s; }

/* 30초 고리(작동 방식) — 실제와 같은 30초를 센다. 긴급 장면이라 캐릭터 없음 */
.r30-wrap { display: grid; justify-items: center; gap: 16px; }
.r30 { position: relative; display: grid; place-items: center; width: 210px; height: 210px; border-radius: 50%;
  background: #1A0F10; box-shadow: 0 0 0 12px #2A2E33, 0 20px 40px rgba(0,0,0,.18); color: #fff; }
.r30 svg { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); transform: rotate(-90deg); }
.r30 .r30-track { fill: none; stroke: rgba(255,255,255,.14); stroke-width: 8; }
.r30 .r30-bar { fill: none; stroke: #FF5A4A; stroke-width: 8; stroke-linecap: round; stroke-dasharray: 478; stroke-dashoffset: 0; }
.r30.go .r30-bar { transition: stroke-dashoffset 30s linear; stroke-dashoffset: 478; }
.r30 .r30-in { position: relative; text-align: center; line-height: 1.2; }
.r30 .r30-t { display: block; font-size: 13px; font-weight: 800; }
.r30 .r30-num { display: block; font-size: 50px; font-weight: 900; font-variant-numeric: tabular-nums; }
.r30 .r30-s { display: block; font-size: 12px; opacity: .8; }
.r30.done .r30-s::after { content: " · 연락이 나갑니다"; }
.r30-wrap p { margin: 0; font-size: 14px; color: var(--muted); text-align: center; max-width: 320px; }

/* ---------------------------------------------------------- 메인 — 3D 지도 슬라이드 */
.hero.slides .slide.map-slide { background: linear-gradient(120deg, #132232 0%, #1F3A52 100%); }
.hero.slides .slide.map-slide::after { display: none; }
.hero.slides .map-slide .copy h1, .hero.slides .map-slide .copy .h1 { color: #fff; }
.hero.slides .map-slide .copy .lead { color: #C9D6E2; }
.hero.slides .map-slide .eyebrow { display: inline-block; margin: 0 0 12px; padding: 4px 12px; border-radius: 999px;
  background: rgba(169,211,107,.18); color: var(--kiwi-green); font-size: 13px; font-weight: 800; letter-spacing: .06em; }
.hero.slides .map-slide .copy > * { max-width: min(46%, 500px); }
.map-art { position: absolute; right: max(20px, calc((100% - 1080px) / 2 + 20px)); top: 50%; z-index: 1;
  transform: translateY(-56%); width: min(46vw, 540px); }
.map-art .stage-fit { position: relative; }
.map-art .stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.map-art .map-m { display: none; }
/* 슬라이드가 켜질 때마다 처음부터(script 가 .play 를 다시 붙인다). 꺼져 있으면 그리지 않는다 */
/* 이름을 뺐다가 다시 붙여야 처음부터 다시 돈다(클래스만 다시 붙이면 이어서 돈다) */
.js .map-slide:not(.play) .map-art * { animation-name: none !important; }
.map-slide .map-art [class^="m5-"], .map-slide .map-art [class*=" m5-"] { animation-iteration-count: 1 !important; animation-fill-mode: both !important; }
/* 슬라이드 단추·안내가 지도 위로 오지 않게 — 지도 쪽은 남색 바탕이라 단추 글을 밝게 */
.hero.slides.on-map .dot { background: rgba(255,255,255,.35); }
.hero.slides.on-map .dot.is-on { background: #fff; }
.hero.slides.on-map .pause { color: #fff; }
.hero.slides.on-map .slide-ui .hint { color: #C9D6E2; }
.hero.slides.on-map .btn-ghost { background: rgba(255,255,255,.92); }
.hero.slides.on-map .slide-ui .hint { max-width: 46%; }
@media (max-width: 760px) {
  .hero.slides .map-slide .copy > * { max-width: none; }
  .map-art { right: 50%; transform: translateX(50%); top: auto; bottom: 146px; width: min(76vw, 290px); }
  .map-art .map-pc { display: none; }
  .map-art .map-m { display: block; }
  .hero.slides .map-slide .copy { padding-top: 28px; }
  /* 휴대폰은 지도가 설명을 대신한다 — 긴 설명은 접는다(화면 낭독기는 그대로 읽는다) */
  .hero.slides.on-map .slide-ui .hint { max-width: none; }
}
/* 지도와 설명이 나란히 들어가지 않는 폭 — 긴 설명은 접는다(지도가 대신 보여 주고, 화면 낭독기는 그대로 읽는다) */
@media (max-width: 1000px) {
  .hero.slides .map-slide .copy .lead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* ---------------------------------------------------------- 메인 — 이야기 한 편 */
.kw-story { background: #132232; color: #fff; padding: clamp(56px, 8vw, 96px) 0; }
.kw-story h2 { color: #fff; }
.kw-story .eyebrow { margin: 0 0 8px; font-size: 14px; font-weight: 800; letter-spacing: .12em; color: var(--kiwi-green); }
.kw-story .head { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; flex-wrap: wrap; margin-bottom: 26px; }
.kw-story .head h2 { margin: 0; font-size: clamp(26px, 3.6vw, 40px); line-height: 1.3; }
.kw-story .head p { margin: 0; max-width: 420px; color: #9FB2C2; font-size: 15.5px; }
.kw-story .stage-fit { position: relative; }
.kw-story .stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.kw-story .story-pc .stage { width: 1152px; }
.kw-story .story-m .stage { width: 358px; }
.kw-story .story-m { display: none; }
.kw-story .story-static { display: none; }
@media (max-width: 900px) {
  .kw-story .story-pc { display: none; }
  .kw-story .story-m { display: block; }
}
/* 스크립트가 없거나 동작 줄이기면 장면 목록(멈춘 그림) */
html:not(.js) .kw-story .story-live-box,
html.still .kw-story .story-live-box { display: none; }
html:not(.js) .kw-story .story-static.pc,
html.still .kw-story .story-static.pc { display: grid; }
@media (max-width: 900px) {
  html:not(.js) .kw-story .story-static.pc,
  html.still .kw-story .story-static.pc { display: none; }
  html:not(.js) .kw-story .story-static.m,
  html.still .kw-story .story-static.m { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  .kw-story .story-live-box { display: none; }
  .kw-story .story-static.pc { display: grid; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 900px) {
  .kw-story .story-static.pc { display: none; }
  .kw-story .story-static.m { display: flex; }
}
/* 화면에 들어오기 전·밖에 있을 때·다른 탭일 때는 멈춘다 */
.story-live:not(.run) *, .story-live.paused *, .story-live.hidden-tab * { animation-play-state: paused !important; }

/* ---------------------------------------------------------- 메인 — 새 구간들 */
.kw-eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 800; letter-spacing: .12em; color: var(--green-dark); }
.kw-dark { background: var(--surface); }
.kw-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.kw-grid2 > div { min-width: 0; }
.kw-grid2 p { color: var(--muted); }
.kw-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.kw-points li { background: var(--beige); border-radius: 16px; padding: 14px 16px; font-size: 15px; color: var(--muted); }
.kw-points b { display: block; color: var(--navy); font-size: 16px; margin-bottom: 2px; }

/* 손목 화면 모형 — 긴급 화면이라 빨강·캐릭터 없음 */
.kw-watch { justify-self: center; position: relative; width: 300px; height: 300px; border-radius: 50%;
  background: #1A0F10; box-shadow: 0 0 0 16px #2A2E33, 0 0 0 18px #3A3F45, 0 30px 60px rgba(0,0,0,.25);
  display: grid; place-items: center; color: #fff; text-align: center; }
.kw-watch .in { width: 76%; display: grid; gap: 6px; justify-items: center; }
.kw-watch .t { font-size: 13px; color: #FFB4AA; font-weight: 700; }
.kw-watch .h { font-size: 22px; font-weight: 900; line-height: 1.2; }
.kw-watch ol { list-style: none; padding: 0; margin: 2px 0; font-size: 12px; color: #F1C9C4; line-height: 1.5; }
.kw-watch .b { display: flex; gap: 6px; }
.kw-watch .b span { padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 800; }
.kw-watch .b .g { background: #3A1614; color: #fff; border: 1px solid #FF8A7A; }
.kw-watch .b .r { background: #D32F2F; color: #fff; }
.kw-watch::before { content: ""; position: absolute; inset: -16px; border-radius: 50%; border: 3px solid rgba(255,90,74,.5); }
.js .kw-watch::before { animation: kwPulse 2.6s ease-out infinite; }
@keyframes kwPulse { 0% { transform: scale(.96); opacity: .8; } 100% { transform: scale(1.22); opacity: 0; } }

/* 보호자 — 세 갈래가 동시에 차오르는 막대 */
.kw-bars { display: grid; gap: 12px; margin: 16px 0 6px; }
.kw-bars div { display: grid; grid-template-columns: 60px minmax(0, 1fr); align-items: center; gap: 12px; font-size: 14.5px; font-weight: 700; }
.kw-bars i { display: block; height: 10px; border-radius: 5px; background: var(--kiwi-green); transform-origin: left; }
.js .kw-bars i { transform: scaleX(0); transition: transform 1.4s cubic-bezier(.2,.8,.2,1) .3s; }
.js .kw-bars.on i { transform: scaleX(1); }
.kw-order { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.kw-order li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: center; font-size: 15px; color: var(--muted); }
.kw-order li b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 14px; }

/* 잘못 울려도 괜찮습니다 — 네 칸 */
.kw-four { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kw-four .card b.big { display: block; font-size: clamp(26px, 3vw, 34px); color: var(--green-dark); line-height: 1.1; margin-bottom: 8px; }

/* 평소에는 — 컨디션 막대 */
.kw-cond { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; display: grid; gap: 12px; }
.kw-cond .top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.kw-cond .top b { font-size: 17px; }
.kw-cond .top span { font-size: 14px; font-weight: 700; color: var(--green-dark); }
.kw-cond .row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; font-size: 14px; color: var(--muted); }
.kw-cond .row i { display: block; height: 8px; border-radius: 4px; background: #EDE7DD; position: relative; overflow: hidden; }
.kw-cond .row i::after { content: ""; position: absolute; inset: 0; width: var(--w); border-radius: 4px; background: var(--c); transform-origin: left; }
.js .kw-cond .row i::after { transform: scaleX(0); transition: transform 1.4s cubic-bezier(.2,.8,.2,1) .4s; }
.js .kw-cond.on .row i::after { transform: scaleX(1); }
.kw-cond small { color: var(--muted); font-size: 12.5px; }
.kw-daily-art { display: grid; gap: 16px; justify-items: center; }
.kw-daily-art img { width: 180px; height: auto; }

/* 개인정보·기기·요금 */
.kw-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.kw-three .card h3 { font-size: 20px; line-height: 1.35; }
.kw-three .card.plan { background: var(--navy); border-color: var(--navy); }
.kw-three .card.plan h3, .kw-three .card.plan .amount { color: #fff; }
.kw-three .card.plan p { color: #C9D6E2; }
.kw-three .card.plan .amount { font-size: 34px; font-weight: 900; margin: 4px 0 8px; }
.kw-tag { display: inline-block; font-size: 12px; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: var(--soft-blue); color: var(--navy); margin-top: 10px; }

/* 자주 묻는 질문 요약 */
.kw-faq { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 40px; align-items: start; }
.kw-faq .side img { width: 160px; height: auto; margin-top: 10px; }

/* 맺음의 꼭 알아 두실 것 */
.kw-must { border: 1px solid var(--line); border-radius: 18px; padding: 18px 22px; font-size: 14.5px; color: var(--muted); background: var(--surface); }
.kw-must b { color: var(--navy); }
.kw-must ul { margin: 6px 0 0; padding-left: 20px; }

@media (max-width: 900px) {
  .kw-grid2, .kw-faq { grid-template-columns: 1fr; gap: 26px; }
  .kw-four { grid-template-columns: 1fr 1fr; }
  .kw-three { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .kw-points, .kw-four { grid-template-columns: 1fr; }
  .kw-watch { width: 260px; height: 260px; }
}

/* ---------------------------------------------------------- 동작 줄이기 — 모두 처음부터 보인다 */
@media (prefers-reduced-motion: reduce) {
  .js .rv { opacity: 1; transform: none; }
  .how-timeline.draw::after { transform: scaleY(1); }
  .js .kw-bars i, .js .kw-cond .row i::after { transform: none; }
  /* 지도 슬라이드 — 마지막 장면(기울여 다가간 지도·핀·오차 원·장소 카드)으로 멈춘 그림 */
  /* 그림마다 마지막 모습이 그대로 적혀 있어 움직임만 끄면 된다(위성·신호 고리는 처음부터 숨김) */
  .map-art * { animation: none !important; }
}
