/* Thrum landing-page demos. Scenes are built by demo.js at a fixed design size and scaled to fit.
   Motion uses transform and opacity only; graph paths and numbers update once per sample, like the app. */

.demo { margin: 0; position: relative; width: 100%; }
.demo.js:not(.ready) { visibility: hidden; }
.demo .stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.demo-hero { max-width: 460px; justify-self: center; }
.demo-quit { max-width: 420px; margin: 0 auto; }
.demo-menubar { margin-top: 28px; }
.demo .sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- theme tokens for the scenes (follow the system appearance, like the app) ---------- */
.demo {
  --tx: #1d1d1f;
  --tx2: rgba(60, 60, 67, 0.62);
  --tx3: rgba(60, 60, 67, 0.32);
  --pop: rgba(244, 240, 255, 0.70);
  --pop-line: rgba(255, 255, 255, 0.75);
  --pop-hi: rgba(255, 255, 255, 0.9);
  --card: rgba(255, 255, 255, 0.46);
  --card-line: rgba(255, 255, 255, 0.72);
  --ink: #000;            /* union fills: group opacity carries the alpha */
  --bar-op: 0.06;
  --sel-op: 0.10;
  --rowbg-op: 0.06;
  --track: rgba(0, 0, 0, 0.08);
  --grid: rgba(60, 60, 67, 0.22);
  --btn: rgba(255, 255, 255, 0.55);
  --btn-line: rgba(0, 0, 0, 0.06);
  --mb: rgba(246, 244, 252, 0.62);
  --mb-tx: #1d1d1f;
  --wall: linear-gradient(160deg, #7d97e0 0%, #9c7fd6 45%, #c58fc0 75%, #e7b0a2 100%);
  --red: #ff3b30; --blue: #007aff; --green: #34c759; --orange: #ff9500; --cyan: #32ade6; --indigo: #5856d6; --pink: #ff2d55; --purple: #af52de;
  --cursor-fill: #000; --cursor-line: #fff;
}
@media (prefers-color-scheme: dark) {
  .demo {
    --tx: rgba(255, 255, 255, 0.94);
    --tx2: rgba(235, 235, 245, 0.60);
    --tx3: rgba(235, 235, 245, 0.30);
    --pop: rgba(40, 34, 70, 0.66);
    --pop-line: rgba(255, 255, 255, 0.16);
    --pop-hi: rgba(255, 255, 255, 0.14);
    --card: rgba(22, 18, 44, 0.46);
    --card-line: rgba(255, 255, 255, 0.08);
    --ink: #fff;
    --bar-op: 0.08;
    --sel-op: 0.13;
    --rowbg-op: 0.07;
    --track: rgba(255, 255, 255, 0.10);
    --grid: rgba(235, 235, 245, 0.22);
    --btn: rgba(255, 255, 255, 0.10);
    --btn-line: rgba(255, 255, 255, 0.08);
    --mb: rgba(30, 26, 52, 0.55);
    --mb-tx: rgba(255, 255, 255, 0.92);
    --wall: linear-gradient(160deg, #2f3b86 0%, #4a3488 45%, #6d3a78 75%, #8a4a5a 100%);
    --red: #ff453a; --blue: #0a84ff; --green: #30d158; --orange: #ff9f0a; --cyan: #64d2ff; --indigo: #5e5ce6; --pink: #ff375f; --purple: #bf5af2;
  }
}

.demo .stage, .demo .stage *, .demo .stage-flow, .demo .stage-flow * { box-sizing: border-box; }
.demo .stage, .demo .stage-flow {
  font: 13px/1.25 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  color: var(--tx);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  user-select: none;
}
.demo .i { width: 1em; height: 1em; fill: currentColor; display: inline-block; vertical-align: -0.125em; flex: none; }
.demo .abs { position: absolute; left: 0; top: 0; }

/* ---------- desktop + menu bar ---------- */
.demo .desk { position: absolute; inset: 0; border-radius: 22px; background: var(--wall); overflow: hidden; box-shadow: 0 30px 80px rgba(10, 10, 40, 0.40); }
.demo-hero .desk { border: 1px solid rgba(255, 255, 255, 0.22); }
.demo .mbar {
  position: absolute; left: 0; right: 0; top: 0; height: 28px;
  display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 0 12px;
  background: var(--mb); color: var(--mb-tx); font-size: 13px; font-weight: 500;
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
}
.demo .mi { position: relative; height: 22px; display: flex; align-items: center; justify-content: center; padding: 0 7px; }
.demo .mi > * { position: relative; }
.demo .mi .hl { position: absolute; inset: 0; border-radius: 6px; background: var(--ink); opacity: 0; transition: opacity 0.15s; }
.demo .mi.on .hl { opacity: 0.12; }
.demo .mi .clock { font-variant-numeric: tabular-nums; }
.demo .spark { width: 34px; height: 16px; display: block; }
.demo .netmb { width: 46px; height: 18px; display: flex; flex-direction: column; justify-content: center; font: 500 9px/9px ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: -0.02em; }
.demo .mbtext { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; }
.demo .mbtext .i { font-size: 13px; }
.demo .mbars { width: 15px; height: 16px; display: block; }

/* ---------- popover ---------- */
.demo .pop {
  position: absolute; width: 392px; padding: 14px; border-radius: 26px;
  background: var(--pop); border: 1px solid var(--pop-line);
  box-shadow: inset 0 1px 0 var(--pop-hi), 0 24px 64px rgba(8, 6, 30, 0.38);
  backdrop-filter: blur(28px) saturate(170%); -webkit-backdrop-filter: blur(28px) saturate(170%);
  transform-origin: 50% 0;
}
.demo .pop.anim { transition: opacity 0.22s ease-out, transform 0.28s cubic-bezier(0.2, 0.9, 0.25, 1); }
.demo .pop.shut { opacity: 0; transform: translateY(-6px) scale(0.97); pointer-events: none; }
.demo .pop > * + * { margin-top: 12px; }
.demo .gc { position: relative; border-radius: 22px; background: var(--card); border: 1px solid var(--card-line); box-shadow: inset 0 1px 0 var(--pop-hi); }

/* header + morphing tab bar */
.demo .hdr { position: relative; height: 34px; }
.demo .tabs { position: absolute; left: 0; top: 0; height: 34px; }
.demo .cap { position: absolute; left: 0; top: 0; }
.demo .cap i { position: absolute; left: 0; top: 0; background: var(--ink); transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.25, 1); }
.demo .cap.bar { opacity: var(--bar-op); }
.demo .cap.bar i { height: 34px; border-radius: 17px; }
.demo .cap.sel { opacity: var(--sel-op); top: 2px; }
.demo .cap.sel i { height: 30px; border-radius: 15px; background: var(--tint, var(--ink)); }
.demo .tab {
  position: absolute; left: 0; top: 2px; height: 30px; display: flex; align-items: center; gap: 5px; padding: 0 8px;
  font-size: 12px; font-weight: 600; color: var(--tx2); white-space: nowrap;
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.25, 1);
}
.demo .tab .i { width: 16px; font-size: 13px; }
.demo .tab .t { opacity: 0; transform: scale(0.9); transition: opacity 0.2s, transform 0.3s cubic-bezier(0.2, 0.9, 0.25, 1); }
.demo .tab.on { color: var(--tx); padding: 0 11px; }
.demo .tab.on .t { opacity: 1; transform: none; }
.demo .more { position: absolute; right: 0; top: 2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--btn); border: 1px solid var(--btn-line); font-size: 14px; }

