/* ===== Страница «Плагины и модули»: сайт-чертёж и модули-конструктор ===== */

.plg {
    --gold: #ce9248;
    --gold-light: #f3d3a3;
    --bronze: #b79654;
    --cream: #f1e3d3;
    --muted: #a79c8f;
    --ink: #1a1108;
    --line: rgba(255, 255, 255, .09);
    --dash: rgba(206, 146, 72, .45);
    --glow: 0 0 5px rgba(255, 255, 255, .8);
    --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;
}

.plg p {
    margin: 0;
}

.plg-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* --- общие элементы --- */
.plg-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--gold);
}

.plg-label:before {
    content: "";
    width: 10px;
    height: 10px;
    border: 1.5px solid var(--gold);
    transform: rotate(45deg);
}

.plg-h2 {
    max-width: 760px;
    margin: 12px 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;
}

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

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

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

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

.plg-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);
}

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

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

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

/* --- первый экран: схема слева, текст справа --- */
.plg-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 56px;
    align-items: center;
    margin-top: 30px;
}

.plg-hero__text {
    order: 2;
}

.plg-hero__title {
    margin: 16px 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;
}

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

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

/* чертёж сайта */
.plg-build {
    order: 1;
    position: relative;
    padding: 28px;
    border-radius: 4px;
    background-color: #050505;
    background-image:
        linear-gradient(rgba(206, 146, 72, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(206, 146, 72, .07) 1px, transparent 1px);
    background-size: 28px 28px;
    box-shadow: inset 0 0 0 1px rgba(206, 146, 72, .25);
}

.plg-site {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1.5px dashed var(--dash);
    border-radius: 10px;
    background: rgba(0, 0, 0, .7);
}

.plg-site__top {
    display: flex;
    gap: 6px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--dash);
}

.plg-site__top i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1.5px solid var(--dash);
}

.plg-site__row {
    height: 14px;
    width: 55%;
    border-radius: 4px;
    background: rgba(255, 255, 255, .07);
}

.plg-site__row--wide {
    width: 85%;
    height: 22px;
}

.plg-slots {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 6px;
}

.plg-slot {
    position: relative;
    min-height: 74px;
    border: 1.5px dashed var(--dash);
    border-radius: 8px;
}

.plg-slot:before {
    content: "+";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 24px;
    color: var(--dash);
    transition: opacity .2s;
}

.plg-slot.is-in:before {
    opacity: 0;
}

.plg-block {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    height: 100%;
    min-height: 74px;
    padding: 12px 14px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--gold-light), var(--gold) 70%);
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    box-shadow: 0 8px 22px -8px rgba(206, 146, 72, .9);
}

/* до запуска анимации модули «висят» над слотами */
.plg.js-ready .plg-block {
    opacity: 0;
    transform: translateY(-46px) rotate(-4deg);
}

.plg.js-ready .plg-slot.is-in .plg-block {
    animation: plg-snap .6s cubic-bezier(.2, 1.4, .4, 1) forwards;
}

@keyframes plg-snap {
    0%   { opacity: 0; transform: translateY(-46px) rotate(-4deg); }
    70%  { opacity: 1; transform: translateY(3px) rotate(0); }
    100% { opacity: 1; transform: none; }
}

.plg-slot.is-in:after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 11px;
    box-shadow: 0 0 0 2px var(--gold-light);
    opacity: 0;
    animation: plg-click .7s .35s ease-out;
}

@keyframes plg-click {
    0%   { opacity: .9; transform: scale(.96); }
    100% { opacity: 0; transform: scale(1.06); }
}

.plg-site__status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--dash);
    font-size: 13px;
    color: var(--muted);
}

.plg-site__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6f6961;
    transition: background .4s, box-shadow .4s;
}

.plg-site.is-done .plg-site__dot {
    background: var(--gold-light);
    box-shadow: 0 0 10px var(--gold);
}

.plg-site.is-done .plg-site__status {
    color: var(--gold-light);
}

/* --- платформы --- */
.plg-platforms {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.plg-platform {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 28px 24px;
    border-top: 2px solid var(--gold);
    border-radius: 0 0 14px 14px;
    background: #000;
    box-shadow: var(--glow);
    transition: transform .3s ease;
}

.plg-platform:hover {
    transform: translateY(-4px);
}

.plg-platform__logo {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 6px;
    border-radius: 50%;
    background: #fff;
}

.plg-platform__logo img {
    display: block;
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.plg-platform h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.plg-platform p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--muted);
}

.plg-more {
    margin-top: auto;
    padding-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gold-light);
    text-decoration: none;
}

.plg-more:hover {
    color: #fff;
}

/* --- карточки-перевёртыши --- */
.plg .plg-hint {
    margin: -20px 0 24px;
    font-size: 14px;
    color: var(--muted);
}

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

.plg-flip {
    position: relative;
    display: block;
    width: 100%;
    min-height: 170px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    perspective: 1000px;
}

.plg-flip:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 4px;
    border-radius: 12px;
}

.plg-flip__face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}

.plg-flip__face small {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
}

.plg-flip__front {
    border: 1.5px dashed var(--dash);
    background: #050505;
    color: var(--cream);
}

.plg-flip__front small {
    color: var(--muted);
}

.plg-flip__front:after {
    content: "↻";
    position: absolute;
    right: 16px;
    bottom: 12px;
    font-size: 18px;
    color: var(--gold);
}

