/* 인터랙티브 데모 페이지 (/demo, /demo/c/*, /demo/*-demo) 전용 스타일.
 *
 * 레이아웃은 목업(Demo Hub v4 · Mount Demo Page v3)을 따르되 색·폰트는 사이트
 * 토큰을 쓴다. 포인트 컬러는 브랜드 오렌지 #ff9012 지만, 흰 배경 위 작은
 * 글자에는 대비가 모자라므로(2.1:1) eyebrow·링크 같은 텍스트에는 어두운 변형
 * --demo-accent-ink 를 쓴다. 채움(버튼 배경·불릿·재생 아이콘)에만 원래 오렌지를 쓴다.
 *
 * 공통 navbar/footer 는 jQuery .load() 로 들어오므로 여기선 건드리지 않는다.
 */
:root {
    --demo-accent: #ff9012;
    --demo-accent-hover: #e07c00;
    --demo-accent-ink: #a85d00;
    --demo-accent-soft: #fff4e5;
    --demo-bg: #f6f7f9;
    --demo-ink: #141821;
    --demo-ink-2: #4a5160;
    --demo-ink-3: #5b6270;
    --demo-ink-body: #2b303b;
    --demo-muted: #8a909b;
    --demo-border: #e3e6eb;
    --demo-border-2: #d9dde3;
    --demo-border-hover: #b8bec8;
    --demo-surface-2: #f1f2f5;
    --demo-dark: #0e1118;
    --demo-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --demo-stripes: repeating-linear-gradient(135deg, #eceef2 0 10px, #e4e7ec 10px 20px);
}

/* styles.css 가 html·body 에 height:100% + 흰 배경을 주므로, body 배경만 칠하면
 * 첫 화면 높이 아래로 html 의 흰색이 드러나 스크롤 도중 배경이 바뀐다.
 * 문서 전체(html)를 같은 색으로 칠하고 body 높이 제한을 푼다. */
html.demo-html {
    background: var(--demo-bg);
}
body.demo-body {
    height: auto;
    min-height: 100%;
    background: var(--demo-bg);
    color: var(--demo-ink);
    font-family: 'Poppins', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* 클래스가 display 를 정하는 요소에도 hidden 속성이 먹도록 */
.demo-main [hidden],
.demo-bar[hidden] {
    display: none !important;
}

/* 데모 팝업이 떠 있는 동안 공통 네비바를 감춘다.
 *
 * styles.css 의 #mainNav 는 z-index 100000000 인데 Supademo 오버레이는
 * 10000000 이라, 네비바가 모달을 뚫고 올라온다. 보기 싫은 것으로 끝나지 않고
 * 모달의 닫기(X) 버튼이 (1361, 24) — 네비바 띠 안 — 에 있어서 **버튼이 가려져
 * 클릭이 안 된다.** 데모 페이지는 진입하자마자 데모가 뜨므로 특히 치명적이다.
 *
 * display 가 아니라 visibility 를 쓰는 이유: 네비바가 자리를 비우면 뒤 페이지가
 * 67px 위로 밀렸다가 닫을 때 되돌아와 깜빡인다. visibility 는 레이아웃을
 * 그대로 두고 보이기만 감춘다. */
body.demo-modal-open #mainNav {
    visibility: hidden;
}

/* 모바일 세로 화면에서 데모가 너무 작게 보이는 문제.
 *
 * Supademo 모달 컨테이너는 `aspect-ratio: 16/9` 로 고정돼 있다. 393px 폭
 * 휴대폰에서는 높이가 221px — 화면의 26% 밖에 못 쓴다. 데모를 그 납작한 상자에
 * 맞추느라 내용이 **세로 기준으로** 축소돼, 안내 말풍선 글씨를 읽기 어렵다.
 *
 * 비율 고정을 풀면 내용이 가로 기준으로 맞춰진다 — 실측으로 데모 내용 폭이
 * 298px → 393px (+32%, 면적 +74%) 로 커진다. 가로 화면은 16:9 가 이미 잘
 * 맞으므로 세로일 때만 적용한다.
 *
 * 남의 위젯 클래스를 덮어쓰는 것이라, Supademo 가 클래스명을 바꾸면 이 규칙은
 * 그냥 적용되지 않는다(= 지금 동작으로 되돌아갈 뿐 깨지지 않는다).
 * 상단 패딩은 Supademo 자체 닫기(X) 버튼 자리를 비워 둔다. */
@media (max-width: 820px) and (orientation: portrait) {
    .supademo-standalone-modal-overlay {
        padding: 76px 0 16px !important;
        box-sizing: border-box !important;
    }
    .supademo-standalone-modal-container {
        aspect-ratio: auto !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
    }
}

/* 모바일 브라우저는 주소창·탭바가 떴다 사라지며 '보이는 높이'가 변한다.
 * 오버레이는 position:fixed 라 큰 쪽(툴바가 숨은 상태) 기준으로 잡히는데,
 * 특히 가로로 돌리면 툴바가 뜬 채여서 모달 아래쪽이 화면 밖으로 밀린다 —
 * 사용자가 위로 스와이프해 툴바를 치워야 비로소 다 보인다.
 *
 * dvh 는 '지금 실제로 보이는 높이'라 이 어긋남을 없앤다. 툴바가 떠 있으면 그에
 * 맞춰 줄고, 사용자가 스크롤해 툴바가 숨으면 자동으로 다시 커진다.
 *
 * (iPhone Safari 는 웹페이지의 전체화면 전환 자체를 허용하지 않는다 —
 *  Fullscreen API 가 없고 video 요소만 예외다. 회전도 사용자 제스처로 쳐주지
 *  않으므로 "가로로 돌리면 자동 전체화면"은 구현할 수 없다. dvh 로 잘림을
 *  없애는 것이 할 수 있는 최선이다.) */
@media (max-width: 1024px) {
    .supademo-standalone-modal-overlay {
        height: 100dvh !important;
        max-height: 100dvh !important;
    }
}

/* 데모 페이지: 팝업을 뷰포트 가득(100vw × 100dvh, 모서리 0)으로 띄운다.
 * Fullscreen API 가 아니다 — iPhone 에선 그게 불가능하므로(위 주석) 오버레이
 * 상자만 화면 크기로 키운다. body.demo-fullscreen 은 팝업이 떠 있는 동안만
 * demo-launcher.js 가 붙인다. 위의 세로 화면 규칙보다 뒤에 와야 이긴다. */
body.demo-fullscreen .supademo-standalone-modal-overlay {
    padding: 0 !important;
}
body.demo-fullscreen .supademo-standalone-modal-container {
    aspect-ratio: auto !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
}

/* ---------- 공통 레이아웃 ---------- */
.demo-main {
    /* 1400px = 카드(약 252px) 5장 + 간격 16px × 4 + 좌우 여백 32px × 2.
     * Start here 5장이 라이브러리 카드와 같은 크기로 한 줄에 들어가는 폭이다. */
    max-width: 1400px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 40px 32px 72px;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

/* styles.css 는 @media(min-width:768px) 에서 모든 <section> 에 9rem 세로 패딩을
 * 준다(기존 랜딩 페이지 섹션용). 데모 페이지는 .demo-main 의 gap 으로 간격을
 * 잡으므로 여기서 되돌린다. */
.demo-main section {
    padding: 0;
}
.demo-main h1,
.demo-main h2,
.demo-main h3,
.demo-main h4,
.demo-main p,
.demo-main figure,
.demo-main ol {
    margin: 0;
}

.demo-main a {
    color: var(--demo-accent-ink);
    text-decoration: none;
}
.demo-main a:hover {
    color: var(--demo-accent-hover);
    text-decoration: underline;
}

.demo-eyebrow {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--demo-accent-ink);
}

.demo-h1 {
    margin: 0;
    font-size: clamp(28px, 7vw, 44px);
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-wrap: pretty;
}

.demo-lead {
    margin: 0;
    font-size: clamp(15px, 3.6vw, 17px);
    line-height: 1.6;
    color: var(--demo-ink-2);
    max-width: 52ch;
}

.demo-section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}
.demo-section-head h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.demo-section-head a {
    font-size: 14px;
    font-weight: 600;
}

