/* =========================================
   Live-Demos: "product UI" layer (loaded after demos.css, only on demos.html)
   Goal: look like real software screens, not a template.
   - one accent (blue), no neon glows, no sparkles, no bouncy pops
   - sharp window chrome with path + run status instead of traffic lights
   - crisp wipe/slide motion and a real mouse pointer that clicks
   ========================================= */

.dm-section {
    --accent-petrol: #60A5FA;
    --accent-pink: #3B82F6;
    --gradient-btn: #2563EB;
    --pro-bg: #0A111F;
    --pro-panel: #0F1829;
    --pro-line: rgba(148, 163, 184, 0.14);
    --pro-line-strong: rgba(148, 163, 184, 0.26);
    --pro-blue: #3B82F6;
    --pro-blue-soft: rgba(59, 130, 246, 0.12);
    --pro-ok: #4ADE80;
    --pro-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Windows ---------- */
.dm-section .dm-window,
.dm-section .demo-app {
    border-radius: 10px;
    background: var(--pro-bg);
    box-shadow:
        0 0 0 1px var(--pro-line-strong),
        0 1px 0 0 rgba(255, 255, 255, 0.06) inset,
        0 50px 100px -40px rgba(0, 0, 0, 0.85);
}

.dm-section .demo-device {
    box-shadow:
        0 0 0 1px var(--pro-line-strong),
        0 50px 100px -40px rgba(0, 0, 0, 0.85);
}

.dm-section .demo-screen { background: #070C16; }

/* Title bar: path on the left, run status on the right */
.dm-section .demo-app-bar {
    position: relative;
    justify-content: flex-start;
    gap: 10px;
    height: 38px;
    padding: 0 14px;
    background: #0B1322;
    border-bottom: 1px solid var(--pro-line);
}

.dm-section .demo-app-dots { display: none; }

.dm-section .demo-app-url {
    position: static;
    transform: none;
    padding: 0;
    background: none;
    box-shadow: none;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.72rem;
    letter-spacing: 0;
    color: rgba(226, 232, 240, 0.72);
}

.dm-section .demo-app-url::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 9px;
    border-radius: 2px;
    background: var(--pro-blue);
    vertical-align: 0;
}

.dm-section .demo-app-url svg { display: none; }

.dm-section .demo-app-bar::before {
    content: 'idle';
    margin-left: auto;
    order: 2;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.68rem;
    color: rgba(148, 163, 184, 0.7);
}

[data-dm].is-running .demo-app-bar::before,
.demo-stage .demo-app-bar::before { content: 'running'; color: #93C5FD; }
[data-dm].is-finished .demo-app-bar::before { content: 'done \2713'; color: var(--pro-ok); }

/* Thin run indicator along the bottom edge of the title bar */
.dm-section .demo-app-bar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--pro-blue) 40%, #93C5FD 50%, var(--pro-blue) 60%, transparent);
    background-size: 40% 100%;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.4s;
}

[data-dm].is-running .demo-app-bar::after {
    opacity: 1;
    animation: proRun 1.6s linear infinite;
}

[data-dm].is-finished .demo-app-bar::after {
    opacity: 1;
    background: var(--pro-ok);
    animation: proDone 2.4s var(--pro-ease) both;
}

/* ---------- Panels, cards, pills ---------- */
.dm-section .demo-card,
.dm-section .demo-kpi,
.dm-section .dm-kpi,
.dm-section .dm-col,
.dm-section .dm-deal,
.dm-section .dm-erp-flow li,
.dm-section .dm-extract-body,
.dm-section .dm-stock,
.dm-section .dm-gantt,
.dm-section .dm-order {
    border-radius: 6px;
}

