/* 데모 페이지 (메뉴판 style.css 토큰 위에 얹음) */
.demo-nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.demo-nav-inner { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.demo-nav .back { text-decoration: none; color: var(--fg); font-weight: 600; font-size: 14px; }
.demo-nav .back:hover { color: var(--accent); }
.demo-nav .code { font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; letter-spacing: .02em; }

.demo-layout { display: grid; grid-template-columns: minmax(0, 1fr) 410px; gap: 40px; padding-block: 32px 64px; align-items: start; }

.demo-info { display: grid; gap: 14px; min-width: 0; }
.demo-info .card-top { display: flex; gap: 6px; }
.demo-info .areas { display: flex; gap: 4px; }
.demo-info h1 { font-size: clamp(24px, 3.4vw, 30px); font-weight: 800; letter-spacing: -.02em; }
.demo-info .desc { margin: 0; color: var(--muted); max-width: 56ch; }
.demo-info .facts { background: var(--surface); border: 1px solid var(--line); border-top-style: solid; border-radius: var(--radius); padding: 14px 16px; margin: 0; }
.demo-price { margin: 0; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.demo-price:empty { display: none; }

.seg { display: inline-flex; align-items: center; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; justify-self: start; }
.seg-btn, .seg-reload { font: inherit; font-size: 13.5px; font-weight: 600; border: 0; background: transparent; color: var(--muted); height: 34px; padding: 0 14px; border-radius: 7px; cursor: pointer; }
.seg-btn[aria-pressed="true"] { background: var(--fg); color: var(--surface); }
.seg-reload { padding: 0 10px; font-size: 16px; }
.seg-btn:focus-visible, .seg-reload:focus-visible, .code-tab:focus-visible, .copy-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.demo-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.demo-block h2 { font-size: 15px; margin-bottom: 10px; }
.demo-block ol, .demo-block ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.demo-block ul { list-style: none; padding: 0; }
.demo-block b { color: var(--fg); margin-right: 8px; }
.demo-block code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12.5px; background: var(--bg); padding: 1px 5px; border-radius: 4px; }

.scope-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 24px; }
.scope-grid h3 { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--faint); }
.demo-block .scope-grid ul { list-style: disc; padding-left: 18px; gap: 4px; font-size: 13.5px; }
.scope-note { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.scope-note a { color: var(--accent); font-weight: 600; }

.code-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.code-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.code-tab { font: inherit; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); height: 30px; padding: 0 10px; border-radius: 7px; cursor: pointer; }
.code-tab[aria-selected="true"] { color: var(--fg); border-color: var(--fg); }
.copy-btn { font: inherit; font-size: 12.5px; font-weight: 600; border: 0; background: var(--accent-soft); color: var(--accent); height: 30px; padding: 0 12px; border-radius: 7px; cursor: pointer; }
.code-view { margin: 0; max-height: 420px; overflow: auto; background: var(--bg); border-radius: 8px; padding: 14px; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12.5px; line-height: 1.6; white-space: pre; }

.controls { display: flex; flex-wrap: wrap; gap: 8px; }

.demo-stage { position: sticky; top: 76px; display: grid; gap: 10px; justify-items: center; min-width: 0; }
.stage-note { margin: 0; font-size: 12.5px; color: var(--faint); }

.device { max-width: 100%; box-shadow: 0 20px 50px -24px rgba(10, 20, 40, .45); }
.device-screen { position: relative; width: 100%; height: 100%; overflow: hidden; background: #fff; }
.device-screen iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; transform-origin: 0 0; }
.device-bar { display: none; }

/* 모바일: 폰 프레임 */
.phone { width: 410px; height: min(820px, calc(100vh - 130px)); min-height: 560px; padding: 10px; background: var(--fg); border-radius: 36px; }
.phone .device-screen { border-radius: 27px; }

/* PC: 브라우저 프레임, 1280px 화면을 축소해서 표시 */
.browser { width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--surface); }
.browser .device-bar { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--bg); }
.browser .device-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.browser .device-bar span { margin-left: 10px; font-size: 12px; color: var(--faint); }
.browser .device-screen { height: min(720px, calc(100vh - 200px)); min-height: 480px; }

/* PC 보기일 때는 화면을 위로, 설명을 아래로 */
body.is-pc .demo-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
body.is-pc .demo-stage { position: static; order: -1; justify-items: stretch; }

@media (max-width: 900px) {
  .demo-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .demo-stage { position: static; order: -1; }
  .phone { height: 680px; min-height: 0; }
}
@media (max-width: 480px) {
  .phone { padding: 0; border-radius: 14px; background: transparent; box-shadow: 0 0 0 1px var(--line-strong); }
  .phone .device-screen { border-radius: 14px; }
}
