/* =====================================================================
   CONCEPT KIT — общий слой для демо-концептов WebChoice
   · примитивы появления (data-reveal) и счётчиков (data-count)
   · иконки <icon>
   · док «Концепт WebChoice» + режим разбора (data-xray)
   ===================================================================== */

/* Знак ₽ из системного шрифта: иначе ради одного символа качаются latin-ext подмножества веб-шрифтов */
@font-face { font-family: "Rub"; src: local("Arial"), local("ArialMT"), local("Helvetica"), local("Roboto"); font-weight: 100 500; unicode-range: U+20BD; }
@font-face { font-family: "Rub"; src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"), local("Roboto Bold"); font-weight: 600 900; unicode-range: U+20BD; }
@font-face { font-family: "RubSerif"; src: local("Times New Roman"), local("TimesNewRomanPSMT"), local("Georgia"); unicode-range: U+20BD; }

:root {
    --ck-accent: #C8FF2E;
    --ck-ink: #0B0C0F;
    --ck-glass: rgba(14, 15, 19, 0.86);
    --ck-line: rgba(255, 255, 255, 0.12);
    --ck-text: #F4F5F7;
    --ck-text-2: #A9AEB9;
    --ck-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ck-font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* Сколько места оставить внизу страницы под док (используйте в padding футера) */
    --ck-dock-space: 104px;
}

/* ---------- Icons ---------- */
.i {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -0.125em;
}

/* ---------- Reveal ---------- */
.js [data-reveal] {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
    transition: opacity 0.8s var(--ck-ease), transform 0.8s var(--ck-ease);
    transition-delay: calc(var(--i, 0) * 90ms);
}
.js [data-reveal="left"] { transform: translate3d(-40px, 0, 0); }
.js [data-reveal="right"] { transform: translate3d(40px, 0, 0); }
.js [data-reveal="scale"] { transform: scale(0.94); }
.js [data-reveal="fade"] { transform: none; }
.js [data-reveal].is-in { opacity: 1; transform: none; }
/* Страховка: если JS не загрузился, контент проявится через 2,5 с */
.js:not(.rv) [data-reveal] { animation: ck-reveal-failsafe 0s 2.5s forwards; }
@keyframes ck-reveal-failsafe { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------- Dock ---------- */
.ck-dock {
    position: fixed;
    left: 50%;
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border-radius: 999px;
    background: var(--ck-glass);
    border: 1px solid var(--ck-line);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    font: 500 14px/1.2 var(--ck-font);
    color: var(--ck-text);
    transform: translate(-50%, 140%);
    transition: transform 0.7s var(--ck-ease);
    white-space: nowrap;
    max-width: calc(100vw - 24px);
}
.ck-dock.is-ready { transform: translate(-50%, 0); }

.ck-dock a, .ck-dock button {
    font: inherit;
    color: inherit;
    text-decoration: none;
    border: 0;
    background: none;
    cursor: pointer;
}

.ck-dock__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    color: var(--ck-text-2) !important;
    font-size: 13px;
}
.ck-dock__brand b { color: var(--ck-text); font-weight: 600; }
.ck-dock__logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.ck-dock__xray {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06) !important;
    transition: background 0.3s;
}
.ck-dock__xray:hover { background: rgba(255, 255, 255, 0.12) !important; }
.ck-dock__xray .i { font-size: 17px; }

.ck-switch {
    position: relative;
    width: 30px;
    height: 18px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.18);
    transition: background 0.3s;
}
.ck-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.35s var(--ck-ease);
}
.ck-dock__xray[aria-pressed="true"] .ck-switch { background: var(--ck-accent); }
.ck-dock__xray[aria-pressed="true"] .ck-switch::after { transform: translateX(12px); background: var(--ck-ink); }

.ck-dock__cta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 10px 18px;
    border-radius: 999px;
    background: var(--ck-accent) !important;
    color: var(--ck-ink) !important;
    font-weight: 700 !important;
    transition: transform 0.3s var(--ck-ease), box-shadow 0.3s;
}
.ck-dock__cta:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(200, 255, 46, 0.35); }
.ck-dock__cta .i { transition: transform 0.3s var(--ck-ease); }
.ck-dock__cta:hover .i { transform: translateX(3px); }

.ck-dock :focus-visible, .ck-panel :focus-visible, .ck-xr-pin:focus-visible, .ck-hint :focus-visible {
    outline: 2px solid var(--ck-accent);
    outline-offset: 2px;
}

@media (max-width: 560px) {
    .ck-dock__brand-text, .ck-hide-sm { display: none; }
    .ck-dock__brand { padding-right: 4px; }
}
@media (max-width: 380px) {
    .ck-dock { gap: 4px; padding: 5px; }
    .ck-dock__brand { display: none; }
    .ck-dock__xray { padding: 9px 10px 9px 12px; }
    .ck-dock__cta { padding: 9px 14px; }
}

/* ---------- Hint bubble ---------- */
.ck-hint {
    position: fixed;
    left: 50%;
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 66px);
    z-index: 901;
    transform: translateX(-50%);
    width: min(340px, calc(100vw - 32px));
    padding: 14px 40px 14px 16px;
    transition: opacity 0.4s, transform 0.4s;
    border-radius: 16px;
    background: var(--ck-accent);
    color: var(--ck-ink);
    font: 500 14px/1.45 var(--ck-font);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
    animation: ck-pop 0.6s var(--ck-ease) both;
}
.ck-hint::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 12px;
    height: 12px;
    background: inherit;
    transform: translateX(-50%) rotate(45deg);
}
.ck-hint b { font-weight: 700; }
.ck-hint__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
    cursor: pointer;
    display: grid;
    place-items: center;
}
.ck-hint[hidden] { display: none; }
@media (max-width: 560px) {
    .ck-hint { padding: 11px 38px 11px 14px; font-size: 13px; }
}