.dm-section .dm-ai-pill,
.dm-section .dm-tag,
.dm-section .demo-sync {
    border-radius: 3px;
    padding: 2px 7px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.dm-section .dm-ai-pill {
    background: var(--pro-blue-soft);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
    color: #93C5FD;
}

.dm-section .dm-ai-pill svg,
.dm-section .dm-tag svg,
.dm-section .dm-deal-note svg { width: 10px; height: 10px; }

.dm-section .dm-avatar { border-radius: 6px; }

/* Live dots: steady, no pulse halo */
.dm-section .demo-live-dot {
    border-radius: 2px;
    animation: none !important;
    box-shadow: none !important;
}

/* ---------- Buttons ---------- */
.dm-section .dm-btn {
    border-radius: 5px;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s, transform 0.12s;
}

.dm-section .dm-btn.is-primary { background: var(--pro-blue); }
.dm-section .dm-btn.is-press { transform: scale(0.95); background: #1D4ED8; }
.dm-section .dm-btn.is-done {
    background: rgba(74, 222, 128, 0.12);
    color: var(--pro-ok);
}

/* ---------- Mail ---------- */
.dm-section .dm-mail.is-selected {
    background: rgba(59, 130, 246, 0.08);
    box-shadow: inset 2px 0 0 var(--pro-blue);
}

.dm-section .dm-draft {
    border-radius: 6px;
    background: rgba(59, 130, 246, 0.05);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.28);
}

.dm-section .dm-folder b.is-bumped { animation: proTick 0.35s steps(2) 1; }

/* ---------- Documents: hard laser line instead of a glowing fog ---------- */
.dm-section .dm-scan {
    height: 2px;
    background: var(--pro-blue);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25), 0 -40px 40px -20px rgba(59, 130, 246, 0.10);
}

.dm-section .dm-hl.is-found {
    background: rgba(59, 130, 246, 0.14);
    box-shadow: 0 0 0 1.5px var(--pro-blue);
}

/* ---------- Web design steps ---------- */
.dm-section .dm-steps li::before { border-radius: 3px; }
.dm-section .dm-steps li.is-active::before {
    box-shadow: inset 0 0 0 1.5px var(--pro-blue);
    animation: none;
    background: conic-gradient(var(--pro-blue) 0 25%, transparent 0) border-box;
}
.dm-section .dm-steps li.is-done::before { background-color: var(--pro-blue); }

/* ---------- CRM / ERP / orders ---------- */
.dm-section .dm-deal.is-hot,
.dm-section .dm-order.is-hot,
.dm-section [class*="dm-order"].is-new {
    background: #0F1A2E;
    box-shadow: 0 0 0 1px var(--pro-blue), 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.dm-section .dm-toast {
    border-radius: 6px;
    background: #0B1322;
    box-shadow: 0 0 0 1px var(--pro-line-strong), 0 20px 40px -12px rgba(0, 0, 0, 0.8);
}

.dm-section .dm-erp-flow li.is-active {
    box-shadow: inset 0 0 0 1px var(--pro-blue);
    background: var(--pro-blue-soft);
}
.dm-section .dm-erp-flow li.is-active i { background: var(--pro-blue); }
.dm-section .dm-erp-flow li.is-done { box-shadow: inset 0 0 0 1px var(--pro-line-strong); }
.dm-section .dm-erp-flow li.is-done i { background: #fff; color: #0A111F; }

.dm-section .dm-stock-fill {
    border-radius: 2px;
    background: #93C5FD;
}

.dm-section .dm-gantt-bar {
    border-radius: 3px;
    background: rgba(148, 163, 184, 0.14);
    box-shadow: inset 0 0 0 1px var(--pro-line-strong);
    color: #CBD5E1;
}

.dm-section .dm-gantt-bar.is-new {
    background: var(--pro-blue);
    box-shadow: none;
    color: #fff;
    transform-origin: left center;
    animation: proWipe 0.9s var(--pro-ease) both;
}

.dm-section .dm-erp-order { border-radius: 8px; }

/* Navy surfaces instead of the old purple-grey */
.dm-section .dm-build {
    border-radius: 10px;
    background: var(--pro-bg);
    box-shadow: 0 0 0 1px var(--pro-line-strong), 0 50px 100px -40px rgba(0, 0, 0, 0.85);
}
.dm-section .dm-progress i { background: var(--pro-blue); border-radius: 1px; }
.dm-section .dm-site.is-wire { background: #0D1626; }
.dm-section .dm-deal { background: var(--pro-panel); }
.dm-section .dm-erp-order { background: rgba(11, 19, 34, 0.94); }

/* ---------- Mouse pointer (added by demos.js) ---------- */
[data-dm] { position: relative; }

.dm-cursor {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 30;
    width: 22px;
    height: 22px;
    pointer-events: none;
    opacity: 0;
    transition: transform 0.75s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.3s;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
}

.dm-cursor.is-on { opacity: 1; }
.dm-cursor svg { display: block; width: 100%; height: 100%; }

.dm-cursor::after {
    content: '';
    position: absolute;
    top: -9px;
    left: -9px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #93C5FD;
    opacity: 0;
    transform: scale(0.3);
}

.dm-cursor.is-press::after { animation: proClick 0.45s ease-out; }

/* ---------- Hero: bento overview of all demos ---------- */
.dm-bento {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    /* wider than the hero text, centred via margins: the hero's entry animation
       sets transform on its children, so transform cannot be used here */
    width: min(1100px, calc(100vw - 32px));
    margin-top: 2.75rem;
    margin-left: calc((100% - min(1100px, 100vw - 32px)) / 2);
    text-align: left;
}

.dm-tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 132px;
    padding: 18px;
    border-radius: 10px;
    background: rgba(15, 24, 41, 0.72);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
    color: #fff;
    text-decoration: none;
    transition: box-shadow 0.2s ease-out, background 0.2s ease-out, transform 0.2s ease-out;
}

.dm-tile:hover,
.dm-tile:focus-visible {
    background: rgba(20, 33, 58, 0.9);
    box-shadow: inset 0 0 0 1px #3B82F6;
    transform: translateY(-2px);
}

.dm-tile-wide {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(15, 24, 41, 0.72) 70%);
}

.dm-tile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: auto;
    padding-bottom: 14px;
}