/* ---------- 배지 ---------- */
.demo-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.demo-badge {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    padding: 1px 8px;
    border-radius: 999px;
    background: #eef0f3;
    color: var(--demo-ink-2);
    white-space: nowrap;
}
.demo-badge-accent {
    background: var(--demo-accent-soft);
    color: var(--demo-accent-ink);
}
.demo-badge-plus {
    background: var(--demo-ink);
    color: #fff;
}
.demo-badge-new {
    background: var(--demo-accent);
    color: var(--demo-ink);
}

/* ---------- 히어로 ---------- */
.demo-hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: clamp(24px, 5vw, 48px);
    align-items: center;
}

.demo-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;
    min-width: 0;
}

.demo-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--demo-border);
    font-size: 13px;
    font-weight: 500;
    color: var(--demo-ink-2);
}
.demo-pill-dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9aa1ad;
    box-sizing: border-box;
}
.demo-pill[data-state='loading'] .demo-pill-dot {
    width: 12px;
    height: 12px;
    background: none;
    border: 2px solid #ffd9a8;
    border-top-color: var(--demo-accent);
    animation: demo-spin 0.8s linear infinite;
}
.demo-pill[data-state='open'] .demo-pill-dot {
    background: #2f9e58;
    animation: demo-pulse 1.4s ease-in-out infinite;
}
.demo-pill[data-state='error'] .demo-pill-dot {
    background: #d04a3b;
}
@keyframes demo-spin {
    to {
        transform: rotate(360deg);
    }
}
@keyframes demo-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.35;
    }
}