/* graph card */
.demo .gcard { height: 214px; }
.demo .pnl { position: absolute; inset: 0; padding: 14px; opacity: 0; transition: opacity 0.25s; }
.demo .pnl.on { opacity: 1; }
.demo .head { display: flex; align-items: baseline; gap: 8px; height: 36px; }
.demo .big { font: 600 30px/36px ui-rounded, "SF Pro Rounded", -apple-system, sans-serif; letter-spacing: -0.01em; }
.demo .cap2 { font-size: 13px; font-weight: 500; color: var(--tx2); }
.demo .det { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--tx2); }
.demo .badge { margin-left: auto; align-self: center; font-size: 11px; font-weight: 600; color: var(--green); padding: 3px 8px; border-radius: 99px; position: relative; }
.demo .badge::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: currentColor; opacity: 0.15; }
.demo .rate { display: flex; align-items: baseline; gap: 4px; margin-right: 10px; }
.demo .rate .i { font-size: 13px; align-self: center; }
.demo .rate b { font: 600 22px/36px ui-rounded, "SF Pro Rounded", -apple-system, sans-serif; }
.demo .chart { display: block; margin-top: 10px; width: 362px; height: 100px; overflow: visible; }
.demo .chart .gl { stroke: var(--grid); stroke-width: 0.5; stroke-dasharray: 2 3; fill: none; }
.demo .chart text { fill: var(--tx2); font-size: 9px; }
.demo .stats { display: flex; gap: 8px; margin-top: 10px; }
.demo .stat { flex: 1 1 0; min-width: 0; }
.demo .stat .l { font-size: 10px; font-weight: 500; color: var(--tx2); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.demo .stat .l i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.demo .stat .v { font-size: 12px; font-weight: 600; white-space: nowrap; margin-top: 2px; }

/* search */
.demo .search { height: 32px; border-radius: 16px; display: flex; align-items: center; gap: 7px; padding: 0 12px; background: var(--card); border: 1px solid var(--card-line); color: var(--tx2); }
.demo .search .i { font-size: 12px; }

/* process list */
.demo .list { height: 347px; overflow: hidden; }
.demo .lh { position: relative; height: 29px; padding: 10px 12px 0; font-size: 11px; font-weight: 600; color: var(--tx2); }
.demo .lh .col { position: absolute; right: 12px; top: 10px; opacity: 0; transition: opacity 0.25s; }
.demo .lh .col.on { opacity: 1; }
.demo .layer { position: absolute; left: 6px; right: 6px; top: 29px; opacity: 0; transition: opacity 0.25s; }
.demo .layer.on { opacity: 1; }
.demo .row { position: absolute; left: 0; right: 0; top: 0; height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.demo .row .nm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.demo .row .n { font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.demo .root { font-size: 9px; font-weight: 600; color: var(--tx2); padding: 1px 4px; border-radius: 99px; position: relative; }
.demo .root::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--tx2); opacity: 0.18; }
.demo .vb { position: relative; height: 4px; width: 214px; border-radius: 2px; background: var(--track); }
.demo .vb i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; min-width: 3px; }
.demo .row .val { width: 72px; text-align: right; font-size: 12px; font-weight: 600; }
.demo .chev { font-size: 9px; color: var(--tx3); width: 10px; transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.25, 1); }
.demo .row.x .chev { transform: rotate(90deg); }
.demo .ico { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; flex: none; font-size: 11px; color: var(--tx2); position: relative; }
.demo .ico.sys::before { content: ""; position: absolute; inset: 1px; border-radius: 6px; background: var(--tx2); opacity: 0.2; }
.demo .ico .i { position: relative; }
.demo .ico.app { border-radius: 6px; color: #fff; font-size: 13px; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.18); }

/* footer */
.demo .foot { padding: 0 4px; font-size: 11px; color: var(--tx2); }
.demo .foot .r1 { display: flex; gap: 12px; align-items: center; }
.demo .foot .r1 b { font-weight: 400; color: var(--tx); opacity: 0.8; }
.demo .foot .r1 .th { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.demo .foot .r2 { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.demo .foot .r2 .sp { flex: 1; }
.demo .gb { height: 22px; padding: 0 10px; border-radius: 11px; display: inline-flex; align-items: center; font-size: 11px; font-weight: 500; color: var(--tx); background: var(--btn); border: 1px solid var(--btn-line); white-space: nowrap; }
.demo .gb.pro { background: var(--blue); color: #fff; border-color: transparent; }
.demo .gb.red { color: var(--red); }
.demo .gb.ic { padding: 0 8px; font-size: 12px; }

/* expanded row (quit demo) */
.demo .rowbg { position: absolute; left: 0; right: 0; top: 0; opacity: 0; transition: opacity 0.28s; }
.demo .rowbg.on { opacity: var(--rowbg-op); }
.demo .rowbg i { position: absolute; left: 0; right: 0; top: 0; height: 160px; border-radius: 14px; background: var(--ink); transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.25, 1); }
.demo .mv { transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.25, 1), opacity 0.28s; }
.demo .detail { position: absolute; left: 8px; right: 8px; top: 40px; font-size: 11px; opacity: 0; transform: translateY(-10px); }
.demo .detail.on { opacity: 1; transform: none; }
.demo .grid2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; row-gap: 5px; }
.demo .grid2 .l { font-size: 10px; color: var(--tx2); }
.demo .grid2 .v { font-size: 11.5px; font-weight: 500; margin-top: 1px; }
.demo .acts { position: absolute; left: 0; right: 0; top: 150px; display: flex; gap: 6px; transition: opacity 0.2s; }
.demo .acts .sp { flex: 1; }
.demo .acts.off { opacity: 0; }
.demo .confirm { position: absolute; left: 0; right: 0; top: 150px; padding: 10px; border-radius: 12px; opacity: 0; transform: translateY(-4px); transition: opacity 0.22s, transform 0.28s cubic-bezier(0.2, 0.9, 0.25, 1); }
.demo .confirm::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--blue); opacity: 0.08; }
.demo .confirm.on { opacity: 1; transform: none; }
.demo .confirm p { position: relative; margin: 0 0 8px; font-size: 11.5px; font-weight: 500; }
.demo .confirm .bt { position: relative; display: flex; justify-content: flex-end; gap: 6px; }
.demo .press { transition: transform 0.12s; }
.demo .press.dn { transform: scale(0.94); }
.demo .fade { transition: opacity 0.4s; }
.demo .fade.out { opacity: 0; }

