.wizard-demo {
    --wizard-ink: #26204a;
    --wizard-accent: #5c3cbd;
    --wizard-line: #ddd4f2;
    color: var(--wizard-ink);
    background: linear-gradient(155deg, white 42%, #f4efff);
    border: 1px solid #e9e0fa;
    border-radius: clamp(1rem, 3vw, 2rem);
    box-shadow: 0 1rem 3rem #38237612;
    padding: clamp(1rem, 4vw, 3.5rem);
}

.wizard-demo__header {
    max-width: 48rem;
    margin: 0 auto 2rem;
    color: var(--body-text-purple);
}
.how_it_works .yt_video.wizard-demo-video { margin-block-start: clamp(1.5rem, 4vw, 3rem); }
.wizard-demo__flow {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
    align-items: stretch;
    gap: clamp(1rem, 3vw, 2.5rem);
    min-inline-size: 0;
    margin: 0;
}
.wizard-demo__steps { display: grid; gap: .65rem; }
.wizard-demo__step {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: .8rem;
    margin: 0;
    padding: .9rem;
    border: 1px solid var(--wizard-line);
    border-radius: .85rem;
    background: #fff;
    cursor: pointer;
}
.wizard-demo__step:hover, .wizard-demo__step:has(input:checked) { border-color: #8064d4; background: #f6f1ff; }
.wizard-demo__step:has(input:focus-visible) { outline: 2px solid var(--wizard-accent); outline-offset: 3px; }
.wizard-demo__step input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; }
.wizard-demo__number {
    display: grid; place-items: center;
    width: 2.3rem; height: 2.3rem;
    border-radius: .7rem;
    background: #eee7ff;
    color: var(--wizard-accent);
    font-weight: 750;
}
.wizard-demo__step:has(input:checked) .wizard-demo__number { color: #fff; background: var(--wizard-accent); }
.wizard-demo__copy { display: grid; gap: .25rem; overflow-wrap: anywhere; }
.wizard-demo__copy > span { font-size: .9rem; color: #504867; line-height: 1.55; }
.wizard-demo__preview {
    --branch-color: #a895d6;
    display: grid;
    grid-template-rows: auto 1fr;
    min-width: 0;
    border: 1px solid var(--wizard-line);
    border-radius: 1rem;
    background: #fff;
    overflow: hidden;
}
.wizard-demo__bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--wizard-line);
    color: var(--wizard-accent);
}
.wizard-demo__bar > .wizard-demo__state { margin-inline-start: auto; }
.wizard-demo__canvas {
    --branch-gap: clamp(.3rem, 1.4vw, .8rem);
    display: grid; align-content: center;
    padding: clamp(.65rem, 3vw, 2rem);
    background: radial-gradient(circle, #cfc1ec 1px, transparent 1px) 0 0 / 15px 15px, #f7f3ff;
}
.wizard-demo__node {
    display: grid; justify-items: center; align-content: start; gap: .3rem;
    height: 100%;
    padding: .6rem .25rem;
    border: 1px solid var(--wizard-line); border-radius: .7rem;
    background: #fff; box-shadow: 0 .3rem 1rem #38237610;
    text-align: center; line-height: 1.3; overflow-wrap: anywhere;
}
.wizard-demo__node i { color: var(--wizard-accent); font-size: 1.15rem; }
.wizard-demo__root { justify-self: center; padding-inline: 1.2rem; border-color: #a791e0; }
.wizard-demo__branches {
    position: relative;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--branch-gap);
    padding-top: 2.4rem;
}
.wizard-demo__branches::before, .wizard-demo__branches::after, .wizard-demo__branch::before {
    content: ""; position: absolute; background: var(--branch-color);
}
.wizard-demo__branches::before { top: 0; left: calc(50% - 1px); width: 2px; height: 1.2rem; }
.wizard-demo__branches::after { top: 1.2rem; inset-inline: calc((100% - 2 * var(--branch-gap)) / 6); height: 2px; }
.wizard-demo__branch { position: relative; }
.wizard-demo__branch::before { bottom: 100%; left: calc(50% - 1px); width: 2px; height: 1.2rem; }
.wizard-demo__publication { display: none; justify-items: center; position: relative; padding-top: 2.4rem; }
.wizard-demo__publication .wizard-demo__node { padding-inline: 1.2rem; border-color: var(--branch-color); }
.wizard-demo__flow:has([value="2"]:checked, [value="3"]:checked) .wizard-demo__publication { display: grid; }
.wizard-demo__flow:has([value="2"]:checked, [value="3"]:checked) .wizard-demo__branch:nth-child(-n+2)::after,
.wizard-demo__publication::before,
.wizard-demo__publication::after { content: ""; position: absolute; background: var(--branch-color); }
.wizard-demo__branch::after { top: 100%; left: calc(50% - 1px); width: 2px; height: 1.2rem; }
.wizard-demo__publication::before { top: 1.2rem; left: calc((100% - 2 * var(--branch-gap)) / 6); right: 50%; height: 2px; }
.wizard-demo__publication::after { top: 1.2rem; left: calc(50% - 1px); width: 2px; height: 1.2rem; }
.wizard-demo__left-flow { display: none; }
.wizard-demo__state { display: none; padding: .2rem .4rem; border-radius: .4rem; background: #efe8ff; color: #50309c; font-size: .75rem; line-height: 1.25; }
.wizard-demo__flow:has([value="1"]:checked) .wizard-demo__state--plan,
.wizard-demo__flow:has([value="2"]:checked) .wizard-demo__state--draft,
.wizard-demo__flow:has([value="3"]:checked) .wizard-demo__state--publish { display: block; }
.wizard-demo__state--draft, .wizard-demo__state--publish { background: #dcf3e8; color: #195b45; }
.wizard-demo__publication .wizard-demo__state--draft { background: #efe8ff; color: #50309c; }
.wizard-demo__branch:nth-child(3) .wizard-demo__state--publish { background: #fff0d5; color: #714207; }
.wizard-demo__flow:has([value="2"]:checked) .wizard-demo__preview { --branch-color: #7654cc; }
.wizard-demo__flow:has([value="3"]:checked) .wizard-demo__preview { --branch-color: #49977d; }
.wizard-demo__links { display: flex; flex-wrap: wrap; gap: .15rem 1.4rem; margin-top: 1rem; }
.wizard-demo__links a { display: inline-flex; align-items: center; gap: .4em; min-height: 44px; color: var(--wizard-accent); text-decoration: underline; text-underline-offset: .2em; }
.wizard-demo__chatgpt-link {
    --wizard-cta-color: #a528a1;
    flex: 0 0 100%;
    display: flex;
    justify-content: center;
    margin-top: .6rem;
}
.wizard-demo__chatgpt-link a {
    justify-content: center;
    padding: .65rem 1.2rem;
    border-radius: 999px;
    background: var(--wizard-cta-color);
    color: #fff;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}
.wizard-demo__chatgpt-link a:hover { background: #851d82; color: #fff; }
.wizard-demo__chatgpt-link a:focus-visible { outline: 2px solid var(--wizard-cta-color); outline-offset: 3px; }

@media (max-width: 991.98px) {
    .wizard-demo__flow { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: no-preference) {
    .wizard-demo__flow:has([value="1"]:checked) .wizard-demo__branches::before,
    .wizard-demo__flow:has([value="1"]:checked) .wizard-demo__branches::after {
        animation: wizard-demo-state .45s ease-out both;
    }
    .wizard-demo__flow:has([value="1"]:checked) .wizard-demo__branch {
        animation: wizard-demo-grow .65s ease-out .3s both;
        transform-origin: top center;
    }
    .wizard-demo__flow:has([value="1"]:checked) .wizard-demo__branch:nth-child(2) { animation-delay: .6s; }
    .wizard-demo__flow:has([value="1"]:checked) .wizard-demo__branch:nth-child(3) { animation-delay: .9s; }
    .wizard-demo__state { animation: wizard-demo-state .7s ease-out both; }
    .wizard-demo__branch:nth-child(2) .wizard-demo__state--draft { animation-delay: .4s; }
    .wizard-demo__branch:nth-child(3) .wizard-demo__state--draft { animation-delay: .8s; }
    .wizard-demo__publication .wizard-demo__state--draft { animation-delay: 1.2s; }
    .wizard-demo__flow:has([value="2"]:checked) .wizard-demo__branches::before,
    .wizard-demo__flow:has([value="2"]:checked) .wizard-demo__branch::before {
        background: repeating-linear-gradient(to bottom, #7654cc 0 4px, #d9c9ff 4px 8px);
        animation: wizard-demo-flow 1.6s linear 3;
    }
    .wizard-demo__flow:has([value="2"]:checked) .wizard-demo__branches::after,
    .wizard-demo__flow:has([value="2"]:checked) .wizard-demo__left-flow {
        background: repeating-linear-gradient(to right, #7654cc 0 4px, #d9c9ff 4px 8px);
        animation: wizard-demo-publish-flow 1.6s linear 3;
    }
    .wizard-demo__flow:has([value="2"]:checked) .wizard-demo__branches::after { left: 50%; }
    .wizard-demo__flow:has([value="2"]:checked) .wizard-demo__left-flow {
        display: block;
        position: absolute;
        grid-column: 1 / -1;
        grid-row: 1;
        top: 1.2rem;
        transform: translateY(-2.4rem);
        left: calc((100% - 2 * var(--branch-gap)) / 6);
        width: calc((100% + var(--branch-gap)) / 3);
        height: 2px;
        animation-direction: reverse;
    }
    .wizard-demo__flow:has([value="3"]:checked) .wizard-demo__branch:nth-child(-n+2)::after,
    .wizard-demo__flow:has([value="3"]:checked) .wizard-demo__publication::after {
        background: repeating-linear-gradient(to bottom, #368168 0 4px, #bde8d7 4px 8px);
        animation: wizard-demo-flow 1.4s linear 3;
    }
    .wizard-demo__flow:has([value="3"]:checked) .wizard-demo__publication::before {
        background: repeating-linear-gradient(to right, #368168 0 4px, #bde8d7 4px 8px);
        animation: wizard-demo-publish-flow 1.4s linear 3;
    }
    .wizard-demo__publication .wizard-demo__state--publish { animation-delay: 1.2s; }
    @keyframes wizard-demo-state {
        from { opacity: 0; transform: translateY(.25rem); }
        to { opacity: 1; transform: translateY(0); }
    }
    @keyframes wizard-demo-flow { to { background-position: 0 8px; } }
    @keyframes wizard-demo-grow {
        from { opacity: 0; transform: translateY(-.3rem) scale(.92); }
        to { opacity: 1; transform: translateY(0) scale(1); }
    }
    @keyframes wizard-demo-publish-flow { to { background-position: 8px 0; } }
}
