/* 재빗 랜딩 페이지 — 반응형 레이어
   base.css = 텀블벅 상세페이지(620px 캔버스) 디자인 그대로. 이 파일은 그 위에 웹 레이아웃만 덧입힘.
   폭 기준  모바일 ~640 · 태블릿 641~959 · 데스크톱 960~
   섹션 배경은 화면 끝까지, 내용은 --wrap 폭 안에서 가운데 정렬. 넓은 섹션(.wide)은 데스크톱에서 2~3단 */

:root { --gutter: 20px; --wrap: 640px; --topbar: 60px; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 8px); -webkit-text-size-adjust: 100%; }
body { background: #fff; font-size: 17px; }
.page { overflow-x: clip; }
a { color: inherit; }

/* ---------- 섹션 폭: 배경은 전체, 내용은 --wrap ---------- */
.sec,
.sec.hero { padding-left: max(var(--gutter), calc((100% - var(--wrap)) / 2)); padding-right: max(var(--gutter), calc((100% - var(--wrap)) / 2)); }
.sec.hero > * { margin-left: 0; margin-right: 0; }
.sec.hero .device { margin-left: 5% !important; margin-right: 5% !important; }
.device-base { margin: 0 -4.5%; }

/* ---------- 상단 바 ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .88); -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.topbar.scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 16px rgba(27, 27, 36, .06); }
.topbar-in { max-width: 1160px; height: var(--topbar); margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--point); color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 800; }
.brand-sub { color: var(--ink-3); font-weight: 700; }
.topbar-cta { padding: 9px 18px; border-radius: var(--r-pill); background: var(--point); color: #fff; font-size: 15px; font-weight: 800; text-decoration: none; white-space: nowrap; transition: background .15s; }
.topbar-cta:hover { background: var(--point-strong); }

/* ---------- 버튼(링크) ---------- */
a.cta { text-decoration: none; transition: transform .15s, box-shadow .15s; }
a.cta:hover { transform: translateY(-2px); }
a:focus-visible { outline: 3px solid var(--point-2); outline-offset: 3px; }

/* ---------- 이미지 ---------- */
.cap.chip { width: auto; max-width: 300px; }

/* ---------- S1 고민 궤도: 폭에 맞춰 줄어드는 비율 그림 ---------- */
.sec.hero > .orbit { width: 100%; max-width: 540px; height: auto; aspect-ratio: 540 / 460; margin-left: auto; margin-right: auto; }
.orbit .face { width: 28%; height: auto; aspect-ratio: 1; font-size: clamp(60px, 17vw, 110px); }

/* ---------- S10 플랜 테스트: 좁은 화면용 단계형 카드(기본은 숨김) ---------- */
.flow-m, .fm-results { display: none; }
.flow-m { list-style: none; padding: 0; margin: 28px 0 0 !important; gap: 22px; text-align: left; }
.fm-q { position: relative; background: var(--bg); border-radius: var(--r-lg); padding: 24px 18px 16px; box-shadow: 0 4px 14px rgba(27, 27, 36, .06); }
.fm-q .qn { position: absolute; top: -12px; left: 16px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--ink); color: #fff; font-size: 12px; font-weight: 800; }
.fm-q p { font-size: 17px; font-weight: 500; line-height: 1.5; color: var(--ink-2); }
.fm-q p b { color: var(--ink); font-weight: 800; }
.fm-go { display: flex; gap: 8px; margin-top: 12px; }
.fm-go span { flex: 1; display: flex; justify-content: center; gap: 6px; padding: 8px 10px; border-radius: var(--r); font-size: 14px; font-weight: 800; }
.fm-go .y { background: var(--point-bg); color: var(--point); }
.fm-go .n { background: #F2F2F7; color: var(--ink-3); }
.fm-go em { font-style: normal; font-weight: 700; opacity: .85; }
.fm-results { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fm-results .r { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 6px; border-radius: var(--r-lg); background: #fff; border: 2px solid var(--line); }
.fm-results .letter { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; font-weight: 900; background: var(--point-3); color: var(--point-ink); }
.fm-results .pn { font-size: 14px; font-weight: 800; letter-spacing: .02em; color: var(--ink-3); }
.fm-results .r2 { border-color: var(--point-2); }
.fm-results .r2 .letter { background: var(--point-2); }
.fm-results .r2 .pn { color: var(--point-strong); }
.fm-results .r3 { background: var(--point); border-color: var(--point); box-shadow: 0 10px 24px rgba(105, 82, 217, .3); }
.fm-results .r3 .letter { background: #fff; color: var(--point); }
.fm-results .r3 .pn { color: #fff; }

/* =================== 데스크톱 960~ =================== */
@media (min-width: 960px) {
  :root { --gutter: 32px; --topbar: 68px; }
  .brand { font-size: 21px; }
  .brand-mark { width: 34px; height: 34px; font-size: 17px; }
  .topbar-cta { padding: 11px 22px; font-size: 16px; }

  .sec { padding-top: 128px; padding-bottom: 128px; }
  .sec.hero { padding-top: 0; padding-bottom: 0; --wrap: 800px; }
  .sec.closing { padding-bottom: 128px; --wrap: 800px; }
  .sec.wide { --wrap: 1100px; }
  [data-sec="S4"], [data-sec="S7"] { --wrap: 880px; }
  [data-sec="S8"], [data-sec="S9"], [data-sec="S13"], [data-sec="S15"] { --wrap: 760px; }
  .h2 { font-size: 42px; }

  /* S1 */
  .hero-title { font-size: 50px; }
  .hero .quotes { max-width: 620px; margin-left: auto !important; margin-right: auto !important; }
  .hero-bridge { font-size: 34px; }
  .hero-promise { font-size: 54px; }
  .hero-sub { font-size: 20px; }

  /* S2 문제 4개: 2×2 */
  .scenes { grid-template-columns: 1fr 1fr; gap: 36px; }
  .s2-close { font-size: 30px; }
  .s2-answer { font-size: 46px; }

  /* S3 변화: 글 + GIF 좌우 번갈아 */
  .change { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); grid-template-rows: 1fr auto 1fr; grid-template-areas: "badge mock" "title mock" "body mock"; column-gap: 64px; }
  .change:nth-child(even) { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); grid-template-areas: "mock badge" "mock title" "mock body"; }
  .change > .badge { grid-area: badge; align-self: end; justify-self: start; }
  .change > .h3 { grid-area: title; margin: 14px 0 0; font-size: 30px; }
  .change > .body { grid-area: body; margin-top: 12px; }
  .change > .mock { grid-area: mock; align-self: center; margin-top: 0; }
  .change + .change { margin-top: 120px; }

  /* S5·S6 기능 목록: 2단 */
  [data-sec="S5"] > .mock { max-width: 900px; }
  .feats { grid-template-columns: 1fr 1fr; column-gap: 64px; row-gap: 64px; align-items: start; }
  .feat h3 { font-size: 24px; }

  /* S7 */
  .kflow { max-width: 680px; margin-left: auto; margin-right: auto; }
  .sq-answers { grid-template-columns: 1fr 1.3fr; align-items: stretch; }
  .aicoach > .mock { max-width: 760px; }

  /* S11·S14 카드 3개: 3단 */
  .pis { grid-template-columns: repeat(3, 1fr); align-items: stretch; }

  /* S12 업그레이드 기능: 카드 안에서 글 + GIF 좌우 번갈아 */
  .upgrade .ups { gap: 40px; }
  .upgrade .up { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); grid-template-rows: 1fr auto auto 1fr; grid-template-areas: ". gif" "tag gif" "title gif" "text gif" ; column-gap: 56px; padding: 44px 48px; }
  .upgrade .up > .up-tag { grid-area: tag; }
  .upgrade .up > h3 { grid-area: title; font-size: 32px; }
  .upgrade .up > p { grid-area: text; align-self: start; font-size: 18px; }
  .upgrade .up > .gif-frame { grid-area: gif; align-self: center; margin-top: 0; }
  .upgrade .up:nth-child(even) { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); grid-template-areas: "gif ." "gif tag" "gif title" "gif text"; }

  /* S17 FAQ: 2단 */
  .faq { grid-template-columns: 1fr 1fr; align-items: start; }

  /* S16 */
  .closing-device { margin-left: 0 !important; margin-right: 0 !important; }
}

/* =================== 모바일 ~640 =================== */
@media (max-width: 640px) {
  :root { --topbar: 56px; }
  body { font-size: 16px; }
  .brand { font-size: 17px; }
  .brand-mark { width: 28px; height: 28px; font-size: 14px; }
  .topbar-cta { padding: 8px 14px; font-size: 14px; }

  .sec { padding-top: 76px; padding-bottom: 76px; }
  .sec > * + * { margin-top: 24px; }
  .sec.closing { padding-bottom: 76px; }
  .h1 { font-size: 32px; }
  .h2 { font-size: 26px; }
  .h3 { font-size: 20px; }
  .body { font-size: 16px; }
  .small { font-size: 14px; }
  .badge { font-size: 13px; padding: 5px 12px; }
  .cta { padding: 14px 26px; font-size: 17px; }
  .deco .spark.l { left: -20px; width: 16px; height: 16px; }
  .deco .spark.r { right: -18px; width: 12px; height: 12px; }

  /* S1 */
  .sec.hero .device.top { margin-top: 32px !important; }
  .sec.hero .device.bottom { margin-top: 48px !important; margin-bottom: 56px !important; }
  .device-bezel { padding: 8px 8px 10px; border-radius: 12px 12px 4px 4px; }
  .device-base { height: 10px; }
  .device-base::after { width: 60px; height: 4px; }
  .hero-title { margin-top: 56px !important; font-size: 29px; }
  .hero-worry { font-size: 54px; }
  .hero .quotes { margin-top: 36px !important; gap: 14px; }
  .hero .quote .say { font-size: 15px; padding: 12px 16px; max-width: 92%; border-radius: 18px; }
  .orbit { margin-top: 56px !important; }
  .orbit .tag { font-size: 13px; padding: 5px 11px; }
  .hero-bridge { margin-top: 48px !important; font-size: 21px; }
  .hero-promise { margin-top: 56px !important; font-size: 31px; }
  .hero-sub { font-size: 16px; margin-top: 16px !important; }

  /* S2 */
  .s2-lead { font-size: 16px; }
  .scenes { margin-top: 32px !important; gap: 24px; }
  .scene { padding: 22px 18px 20px; }
  .scene-head h3 { font-size: 20px; }
  .scene-box { padding: 14px; }
  .chat .b { font-size: 15px; max-width: 88%; }
  .todo { font-size: 15px; }
  .memo { font-size: 15px; padding: 14px; }
  .memo .huh { font-size: 17px; }
  .choices span { font-size: 15px; }
  .scene p.desc { font-size: 15px; }
  .s2-close { margin-top: 36px !important; font-size: 21px; }
  .s2-answer { font-size: 30px; }

  /* S3 */
  .change + .change { margin-top: 56px; }

  /* S4 */
  .step { padding: 20px 16px; }
  .step .h3 { font-size: 19px; }
  .arrow { font-size: 22px; padding: 4px 0; }

  /* S5·S6 */
  .feats { gap: 36px; }
  .feat { grid-template-columns: 30px 1fr; gap: 12px; }
  .feat .num { width: 30px; height: 30px; font-size: 14px; }
  .feat h3 { font-size: 19px; }
  .feat p { font-size: 15px; }
  .mock { padding: 6px; border-radius: 14px; }
  .mock img { border-radius: 9px; }

  /* S7 */
  .kflow { padding: 18px 12px 20px; }
  .same-q { padding: 22px 14px 16px; }
  .sq-ask { font-size: 16px; }
  .sq-a { font-size: 15px; padding: 14px; }

  /* S8 영상 플레이어 */
  .vp-top { font-size: 13px; padding: 10px 12px; }
  .vp-cam { width: 84px; height: 64px; right: 10px; bottom: 46px; border-radius: 10px; }
  .vp-cam svg { width: 26px; height: 26px; }
  .vp-cam span { font-size: 10px; }
  .vp-play { width: 56px; height: 56px; box-shadow: 0 0 0 7px rgba(255, 255, 255, .18); }
  .vp-play svg { width: 26px; height: 26px; }
  .vp-cap { white-space: normal; width: max-content; max-width: 88%; text-align: center; font-size: 12px; bottom: 10px; }

  /* S11·S14 */
  .pi { padding: 22px 18px; }
  .pi h3 { font-size: 20px; }
  .pi p { font-size: 15px; }
  .pi .pn { font-size: 19px; }

  /* S12 */
  .upgrade .up { padding: 24px 18px 20px; }
  .up h3 { font-size: 22px; }
  .up p { font-size: 15px; }
  .ups { margin-top: 36px !important; }

  /* S13 기능 표 */
  .tbl { font-size: 13.5px; }
  .tbl th, .tbl td { padding: 11px 4px; }
  .tbl th:first-child, .tbl td:first-child { padding-left: 10px; }
  .only-badge { font-size: 10px; padding: 1px 6px; }

  /* S15 가격 */
  .cmp { padding: 20px 10px 18px; }
  .cmp-cols.four { gap: 6px; }
  .cmp-cols.four .per { font-size: 13px; }
  .cmp-cols.four .bar em { font-size: 14px; }
  .cmp-col .bar em small { font-size: 11px; }
  .cmp-col .bar em.b0 { font-size: 13px; }
  .cmp-col .yt { font-size: 13px; }
  .cmp-base { font-size: 12px; }
  .ptbl th, .ptbl td { padding: 12px 4px; }
  .ptbl thead th { font-size: 15px; }
  .ptbl tbody th { font-size: 13px; padding-left: 10px; }
  .ptbl td b { font-size: 15px; }
  .ptbl td small { font-size: 11px; }

  /* S16 */
  .closing-device { margin: 56px 0 0 !important; }

  /* S17 */
  .faq div { padding: 18px; }
  .faq h3 { font-size: 17px; }
  .faq p { font-size: 15px; }
}

/* 좁은 화면: 갈림길 그림·지식 흐름도를 세로 배치로 */
@media (max-width: 600px) {
  .flow { display: none; }
  .flow-m { display: grid; }
  .fm-results { display: grid; }

  .kf-diagram { width: auto; height: auto; display: flex; flex-direction: column; align-items: center; gap: 0; margin-top: 14px; padding: 0 10px; }
  .kf-wires { display: none; }
  .srcs, .core, .loop, .steps-o { position: static; transform: none; left: auto; top: auto; }
  .aicoach > .body br { display: none; }
  .confetti { clip-path: inset(0 0 76% 0); }
  .confetti i { width: 6px; height: 11px; }
  .srcs { width: 100%; grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .src small { font-size: 12px; }
  .core { width: 136px; height: 136px; margin-top: 44px; position: relative; }
  .core::before, .loop::after { content: "↓"; position: absolute; left: 50%; transform: translateX(-50%); color: var(--point); font-size: 20px; font-weight: 800; line-height: 1; }
  .core::before { top: -40px; }
  .core-in b { font-size: 26px; }
  .loop { margin-top: 28px; position: relative; }
  .loop::after { bottom: -34px; }
  .steps-o { width: 100%; grid-template-columns: repeat(2, 1fr); margin-top: 44px; }
}

/* 아주 좁은 화면 */
@media (max-width: 520px) {
  .duo { grid-template-columns: 1fr; }
  .eb { padding: 20px 14px 16px; }
  .eb-head { flex-wrap: wrap; }
  .eb-cards { grid-template-columns: 1fr; gap: 14px; }
  .eb-card { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "plan b" "s em"; align-items: baseline; column-gap: 12px; padding: 16px 18px 14px; text-align: left; }
  .eb-plan { grid-area: plan; }
  .eb-card b { grid-area: b; justify-self: end; font-size: 22px; }
  .eb-card s { grid-area: s; margin-top: 0; }
  .eb-card em { grid-area: em; justify-self: end; }
  .eb-rec { left: 14px; }
}
@media (max-width: 380px) {
  .brand-sub { display: none; }
  .deco .spark { display: none; }
  .hero-title { font-size: 26px; }
  .h2 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a.cta, .topbar-cta { transition: none; }
}
