:root {
    --color-primary: #7c3aed;
    --color-primary-hover: #6d28d9;
    --color-primary-soft: #f5f3ff;
    --color-text: #1a1a2e;
    --color-text-secondary: #6b7280;
    --color-text-muted: #9ca3af;
    --color-bg: #ffffff;
    --color-surface: #f9fafb;
    --color-border: #e5e7eb;
    --color-success: #059669;
    --color-danger: #dc2626;
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
    --shadow-xl: 0 20px 60px rgba(124, 58, 237, 0.18);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body { line-height: 1.5; }

a { color: inherit; text-decoration: none; }

button {
    font-family: inherit;
    cursor: pointer;
    border: 0;
    background: transparent;
    color: inherit;
}

/* ===== TOP NAV ===== */
.live-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 60;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.live-nav__logo { display: flex; align-items: center; gap: 10px; }
.live-nav__logo img { height: 26px; }
.live-nav__brand {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--color-text);
}
.live-nav__actions { display: flex; align-items: center; gap: 8px; }

.live-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.live-btn:hover { background: var(--color-surface); }
.live-btn--primary {
    background: var(--color-primary);
    color: #fff;
}
.live-btn--primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}
.live-btn--ghost {
    border: 1px solid var(--color-border);
}

/* ===== PROGRESS BAR ===== */
.live-progress {
    position: fixed;
    top: 60px; left: 0; right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.04);
    z-index: 55;
}
.live-progress__fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), #a78bfa);
    transition: width 0.1s linear;
}
.live-progress__label {
    position: fixed;
    top: 72px;
    left: 24px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    letter-spacing: 0.06em;
    z-index: 55;
    font-variant-numeric: tabular-nums;
}

/* ===== STEP DOTS (desktop right-rail) ===== */
.live-dots {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 55;
}
.live-dots__btn {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(26, 26, 46, 0.2);
    transition: background 0.25s var(--ease), transform 0.25s var(--ease);
    position: relative;
}
.live-dots__btn::after {
    content: attr(data-label);
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    background: var(--color-text);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--ease);
}
.live-dots__btn:hover::after { opacity: 1; }
.live-dots__btn.is-active {
    background: var(--color-primary);
    transform: scale(1.5);
}

/* ===== FLOATING RESTART BUTTON ===== */
.live-restart {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 55;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 100px;
    background: var(--color-text);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.live-restart.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.live-restart:hover { background: var(--color-primary); }

/* ===== SCENE LAYOUT ===== */
.live-stage {
    position: relative;
}

.scene {
    position: relative;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    align-items: center;
    padding: 80px 48px 48px;
    gap: 24px;
}

.scene__art {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.scene__art svg {
    width: 100%;
    height: 100%;
    max-height: 80vh;
    max-height: 80dvh;
    overflow: visible;
}

.scene__card {
    position: relative;
    max-width: 420px;
    padding: 28px 32px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    z-index: 2;
}
.scene__badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.scene__title {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--color-text);
    margin-bottom: 10px;
}
.scene__text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
}
.scene__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--color-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.scene__cta:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}
.scene__cta svg { width: 14px; height: 14px; }

.scene__scrollhint {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    animation: scrollNudge 2s ease-in-out infinite;
}
@keyframes scrollNudge {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.7; }
    50%      { transform: translateX(-50%) translateY(6px); opacity: 1; }
}

/* ===== SCENE 1 — WELCOME ===== */
#scene-1 {
    background: linear-gradient(180deg, #f5f3ff 0%, #ffffff 100%);
}

/* ===== SCENE 2 — ARRIVAL ===== */
#scene-2 {
    background: linear-gradient(180deg, #fafafa 0%, #f3f4f6 100%);
}

/* ===== SCENE 3 — SCAN ===== */
#scene-3 {
    background: radial-gradient(1200px 600px at 30% 40%, #ede9fe 0%, #ffffff 60%);
}

/* ===== SCENE 4 — DASHBOARD ===== */
#scene-4 {
    background: linear-gradient(180deg, #ffffff 0%, #faf5ff 100%);
}

/* ===== SCENE 5 — CTA ===== */
#scene-5 {
    background: radial-gradient(900px 500px at 50% 50%, #8b5cf6 0%, #6d28d9 70%, #5b21b6 100%);
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: 100px 24px 48px;
}
#scene-5 .scene__card {
    background: transparent;
    border: 0;
    box-shadow: none;
    max-width: 560px;
    color: #fff;
}
#scene-5 .scene__title { color: #fff; font-size: clamp(32px, 5vw, 48px); }
#scene-5 .scene__text  { color: rgba(255,255,255,0.85); font-size: 17px; }
#scene-5 .scene__badge { background: rgba(255,255,255,0.16); color: #fff; }
#scene-5 .scene__cta {
    background: #fff;
    color: var(--color-primary);
}
#scene-5 .scene__cta:hover {
    background: #f5f3ff;
}
#scene-5 .scene__cta--secondary {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
    margin-left: 10px;
}
#scene-5 .scene__cta--secondary:hover {
    background: rgba(255,255,255,0.1);
}

/* ===== MOBILE (<1024 or no hover) ===== */
@media (max-width: 1023px), (hover: none) {
    .live-dots { display: none; }
    .live-progress__label { left: 16px; font-size: 11px; }

    .scene {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        padding: 80px 20px 40px;
        gap: 18px;
    }
    .scene__art {
        max-height: 55vh;
        max-height: 55dvh;
    }
    .scene__card {
        max-width: 100%;
        padding: 22px 24px;
    }
    .scene__title { font-size: clamp(22px, 5.5vw, 28px); }
    .scene__text  { font-size: 14px; }

    #scene-5 {
        padding: 80px 20px 40px;
    }
    .live-restart { bottom: 16px; left: 16px; }

    /* Mobile dots bottom */
    .live-dots--mobile {
        display: flex;
        position: fixed;
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        gap: 10px;
        z-index: 55;
    }
    .live-dots--mobile .live-dots__btn::after { display: none; }
}
@media (min-width: 1024px) and (hover: hover) {
    .live-dots--mobile { display: none; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .scene__scrollhint, .live-restart { animation: none; }
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