.demo-headings {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.demo-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.demo-points li {
    display: flex;
    gap: 12px;
    align-items: baseline;
    font-size: 15px;
    line-height: 1.5;
    color: var(--demo-ink-body);
}
.demo-points li::before {
    content: '';
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--demo-accent);
    transform: translateY(-2px);
}

.demo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.demo-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    padding: 0 26px;
    border: 0;
    border-radius: 10px;
    background: var(--demo-accent);
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(20, 24, 33, 0.12), 0 6px 18px rgba(255, 144, 18, 0.28);
}
.demo-btn:hover:not([disabled]) {
    background: var(--demo-accent-hover);
    color: #fff;
}
.demo-btn:active:not([disabled]) {
    transform: translateY(1px);
}
.demo-btn[disabled] {
    opacity: 0.55;
    cursor: default;
}
.demo-btn-tri {
    width: 0;
    height: 0;
    border-left: 11px solid #fff;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
}

.demo-btn-ghost {
    display: inline-flex;
    align-items: center;
    height: 50px;
    padding: 0 22px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--demo-border-2);
    box-sizing: border-box;
    font-size: 15px;
    font-weight: 600;
}
.demo-main a.demo-btn-ghost {
    color: var(--demo-ink);
}
.demo-main a.demo-btn-ghost:hover {
    border-color: var(--demo-border-hover);
    color: var(--demo-ink);
    text-decoration: none;
}

.demo-newtab {
    margin-top: -12px;
    font-size: 14px;
    font-weight: 600;
}

.demo-error-hint {
    margin: -8px 0 0;
    font-size: 14px;
    color: #6b7280;
}

.demo-noscript {
    margin: 0;
    font-size: 15px;
}

/* ---------- 썸네일 (로컬 정지 이미지) ---------- */
.demo-thumb {
    all: unset;
    box-sizing: border-box;
    position: relative;
    display: block;
    width: 100%;
    /* Meta Image 권장 규격이 16:9 다. 비율이 다른 이미지는 cover 로 맞춘다. */
    aspect-ratio: 16/9;
    border-radius: 14px;
    overflow: hidden;
    /* 이미지가 없거나 깨졌을 때 드러나는 플레이스홀더 */
    background: var(--demo-stripes);
    border: 1px solid var(--demo-border);
    box-shadow: 0 12px 40px rgba(20, 24, 33, 0.1);
    cursor: pointer;
}
.demo-thumb[disabled] {
    cursor: default;
}
.demo-thumb-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* 재생 버튼이 묻히지 않을 만큼만 덮는다. 정지 스크린샷에 진하게 깔면 화면만
 * 탁해진다. */
.demo-thumb-veil {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(14, 17, 24, 0.06);
    transition: background 0.15s ease;
}
.demo-thumb:hover .demo-thumb-veil,
.demo-ess-thumb:hover .demo-thumb-veil {
    background: rgba(14, 17, 24, 0.16);
}

