/*
 style.css  --  look of the duckScope demo page

 WHAT   Page layout (follows the visitor's light / dark setting) and the Live-style frame around the
        device replica: transport bar, device title bar, controls, drop-down lists and the Info box.
 WHY    The device itself always looks like Live's dark theme, so everything inside .live uses fixed
        dark colours; only the text around it switches with prefers-color-scheme.
*/

:root {
    --page: #f4f4f2; --ink: #1f2023; --muted: #5d6068; --line: #d6d6d2; --card: #ffffff; --accent: #c76a00;
    --font: "Ableton Sans Medium", "Inter", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --dv-bg: #424242; --dv-field: #262626; --dv-edge: #1b1b1b; --dv-text: #c9c9c9; --dv-label: #a8a8a8; --dv-on: #ffa42c;
    --clip: #ff5559;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --page: #16171a; --ink: #dcdcdc; --muted: #9a9ca3; --line: #2b2d33; --card: #1b1c20; --accent: #ff9f2e;
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --page: #16171a; --ink: #dcdcdc; --muted: #9a9ca3; --line: #2b2d33; --card: #1b1c20; --accent: #ff9f2e;
    color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { background: var(--page); color: var(--ink); }
body { margin: 0; font: 15px/1.55 var(--font); padding-inline: max(16px, env(safe-area-inset-left, 0px)); overflow-x: hidden; }
.wrap { max-width: 902px; margin: 0 auto; padding-block: 24px 40px; }
h1 { font: 600 28px/1.2 var(--font); margin: 0 0 6px; }
h2 { font: 600 17px/1.3 var(--font); margin: 0 0 6px; }
p { margin: 0 0 8px; }
.lead { font-size: 16px; }
.muted { color: var(--muted); font-size: 13px; }

/* sticky stage: transport + device + info stay in view while the tour scrolls */
.stage { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; padding-block: 10px; background: var(--page); margin-top: 14px; }
.live { width: 902px; max-width: 100%; background: #2b2b2b; border: 1px solid #1b1b1b; border-radius: 4px; color: var(--dv-text);
    font: 11px/1.3 var(--font); user-select: none; -webkit-user-select: none; }
#debug { font: 11px/1.4 Menlo, monospace; color: var(--muted); margin-top: 4px; }
#status { font: 11px/1.4 var(--font); color: var(--muted); min-height: 1.4em; }

/* transport */
.transport { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 6px 8px; background: #333; border-bottom: 1px solid #1b1b1b; }
.transport button.tp { width: 30px; height: 22px; background: #262626; border: 1px solid #1b1b1b; border-radius: 2px; display: flex;
    align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.transport button.tp svg { width: 12px; height: 12px; fill: #c9c9c9; }
.transport button.tp[aria-pressed="true"] { background: #8bd44c; }
.transport button.tp[aria-pressed="true"] svg { fill: #14200a; }
.transport button.tp.stop[aria-pressed="true"] { background: #bdbdbd; }
.transport .lcd { background: #1b1b1b; color: #ffa42c; font: 600 13px/22px var(--font); padding: 0 10px; height: 22px; min-width: 82px; text-align: center; border-radius: 2px; }
.transport .tlabel { color: var(--dv-label); font-size: 11px; }
.transport .note { color: #8a8a8a; font-size: 11px; flex: 1 1 200px; }

/* device */
.scroller { overflow-x: auto; background: #2b2b2b; }
.devwrap { width: 548px; }
.titlebar { height: 16px; background: #565656; color: #e0e0e0; font: 600 11px/16px var(--font); padding-left: 22px; position: relative; }
.titlebar::before { content: ""; position: absolute; left: 5px; top: 4px; width: 8px; height: 8px; background: var(--dv-on); border-radius: 1px; }
.dev { position: relative; height: 169px; width: 548px; background: var(--dv-bg); font: 9px/1 var(--font); color: var(--dv-text); }
.dev .el { position: absolute; }
.dev canvas { position: absolute; left: 0; top: 0; background: #141414; cursor: crosshair; }
.dev .lab { color: var(--dv-label); font-size: 10px; line-height: 12px; white-space: nowrap; }
.dev .head { font-weight: 600; font-size: 11px; line-height: 14px; padding-top: 3px; white-space: nowrap; }
.dev .sep { position: absolute; top: 4px; width: 1px; height: 161px; background: #2c2c2c; }
.dev a.info-icon { position: absolute; width: 12px; height: 12px; display: block; text-decoration: none; }
.dev a.info-icon svg { display: block; width: 12px; height: 12px; fill: var(--dv-text); fill-rule: evenodd; }
.dev button { font-family: var(--font); }
.dev button.tx { position: absolute; font-size: 9px; font-weight: 500; color: var(--dv-text); background: var(--dv-field); border: 1px solid var(--dv-edge);
    padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.dev button.tx[aria-pressed="true"] { background: var(--dv-on); color: #1c1306; border-color: var(--dv-on); }
.dev button.tx.clipbtn[aria-pressed="true"] { background: var(--clip); border-color: var(--clip); color: #1d0703; }
.dev .menu { position: absolute; background: var(--dv-field); border: 1px solid var(--dv-edge); color: var(--dv-text); font-size: 9px; text-align: left;
    padding: 0 12px 0 4px; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dev .menu::after { content: ""; position: absolute; right: 4px; top: 50%; margin-top: -2px; border: 3px solid transparent; border-top: 4px solid var(--dv-label); }
.dev .nbar { position: absolute; height: 15px; background: #4f4f4f; border: 1px solid var(--dv-edge); cursor: ns-resize; overflow: hidden; padding: 0; touch-action: none; }
.dev .nbar i { position: absolute; left: 0; top: 0; bottom: 0; background: #2a7282; }
.dev .nbar b { position: relative; font-size: 9px; font-weight: 500; color: var(--dv-text); display: block; text-align: center; line-height: 13px; }
.dev .dial { position: absolute; cursor: ns-resize; touch-action: none; }
.dev .dial svg { display: block; }
.dev .dim:not(.nbar) { opacity: .4; }
.dev .nbar.dim i { background: #3b3b3b; }
.dev .pulse { animation: pulse 1.5s ease-out 1; }
@keyframes pulse { 0%, 60% { outline: 2px solid #ffd23f; outline-offset: 2px; } 100% { outline: 2px solid transparent; outline-offset: 2px; } }
.dev button:focus-visible, .transport button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

/* transport menu button (same look as a device menu) */
.tmenu { position: relative; height: 22px; min-width: 110px; background: #262626; border: 1px solid #1b1b1b; color: #c9c9c9; font: 12px var(--font);
    text-align: left; padding: 0 20px 0 8px; cursor: pointer; }
.tmenu::after { content: ""; position: absolute; right: 7px; top: 8px; border: 4px solid transparent; border-top: 5px solid var(--dv-label); }

/* drop-down list */
.popup { position: fixed; z-index: 100; background: #1f1f1f; border: 1px solid #0f0f0f; box-shadow: 0 4px 12px rgba(0, 0, 0, .5); padding: 2px 0;
    font: 11px/1 var(--font); color: #c9c9c9; max-height: 70vh; overflow-y: auto; }
.popup div { padding: 5px 14px 5px 18px; cursor: pointer; white-space: nowrap; position: relative; }
.popup div:hover { background: var(--dv-on); color: #1c1306; }
.popup div.on::before { content: "\2713"; position: absolute; left: 5px; }
.popup div.off { color: #6a6a6a; cursor: default; }
.popup div.off:hover { background: transparent; color: #6a6a6a; }
.popup div.sep { padding: 0; margin: 3px 0; height: 1px; background: #3a3a3a; cursor: default; }
.popup div.sep:hover { background: #3a3a3a; }

/* info box */
.info { min-height: 62px; padding: 8px 10px; background: #2b2b2b; border-top: 1px solid #1b1b1b; font-size: 12px; line-height: 1.45; color: #bdbdbd; }
.info b { display: block; color: #e6e6e6; font-weight: 700; margin-bottom: 2px; }
.info .hint { color: #8a8a8a; }

/* big view overlay */
.bigov { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .7); display: flex; align-items: center; justify-content: center; padding: 16px; }
.bigov[hidden] { display: none; }
.bigov canvas { max-width: 100%; height: auto; background: #141414; border: 1px solid #000; }

/* tour */
.tour { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.card { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: var(--card); }
.card p { color: var(--muted); font-size: 14px; }
.card button.try { font: 600 13px var(--font); background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 7px 14px; cursor: pointer; }
.card button.try:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
footer { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
@media (max-width: 600px) { .tour { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .dev .pulse { animation: none; outline: 2px solid #ffd23f; outline-offset: 2px; } }
