/* ===== Страница «Плагины и приложения для Webasyst»: каталог Инсталлера ===== */

.wap {
    --gold: #ce9248;
    --gold-light: #f3d3a3;
    --cream: #f1e3d3;
    --muted: #a79c8f;
    --ink: #1a1108;
    --line: rgba(255, 255, 255, .09);
    --glow: 0 0 5px rgba(255, 255, 255, .8);
    /* цвета лучей «волшебной палочки» Webasyst */
    --ray1: #0088ee;
    --ray2: #22cc22;
    --ray3: #ee6622;
    --ray4: #ffcc00;
    --ray5: #55dddd;
    --display: "EB Garamond", Georgia, serif;
    --ui: Montserrat, Arial, sans-serif;

    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    color: var(--cream);
    font-family: var(--ui);
    -webkit-user-select: text;
    user-select: text;
}

.wap p {
    margin: 0;
}

/* --- общие элементы --- */
.wap-h2 {
    max-width: 760px;
    margin: 0 0 34px;
    font-family: var(--display);
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 600;
    line-height: 1.1;
    color: var(--cream);
    text-align: left;
    text-wrap: balance;
}

.wap-section {
    margin-top: 110px;
}

.wap-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.wap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 26px;
    border-radius: 10px;
    font: 600 15px/1.2 var(--ui);
    text-decoration: none;
    transition: transform .3s ease, box-shadow .3s ease, color .3s;
}

.wap-btn:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 3px;
}

.wap-btn--gold {
    color: var(--ink);
    background: linear-gradient(135deg, var(--gold-light), var(--gold) 60%, #9c6528);
    box-shadow: 0 10px 30px -12px rgba(206, 146, 72, .9);
}

.wap-btn--gold:hover {
    transform: translateY(-2px);
}

.wap-btn--ghost {
    color: var(--cream);
    background: #000;
    box-shadow: var(--glow);
}

.wap-btn--ghost:hover {
    color: #fff;
    box-shadow: 0 0 12px rgba(255, 255, 255, .9);
}

/* --- первый экран --- */
.wap-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: 56px;
    align-items: center;
    margin-top: 30px;
}

/* лучи палочки за карточкой */
.wap-hero:before {
    content: "";
    position: absolute;
    right: 8%;
    top: 50%;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: conic-gradient(from 200deg,
        transparent 0 10deg, rgba(0, 136, 238, .18) 10deg 22deg,
        transparent 22deg 60deg, rgba(34, 204, 34, .14) 60deg 72deg,
        transparent 72deg 110deg, rgba(238, 102, 34, .16) 110deg 122deg,
        transparent 122deg 160deg, rgba(255, 204, 0, .16) 160deg 172deg,
        transparent 172deg 210deg, rgba(85, 221, 221, .14) 210deg 222deg,
        transparent 222deg 360deg);
    -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%);
    mask: radial-gradient(circle, #000 20%, transparent 70%);
    transform: translateY(-50%);
    animation: wap-spin 60s linear infinite;
    pointer-events: none;
}

@keyframes wap-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

.wap-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 8px;
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
}

.wap-kicker img {
    display: block;
}

.wap-hero__title {
    margin: 20px 0 22px;
    font-family: var(--display);
    font-size: clamp(40px, 5.2vw, 64px);
    font-weight: 600;
    line-height: 1.02;
    color: var(--cream);
    text-align: left;
    text-wrap: balance;
}

.wap-hero__title em {
    font-style: italic;
    background: linear-gradient(40deg, #fff, #d4a729);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wap .wap-hero__lead {
    max-width: 540px;
    margin-bottom: 30px;
    font-size: 17px;
    line-height: 1.65;
    color: var(--muted);
}

/* светлая карточка в стиле Инсталлера */
.wap-store {
    position: relative;
    z-index: 1;
    border-radius: 16px;
    background: #f4f4f6;
    color: #1d1d1f;
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .6);
    overflow: hidden;
}

.wap-store__bar {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 18px;
    background: #fff;
    border-bottom: 1px solid #e3e3e8;
    font-size: 12px;
    font-weight: 600;
    color: #8a8a90;
}

.wap-store__bar span:first-child {
    color: #1d1d1f;
}

.wap-store__card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 18px;
    padding: 20px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

