:root {
    color-scheme: light;
    --ink: #151923;
    --muted: #607086;
    --line: #d8dee8;
    --paper: #fbfcff;
    --panel: #ffffff;
    --accent: #db284d;
    --accent-strong: #ad1837;
    --teal: #0b8f8a;
    --gold: #d59c26;
    --shadow: 0 24px 70px rgba(20, 30, 44, 0.18);
}

* {
    box-sizing: border-box;
}

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

body {
    background: #edf1f6;
    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(96, 112, 134, 0.28);
    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: var(--panel);
    border-bottom: 1px solid var(--line);
    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 {
    align-items: center;
    background: var(--ink);
    border-radius: 6px;
    color: #ffffff;
    display: inline-flex;
    font-size: 14px;
    font-weight: 800;
    height: 36px;
    justify-content: center;
    letter-spacing: 0;
    width: 52px;
}

.brand-title {
    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, var(--accent), var(--teal), var(--gold));
    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 var(--line);
    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: #f7f9fc;
    border: 1px solid var(--line);
    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);
}

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

@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;
    }

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