.dm-tile-top svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: #93C5FD;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dm-tile-top em {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.72rem;
    font-style: normal;
    color: rgba(148, 163, 184, 0.85);
}

.dm-tile b { font-size: 1.02rem; }
.dm-tile small { font-size: 0.82rem; line-height: 1.4; color: rgba(203, 213, 225, 0.82); }

/* ---------- Feature breakdown under each demo ---------- */
.dm-points {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 2.5rem auto 0;
    padding: 0;
    list-style: none;
}

.dm-points li {
    position: relative;
    padding: 14px 0 0 30px;
    border-top: 2px solid rgba(59, 130, 246, 0.55);
    font-size: 0.95rem;
    line-height: 1.5;
}

.dm-points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 16px;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #2563EB url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* ---------- Calmer action row ---------- */
.dm-foot { gap: 0.75rem 1.5rem; }

.dm-foot .btn {
    min-height: 44px;
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
    border-radius: 6px;
}

.dm-foot a.btn {
    border-color: transparent;
    background: none;
    box-shadow: none;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.dm-foot a.btn::after { content: ' \2192'; text-decoration: none; display: inline-block; margin-left: 6px; }

.dm-foot button.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: none;
    box-shadow: none;
}

.dm-foot button.btn::before {
    content: '';
    width: 15px;
    height: 15px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.dm-foot button.btn:hover { border-color: #3B82F6; }

@media (max-width: 900px) {
    .dm-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dm-points { grid-template-columns: 1fr; gap: 14px; max-width: 520px; }
}

@media (max-width: 420px) {
    .dm-tile { min-height: 0; padding: 14px; }
    .dm-tile-top { padding-bottom: 10px; }
}

/* ---------- Motion: crisp, no overshoot ---------- */
@keyframes dmPop { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes dmFadeUp { from { opacity: 0; transform: translateY(4px); } }
@keyframes dmSlideDown {
    from { opacity: 0; transform: translateY(-6px); background-color: rgba(59, 130, 246, 0.16); }
    60% { opacity: 1; transform: none; background-color: rgba(59, 130, 246, 0.10); }
}
@keyframes dmBump { 50% { transform: none; filter: brightness(1.4); } }
@keyframes dmPulsePink { from { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); } }
@keyframes proRun { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@keyframes proDone {
    0% { transform: scaleX(0); transform-origin: left; opacity: 1; }
    30% { transform: scaleX(1); transform-origin: left; opacity: 1; }
    100% { transform: scaleX(1); opacity: 0; }
}
@keyframes proTick { 50% { filter: brightness(1.5); } }
@keyframes proWipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes proClick { from { opacity: 1; transform: scale(0.3); } to { opacity: 0; transform: scale(1.6); } }

@media (prefers-reduced-motion: reduce) {
    .dm-cursor { display: none; }
    [data-dm].is-running .demo-app-bar::after { animation: none; }
}