/* cursor */
.demo .cursor { position: absolute; left: 0; top: 0; width: 17px; height: 25px; z-index: 5; will-change: transform; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.35)); }
.demo .cursor svg { display: block; width: 100%; height: 100%; transition: transform 0.12s; transform-origin: 3px 3px; }
.demo .cursor.dn svg { transform: scale(0.86); }

/* menu bar styles strip */
.demo-menubar .mstrip { position: relative; padding-bottom: 16px; border-radius: 16px; background: var(--wall); overflow: hidden; box-shadow: var(--shadow); }
.demo-menubar .mbar { position: relative; height: 30px; border-radius: 0; }
.demo-menubar .styleslot { position: relative; width: 74px; height: 22px; }
.demo-menubar .sty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transform: translateY(4px); transition: opacity 0.3s, transform 0.35s cubic-bezier(0.2, 0.9, 0.25, 1); }
.demo-menubar .sty.on { opacity: 1; transform: none; }
.demo-menubar .names { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 14px 12px 0; }
.demo-menubar .nm2 { position: relative; font-size: 12px; font-weight: 500; color: var(--tx); padding: 4px 10px; border-radius: 99px; opacity: 0.55; transition: opacity 0.3s; white-space: nowrap; }
.demo-menubar .nm2::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--pop); border: 1px solid var(--pop-line); opacity: 0; transition: opacity 0.3s; }
.demo-menubar .nm2 span { position: relative; }
.demo-menubar .nm2.on { opacity: 1; }
.demo-menubar .nm2.on::before { opacity: 1; }
.demo-menubar.static .nm2 { opacity: 1; }