/* 썸네일이 없을 때의 글자 카드 ("ADD REMOTE / Google Drive") */
.demo-tile {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px;
    text-align: center;
    background: var(--demo-surface-2);
}
.demo-tile-eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--demo-accent-ink);
}
/* 라이브러리 카드는 재생 버튼이 오른쪽 아래에 있으므로 글자를 조금 위로 */
.demo-lcard-thumb .demo-tile {
    padding: 12px 16px 36px;
}
.demo-tile-name {
    font-size: 19px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--demo-ink);
}

/* 재생 아이콘 (흰 원 + 오렌지 삼각형) */
.demo-play {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.demo-play::before {
    content: '';
    width: 0;
    height: 0;
    margin-left: 5px;
    border-left: 20px solid var(--demo-accent);
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
}
.demo-play-sm {
    width: 42px;
    height: 42px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}
.demo-play-sm::before {
    margin-left: 3px;
    border-left-width: 12px;
    border-top-width: 7px;
    border-bottom-width: 7px;
}
.demo-play-xs {
    width: 28px;
    height: 28px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}
.demo-play-xs::before {
    margin-left: 2px;
    border-left-width: 9px;
    border-top-width: 5px;
    border-bottom-width: 5px;
}
/* 오렌지 원 + 흰 삼각형 (목차의 Other demos) */
.demo-play-dot {
    width: 18px;
    height: 18px;
    background: var(--demo-accent);
    box-shadow: none;
}
.demo-play-dot::before {
    margin-left: 2px;
    border-left: 6px solid #fff;
    border-top-width: 4px;
    border-bottom-width: 4px;
}

/* ---------- 가로 스크롤 줄 (Start here · 라이브러리 선반 · Watch next) ----------
 * 넷플릭스식 "둘러보기" 줄. 데모가 늘어도 한 줄로 두고, 다음 카드가 살짝 보이게
 * 해서 더 있다는 걸 알린다(--row-cols 의 소수점이 그 몫이다). 탭·검색의 전체
 * 목록은 줄바꿈 그리드(.demo-grid)다. 마우스 환경에선 넘칠 때만 양 끝 화살표가
 * 나타난다 — macOS 는 스크롤바를 감추므로 화살표가 유일한 단서다. */
.demo-rowwrap {
    position: relative;
}
.demo-row {
    --row-cols: 5;
    --row-gap: 16px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - var(--row-gap) * (var(--row-cols) - 1)) / var(--row-cols));
    gap: var(--row-gap);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 2px 2px 6px;
    margin: -2px -2px -6px;
}
.demo-row::-webkit-scrollbar {
    display: none;
}
.demo-row > * {
    scroll-snap-align: start;
    min-width: 0;
}
.demo-next-row {
    --row-cols: 4;
    --row-gap: 12px;
}
@media (max-width: 1023px) {
    .demo-row {
        --row-cols: 3.4;
    }
    .demo-next-row {
        --row-cols: 2.3;
    }
}
@media (max-width: 639px) {
    .demo-row {
        --row-cols: 1.2;
        --row-gap: 12px;
    }
    .demo-next-row {
        --row-cols: 1.15;
    }
}
.demo-row-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    border: 1px solid var(--demo-border);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 14px rgba(20, 24, 33, 0.16);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.demo-row-nav::before {
    content: '';
    width: 9px;
    height: 9px;
    border-top: 2px solid var(--demo-ink);
    border-right: 2px solid var(--demo-ink);
}
.demo-row-prev {
    left: -14px;
}
.demo-row-prev::before {
    transform: translateX(2px) rotate(-135deg);
}
.demo-row-next {
    right: -14px;
}
.demo-row-next::before {
    transform: translateX(-2px) rotate(45deg);
}
.demo-row-nav:hover {
    border-color: var(--demo-accent);
}
.demo-row-nav[hidden] {
    display: none;
}
/* 터치 기기는 스와이프가 자연스럽고, 살짝 보이는 다음 카드가 단서다 */
@media (hover: none) {
    .demo-row-nav {
        display: none !important;
    }
}

/* ---------- 허브: 인트로 · Start here ---------- */
.demo-hub-intro {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 720px;
}

