/* LineKeeper interactive demo — shell page styles.
   Reuses the site design tokens from /styles.css (:root). */

.demo-hero { padding: 118px 0 32px; }
.demo-hero .sec-head { margin-bottom: 26px; }
.demo-hero h1 { max-width: 720px; }
.demo-sub { max-width: 640px; color: var(--ink-2); font-size: 17px; line-height: 1.6; margin-top: 14px; }
.demo-sub b { color: var(--ink); }

/* ── Factory scene ─────────────────────────────────────────────────── */
.demo-scene {
    --sc-bg: #0c0f14; --sc-panel: #151922; --sc-border: #242a35;
    --sc-muted: #6b7688; --sc-ok: #36c98b; --sc-bad: #e5484d;
    background: var(--sc-bg);
    border-radius: var(--r-lg, 24px);
    padding: 22px 22px 14px;
    box-shadow: var(--shadow, 0 20px 60px rgba(10, 11, 13, .12));
}
.demo-scene svg { width: 100%; height: auto; display: block; }
.scene-label {
    font-family: var(--mono, 'IBM Plex Mono', monospace);
    font-size: 11px; fill: var(--sc-muted); letter-spacing: .04em;
}
.scene-label-lk { fill: #9db9f5; }
.scene-dead {
    font-family: var(--mono, 'IBM Plex Mono', monospace);
    font-size: 12px; fill: #4a5568; letter-spacing: .18em; font-weight: 600;
}

/* bottles conveyor loop: the row is duplicated by translating back 308px */
.scene-bottles { animation: lk-belt 5.5s linear infinite; }
@keyframes lk-belt { from { transform: translateX(-308px); } to { transform: translateX(0); } }
.demo-scene.is-stopped .scene-bottles,
.demo-scene.is-fault .scene-bottles { animation-play-state: paused; }

/* data packets flowing along the cable */
.scene-cable { animation: lk-cable 1.2s linear infinite; }
@keyframes lk-cable { from { stroke-dashoffset: 26; } to { stroke-dashoffset: 0; } }
.demo-scene.is-offline .scene-cable { animation-play-state: paused; opacity: .25; }

/* fault beacon */
.scene-beacon { opacity: 0; }
.demo-scene.is-fault .scene-beacon { animation: lk-beacon .9s ease-in-out infinite; }
@keyframes lk-beacon { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }
.demo-scene.is-fault .scene-machine-led { fill: var(--sc-bad); }
.demo-scene.is-stopped .scene-machine-led { fill: #8a93a3; }

.scene-lk-led { animation: lk-pulse 2.2s ease-in-out infinite; }
@keyframes lk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.demo-scene.is-offline .scene-lk-led,
.demo-scene.is-offline .scene-lk-chart { opacity: .2; animation: none; }

/* status chips under the diagram */
.scene-status { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 14px 4px 4px; }
.scene-chip {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--mono, 'IBM Plex Mono', monospace);
    font-size: 12px; color: #aab4c4;
}
.scene-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #4a5568; flex: none; }
.scene-chip .dot-ok, .scene-chip .dot.ok { background: var(--sc-ok); }
.scene-chip .dot-bad, .scene-chip .dot.bad { background: var(--sc-bad); }
.scene-chip .dot.warn { background: #f5a623; }

/* ── Scenario picker ───────────────────────────────────────────────── */
.demo-controls { margin: 22px 0 14px; }
.demo-picker-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.demo-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-picker .toggle-pill { display: inline-flex; align-items: center; gap: 8px; }
.demo-picker .toggle-pill .n {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%; flex: none;
    font-size: 11.5px; font-weight: 600;
    background: var(--surface-2, #eff1f3); color: var(--ink-2, #45474d);
}
.demo-picker .toggle-pill.active .n { background: rgba(255, 255, 255, .22); color: #fff; }
.demo-picker .toggle-pill.done .n { background: #d9f2e5; color: #1ea966; }

/* ── Tour toolbar ──────────────────────────────────────────────────── */
.tour-bar[hidden], .tour-bar .btn[hidden] { display: none; }
.tour-bar {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    background: #0f1420; color: #e7eaf0;
    border: 1px solid #2e6be6; border-radius: var(--r, 16px);
    padding: 12px 18px; margin: 0 0 14px;
}
.tour-progress { display: flex; gap: 6px; flex: none; }
.tour-progress i {
    width: 10px; height: 10px; border-radius: 50%;
    background: #2a3140; transition: background .2s;
}
.tour-progress i.done { background: #36c98b; }
.tour-progress i.now { background: var(--accent-2, #4d8dff); box-shadow: 0 0 8px rgba(77, 141, 255, .8); }
.tour-text { flex: 1 1 260px; font-size: 14px; line-height: 1.5; }
.tour-actions { display: flex; gap: 8px; }
.tour-bar .btn-ghost { color: #aab4c4; border-color: #2a3140; }
.tour-bar .btn-ghost:hover { color: #e7eaf0; }

/* ── Stage: browser / device frames ────────────────────────────────── */
.demo-stage { position: relative; }
.demo-browser {
    border: 1px solid var(--surface-2, #eff1f3);
    border-radius: var(--r, 16px); overflow: hidden;
    background: #0c0f14;
    box-shadow: var(--shadow, 0 20px 60px rgba(10, 11, 13, .12));
}
.demo-browser-chrome {
    display: flex; align-items: center; gap: 7px;
    background: #171b24; padding: 9px 14px;
}
.demo-browser-chrome .dot-btn { width: 10px; height: 10px; border-radius: 50%; background: #2a3140; }
.demo-url {
    margin-left: 10px; font-family: var(--mono, 'IBM Plex Mono', monospace);
    font-size: 11.5px; color: #6b7688;
    background: #0c0f14; border-radius: 6px; padding: 3px 12px;
}
.demo-scale-wrap { position: relative; overflow: hidden; }
.demo-scale-wrap iframe {
    position: absolute; top: 0; left: 0; border: 0;
    transform-origin: 0 0; background: #0c0f14;
}

.demo-mobile-note {
    display: none; margin-top: 10px; text-align: center;
    font-size: 13px; color: var(--muted, #77797f);
}

/* ── Note under the stage ──────────────────────────────────────────── */
.demo-hints { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 14px; }
.demo-hint-label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.demo-note { font-size: 12.5px; color: var(--muted, #77797f); }

.demo-contact { margin-top: 46px; }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 760px) {
    .demo-hero { padding-top: 96px; }
    .demo-scene { padding: 12px 10px 8px; border-radius: 16px; }
    .scene-status { gap: 6px 12px; padding-top: 10px; }
    .scene-chip { font-size: 10.5px; }
    .tour-bar { padding: 10px 14px; }
    .demo-mobile-note { display: block; }
}

@media (prefers-reduced-motion: reduce) {
    .scene-bottles, .scene-cable, .scene-beacon, .scene-lk-led { animation: none !important; }
    .demo-scene.is-fault .scene-beacon { opacity: 1; }
}