.wap-store__head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.wap-store__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--gold-light), var(--gold) 70%);
    color: var(--ink);
}

.wap-store__icon svg {
    width: 28px;
    height: 28px;
}

.wap-store__head b {
    display: block;
    font-size: 18px;
    color: #1d1d1f;
}

.wap-store__head small {
    font-size: 12px;
    color: #8a8a90;
}

.wap-store__card > p {
    font-size: 14px;
    line-height: 1.55;
    color: #4a4a50;
}

.wap-store__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
}

.wap-store__tags li {
    padding: 4px 10px;
    border-radius: 999px;
    background: #f0f0f3;
    font-size: 12px;
    color: #55555b;
}

.wap-store__action {
    position: relative;
    min-height: 44px;
}

.wap-install {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 8px;
    background: #22aa33;
    color: #fff;
    font: 700 15px var(--ui);
    cursor: pointer;
    transition: background .2s, opacity .2s;
}

.wap-install:hover {
    background: #1d9a2d;
}

.wap-install:focus-visible {
    outline: 2px solid #0088ee;
    outline-offset: 2px;
}

.wap-install__progress {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 8px;
    border-radius: 8px;
    background: #e6e6ea;
    overflow: hidden;
    transform: translateY(-50%);
    opacity: 0;
}

.wap-install__progress i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--ray1), var(--ray5), var(--ray2));
}

.wap-install__done {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #22aa33;
    opacity: 0;
    pointer-events: none;
}

.wap-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #55555b;
}

.wap-toggle i {
    position: relative;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: #22aa33;
}

.wap-toggle i:after {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
}

.wap-store.is-installing .wap-install {
    opacity: 0;
    pointer-events: none;
}

.wap-store.is-installing .wap-install__progress {
    opacity: 1;
}

.wap-store.is-installing .wap-install__progress i {
    width: 100%;
    transition: width 1.8s cubic-bezier(.4, 0, .2, 1);
}

.wap-store.is-installed .wap-install,
.wap-store.is-installed .wap-install__progress {
    opacity: 0;
    pointer-events: none;
}

.wap-store.is-installed .wap-install__done {
    opacity: 1;
    pointer-events: auto;
    transition: opacity .3s;
}

/* --- приложения --- */
.wap-apps {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
    list-style: none;
}

.wap-apps li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 22px 10px;
    border-radius: 16px;
    background: #fff;
    color: #1d1d1f;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    transition: transform .3s ease, box-shadow .3s ease;
}

.wap-apps li:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px -12px rgba(206, 146, 72, .7);
}

.wap-apps img {
    display: block;
    width: 64px;
    height: 64px;
}

.wap .wap-apps__note {
    margin-top: 18px;
    font-size: 15px;
    color: var(--muted);
}

/* --- репутация --- */
.wap-rank {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 48px;
    align-items: center;
}

.wap-rank__badge {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    max-width: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #2b2116, #0a0806 70%);
    box-shadow: 0 0 0 2px var(--gold), 0 0 0 10px rgba(206, 146, 72, .12), 0 0 60px -10px rgba(206, 146, 72, .6);
    text-align: center;
}

.wap-rank__no {
    font-family: var(--display);
    font-size: 110px;
    font-weight: 700;
    line-height: .9;
    background: linear-gradient(40deg, #fff, #d4a729);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wap-rank__cap {
    max-width: 180px;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--gold-light);
}

.wap-rank__facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    list-style: none;
}

.wap-rank__facts li {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 14px;
    border-top: 2px solid var(--gold);
    font-size: 14px;
    color: var(--muted);
}

.wap-rank__facts b {
    font-family: var(--display);
    font-size: 38px;
    font-weight: 600;
    line-height: 1;
    color: #fff;
}

/* --- каталог работ --- */
.wap-cases {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
    list-style: none;
}

.wap-case {
    overflow: hidden;
    border-radius: 16px;
    background: #0b0a09;
    box-shadow: var(--glow);
}

.wap-case img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    filter: saturate(.85);
    transition: transform .6s ease, filter .6s ease;
}

.wap-case:hover img {
    transform: scale(1.04);
    filter: saturate(1);
}

.wap-case__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
}

.wap-case__body > b {
    font-size: 17px;
    line-height: 1.35;
    color: #fff;
}

.wap-case__body > p {
    font-size: 14px;
    line-height: 1.55;
    color: var(--muted);
}