.plg-flip__back {
    background: linear-gradient(135deg, var(--gold-light), var(--gold) 75%);
    color: var(--ink);
    font-size: 15px;
    transform: rotateY(180deg);
}

.plg-flip__back small {
    color: rgba(26, 17, 8, .7);
}

.plg-flip[aria-pressed="true"] .plg-flip__front {
    transform: rotateY(-180deg);
}

.plg-flip[aria-pressed="true"] .plg-flip__back {
    transform: rotateY(0);
}

/* --- до / после --- */
.plg-compare {
    position: relative;
    min-height: 250px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--glow);
}

.plg-compare__side {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding: 30px 40px;
}

.plg-compare__side b {
    font-family: var(--display);
    font-size: 28px;
    font-weight: 600;
}

.plg-compare__side ul {
    display: grid;
    gap: 8px;
    list-style: none;
    font-size: 16px;
}

.plg-compare__before {
    background: #111;
    color: var(--muted);
}

.plg-compare__before li:before {
    content: "✕  ";
    color: #7c5a4a;
}

.plg-compare__after {
    align-items: flex-end;
    text-align: right;
    background: linear-gradient(120deg, #2a1d10, #6b4a22 60%, #b79654);
    color: var(--cream);
    clip-path: inset(0 0 0 var(--pos));
}

.plg-compare__after b {
    color: #fff;
}

.plg-compare__after li:after {
    content: "  ✓";
    color: var(--gold-light);
}

.plg-compare__handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--pos);
    width: 2px;
    background: var(--gold-light);
    box-shadow: 0 0 12px var(--gold);
    pointer-events: none;
}

.plg-compare__handle:after {
    content: "⇆";
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gold-light);
    color: var(--ink);
    font-size: 18px;
    transform: translate(-50%, -50%);
}

.plg-compare__range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
}

.plg-compare__range:focus-visible + .plg-compare__handle,
.plg-compare:focus-within .plg-compare__handle:after {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.plg .plg-compare__note {
    margin-top: 16px;
    font-size: 15px;
    color: var(--muted);
}

/* --- конвейер этапов --- */
.plg-line {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    list-style: none;
}

.plg-line:before,
.plg-line:after {
    content: "";
    position: absolute;
    top: 23px;
    left: 24px;
    right: 24px;
    height: 0;
    border-top: 2px dashed rgba(255, 255, 255, .12);
}

.plg-line:after {
    right: auto;
    width: calc((100% - 48px) * var(--fill, 0));
    border-top: 2px solid var(--gold);
    box-shadow: 0 0 10px rgba(206, 146, 72, .7);
    transition: width 1.6s cubic-bezier(.4, 0, .2, 1);
}

.plg-line.is-on {
    --fill: 1;
}

.plg-line li {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plg-line__num {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
    border-radius: 50%;
    background: #000;
    box-shadow: inset 0 0 0 1.5px var(--dash);
    font-family: var(--display);
    font-size: 22px;
    font-weight: 700;
    color: var(--gold-light);
}

.plg-line b {
    font-size: 18px;
    color: #fff;
}

.plg-line li > span:last-child {
    font-size: 15px;
    line-height: 1.55;
    color: var(--muted);
}

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

/* --- финал --- */
.plg-final {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 48px;
    align-items: center;
    margin-top: 110px;
    padding: 44px;
    border-radius: 4px;
    background-color: #050505;
    background-image:
        linear-gradient(rgba(206, 146, 72, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(206, 146, 72, .06) 1px, transparent 1px);
    background-size: 28px 28px;
    box-shadow: inset 0 0 0 1px rgba(206, 146, 72, .25);
}

.plg-final__slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 180px;
    border: 2px dashed var(--gold);
    border-radius: 12px;
    color: var(--gold-light);
    font-size: 15px;
    font-weight: 600;
    animation: plg-breathe 2.6s ease-in-out infinite;
}

.plg-final__slot span {
    font-size: 48px;
    font-weight: 300;
    line-height: 1;
}

@keyframes plg-breathe {
    0%, 100% { box-shadow: 0 0 0 rgba(206, 146, 72, 0); }
    50%      { box-shadow: 0 0 30px rgba(206, 146, 72, .45); }
}

.plg-final .plg-h2 {
    margin-top: 0;
    margin-bottom: 14px;
}

.plg-final__text p {
    max-width: 520px;
    margin-bottom: 26px;
    font-size: 17px;
    line-height: 1.6;
    color: var(--muted);
}

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

    .plg-hero__text,
    .plg-build {
        order: 0;
    }

    .plg-platforms,
    .plg-flips {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .plg-line {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 34px;
    }

    .plg-line:before,
    .plg-line:after {
        display: none;
    }

    .plg-final {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .plg-final__slot {
        height: 120px;
    }
}

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

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

    .plg-build {
        padding: 16px;
    }

    .plg-platforms,
    .plg-flips,
    .plg-line {
        grid-template-columns: 1fr;
    }

    .plg-flip {
        min-height: 150px;
    }

    .plg-compare {
        min-height: 330px;
    }

    .plg-compare__side {
        padding: 22px;
    }

    .plg-compare__side b {
        font-size: 22px;
    }

    .plg-compare__side ul {
        font-size: 14px;
    }

    .plg-final {
        padding: 26px 20px;
    }

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

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

    .plg.js-ready .plg-block {
        opacity: 1;
        transform: none;
    }
}