.demo-start {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.demo-start-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.demo-start-head h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.demo-start-head span {
    font-size: 14px;
    color: var(--demo-ink-3);
}

.demo-ess {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--demo-border);
    border-radius: 12px;
    overflow: hidden;
    scroll-margin-top: 24px;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.demo-ess:hover {
    border-color: var(--demo-accent);
    box-shadow: 0 8px 24px rgba(20, 24, 33, 0.08);
}
/* #mount 같은 딥링크로 들어오면 2.4초 하이라이트 */
.demo-ess.is-highlight {
    border-color: var(--demo-accent);
    box-shadow: 0 0 0 3px rgba(255, 144, 18, 0.25);
}
.demo-ess-thumb {
    all: unset;
    position: relative;
    display: block;
    aspect-ratio: 16/9;
    cursor: pointer;
    background: var(--demo-stripes);
}
.demo-ess-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px 14px;
    flex: 1;
}
.demo-ess-eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--demo-accent-ink);
}
.demo-ess-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    flex: 1;
    text-wrap: pretty;
}
.demo-ess-body a {
    font-size: 13px;
    font-weight: 600;
}

/* ---------- 허브: Demo library ---------- */
.demo-library {
    display: flex;
    flex-direction: column;
    gap: 22px;
    scroll-margin-top: 24px;
}
.demo-lib-head {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
    justify-content: space-between;
}
.demo-lib-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.demo-lib-copy h2 {
    font-size: 30px;
    line-height: 1.18;
    font-weight: 700;
    letter-spacing: -0.015em;
}
.demo-lib-copy p:last-child {
    font-size: 15px;
    line-height: 1.6;
    color: var(--demo-ink-2);
}

.demo-search {
    /* 예시 문구("…e.g. OneDrive, WebDAV")가 독일어·프랑스어에서도 잘리지 않는 폭 */
    flex: 0 1 420px;
    min-width: min(240px, 100%);
    display: flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    margin: 0;
    padding: 0 14px;
    background: #fff;
    border: 1px solid var(--demo-border-2);
    border-radius: 10px;
    box-sizing: border-box;
}
.demo-search:focus-within {
    border-color: var(--demo-accent);
}
.demo-search-icon {
    flex: none;
    width: 12px;
    height: 12px;
    border: 2px solid var(--demo-muted);
    border-radius: 50%;
    box-sizing: border-box;
}
.demo-search input {
    all: unset;
    flex: 1;
    min-width: 0;
    font-size: 15px;
    color: var(--demo-ink);
}
.demo-search input::placeholder {
    color: var(--demo-muted);
}

.demo-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.demo-main a.demo-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    box-sizing: border-box;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    background: #fff;
    color: var(--demo-ink-body);
    border: 1px solid var(--demo-border);
}
.demo-main a.demo-tab:hover {
    border-color: var(--demo-accent);
    text-decoration: none;
}
.demo-main a.demo-tab[aria-current='page'] {
    background: var(--demo-ink);
    color: #fff;
    border-color: var(--demo-ink);
}
.demo-tab span {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.75;
}
/* 검색 중엔 어느 탭도 선택된 것으로 보이지 않는다 */
.demo-library.is-search a.demo-tab[aria-current='page'] {
    background: #fff;
    color: var(--demo-ink-body);
    border-color: var(--demo-border);
}

.demo-empty {
    padding: 40px 24px;
    border: 1px dashed var(--demo-border-2);
    border-radius: 12px;
    text-align: center;
    font-size: 15px;
    color: var(--demo-ink-2);
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
.demo-empty button {
    all: unset;
    cursor: pointer;
    font-weight: 600;
    color: var(--demo-accent-ink);
}

.demo-view,
.demo-shelves {
    display: flex;
    flex-direction: column;
    gap: 36px;
}
.demo-shelf {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.demo-shelf-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}
.demo-shelf-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.demo-shelf-title h3 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.demo-shelf-title span {
    font-size: 14px;
    color: var(--demo-ink-3);
}
.demo-shelf-more {
    font-size: 14px;
    font-weight: 600;
}

.demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 16px;
}
.demo-lcard {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--demo-border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.demo-lcard:hover {
    border-color: var(--demo-accent);
    box-shadow: 0 8px 24px rgba(20, 24, 33, 0.08);
}
.demo-lcard-thumb {
    all: unset;
    position: relative;
    display: block;
    aspect-ratio: 16/9;
    cursor: pointer;
    background: var(--demo-surface-2);
    border-bottom: 1px solid #eef0f3;
}
.demo-lcard-play {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
}
.demo-lcard-play::before {
    content: '';
    margin-left: 3px;
    border-left: 11px solid var(--demo-accent);
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
}
.demo-lcard-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px 14px;
    flex: 1;
}
.demo-lcard-mins {
    font-size: 12px;
    color: var(--demo-ink-3);
}
.demo-lcard-body h4 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    flex: 1;
    text-wrap: pretty;
}
.demo-main .demo-lcard-body h4 a {
    color: var(--demo-ink);
}
.demo-lcard-link {
    font-size: 13px;
    font-weight: 600;
}
/* 홈 카테고리 라벨 — 다른 탭에서 온 카드와 검색 결과에서만 보인다 */
.demo-lcard-cat {
    display: none;
    font-size: 12px;
    color: var(--demo-ink-3);
}
.demo-lcard[data-show-cat] .demo-lcard-cat {
    display: block;
}

