/* keyhub 공통 물결 부품 (fluid) — 명세: docs/레퍼런스-2/명세.md 4장. 메인·소개 페이지가 함께 부른다.
   바뀐 클래스 기록(다른 작업이 읽음):
   2026-12-01 처음: [data-color] [data-accent] .w .fl-sec .fl-band(.solid .wave-top .wave-bottom) .fl-blob(.a .b .c)
                    .fl-pic(.a .b .c) .fl-stage .fl-mask img.ph(.on) .fl-card img.anim .btn(.go .more .wait) .logo .nw .sr-only
   2026-12-01 셋째: 바닥글 .foot 를 어두운 물결 띠로(.foot-svc · .foot-co · .foot-logo · .sl · .copy), 마크업은 메인 index.html 의 <footer class="foot"> 와 같게
   2026-12-01 둘째: .fl-stage.static(격자 안에서 position:relative 로 쓰기), .foot .fw .foot-svc .foot-row(바닥글), .pill(.away)(쪽 안 이동 알약)
                    — page.css 에 있던 바닥글·알약을 옮김. 메인은 바닥글을 마무리 띠 안에 넣고 글자색만 띠 색을 따른다
   사용법 — 바닥글(메인 index.html 과 같은 마크업):
     <footer class="foot"><div class="w fw">
       <ul class="foot-svc" aria-label="서비스 바로 가기"><li class="fs-g"><span class="fs-h">분류 이름</span><ul><li><a href="…">서비스 이름</a></li>…</ul></li>…</ul>
       (분류 순서·묶음은 services.json categories. 메인은 keyhub.js, 소개 페이지는 tools/build_pages.py 가 같은 마크업으로 그린다)
       <div class="foot-co"><a class="foot-logo" href="../" aria-label="keyhub 처음으로"><img src="../assets/logo/keyhub-logo-white.svg" alt="keyhub" width="100" height="22"></a>
         <p>㈜키출판사<span class="sl" aria-hidden="true">/</span>대표이사: 김기중</p> … <p class="copy">COPYRIGHT 2026 ㈜키출판사, ALL RIGHTS RESERVED.</p></div>
     </div></footer>
     — 위쪽 물결(::before)이 앞 구역 아래에 걸치므로 앞 구역 아래 여백을 물결 높이(--wh)만큼 남긴다
   사용법 — 쪽 안 이동 알약: <nav class="pill" aria-label="쪽 안에서 이동"><a href="#top">맨 위</a>…</nav> (첫 화면에서 숨기려면 .away 를 js 로)
   변수: --tint(띠 진하기, 기본 .1) --o(장식 얼룩 불투명도) --pt(사진 머리 위 여유, 기본 7%) --wh(물결 높이) */
