/* 사용 사례 페이지 — 기준은 DESIGN.md. 움직임 곡선은 kinetics.colorion.co(Accordion Spring·Stagger Entrance·Step Progress)에서 가져옴 */
.cs { --glide: cubic-bezier(.16, 1, .3, 1); --spring: cubic-bezier(.34, 1.56, .64, 1); }
.cs .nav a[aria-current="page"] { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.cs-sky { padding-bottom: 72px; }
.cs-body { max-width: 1080px; margin: 0 auto; padding: 40px 20px 96px; }

/* 분야 버튼 */
.cs-filter { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; }
.cs-filter::-webkit-scrollbar { display: none; }
.cs-filter button { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 500 14.5px var(--font); cursor: pointer; }
.cs-filter button span { font: 500 12.5px var(--mono); color: var(--grey); }
.cs-filter button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.cs-filter button[aria-pressed="true"] span { color: color-mix(in srgb, var(--bg) 70%, transparent); }

/* 기록 목록 */
.cs-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.cx { border-bottom: 1px solid var(--hair); }
.cx-h { margin: 0; font: inherit; }
.cx-btn { width: 100%; display: grid; grid-template-columns: 56px minmax(0, 1fr) 32px; gap: 0 12px; align-items: start; text-align: left; padding: 24px 8px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; border-radius: 16px; transition: background .2s; }
.cx-btn:hover { background: var(--soft); }
.cx-no { font: 500 15px/1.9 var(--mono); color: var(--grey); }
.cx-main { display: grid; gap: 4px; }
.cx-cat { font-size: 13.5px; font-weight: 600; color: var(--grey); }
.cx-ask { font-size: 19px; line-height: 1.5; font-weight: 500; color: var(--ink); letter-spacing: -.015em; }
.cx-sum { font-size: 14.5px; color: var(--grey); }
.cx-chev { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); position: relative; margin-top: 2px; transition: transform .35s var(--spring), background .2s; }
.cx-chev::before { content: ""; position: absolute; left: 50%; top: 45%; width: 8px; height: 8px; border-right: 1.6px solid var(--ink); border-bottom: 1.6px solid var(--ink); transform: translate(-50%, -50%) rotate(45deg); }
.cx.open .cx-chev { transform: rotate(180deg); background: var(--ink); border-color: var(--ink); }
.cx.open .cx-chev::before { border-color: var(--bg); }

/* 펼치기: 높이를 부드럽게(grid 0fr → 1fr) */
.cs-ready .cx-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--glide); }
.cs-ready .cx.open .cx-body { grid-template-rows: 1fr; }
.cx-in { overflow: hidden; min-height: 0; }

/* 다시 보기 무대 */
.replay { margin: 0 0 28px 76px; padding: 22px 24px 18px; background: var(--soft); border: 1px solid var(--hair); border-radius: 20px; }
.rp-acts { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 6px; margin-bottom: 20px; }
.rp-acts i { height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 9%, transparent); overflow: hidden; position: relative; }
.rp-acts i::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform: scaleX(1); transform-origin: left; }
.replay.playing .rp-acts i::after { transform: scaleX(0); transition: transform 0s; }
.replay.playing.a1 .rp-acts i:nth-child(1)::after { transform: scaleX(1); transition: transform var(--d1, 2s) linear; }
.replay.playing.a2 .rp-acts i:nth-child(2)::after { transform: scaleX(1); transition: transform var(--d2, 4s) linear; }
.replay.playing.a3 .rp-acts i:nth-child(3)::after { transform: scaleX(1); transition: transform var(--d3, 1.5s) linear; }
.rp-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px; align-items: start; }
.rp-label { font-size: 12.5px; font-weight: 600; color: var(--grey); margin: 0 0 8px !important; }
.rp-label + .rp-steps { margin-top: 0; }
.rp-ask { margin: 0 0 22px !important; padding: 13px 16px; border-radius: 16px 16px 4px 16px; background: var(--ink); color: #fff; font-size: 15.5px; line-height: 1.6; min-height: 3.2em; transform-origin: right bottom; }
.replay.playing .rp-ask { opacity: 0; transform: translateY(10px) scale(.97); }
.replay.playing.a1 .rp-ask { opacity: 1; transform: none; transition: opacity .3s, transform .5s var(--spring); }
.replay.playing.a1:not(.a2) .rp-ask::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: #fff; animation: rpcaret .9s steps(1) infinite; }
@keyframes rpcaret { 50% { opacity: 0; } }
.replay.playing:not(.a2) .rp-left .rp-label:nth-of-type(3) { opacity: .35; }

.rp-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rp-steps li { position: relative; padding-left: 34px; font-size: 15px; line-height: 1.55; color: var(--text); min-height: 22px; }
.rp-steps li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--ink); color: var(--bg); border: 1.5px solid var(--ink); }
.rp-steps li::after { content: ""; position: absolute; left: 10px; top: 24px; bottom: -12px; width: 2px; background: var(--ink); opacity: .18; }
.rp-steps li:last-child::after { display: none; }
.replay.playing .rp-steps li { opacity: 0; transform: translateY(8px); }
.replay.playing .rp-steps li.on { opacity: 1; transform: none; transition: opacity .45s var(--glide), transform .45s var(--glide); }
.replay.playing .rp-steps li:not(.ok)::before { content: ""; background: var(--bg); border-color: color-mix(in srgb, var(--ink) 25%, transparent); }
.replay.playing .rp-steps li.on:not(.ok)::before { border-color: var(--blue); border-top-color: transparent; animation: rpspin .8s linear infinite; }
@keyframes rpspin { to { transform: rotate(360deg); } }
.replay.playing .rp-steps li.ok::before { animation: rppop .4s var(--spring); }
@keyframes rppop { from { transform: scale(.6); } to { transform: scale(1); } }