.demo-more-btn {
    align-self: center;
    height: 46px;
    padding: 0 22px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--demo-border-2);
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--demo-ink);
    cursor: pointer;
}
.demo-more-btn:hover {
    border-color: var(--demo-border-hover);
}

/* ---------- 데모 페이지: Watch next ---------- */
.demo-next {
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-margin-top: 16px;
}

.demo-main a.demo-next-card {
    box-sizing: border-box;
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--demo-border);
    border-radius: 12px;
    color: var(--demo-ink);
}
.demo-main a.demo-next-card:hover {
    border-color: var(--demo-accent);
    box-shadow: 0 6px 18px rgba(20, 24, 33, 0.08);
    text-decoration: none;
    color: var(--demo-ink);
}
.demo-next-thumb {
    flex: none;
    position: relative;
    width: 112px;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    background: var(--demo-stripes);
    display: flex;
    align-items: center;
    justify-content: center;
}
.demo-next-thumb .demo-tile-name {
    font-size: 12px;
}
.demo-next-thumb .demo-tile-eyebrow {
    font-size: 8px;
}
.demo-next-thumb .demo-play {
    position: relative;
    z-index: 1;
}
.demo-upnext {
    display: none;
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 2;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 999px;
    background: var(--demo-accent);
    color: var(--demo-ink);
}
/* 이 페이지 데모를 닫은 뒤에만 첫 카드를 "UP NEXT" 로 표시 */
body[data-demo-status='closed'] .demo-upnext {
    display: block;
}
body[data-demo-status='closed'] .demo-main a.demo-next-first {
    border-color: var(--demo-accent);
}
.demo-next-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.demo-next-eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--demo-accent-ink);
}
.demo-next-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}
.demo-next-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--demo-accent-ink);
}

/* ---------- 데모 페이지: Step-by-step guide ---------- */
.demo-main section.demo-guide {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-top: clamp(32px, 6vw, 56px);
    border-top: 1px solid var(--demo-border);
    scroll-margin-top: 16px;
}
.demo-guide-head {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
    justify-content: space-between;
}
.demo-guide-copy {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 640px;
}
.demo-guide-copy h2 {
    font-size: clamp(24px, 5.5vw, 32px);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.015em;
    text-wrap: pretty;
}
.demo-guide-copy p:last-child {
    font-size: 16px;
    line-height: 1.6;
    color: var(--demo-ink-2);
}
.demo-shots-btn {
    height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--demo-border-2);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--demo-ink-body);
    cursor: pointer;
}
.demo-shots-btn:hover {
    border-color: var(--demo-accent);
    color: var(--demo-accent-ink);
}

.demo-guide-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: flex-start;
}

/* ≥1000px: 왼쪽 sticky 목차 */
.demo-toc {
    flex: 0 0 250px;
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: calc(100vh - 40px);
    overflow: auto;
    background: var(--demo-bg);
}
.demo-main .demo-toc a {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--demo-ink-body);
}
.demo-main .demo-toc a:hover {
    background: #fff;
    color: var(--demo-accent-ink);
    text-decoration: none;
}
.demo-toc a span:first-child {
    flex: none;
    width: 22px;
    font-weight: 600;
    color: var(--demo-accent-ink);
    font-variant-numeric: tabular-nums;
}
.demo-toc-others {
    margin-top: 12px;
    padding: 12px 10px 4px;
    border-top: 1px solid var(--demo-border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.demo-toc-others > span {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--demo-ink-3);
}
.demo-toc-others button {
    all: unset;
    cursor: pointer;
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--demo-ink-body);
    padding: 3px 0;
}
.demo-toc-others button:hover {
    color: var(--demo-accent-ink);
}

