:root {
    color-scheme: light;
    --ink: #111111;
    --muted: #6f7280;
    --line: #ded8f7;
    --paper: #f7f4ff;
    --panel: #ffffff;
    --accent: #a98bf5;
    --accent-strong: #7b57dc;
    --teal: #0b8f8a;
    --gold: #d59c26;
    --shadow: 0 24px 70px rgba(17, 17, 17, 0.18);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    background: #111111;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
}

button {
    font: inherit;
}

.demo-shell {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 18px;
}

.stage {
    background: var(--paper);
    border: 1px solid rgba(169, 139, 245, 0.34);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    height: calc(100vh - 36px);
    height: calc(100dvh - 36px);
    min-height: 620px;
    overflow: hidden;
}

.topbar {
    align-items: center;
    background: #111111;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 18px;
}

.brand {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    background: var(--accent);
    border-radius: 6px;
    height: 36px;
    object-fit: cover;
    width: 52px;
}

.brand-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-actions {
    display: flex;
    gap: 8px;
}

.icon-button,
.control-button {
    appearance: none;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    cursor: pointer;
    min-height: 40px;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-button {
    align-items: center;
    display: inline-flex;
    font-size: 23px;
    justify-content: center;
    line-height: 1;
    width: 40px;
}

.icon-button:hover,
.control-button:hover {
    background: #f4f7fb;
    border-color: #aab6c7;
}

.icon-button:active,
.control-button:active {
    transform: translateY(1px);
}

.embed-only {
    display: none;
}

.demo-shell.is-embed .embed-only {
    display: inline-flex;
}

.progress {
    background: #dfe5ee;
    height: 4px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #ffffff, var(--accent), var(--accent-strong));
    display: block;
    height: 100%;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 280ms ease;
}

.hero {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(250px, 340px) minmax(0, 1fr);
    min-height: 0;
    padding: 18px;
}

.scene-copy {
    align-self: stretch;
    background: #ffffff;
    border: 1px solid rgba(169, 139, 245, 0.4);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 24px;
}

.eyebrow {
    color: var(--accent-strong);
    font-size: 13px;
    font-weight: 800;
    margin: 0 0 12px;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(28px, 4.2vh, 44px);
    letter-spacing: 0;
    line-height: 1.05;
    margin: 0;
}

.scene-copy p[data-description] {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.55;
    margin: 18px 0 0;
}

.scene-meta {
    border-top: 1px solid var(--line);
    color: var(--muted);
    display: flex;
    font-size: 13px;
    gap: 12px;
    justify-content: space-between;
    margin-top: 28px;
    padding-top: 16px;
}

.screen-area {
    min-height: 0;
    min-width: 0;
}

.screen-frame {
    background: #111111;
    border: 1px solid rgba(169, 139, 245, 0.42);
    border-radius: 8px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.screen-frame img {
    display: block;
    height: 100%;
    object-fit: contain;
    opacity: 1;
    transform: scale(1);
    transition: opacity 260ms ease, transform 460ms ease;
    width: 100%;
}

.screen-frame.is-changing img {
    opacity: 0.25;
    transform: scale(0.985);
}

.phase-ribbon {
    align-items: center;
    background: #050505;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    inset: 0;
    justify-content: center;
    opacity: 0;
    padding: 42px;
    pointer-events: none;
    position: absolute;
    text-align: center;
    transform: scale(0.88);
    transition: opacity 320ms ease, transform 620ms cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 8;
}

.phase-ribbon.is-visible {
    animation: phaseZoom 1500ms cubic-bezier(0.16, 1, 0.3, 1) both;
    opacity: 1;
    transform: scale(1);
}

.phase-ribbon.is-visible.is-final {
    animation: finalZoom 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.phase-ribbon span,
.phase-ribbon strong,
.phase-ribbon em,
.phase-ribbon code {
    display: block;
}

.phase-ribbon span {
    color: var(--accent);
    font-size: clamp(14px, 1.6vw, 22px);
    font-style: normal;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: uppercase;
}

.phase-ribbon strong {
    color: #ffffff;
    font-size: clamp(44px, 7.2vw, 112px);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 0.92;
    margin-top: 14px;
    max-width: 980px;
    text-wrap: balance;
}

.phase-ribbon em {
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(18px, 2.2vw, 34px);
    font-style: normal;
    line-height: 1.22;
    margin-top: 18px;
    max-width: 780px;
}

.phase-ribbon code {
    background: rgba(169, 139, 245, 0.14);
    border: 1px solid rgba(169, 139, 245, 0.48);
    border-radius: 6px;
    color: #ffffff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
    margin-top: 24px;
    overflow-wrap: anywhere;
    padding: 8px 10px;
}

.phase-ribbon.is-final span {
    color: var(--accent);
}

.phase-ribbon.is-final strong {
    font-size: clamp(46px, 7.8vw, 118px);
}

.phase-ribbon.is-final em {
    color: #ffffff;
    font-size: clamp(24px, 3vw, 44px);
    font-weight: 900;
}

.spotlight {
    border: 3px solid rgba(219, 40, 77, 0.86);
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(11, 20, 34, 0.18), 0 0 0 rgba(219, 40, 77, 0);
    left: 50%;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: left 420ms ease, opacity 220ms ease, top 420ms ease, width 420ms ease, height 420ms ease;
}

.spotlight.is-visible {
    animation: spotlightArrive 760ms cubic-bezier(0.16, 1, 0.3, 1) both, spotlightPulse 1200ms ease 760ms 2;
    opacity: 1;
}

.cursor {
    background: #ffffff;
    border: 2px solid var(--ink);
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(20, 30, 44, 0.25);
    height: 18px;
    left: 50%;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: left 620ms ease, opacity 220ms ease, top 620ms ease, transform 160ms ease;
    width: 18px;
}

.cursor.is-visible {
    opacity: 1;
}

.cursor.is-clicking {
    transform: translate(-50%, -50%) scale(0.72);
}

.typed-field {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(96, 112, 134, 0.45);
    border-radius: 6px;
    box-shadow: 0 10px 24px rgba(20, 30, 44, 0.16);
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    left: 50%;
    min-height: 34px;
    min-width: 180px;
    opacity: 0;
    padding: 8px 12px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: left 420ms ease, opacity 180ms ease, top 420ms ease;
    white-space: nowrap;
}

.typed-field.is-visible {
    opacity: 1;
}

.typed-field::after {
    animation: blink 900ms steps(2, start) infinite;
    background: var(--accent);
    content: "";
    display: inline-block;
    height: 15px;
    margin-left: 4px;
    position: relative;
    top: 2px;
    width: 2px;
}

.controls {
    align-items: center;
    background: #ffffff;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1fr 1fr;
    padding: 12px 18px;
}

.control-button {
    font-weight: 750;
    padding: 0 14px;
}

.control-button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.control-button.primary:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

@keyframes phaseZoom {
    0% {
        opacity: 0;
        transform: scale(0.78);
    }

    18%,
    74% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1.08);
    }
}

@keyframes spotlightArrive {
    0% {
        opacity: 0;
        transform: translate(-68%, -50%) scale(1.22);
    }

    62% {
        opacity: 1;
        transform: translate(-48%, -50%) scale(0.96);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes spotlightPulse {
    0%,
    100% {
        border-color: rgba(219, 40, 77, 0.9);
        box-shadow: 0 0 0 9999px rgba(11, 20, 34, 0.18), 0 0 0 rgba(219, 40, 77, 0);
    }

    50% {
        border-color: rgba(255, 55, 96, 1);
        box-shadow: 0 0 0 9999px rgba(11, 20, 34, 0.2), 0 0 22px rgba(219, 40, 77, 0.65);
    }
}

@keyframes finalZoom {
    0% {
        opacity: 0;
        transform: scale(0.78);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 860px) {
    .demo-shell {
        padding: 0;
    }

    .stage {
        border: 0;
        border-radius: 0;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
    }

    .hero {
        gap: 12px;
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
        padding: 12px;
    }

    .scene-copy {
        padding: 16px;
    }

    h1 {
        font-size: 26px;
    }

    .scene-copy p[data-description] {
        font-size: 14px;
        margin-top: 10px;
    }

    .scene-meta {
        margin-top: 12px;
        padding-top: 10px;
    }

    .phase-ribbon strong {
        font-size: clamp(32px, 11vw, 54px);
    }

    .phase-ribbon em {
        font-size: 16px;
    }

    .controls {
        padding: 10px 12px;
    }
}

@media (max-width: 520px) {
    .topbar {
        min-height: 56px;
        padding: 0 12px;
    }

    .brand-title {
        font-size: 14px;
    }

    .brand-mark {
        height: 34px;
        width: 48px;
    }

    .control-button {
        font-size: 13px;
        min-height: 38px;
        padding: 0 8px;
    }

    .typed-field {
        font-size: 12px;
        max-width: 70%;
        min-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