.wap-case details {
    margin-top: 4px;
    border-top: 1px solid var(--line);
}

.wap-case summary {
    display: flex;
    justify-content: space-between;
    padding-top: 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--gold-light);
    cursor: pointer;
    list-style: none;
}

.wap-case summary::-webkit-details-marker {
    display: none;
}

.wap-case summary:after {
    content: "+";
    font-size: 18px;
    line-height: 1;
    transition: transform .3s;
}

.wap-case details[open] summary:after {
    transform: rotate(45deg);
}

.wap-case summary:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 4px;
}

.wap-case details ul {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    list-style: none;
    font-size: 13px;
    line-height: 1.5;
    color: var(--cream);
}

.wap-case details li {
    position: relative;
    padding-left: 16px;
}

.wap-case details li:before {
    content: "";
    position: absolute;
    left: 0;
    top: .55em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
}

/* --- этапы: 3 × 2, цвета лучей палочки --- */
.wap-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    border-radius: 16px;
    background: var(--line);
    overflow: hidden;
    list-style: none;
    counter-reset: wap-step;
}

.wap-steps li {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 28px 24px;
    background: #070605;
    counter-increment: wap-step;
}

.wap-steps li:before {
    content: counter(wap-step, decimal-leading-zero);
    font-family: var(--display);
    font-size: 34px;
    font-weight: 600;
    line-height: 1;
    color: var(--ray, var(--gold));
}

.wap-steps li:nth-child(1) { --ray: var(--ray1); }
.wap-steps li:nth-child(2) { --ray: var(--ray2); }
.wap-steps li:nth-child(3) { --ray: var(--ray3); }
.wap-steps li:nth-child(4) { --ray: var(--ray4); }
.wap-steps li:nth-child(5) { --ray: var(--ray5); }
.wap-steps li:nth-child(6) { --ray: var(--gold); }

.wap-steps b {
    font-size: 18px;
    color: #fff;
}

.wap-steps span {
    font-size: 14px;
    line-height: 1.55;
    color: var(--muted);
}

/* --- вопросы --- */
.wap-faq .faq {
    max-width: 820px;
}

/* --- финал --- */
.wap-final {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 120px;
    padding: 70px 24px 56px;
    border-radius: 24px;
    text-align: center;
    background: #070605;
    box-shadow: var(--glow);
    overflow: hidden;
}

.wap-final__rays {
    position: absolute;
    left: 50%;
    top: 0;
    display: flex;
    gap: 10px;
    transform: translateX(-50%);
}

.wap-final__rays i {
    width: 6px;
    height: 36px;
    border-radius: 0 0 6px 6px;
    background: var(--ray1);
}

.wap-final__rays i:nth-child(2) { background: var(--ray2); height: 46px; }
.wap-final__rays i:nth-child(3) { background: var(--ray3); height: 56px; }
.wap-final__rays i:nth-child(4) { background: var(--ray4); height: 46px; }
.wap-final__rays i:nth-child(5) { background: var(--ray5); height: 36px; }

.wap-final .wap-h2 {
    margin-bottom: 14px;
    text-align: center;
}

.wap-final > p {
    max-width: 520px;
    margin-bottom: 28px;
    font-size: 17px;
    line-height: 1.6;
    color: var(--muted);
}

.wap-final .wap-actions {
    justify-content: center;
}

/* --- адаптив --- */
@media (max-width: 960px) {
    .wap-hero {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .wap-hero:before {
        right: 50%;
        top: 70%;
        transform: translate(50%, -50%);
        animation: none;
    }

    .wap-apps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .wap-rank {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .wap-rank__badge {
        width: 220px;
    }

    .wap-rank__no {
        font-size: 84px;
    }

    .wap-cases {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wap-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .wap {
        padding: 20px 16px 60px;
    }

    .wap-section,
    .wap-final {
        margin-top: 80px;
    }

    .wap-hero:before {
        width: 360px;
        height: 360px;
    }

    .wap-rank__facts,
    .wap-cases,
    .wap-steps {
        grid-template-columns: 1fr;
    }

    .wap-apps li {
        padding: 16px 6px;
        font-size: 12px;
    }

    .wap-apps img {
        width: 48px;
        height: 48px;
    }

    .wap-btn {
        width: 100%;
    }
}

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