/* <1000px: 번호 칩 가로 스크롤 (sticky 아님) */
.demo-stepchips {
    display: none;
    flex: 1 1 100%;
    min-width: 0;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    overflow-x: auto;
    padding-bottom: 4px;
}
.demo-stepchips > span {
    flex: none;
    font-size: 13px;
    color: var(--demo-ink-3);
    margin-right: 4px;
    white-space: nowrap;
}
.demo-main .demo-stepchips a {
    flex: none;
    width: 36px;
    height: 36px;
    box-sizing: border-box;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--demo-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--demo-ink-body);
}
.demo-main .demo-stepchips a:hover {
    border-color: var(--demo-accent);
    color: var(--demo-accent-ink);
    text-decoration: none;
}
@media (max-width: 999px) {
    .demo-toc {
        display: none;
    }
    .demo-stepchips {
        display: flex;
    }
    .demo-guide-layout {
        gap: 20px;
    }
}

.demo-steps {
    flex: 1 1 560px;
    min-width: 0;
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.demo-step {
    background: #fff;
    border: 1px solid var(--demo-border);
    border-radius: 12px;
    padding: clamp(14px, 3.5vw, 20px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-margin-top: 16px;
}
.demo-step-head {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    grid-template-areas: 'n text try';
    column-gap: 14px;
    row-gap: 6px;
    align-items: start;
}
.demo-step-n {
    grid-area: n;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--demo-accent-soft);
    color: var(--demo-accent-ink);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.demo-step-text {
    grid-area: text;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 4px;
    min-width: 0;
}
.demo-step-text h3 {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.demo-step-text h3 strong {
    font-weight: 700;
}
.demo-step-text p {
    font-size: 15px;
    line-height: 1.55;
    color: var(--demo-ink-2);
}
/* 음성 원고에서 가져온 설명 — 말풍선(제목·불릿)보다 한 단계 옅게 */
.demo-main p.demo-step-narr {
    margin-top: 2px;
    font-size: 15px;
    line-height: 1.65;
    color: var(--demo-ink-3);
}
.demo-step code {
    font-family: var(--demo-mono);
    font-size: 0.88em;
    background: var(--demo-surface-2);
    border: 1px solid var(--demo-border);
    border-radius: 4px;
    padding: 1px 5px;
    color: var(--demo-ink);
    overflow-wrap: anywhere;
}
.demo-try {
    grid-area: try;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    padding-top: 6px;
}
/* <640px: "Try this step" 을 본문 아래로 */
@media (max-width: 639px) {
    .demo-step-head {
        grid-template-columns: 32px minmax(0, 1fr);
        grid-template-areas: 'n text' '. try';
    }
    .demo-try {
        padding-top: 0;
    }
}

.demo-shot {
    position: relative;
}
.demo-shot img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--demo-border);
    border-radius: 8px;
    background: var(--demo-surface-2);
    box-sizing: border-box;
}
.demo-guide.no-shots .demo-shot {
    display: none;
}
/* 핫스팟 위치 표시 — 원본 스크린샷은 말풍선 없는 깨끗한 화면이라, 데모의
 * 클릭 지점 좌표(% 단위)에 펄스 점을 겹친다. 언어와 무관하다. */
.demo-hotspot {
    position: absolute;
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border-radius: 50%;
    background: var(--demo-accent);
    border: 3px solid #fff;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(20, 24, 33, 0.35);
    pointer-events: none;
}
.demo-hotspot::after {
    content: '';
    position: absolute;
    inset: -9px;
    border-radius: 50%;
    border: 2px solid var(--demo-accent);
    animation: demo-ping 1.8s ease-out infinite;
}
@keyframes demo-ping {
    0% {
        transform: scale(0.6);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* 가이드 끝: Next demo + 다운로드 CTA */
.demo-guide-end {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 12px;
}
.demo-nextdemo {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    background: #fff;
    border: 1px solid var(--demo-accent);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 14px;
    align-items: center;
}
.demo-nextdemo:hover {
    box-shadow: 0 8px 24px rgba(255, 144, 18, 0.18);
}
.demo-nextdemo[disabled] {
    opacity: 0.55;
    cursor: default;
}
.demo-nextdemo .demo-play {
    width: 44px;
    height: 44px;
    background: var(--demo-accent);
    box-shadow: none;
}
.demo-nextdemo .demo-play::before {
    border-left-color: #fff;
}
.demo-nextdemo > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.demo-nextdemo-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--demo-accent-ink);
}
.demo-nextdemo-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--demo-ink);
}
.demo-cta {
    background: var(--demo-ink);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    color: #fff;
}
.demo-cta > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.demo-cta strong {
    font-size: 16px;
}
.demo-cta div span {
    font-size: 13px;
    color: #c4c9d2;
}
.demo-main .demo-cta a {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 18px;
    border-radius: 10px;
    background: var(--demo-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}
.demo-main .demo-cta a:hover {
    background: var(--demo-accent-hover);
    color: #fff;
    text-decoration: none;
}

/* ---------- 데모 페이지: 모바일 하단 바 (<640px, 팝업 닫힘) ---------- */
.demo-bar {
    display: none;
}
@media (max-width: 639px) {
    .demo-page .demo-main {
        padding-bottom: 120px;
    }
    .demo-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        display: flex;
        gap: 10px;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border-top: 1px solid var(--demo-border);
    }
    body[data-demo-status='open'] .demo-bar,
    body[data-demo-status='loading'] .demo-bar {
        display: none;
    }
}
.demo-bar button {
    flex: 1;
    min-width: 0;
    height: 48px;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}
