/* 제안서 뷰어 — /proposal/agency · /proposal/brand 공통(대행사용·인하우스용)
   왼쪽 쪽 목록 · 가운데 16:9 슬라이드 세로 나열 · 아래 이동/확대/발표/공유 막대 · 오른쪽 아래 문의 카드
   웹으로 만든 쪽은 .cv(1440×810) 캔버스 — 픽셀 값은 전부 이 캔버스 기준이고 viewer.js 가 통째로 축소한다. */
:root {
  --bg: #e7eaf0;
  --side: #ffffff;
  --line: #dde1e8;
  --ink: #12151c;
  --sub: #5d6575;
  --cy: #1fe3ff;       /* 기존 제안서의 형광 하늘색 */
  --cy-ink: #0a8fb5;
  --navy: #070b18;
  --radius: 18px;
  --zoom: 1;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; word-break: keep-all;
}
img, video { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; color: inherit; }
a { color: inherit; }

/* ── 위쪽 진행 막대 ── */
.prog { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 40; background: transparent; }
.prog i { display: block; height: 100%; background: linear-gradient(90deg, #2f6bff, var(--cy)); transform-origin: 0 50%; transform: scaleX(0); transition: transform .3s; }

/* ── 왼쪽 쪽 목록 ── */
.side { position: fixed; inset: 0 auto 0 0; width: 212px; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 20; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 12px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; text-decoration: none; }
.brand img { width: 22px; height: 22px; }
.count { font: 600 11px/1 ui-monospace, 'SFMono-Regular', Menlo, monospace; color: #9aa1ae; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.thumbs { list-style: none; margin: 0; padding: 10px; overflow-y: auto; display: grid; gap: 10px; }
.thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; border: 0; background: var(--navy); padding: 0; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .15s; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.on { box-shadow: 0 0 0 2px var(--cy-ink), 0 4px 12px rgba(10, 143, 181, .25); }
.thumb .no { position: absolute; left: 5px; top: 5px; z-index: 3; background: rgba(10, 14, 22, .8); color: #fff; font: 700 9.5px/1 ui-monospace, Menlo, monospace; padding: 4px 5px; border-radius: 4px; }
.thumb .cv { position: absolute; left: 0; top: 0; pointer-events: none; }

/* ── 슬라이드 ── */
.stage { margin-left: 212px; padding: 28px 28px 120px; }
.deck { width: calc(min(1080px, 100%) * var(--zoom)); margin: 0 auto; display: grid; gap: 24px; }
.slide { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--navy); scroll-margin-top: 20px; box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 10px 30px rgba(16, 24, 40, .08); }
.slide.img img { width: 100%; height: 100%; object-fit: cover; }

/* ── 1440×810 캔버스 ── */
.cv { position: absolute; left: 0; top: 0; width: 1440px; height: 810px; transform-origin: 0 0; color: #eef2fa; overflow: hidden; background: var(--navy); }
.cv-bg { position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(1200px 520px at 108% 118%, rgba(47, 107, 255, .42), transparent 62%),
    radial-gradient(900px 420px at 100% 110%, rgba(31, 227, 255, .16), transparent 60%),
    radial-gradient(600px 400px at -10% -20%, rgba(70, 90, 160, .22), transparent 65%),
    linear-gradient(180deg, #080d1d, #060914);
}
.cv-bg::after { content: ''; position: absolute; right: -340px; bottom: -760px; width: 1500px; height: 1100px; border-radius: 50%; border-top: 2px solid rgba(80, 150, 255, .5); box-shadow: 0 -30px 80px rgba(47, 107, 255, .25); }
.cv-foot { position: absolute; left: 72px; right: 72px; bottom: 26px; display: flex; align-items: center; gap: 10px; font: 700 12px/1 ui-monospace, Menlo, monospace; letter-spacing: .18em; color: rgba(255, 255, 255, .38); }
.cv-foot .zz { width: 26px; height: 16px; color: rgba(255, 255, 255, .55); }
.cv-foot .pgno { margin-left: auto; letter-spacing: .06em; }
.cv .kick { font: 700 15px/1 ui-monospace, Menlo, monospace; letter-spacing: .2em; color: var(--cy); }
.cv h2 { margin: 18px 0 0; font-size: 58px; line-height: 1.18; letter-spacing: -.035em; font-weight: 800; color: #fff; }
.cv h2 em { font-style: normal; color: var(--cy); }
.cv .lead { margin: 18px 0 0; font-size: 21px; line-height: 1.6; color: #b9c2d6; }
.cv-in { position: absolute; left: 72px; top: 72px; right: 72px; }

/* 표지 */
.cover .cv-in { right: 640px; top: 150px; }
.cover .stats { display: flex; gap: 14px; margin-top: 44px; }
.cover .stats div { padding: 18px 22px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); min-width: 150px; }
.cover .stats b { display: block; font-size: 38px; letter-spacing: -.02em; color: #fff; font-variant-numeric: tabular-nums; }
.cover .stats span { display: block; margin-top: 6px; font-size: 15px; color: #9aa6bf; }
.fan { position: absolute; right: 70px; top: 96px; width: 600px; height: 600px; }
.fan img { position: absolute; top: 40px; width: 230px; height: 409px; object-fit: cover; border-radius: 18px; border: 3px solid rgba(255, 255, 255, .9); box-shadow: 0 24px 50px rgba(0, 0, 0, .55); }
.fan .f0 { left: 0; transform: rotate(-14deg) translateY(60px); }
.fan .f1 { left: 92px; transform: rotate(-7deg) translateY(18px); }
.fan .f2 { left: 185px; transform: rotate(0); z-index: 3; border-color: var(--cy); box-shadow: 0 0 0 6px rgba(31, 227, 255, .18), 0 28px 60px rgba(0, 0, 0, .6); }
.fan .f3 { left: 278px; transform: rotate(7deg) translateY(18px); z-index: 2; }
.fan .f4 { left: 370px; transform: rotate(14deg) translateY(60px); z-index: 1; }

/* 목차 — 2열 × 5줄 목록 */
.toc .cv-in { top: 60px; }
.toc h2 { font-size: 46px; margin-top: 14px; }
.toc .lead { font-size: 18px; margin-top: 12px; }
.toc .toc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 18px; margin-top: 28px; }
.toc-item { position: relative; display: grid; grid-template-columns: 34px 124px 1fr auto; align-items: center; column-gap: 16px; height: 84px; padding: 0 18px 0 16px; border-radius: 14px; text-align: left; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04); transition: border-color .15s, background .15s; }
.toc-item:hover { border-color: var(--cy); background: rgba(31, 227, 255, .06); }
.toc-item img { width: 124px; height: 64px; object-fit: cover; border-radius: 8px; }
.toc-item .n { font: 700 15px/1 ui-monospace, Menlo, monospace; color: var(--cy); letter-spacing: .06em; }
.toc-item .tx { min-width: 0; }
.toc-item .tx b { display: block; font-size: 21px; color: #fff; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toc-item .tx span { display: block; font-size: 14px; color: #9aa6bf; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toc-item .arr { font: 700 13px/1 ui-monospace, Menlo, monospace; color: rgba(255, 255, 255, .45); }

/* 포트폴리오 한 편 */
.pf { display: grid; grid-template-columns: 1fr 340px 214px; column-gap: 34px; padding: 58px 72px 70px; }
.pf.r11 { grid-template-columns: 1fr 440px 214px; }
.pf-l, .pf-m, .pf-r { position: relative; z-index: 1; }
.pf-l { min-width: 0; display: flex; flex-direction: column; }
.pf h3 { margin: 14px 0 0; font-size: 50px; line-height: 1.12; letter-spacing: -.04em; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf h3 .br { color: var(--cy); }
.pf-head { margin-top: 20px; padding: 16px 18px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); }
.pf-head b { display: block; font-size: 20px; line-height: 1.4; color: #fff; }
.pf-head .meta { display: block; font-size: 14px; color: #95a0b8; margin: 6px 0 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags span { font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 99px; border: 1px solid rgba(31, 227, 255, .45); color: #cdf7ff; background: rgba(31, 227, 255, .06); }
.pf-rows { margin: 22px 0 0; display: grid; gap: 14px; }
.pf-row { display: grid; grid-template-columns: 92px 1fr; gap: 14px; font-size: 16px; line-height: 1.62; color: #c3cad9; }
.pf-row > dt { font-weight: 800; color: #8792aa; font-size: 15px; padding-top: 1px; }
.pf-row > dd { margin: 0; }
.pf-row.hook { padding: 12px 14px; margin: 2px -14px 0; border-radius: 12px; background: linear-gradient(90deg, rgba(31, 227, 255, .12), rgba(31, 227, 255, 0)); }
.pf-row.hook > dt { color: var(--cy); }
.pf-row.hook > dd { color: #fff; font-weight: 700; }
.tl { margin-top: 26px; }
.tl-h { font-size: 13px; font-weight: 800; color: #8792aa; margin-bottom: 30px; }
.tl-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; font: 700 12px/1 ui-monospace, Menlo, monospace; color: #7d889f; }
.rail { position: relative; height: 6px; border-radius: 99px; background: linear-gradient(90deg, rgba(47, 107, 255, .55), rgba(31, 227, 255, .75)); }
.mk { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 3px solid var(--navy); background: var(--cy); padding: 0; }
.mk i { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); font: 800 11px/1 ui-monospace, Menlo, monospace; font-style: normal; color: var(--cy); }
.mk em { position: absolute; left: 50%; top: 24px; transform: translateX(-50%); white-space: nowrap; font-style: normal; font-size: 12px; font-weight: 700; color: #9aa6bf; opacity: 0; transition: opacity .15s; pointer-events: none; }
.mk:hover em, .mk.on em { opacity: 1; }
.mk.on { background: #fff; box-shadow: 0 0 0 4px rgba(31, 227, 255, .35); }
.metrics { display: flex; align-items: flex-end; gap: 12px; margin-top: auto; }
.metrics div { padding: 12px 18px; border-radius: 14px; background: #fff; color: var(--navy); min-width: 132px; }
.metrics div span { display: block; font: 800 12px/1 ui-monospace, Menlo, monospace; letter-spacing: .12em; color: #2f6bff; }
.metrics div b { display: block; font-size: 32px; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.metrics .note { margin: 0 0 4px; font-size: 13px; color: #7d889f; }

.pf-m { display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.frame { position: relative; overflow: hidden; background: #000; border-radius: 22px; border: 3px solid rgba(31, 227, 255, .55); box-shadow: 0 0 0 8px rgba(31, 227, 255, .07), 0 26px 60px rgba(0, 0, 0, .55); }
.frame.r916 { width: 340px; height: 604px; }
.frame.r11 { width: 440px; height: 440px; margin-top: 60px; }
.frame video, .frame .vposter { width: 100%; height: 100%; object-fit: cover; }
.frame .badge { position: absolute; left: 12px; top: 12px; z-index: 2; font-size: 12px; font-weight: 800; background: rgba(0, 0, 0, .62); color: #fff; padding: 5px 9px; border-radius: 7px; }
.frame .play { position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border-radius: 50%; border: 0; z-index: 2; background: rgba(255, 255, 255, .94); display: grid; place-items: center; box-shadow: 0 8px 26px rgba(0, 0, 0, .4); }
.frame .play svg { width: 30px; height: 30px; margin-left: 5px; fill: var(--navy); }
.frame.playing .play, .frame.playing .badge { display: none; }
.pf-m .full { display: inline-flex; align-items: center; gap: 9px; border: 0; background: #fff; color: var(--navy); font-weight: 800; font-size: 16px; padding: 13px 20px; border-radius: 12px; }
.pf-m .full svg { width: 13px; height: 13px; fill: currentColor; }
.pf-m .full small { font-weight: 700; color: #7a8496; font-size: 13px; }

.pf-r { display: grid; grid-template-rows: auto repeat(4, 1fr); gap: 10px; min-height: 0; height: 682px; }
.sc-h { font-size: 14px; font-weight: 800; color: #c3cad9; letter-spacing: .02em; }
.scene { position: relative; border: 1px solid rgba(255, 255, 255, .14); padding: 0; border-radius: 12px; overflow: hidden; background: #000; text-align: left; min-height: 0; transition: border-color .15s; }
.scene img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.scene:hover img { transform: scale(1.05); }
.scene.on { border-color: var(--cy); box-shadow: 0 0 0 2px var(--cy); }
.scene .tm { position: absolute; right: 8px; top: 8px; background: #c6f432; color: #10140a; font: 800 12px/1 ui-monospace, Menlo, monospace; padding: 4px 6px; border-radius: 5px; }
.scene .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 9px; font-size: 13.5px; font-weight: 700; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .85)); line-height: 1.35; }
.scene .cap i { font-style: normal; font: 800 11px/1 ui-monospace, Menlo, monospace; color: var(--cy); margin-right: 6px; }

/* 마무리 — 가운데 정렬 · 아래 행성 곡선 · 실제로 눌리는 버튼 */
.end .cv-bg::after { display: none; }
.planet { position: absolute; left: 50%; top: 545px; width: 2400px; height: 1400px; margin-left: -1200px; border-radius: 50%; background: #0a0f1f;
  box-shadow: 0 -2px 0 rgba(120, 170, 255, .55), 0 -40px 110px rgba(47, 107, 255, .55), 0 -120px 220px rgba(47, 107, 255, .25); }
.end-in { position: absolute; left: 0; right: 0; top: 104px; text-align: center; z-index: 1; }
.end h2 { margin: 0; font-size: 70px; line-height: 1.32; font-weight: 400; letter-spacing: -.03em; color: #fff; }
.end h2 b { font-weight: 800; }
.end h2 em { font-style: normal; color: var(--cy); }
.end .sub { margin: 34px 0 0; font-size: 26px; color: #dfe6f5; }
.end .sub b { color: #fff; font-weight: 800; }
.cta { display: flex; justify-content: center; gap: 26px; margin-top: 44px; }
.cta > * { display: inline-flex; align-items: center; justify-content: center; height: 62px; padding: 0 56px; border-radius: 99px; font-size: 23px; font-weight: 800; text-decoration: none; border: 0; transition: transform .15s, box-shadow .15s; }
.cta-pf { background: #fff; color: var(--navy); box-shadow: 0 0 30px rgba(120, 170, 255, .45); min-width: 262px; }
.cta-kakao { background: #fee500; color: #191600; min-width: 306px; }
.cta > *:hover { transform: translateY(-2px); box-shadow: 0 10px 34px rgba(31, 227, 255, .35); }
.cta-mail { display: inline-block; margin-top: 34px; padding: 12px 36px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .04); color: #d5dcea; font-size: 19px; text-decoration: none; }
.cta-mail:hover { border-color: var(--cy); color: #fff; }
.end-logo { position: absolute; left: 0; right: 0; bottom: 74px; display: flex; justify-content: center; z-index: 1; }
.end-logo .zz { width: 52px; height: 32px; color: #fff; }

/* ── 아래 막대 ── */
.bar { position: fixed; left: calc(50% + 106px); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 4px; background: #fff; border-radius: 99px; padding: 6px 10px; box-shadow: 0 6px 24px rgba(16, 24, 40, .16); font-size: 13px; }
.bar button { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); }
.bar button:hover { background: #f1f3f6; }
.bar button.wide { width: auto; padding: 0 12px; border-radius: 99px; display: inline-flex; gap: 6px; font-weight: 600; }
.bar svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bar .pg, .bar .zm { font: 600 12.5px/1 ui-monospace, Menlo, monospace; color: var(--sub); min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; }
.bar .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.zoomset { display: contents; }

/* ── 문의 카드 ── */
.contact { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 30; width: 236px; background: #fff; border-radius: 16px; box-shadow: 0 8px 30px rgba(16, 24, 40, .16); padding: 14px; font-size: 13px; }
.contact-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.contact-head img { width: 32px; height: 32px; border-radius: 50%; background: var(--navy); padding: 6px; }
.contact-head b { display: block; font-size: 13.5px; }
.contact-head span { display: block; font-size: 11.5px; color: var(--sub); }
.contact a, .contact button.mail { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 10px 11px; margin-top: 6px; border-radius: 10px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 13px; }
.contact a small, .contact button.mail small { color: var(--sub); font-weight: 600; font-size: 11.5px; }
.contact .x { position: absolute; right: 8px; top: 8px; border: 0; background: transparent; color: #9aa1ae; width: 26px; height: 26px; border-radius: 50%; }
.contact.min { width: auto; padding: 0; }
.contact.min > *:not(.open) { display: none; }
.contact .open { display: none; }
.contact.min .open { display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--navy); color: #fff; font-weight: 800; padding: 12px 16px; border-radius: 99px; }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: #12151c; color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 10px; z-index: 50; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.on { opacity: 1; }

/* ── 발표(한 쪽씩 화면 가득) ── */
body.present { background: #000; overflow: hidden; }
body.present .side, body.present .contact { display: none; }
body.present .stage { margin: 0; padding: 0; height: 100vh; display: grid; place-items: center; }
body.present .deck { width: min(100vw, calc(100vh * 16 / 9)); gap: 0; }
body.present .slide { display: none; border-radius: 0; box-shadow: none; }
body.present .slide.show { display: block; }
body.present .bar { left: 50%; opacity: .2; transition: opacity .2s; }
body.present .bar:hover { opacity: 1; }

/* ── 좁은 화면 ── */
@media (max-width: 900px) {
  .side { display: none; }
  .stage { margin-left: 0; padding: 16px 12px 150px; }
  .deck { width: 100%; gap: 14px; }
  .slide { border-radius: 10px; }
  .bar { left: 50%; }
  .bar .zoomset, .bar #present { display: none; }
  .contact { left: 16px; right: 16px; width: auto; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .contact.min { left: auto; }
}
@media (max-width: 480px) {
  .bar .share-tx { display: none; }
}