/* section that holds the quit demo */
.quit-demo { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.quit-demo ul { margin: 0; padding-left: 20px; color: var(--muted); }
.quit-demo li { margin-bottom: 6px; }
@media (max-width: 860px) {
  .quit-demo { grid-template-columns: 1fr; }
}

/* colors and app tiles */
.demo .c-blue { color: var(--blue); } .demo .c-red { color: var(--red); } .demo .c-green { color: var(--green); }
.demo .c-orange { color: var(--orange); } .demo .c-cyan { color: var(--cyan); } .demo .c-indigo { color: var(--indigo); }
.demo .c-pink { color: var(--pink); } .demo .c-purple { color: var(--purple); }
.demo .vb i, .demo .stat .l i { background: currentColor; }
.demo .ap-xcode { background: linear-gradient(160deg, #6fd0ff, #1667e0); }
.demo .ap-safari { background: linear-gradient(160deg, #7fd8ff, #0f74f2); }
.demo .ap-music { background: linear-gradient(160deg, #ff7a8e, #f5203d); }
.demo .ap-mail { background: linear-gradient(160deg, #6cc0ff, #1868ef); }
.demo .mi > .i { font-size: 16px; }
.demo .mv-ico { display: contents; }

@media (prefers-reduced-motion: reduce) {
  .demo *, .demo *::before { transition: none !important; }
}
.demo-quit:not(.js) { display: none; }