.demo-bar-play {
    border: 0;
    background: var(--demo-accent);
    color: #fff;
}
.demo-bar-next {
    background: #fff;
    border: 1px solid var(--demo-border-2);
    color: var(--demo-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.demo-bar button[disabled] {
    opacity: 0.55;
}

/* ---------- YouTube 모달 (player: youtube) ---------- */
.demo-yt {
    position: fixed;
    inset: 0;
    z-index: 100000001;
    background: rgba(14, 17, 24, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.demo-yt-box {
    width: min(960px, 100%);
    background: var(--demo-dark);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}
.demo-yt-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #fff;
}
.demo-yt-title {
    font-size: 15px;
    font-weight: 600;
    flex: 1;
    min-width: 0;
}
.demo-yt-close {
    all: unset;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 20px;
    color: #fff;
}
.demo-yt-close:hover {
    background: rgba(255, 255, 255, 0.12);
}
.demo-yt-frame {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    border: 0;
    background: #000;
}

@media (max-width: 575px) {
    .demo-main {
        padding: 24px 16px 48px;
        gap: 40px;
    }
    .demo-btn,
    .demo-btn-ghost {
        height: 46px;
        padding: 0 18px;
        font-size: 15px;
    }
    .demo-play {
        width: 56px;
        height: 56px;
    }
    .demo-play-sm {
        width: 42px;
        height: 42px;
    }
    .demo-play-xs {
        width: 28px;
        height: 28px;
    }
    .demo-play-dot {
        width: 18px;
        height: 18px;
    }
    .demo-lib-copy h2 {
        font-size: 26px;
    }
    .demo-yt {
        padding: 0;
    }
}

/* styles.css 가 300–768px 에서 모든 h2 에 `font-size: 1.8rem !important` 와
 * 위아래 8px 마진을 강제한다(기존 랜딩 페이지용). 데모 페이지의 h2 는 크기가
 * 제각각이라 같은 범위에서 !important 로 되돌린다. */
@media (min-width: 300px) and (max-width: 768px) {
    .demo-main h2 {
        margin: 0 !important;
    }
    .demo-section-head h2 {
        font-size: 18px !important;
    }
    .demo-start-head h2 {
        font-size: 22px !important;
    }
    .demo-lib-copy h2 {
        font-size: 26px !important;
    }
    .demo-guide-copy h2 {
        font-size: clamp(24px, 5.5vw, 32px) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .demo-pill-dot,
    .demo-hotspot::after {
        animation: none !important;
        transition: none !important;
    }
}