.rp-result { margin: 0; }
.rp-win { background: var(--bg); border: 1px solid var(--hair); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 18px 40px -18px rgba(0, 0, 0, .22); }
.rp-dots { display: flex; gap: 6px; padding: 9px 12px; background: var(--soft); border-bottom: 1px solid var(--hair); }
.rp-dots i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.rp-dots i:nth-child(2) { background: #febc2e; } .rp-dots i:nth-child(3) { background: #28c840; }
.rp-win img { width: 100%; height: auto; display: block; }
.rp-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rp-facts span { padding: 6px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--hair); font-size: 14px; color: var(--grey); }
.rp-facts b { color: var(--ink); font-weight: 700; margin-left: 2px; }
.replay.playing .rp-result .rp-win { opacity: .16; filter: grayscale(1); transform: translateY(18px) scale(.985); }
.replay.playing.a3 .rp-result .rp-win { opacity: 1; filter: none; transform: none; transition: opacity .5s var(--glide), filter .5s, transform .7s var(--glide); }
.replay.playing .rp-facts span { opacity: 0; transform: translateY(6px) scale(.9); }
.replay.playing.a3 .rp-facts span { opacity: 1; transform: none; transition: opacity .35s, transform .45s var(--spring); transition-delay: .55s; }
.replay.playing.a3 .rp-facts span:nth-child(2) { transition-delay: .7s; }

.rp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; min-height: 34px; }
.rp-cap { margin: 0 !important; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.rp-again { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 999px; height: 34px; padding: 0 14px; font: 500 13.5px var(--font); cursor: pointer; opacity: .45; transition: opacity .2s; }
.replay.done .rp-again, .rp-again:hover, .rp-again:focus-visible { opacity: 1; }

.cs-end { margin-top: 48px; text-align: center; display: grid; justify-items: center; gap: 18px; }
.cs-end p { font-size: 14px; color: var(--grey); }

/* 휴대폰: 한 장씩 세로로, 큰 글자, 보조 정보 줄이기 */
@media (max-width: 760px) {
  .cs-body { padding: 24px 16px 72px; }
  .cx-btn { grid-template-columns: 30px minmax(0, 1fr) 30px; gap: 0 10px; padding: 20px 2px; }
  .cx-no { font-size: 13px; line-height: 2.1; }
  .cx-ask { font-size: 17.5px; }
  .cx-sum { font-size: 14px; }
  .cx-chev { width: 30px; height: 30px; }
  .replay { margin: 0 0 22px; padding: 16px 14px 14px; border-radius: 16px; }
  .rp-grid { grid-template-columns: 1fr; gap: 18px; }
  .rp-ask { font-size: 15px; margin-bottom: 18px !important; }
  .rp-steps li { font-size: 15px; }
  .rp-foot { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-ready .cx-body { transition: none; }
  .cx-chev { transition: none; }
}
@media (max-width: 860px) { .cs .header-cta { margin-left: auto; } }