@keyframes ck-pop {
    from { opacity: 0; transform: translate(-50%, 12px) scale(0.96); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* ---------- X-ray layer ---------- */
.ck-xr-layer {
    position: fixed;
    inset: 0;
    z-index: 880;
    pointer-events: none;
}
.ck-xr-layer[hidden] { display: none; }

.ck-xr-box {
    position: absolute;
    top: 0;
    left: 0;
    border: 1.5px dashed rgba(200, 255, 46, 0.75);
    border-radius: 10px;
    background: rgba(200, 255, 46, 0.035);
    box-shadow: 0 0 0 9999px transparent;
    transition: border-color 0.3s, background 0.3s, box-shadow 0.4s;
}
.ck-xr-box.is-active {
    border-style: solid;
    border-color: var(--ck-accent);
    background: rgba(200, 255, 46, 0.07);
    box-shadow: 0 0 0 9999px rgba(8, 9, 12, 0.35);
}

.ck-xr-pin {
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--ck-ink);
    background: var(--ck-accent);
    color: var(--ck-ink);
    font: 800 13px/1 var(--ck-font);
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s var(--ck-ease);
}
.ck-xr-pin::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--ck-accent);
    opacity: 0;
    animation: ck-ping 2.4s var(--ck-ease) infinite;
}
.ck-xr-pin:hover { transform: scale(1.12); }
.ck-xr-pin.is-active { transform: scale(1.18); background: #fff; }

@keyframes ck-ping {
    0% { opacity: 0.7; transform: scale(0.8); }
    80%, 100% { opacity: 0; transform: scale(1.6); }
}

/* ---------- X-ray panel ---------- */
.ck-panel {
    position: fixed;
    top: 16px;
    right: 16px;
    bottom: 96px;
    z-index: 895;
    width: 360px;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    background: var(--ck-glass);
    border: 1px solid var(--ck-line);
    color: var(--ck-text);
    font: 400 14px/1.5 var(--ck-font);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    animation: ck-slide 0.6s var(--ck-ease) both;
    overflow: hidden;
}
.ck-panel[hidden] { display: none; }

@keyframes ck-slide {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: none; }
}

.ck-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 20px 14px;
    border-bottom: 1px solid var(--ck-line);
}
.ck-panel__eyebrow {
    display: block;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ck-accent);
    margin-bottom: 4px;
}
.ck-panel__title { font-size: 17px; font-weight: 700; line-height: 1.3; margin: 0; color: var(--ck-text); }
.ck-panel__close, .ck-panel__nav button {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--ck-line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--ck-text);
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 16px;
}
.ck-panel__close:hover, .ck-panel__nav button:hover { background: rgba(255, 255, 255, 0.1); }

.ck-panel__list {
    list-style: none;
    margin: 0;
    padding: 10px;
    overflow-y: auto;
    flex: 1;
    overscroll-behavior: contain;
}
.ck-xr-item__btn {
    width: 100%;
    display: flex;
    gap: 12px;
    text-align: left;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: background 0.25s, border-color 0.25s;
}
.ck-xr-item__btn:hover { background: rgba(255, 255, 255, 0.05); }
.ck-xr-item.is-active .ck-xr-item__btn { background: rgba(200, 255, 46, 0.08); border-color: rgba(200, 255, 46, 0.4); }
.ck-xr-item__n {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--ck-accent);
    color: var(--ck-ink);
    font-weight: 800;
    font-size: 12px;
}
.ck-xr-item__body b { display: block; font-weight: 650; margin-bottom: 3px; color: var(--ck-text); }
.ck-xr-item__body span { color: var(--ck-text-2); font-size: 13.5px; }

.ck-panel__disclaimer { margin: 0; padding: 10px 20px 0; color: var(--ck-text-2); font-size: 12px; line-height: 1.45; }

.ck-panel__foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--ck-line);
}
.ck-panel__nav { display: none; gap: 8px; }
.ck-panel__cta {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 999px;
    background: var(--ck-accent);
    color: var(--ck-ink);
    font-weight: 700;
    text-decoration: none;
}

/* Мобильная версия панели: нижний лист с одним пояснением и навигацией */
@media (max-width: 860px) {
    .ck-panel {
        top: auto;
        left: 12px;
        right: 12px;
        bottom: calc(max(16px, env(safe-area-inset-bottom)) + 64px);
        width: auto;
        max-height: 46vh;
        animation-name: ck-rise;
    }
    .ck-panel__head { padding: 14px 16px 10px; }
    .ck-panel__list { padding: 6px 8px; }
    .ck-xr-item { display: none; }
    .ck-xr-item.is-active { display: block; }
    .ck-xr-item.is-active .ck-xr-item__btn { background: none; border-color: transparent; }
    .ck-panel__nav { display: flex; }
    .ck-panel__disclaimer { display: none; }
    /* Цель пояснения прокручивается в видимую полосу над нижним листом */
    html.ck-xray-on { scroll-padding-bottom: calc(46vh + max(16px, env(safe-area-inset-bottom)) + 76px); }
    .ck-panel__foot { padding: 10px 12px; }
    .ck-panel__cta { padding: 10px 14px; font-size: 13px; }
}

@keyframes ck-rise {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ck-dock, .ck-panel, .ck-hint, .ck-xr-pin::before { animation: none !important; transition: none !important; }
}