:root {
  --white: #ffffff; --bg2: #f4f5f8; --line: #e3e5ea;
  --ink: #17181c; --ink2: #2b2d33; --sub: #5e636e;
  --violet: #7a3ff2; --violet-on: #ffffff; --sky: #2aa4f4; --sky-on: #04233a; --mint: #14d2a8; --mint-on: #06322a;
  --orange: #ff7a1a; --orange-on: #3a1500; --pink: #ff4f8f; --pink-on: #3a0519; --yellow: #ffc31f; --yellow-on: #2b2000;
  --pc: var(--violet); --pon: var(--violet-on); --pa: var(--yellow);
  --serif: "Gowun Batang", "Paperlogy", serif; --display: "Paperlogy", "Pretendard", sans-serif; --text: "Pretendard", "Paperlogy", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1); --morph: cubic-bezier(.3, .8, .2, 1);
  --wrap: min(1180px, 100% - 48px);
  --gut: max(24px, (100% - 1180px) / 2);
  --wh: clamp(36px, 6vw, 96px);
  --card-r: 14px;
  --card-sh: 0 24px 48px -24px rgb(30 34 60 / .28), 0 2px 8px rgb(30 34 60 / .05);
  --mA: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1 1' preserveAspectRatio='none'%3E%3Cpath d='M0.990,0.599C0.962,0.714 0.811,0.826 0.696,0.883C0.581,0.940 0.406,0.987 0.300,0.942C0.195,0.897 0.097,0.735 0.064,0.611C0.031,0.487 0.031,0.286 0.102,0.198C0.173,0.109 0.363,0.081 0.490,0.080C0.617,0.080 0.781,0.108 0.864,0.195C0.947,0.281 1.018,0.485 0.990,0.599Z'/%3E%3C/svg%3E"); --mB: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1 1' preserveAspectRatio='none'%3E%3Cpath d='M0.786,0.860C0.673,0.950 0.434,1.015 0.316,0.965C0.198,0.915 0.100,0.704 0.080,0.562C0.059,0.421 0.098,0.195 0.195,0.116C0.292,0.038 0.529,0.039 0.662,0.091C0.795,0.143 0.974,0.298 0.995,0.427C1.015,0.555 0.899,0.771 0.786,0.860Z'/%3E%3C/svg%3E"); --mC: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1 1' preserveAspectRatio='none'%3E%3Cpath d='M0.939,0.740C0.894,0.831 0.732,0.913 0.627,0.932C0.522,0.950 0.407,0.900 0.308,0.851C0.210,0.802 0.076,0.735 0.035,0.637C-0.007,0.538 0.004,0.353 0.061,0.260C0.118,0.167 0.265,0.107 0.376,0.078C0.487,0.049 0.638,0.037 0.725,0.088C0.812,0.138 0.863,0.274 0.898,0.383C0.934,0.492 0.984,0.648 0.939,0.740Z'/%3E%3C/svg%3E"); --mH: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1 1' preserveAspectRatio='none'%3E%3Cpath d='M0.978,0.352C1.010,0.456 0.967,0.614 0.911,0.717C0.856,0.820 0.750,0.943 0.646,0.973C0.543,1.003 0.392,0.953 0.290,0.898C0.188,0.843 0.067,0.748 0.032,0.645C-0.003,0.542 0.026,0.382 0.080,0.278C0.133,0.175 0.246,0.053 0.352,0.022C0.458,-0.009 0.610,0.038 0.715,0.093C0.819,0.148 0.945,0.248 0.978,0.352Z'/%3E%3C/svg%3E");
  --wT: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100' preserveAspectRatio='none'%3E%3Cpath d='M0 46C180 10 360 4 540 30S900 96 1080 70 1320 20 1440 34V100H0Z'/%3E%3C/svg%3E"); --wB: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H1440V54C1260 92 1080 98 900 72S540 6 360 30 120 90 0 66Z'/%3E%3C/svg%3E"); --wR: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60' preserveAspectRatio='none'%3E%3Cpath d='M0 22C200 2 420 2 640 22S1080 58 1440 18V30C1080 70 860 44 640 34S200 14 0 36Z'/%3E%3C/svg%3E");
}
[data-color="violet"] { --pc: var(--violet); --pon: var(--violet-on); }
[data-color="sky"] { --pc: var(--sky); --pon: var(--sky-on); }
[data-color="mint"] { --pc: var(--mint); --pon: var(--mint-on); }
[data-color="orange"] { --pc: var(--orange); --pon: var(--orange-on); }
[data-color="pink"] { --pc: var(--pink); --pon: var(--pink-on); }
[data-color="yellow"] { --pc: var(--yellow); --pon: var(--yellow-on); }
[data-accent="violet"] { --pa: var(--violet); } [data-accent="sky"] { --pa: var(--sky); } [data-accent="mint"] { --pa: var(--mint); }
[data-accent="orange"] { --pa: var(--orange); } [data-accent="pink"] { --pa: var(--pink); } [data-accent="yellow"] { --pa: var(--yellow); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body { margin: 0; background: var(--white); color: var(--ink); font: 400 16px/1.65 var(--text); letter-spacing: -0.01em; word-break: keep-all; overflow-wrap: anywhere; overflow-x: clip; -webkit-font-smoothing: antialiased; }
main { overflow-x: clip; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.03em; line-height: 1.12; text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
::selection { background: var(--pc); color: var(--pon); }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 8px; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.nw { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.w { width: var(--wrap); margin-inline: auto; position: relative; }

/* 구역: 화면 끝까지, 패널로 가두지 않는다 */
.fl-sec { position: relative; isolation: isolate; padding-block: clamp(72px, 9vw, 128px); }

/* 물결 띠: ::after = 서비스 색 면(위·아래 물결), ::before = 아래 경계를 비껴 흐르는 보조 색 가는 물결 */
.fl-band { --wt: var(--wT); --wb: var(--wB); padding-block: calc(clamp(72px, 9vw, 128px) + var(--wh) * .6); }
.fl-band::after { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--pc); opacity: var(--tint, .1); transition: background-color .9s var(--morph);
  -webkit-mask: var(--wt) top / 100% var(--wh) no-repeat, linear-gradient(#000 0 0) center / 100% calc(100% - 2 * var(--wh) + 2px) no-repeat, var(--wb) bottom / 100% var(--wh) no-repeat;
          mask: var(--wt) top / 100% var(--wh) no-repeat, linear-gradient(#000 0 0) center / 100% calc(100% - 2 * var(--wh) + 2px) no-repeat, var(--wb) bottom / 100% var(--wh) no-repeat; }
.fl-band::before { content: ""; position: absolute; left: 0; right: 0; bottom: calc(var(--wh) * -.18); height: calc(var(--wh) * .62); z-index: -1; background: var(--pa); opacity: .35;
  -webkit-mask: var(--wR) center / 100% 100% no-repeat; mask: var(--wR) center / 100% 100% no-repeat; }
.fl-band.wave-top { --wb: linear-gradient(#000 0 0); }
.fl-band.wave-top::before { display: none; }
.fl-band.wave-bottom { --wt: linear-gradient(#000 0 0); }
.fl-band.solid { --tint: 1; color: var(--pon); }

/* 장식 얼룩: 화면 밖까지 번진다(요소에 data-bleed). 색은 --pc, 진하기 --o */
.fl-blob { position: absolute; z-index: -1; aspect-ratio: 1; pointer-events: none; background: var(--pc); opacity: var(--o, .16); transition: background-color .9s var(--morph);
  -webkit-mask: var(--m, var(--mA)) center / 100% 100% no-repeat; mask: var(--m, var(--mA)) center / 100% 100% no-repeat; }
.fl-blob.a, .fl-pic.a { --m: var(--mA); } .fl-blob.b, .fl-pic.b { --m: var(--mB); } .fl-blob.c, .fl-pic.c { --m: var(--mC); }

/* 얼룩 마스크 사진: 바탕 = 서비스 색(사진 바탕과 같은 단색), 사진은 꽉 채우되 머리 위 여유 --pt */
.fl-pic { position: relative; margin: 0; background: var(--pc); transition: background-color .9s var(--morph);
  -webkit-mask: var(--m, var(--mA)) center / 100% 100% no-repeat; mask: var(--m, var(--mA)) center / 100% 100% no-repeat; }
.fl-pic img, .fl-mask .ph { position: absolute; left: 0; top: var(--pt, 7%); width: 100%; height: calc(100% - var(--pt, 7%)); object-fit: cover; object-position: 50% 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 7%); mask-image: linear-gradient(to bottom, transparent, #000 7%); }   /* 사진 바탕과 얼룩 색이 조금 달라도 이음매가 안 보이게 위쪽을 스며들게 */

/* 첫 화면 숨쉬는 얼룩 사진: 크기·자리는 각 페이지가 .fl-stage 에. 사진 여러 장 중 .on 만 보이고 .9s 겹쳐 바뀐다.
   기본은 정지 얼룩(마스크), fluid.js 가 .breathe 를 붙이면 숨쉬는 얼룩(#fl-breath, 16초)으로 */
.fl-stage { position: absolute; pointer-events: none; }
.fl-mask { position: absolute; inset: 0; background: var(--pc); transition: background-color .9s var(--morph);
  -webkit-mask: var(--mH) center / 100% 100% no-repeat; mask: var(--mH) center / 100% 100% no-repeat; }
.fl-mask.breathe { -webkit-mask: none; mask: none; clip-path: url(#fl-breath); }
.fl-mask .ph { opacity: 0; transition: opacity .9s var(--ease); }
.fl-mask .ph.on { opacity: 1; }

/* 떠 있는 흰 카드 (참고 그림처럼 모서리는 작게) */
.fl-card { position: relative; background: var(--white); border-radius: var(--card-r); box-shadow: var(--card-sh); padding: clamp(20px, 3vw, 40px); }

/* 작은 애니메이션(assets/anim): fluid.js 가 보일 때만 움직이는 그림으로 바꾼다 */
img.anim { object-fit: contain; pointer-events: none; }

/* 단추·로고 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 0 28px; border-radius: 999px; font: 600 16px/1 var(--display); text-decoration: none; border: 0; white-space: nowrap; cursor: pointer; transition: transform .25s var(--ease); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.go { background: var(--ink2); color: var(--white); }
.btn.go:hover { transform: translateY(-2px); }
.btn.more { background: var(--bg2); color: var(--ink2); }
.btn.wait { background: var(--bg2); color: var(--sub); cursor: default; }
.logo { display: inline-flex; align-items: center; text-decoration: none; min-height: 44px; color: #382116; }
.logo .mark svg, .logo .mark img { display: block; height: 24px; width: auto; }
.logo .mark:has(svg) img { display: none; }
.logo .hub { font: 200 29px/1 var(--text); color: #382116; margin-left: 4px; transform: translateY(.25px); }   /* 기준선(h 바닥)을 Key 글자 바닥에 정확히 맞춤 — 예전 1px 내림을 없앰(2026-12-01, 4배 확대로 잼) */

/* 격자 안에서 쓰는 첫 화면 얼룩(소개 페이지) */
.fl-stage.static { position: relative; }

/* 바닥글(메인·소개 페이지 같은 것): 위쪽이 물결로 이어지는 어두운 띠. 서비스 바로 가기 줄 → 로고 → 회사 정보.
   바탕색은 요소에 직접(글자 대비 검사가 읽을 수 있게), 물결은 ::before 가 띠 위로 올라가 앞 구역에 걸친다 */
.foot { position: relative; z-index: 1; margin-top: 0; padding: 8px 0 56px; background: var(--ink2); color: var(--line); font-size: 14px; line-height: 1.75; }
.foot::before { content: ""; position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); height: var(--wh); background: var(--ink2);
  -webkit-mask: var(--wT) bottom / 100% 100% no-repeat; mask: var(--wT) bottom / 100% 100% no-repeat; }
.fw { display: grid; gap: 24px; }
/* 서비스 바로 가기: 분류별로 묶음(분류 이름 작게 + 그 분류의 서비스). 2026-12-01 분류 도입 */
.foot-svc { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 24px; list-style: none; margin: 0; padding: 0 0 16px; border-bottom: 1px solid rgb(227 229 234 / .14); }
.foot-svc .fs-g { display: grid; align-content: start; min-width: 0; }
.foot-svc .fs-h { padding-top: 8px; font: 500 14px/1.4 var(--display); color: var(--line); }
.foot-svc .fs-g ul { display: flex; flex-wrap: wrap; gap: 0 4px; list-style: none; margin: 0 0 0 -12px; padding: 0; }
@media (max-width: 860px) { .foot-svc { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; } }
.foot-svc a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; text-decoration: none; color: var(--white); font: 500 16px/1 var(--display); }
.foot-svc a:hover { background: rgb(255 255 255 / .08); }
.foot-co { display: grid; gap: 12px; }
.foot-logo { display: inline-flex; min-height: 44px; align-items: center; justify-self: start; }
.foot-logo img { height: 22px; width: auto; }
.foot-co p { margin: 0; }
.foot-co .sl { color: var(--yellow); margin: 0 8px; }
.foot-co a { color: inherit; display: inline-block; padding-block: 14px; margin-block: -14px; }   /* 누를 자리 44px, 줄 높이는 그대로 */
.foot-co .copy { margin-top: 4px; }
.foot-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.foot-row img { height: 22px; width: auto; }

/* 쪽 안 이동 알약(소개 페이지): 흰 알약이 떠 있다. 첫 화면에서는 숨김(.away) */
.pill { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 30; display: flex; gap: 2px; padding: 6px; border-radius: 999px; background: var(--white); box-shadow: var(--card-sh), 0 0 0 1px var(--line);
  transition: opacity .35s var(--ease), visibility 0s .35s; }
.pill.away { opacity: 0; visibility: hidden; pointer-events: none; }
.pill:not(.away) { transition-delay: 0s; }
.pill a { white-space: nowrap; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; color: var(--ink2); text-decoration: none; font: 500 14px/1 var(--display); }
.pill a:hover { background: var(--bg2); }
body:has(.pill) .foot { padding-bottom: 104px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* 2026-12-02 로그인 머리글(js/auth.js mountHeader): 오른쪽 위 「로그인」 또는 「이름 님 · 로그아웃」 */
.kh-auth { position: absolute; top: 18px; right: var(--gut); z-index: 30; display: flex; align-items: center; gap: 10px; font: 500 15px/1 var(--text); }
.kh-auth a, .kh-auth button { min-height: 40px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 999px; text-decoration: none; cursor: pointer; font: inherit; }
.kh-auth-in { background: var(--ink2); color: #fff; }
.kh-auth-in:hover { background: var(--ink); }
.kh-auth-name { color: var(--ink); }
.kh-auth-out { background: #fff; color: var(--ink2); border: 1px solid var(--line); }
@media (max-width: 560px) { .kh-auth { top: 12px; right: 16px; font-size: 14px; } .kh-auth a, .kh-auth button { padding: 0 14px; min-height: 40px; } .kh-auth-name { display: none; } }
/* 2026-12-03 이용 기록 동의를 한 번 묻는 띠(js/auth.js askUsage) — 로그인한 기존 회원에게만, 아래에 떠 있는 흰 카드 */
.kh-ask { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 40; width: min(560px, 100% - 32px); box-sizing: border-box;
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--card-r); background: var(--white); color: var(--ink2);
  box-shadow: var(--card-sh), 0 0 0 1px var(--line); font: 400 14px/1.55 var(--text); }
.kh-ask p { margin: 0; flex: 1; }
.kh-ask b { font-weight: 600; color: var(--ink); }
.kh-ask a { color: var(--ink2); text-decoration: underline; text-underline-offset: 3px; padding: 10px 2px; }   /* 줄 높이는 그대로, 누를 자리만 넓게 */
.kh-ask-b { display: flex; gap: 8px; flex: none; }
.kh-ask button { min-height: 40px; padding: 0 16px; border-radius: 999px; font: 500 14px/1 var(--text); cursor: pointer; border: 1px solid var(--line); background: var(--white); color: var(--ink2); }
.kh-ask button[data-on="1"] { background: var(--ink2); border-color: var(--ink2); color: #fff; }
.kh-ask button[data-on="1"]:hover { background: var(--ink); }
.kh-ask button:disabled { opacity: .6; cursor: default; }
@media (max-width: 560px) { .kh-ask { flex-direction: column; align-items: stretch; gap: 10px; bottom: 12px; } .kh-ask-b button { flex: 1; } }

