/* The recorder animations on the home and download pages (_recorder_demo.html).
 *
 * They run on the guide animations' stage, motion vocabulary and script
 * (use-case-demo.css, use-case-demo.js), which load first. This file adds the
 * figure's frame and the pieces only the recorders draw: the desktop app, the
 * recorded app window on a desktop, and the Studio tab both recorders end in.
 */

/* ---------- figure ---------- */
.rec-demo { min-width: 0; }
.rec-demo .demo-head { margin-bottom: 8px; }
.rec-demo .rec-demo-kicker { color: var(--fg-3); font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: var(--track-label); text-transform: uppercase; }
.rec-demo .rec-demo-title { font-size: clamp(22px, 2vw, 26px); letter-spacing: -0.03em; line-height: 1.15; }
/* Pages around the figure style bare p and li (.v2-rec p, .v2-rec li); the
   figure's own text keeps the guide animations' look. */
.rec-demo .demo-caption { min-height: 3.2em; color: var(--fg); font-size: 15px; line-height: 1.6; }
.rec-demo .demo-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.rec-demo .demo-steps li { display: block; color: inherit; font-size: inherit; }
.rec-demo .demo-step-title { font-size: 14px; }
.rec-demo .demo-step-bar { margin-bottom: 8px; }
.rec-demo .demo-callout { color: var(--bg); font-size: 0.78em; line-height: 1.35; }

/* ---------- shared marks ---------- */
.rec-demo .demo-window { --rd-lime: oklch(80% 0.18 128); }
.rd-dot { display: inline-block; flex: none; width: 0.55em; height: 0.55em; margin-right: 0.45em; border-radius: 50%; background: currentColor; vertical-align: 0.05em; }
.rd-dot.is-rec { background: var(--danger); }
.rd-swap { display: grid; }
.rd-swap > span { grid-area: 1 / 1; overflow: hidden; text-overflow: ellipsis; }
.demo-popup small { display: flex; align-items: center; flex-wrap: wrap; gap: 0 0.35em; }
.demo-popup small b { color: var(--fg); font-family: var(--font-mono); }
.demo-popup-btn > span { display: inline-flex; align-items: center; }
.rd-ok { color: var(--sig); font-weight: 800; }

/* ---------- the sample site in Chrome ---------- */
.rd-cards { margin-bottom: 0.9em; }

/* ---------- desktop app ---------- */
.rd-app { display: flex; flex-direction: column; background: var(--bg); }
.rd-titlebar { display: flex; align-items: center; gap: 0.9em; flex: none; height: 2.6em; padding: 0 1em; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.rd-titlebar img { width: 1.25em; height: 1.25em; border-radius: 0.3em; }
.rd-titlebar b { font-size: 0.85em; }
.rd-titlebar small { color: var(--fg-3); font-family: var(--font-mono); font-size: 0.68em; white-space: nowrap; }
.rd-brand { display: flex; align-items: center; gap: 0.5em; min-width: 0; }
.rd-stepper { display: flex; align-items: center; gap: 0.6em; flex: none; height: 3.4em; padding: 0 1.6em; border-bottom: 1px solid var(--line); color: var(--fg-3); font-family: var(--font-mono); font-size: 0.72em; }
.rd-stepper > span { display: flex; align-items: center; gap: 0.5em; white-space: nowrap; }
.rd-stepper em { font-style: normal; }
.rd-stepper > span::before { content: ""; flex: none; width: 0.8em; height: 0.8em; border: 0.15em solid var(--line-2); border-radius: 50%; }
.rd-stepper > span.is-done::before { border-color: var(--fg-3); background: var(--fg-3); }
.rd-stepper > span.is-now { color: var(--sig); font-weight: 700; }
.rd-stepper > span.is-now::before { border-color: var(--sig); background: var(--sig); box-shadow: 0 0 0 0.3em var(--sig-dim); }
.rd-stepper > i { flex: 1; min-width: 0.6em; height: 1px; background: var(--line); }
.rd-body { position: relative; display: flex; flex-direction: column; gap: 0.9em; flex: 1; min-height: 0; padding: 1.2em 1.4em; }
.rd-heading { display: flex; align-items: center; gap: 0.5em; font-family: var(--font-display); font-size: 1.3em; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; }
.rd-heading svg { flex: none; width: 1em; height: 1em; color: var(--sig); }
.rd-foot { display: flex; align-items: center; justify-content: flex-end; gap: 0.9em; flex: none; min-height: 3.2em; margin-top: auto; padding-top: 0.8em; border-top: 1px solid var(--line); }

/* 01 · what to record */
.rd-targets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9em; flex: 1; min-height: 0; }
.rd-target { position: relative; display: flex; flex-direction: column; gap: 0.5em; min-height: 0; padding: 0.7em; border: 1px solid var(--line); border-radius: 0.8em; background: var(--bg-2); }
.rd-target-on { position: absolute; inset: -1px; border: 0.14em solid var(--sig); border-radius: inherit; box-shadow: 0 0 0 0.3em var(--sig-dim); pointer-events: none; }
.rd-target-fig { position: relative; flex: 1; min-height: 4.4em; overflow: hidden; border: 1px solid var(--line); border-radius: 0.5em; background: var(--bg); }
.rd-target-name { display: flex; align-items: center; flex-wrap: wrap; gap: 0.3em 0.5em; font-size: 0.82em; font-weight: 800; }
.rd-badge { position: absolute; top: 1.1em; right: 1.1em; padding: 0.2em 0.6em; border-radius: var(--radius-round); background: var(--sig); color: var(--bg); font-size: 0.62em; font-weight: 800; white-space: nowrap; }
.rd-fig-win { position: absolute; border: 1px solid var(--line-2); border-radius: 0.3em; background: var(--bg-3); }
.rd-fig-win::before { content: ""; position: absolute; left: 0.35em; right: 0.35em; top: 0.35em; height: 0.3em; border-radius: 0.15em; background: var(--line); }
.rd-fig-win.is-sig { border: 0.14em solid var(--sig); box-shadow: 0 0 0.7em var(--sig-dim); }
.rd-fig-win.is-screen { background: transparent; }
.rd-fig-win.is-screen::before { display: none; }
.rd-chip { display: inline-flex; align-items: center; gap: 0.4em; padding: 0.15em 0.55em 0.15em 0.3em; border-radius: 0.4em; background: var(--sig-dim); color: var(--sig); font-size: 0.85em; white-space: nowrap; }
.rd-app-icon { flex: none; width: 1.1em; height: 1.1em; border-radius: 0.28em; background: var(--app-accent); }
.rd-app-icon.is-green { background: oklch(62% 0.14 155); }
.rd-app-icon.is-orange { background: oklch(70% 0.15 60); }
.rd-picker { position: absolute; z-index: 3; left: 0.7em; right: 0.7em; top: 58%; display: flex; flex-direction: column; gap: 0.2em; padding: 0.4em; border: 1px solid var(--line-2); border-radius: 0.6em; background: var(--bg-4); box-shadow: var(--shadow-md); }
.rd-picker-row { position: relative; isolation: isolate; display: flex; align-items: center; gap: 0.55em; padding: 0.45em 0.5em; border-radius: 0.4em; font-size: 0.78em; font-weight: 700; white-space: nowrap; }
.rd-picker-row > i:not([class]) { flex: 1; max-width: 7em; height: 0.45em; border-radius: 0.2em; background: var(--line-2); }
.rd-picker-on { position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--sig-dim); box-shadow: inset 0 0 0 0.1em var(--sig); }

/* 03 · saved, then sent to Studio */
.rd-saved { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.7em; }
.rd-saved > span { position: relative; display: block; }
.rd-saved b { position: absolute; left: 0.35em; bottom: 0.3em; padding: 0 0.35em; border-radius: 0.25em; background: var(--bg); color: var(--fg-2); font-family: var(--font-mono); font-size: 0.6em; }
.rd-progress { display: flex; align-items: center; gap: 0.7em; margin-right: auto; color: var(--fg-2); font-size: 0.75em; white-space: nowrap; }
.rd-progress > span { position: relative; display: block; width: 8em; height: 0.4em; overflow: hidden; border-radius: 0.2em; background: var(--line); }
.rd-progress > span > i { position: absolute; inset: 0; background: var(--sig); }

/* ---------- 02 · an app window recorded on a desktop ---------- */
.rd-desktop { background: radial-gradient(120% 90% at 18% 0%, oklch(33% 0.07 268 / 0.9), transparent 62%), linear-gradient(160deg, oklch(22% 0.04 262), oklch(15% 0.03 285)); }
.rd-frame { position: absolute; left: 4%; top: 10%; width: 62%; height: 80%; border-radius: 0.8em; box-shadow: 0 0 0 0.18em var(--sig), 0 0 1.6em var(--sig-dim); }
.rd-frame-tag { position: absolute; z-index: 2; left: 0; bottom: calc(100% + 0.5em); display: flex; align-items: center; padding: 0.2em 0.6em; border-radius: 0.4em; background: var(--sig); color: var(--bg); font-family: var(--font-mono); font-size: 0.66em; font-weight: 800; letter-spacing: 0.06em; }
.rd-native { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: inherit; background: var(--app-bg); color: var(--app-fg); }
.rd-native-bar { display: flex; align-items: center; gap: 0.8em; flex: none; height: 2.2em; padding: 0 0.8em; border-bottom: 1px solid var(--app-line); background: var(--app-side); font-size: 0.85em; }
.rd-native-bar .demo-dots i { background: var(--app-line); }
.rd-native-bar b { font-size: 0.85em; }
.rd-native-body { display: flex; flex: 1; min-height: 0; }
.rd-tools { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; gap: 0.35em; flex: none; width: 2.8em; padding-top: 0.6em; border-right: 1px solid var(--app-line); background: var(--app-side); }
.rd-tool { position: relative; display: grid; place-items: center; width: 2em; height: 2em; color: var(--app-fg-2); }
.rd-tool svg { width: 1.05em; height: 1.05em; }
.rd-tool-on { position: absolute; z-index: -1; left: 0.4em; top: calc(0.6em + var(--n) * 2.35em); width: 2em; height: 2em; border-radius: 0.45em; background: oklch(55% 0.17 262 / 0.16); }
.rd-art { position: relative; display: grid; place-items: center; flex: 1; min-width: 0; padding: 1em; background: oklch(94% 0.006 265); }
.rd-board { position: relative; width: 100%; max-width: 22em; aspect-ratio: 4 / 3; border-radius: 0.3em; background: #fff; box-shadow: 0 0.2em 0.8em oklch(20% 0.02 265 / 0.12); }
/* The artboard and the recorded thumbnails share one geometry, so a scene in
   the tray or in Studio is the frame it was recorded from. */
.rd-circle { position: absolute; left: 18%; top: 20%; width: 34%; aspect-ratio: 1; border-radius: 50%; background: var(--app-accent); }
.rd-circle.is-lime { background: var(--rd-lime); }
.rd-circle.is-big { left: 12%; top: 10%; width: 46%; }
.rd-rect { position: absolute; right: 12%; bottom: 16%; width: 34%; height: 36%; border-radius: 0.2em; background: var(--app-fg); }
.rd-inspect { display: flex; flex-direction: column; gap: 0.8em; flex: none; width: 27%; padding: 0.9em 0.8em; border-left: 1px solid var(--app-line); background: var(--app-side); }
.rd-swatches { display: flex; flex-wrap: wrap; gap: 0.4em; }
.rd-swatch { position: relative; width: 1.25em; height: 1.25em; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px oklch(20% 0.02 265 / 0.12); }
.rd-slider { position: relative; height: 0.3em; margin: 0.5em 0.4em; border-radius: 0.15em; background: var(--app-line); }
.rd-knob { position: absolute; top: 50%; left: var(--p, 25%); width: 1em; height: 1em; margin: -0.5em 0 0 -0.5em; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0.12em var(--app-accent); }
.rd-line { height: 0.4em; border-radius: 0.2em; background: var(--app-line); }
.rd-line.is-short { width: 60%; }
.rd-native .demo-flash { top: 2.2em; }
.rd-panel { position: absolute; right: 4%; bottom: 10%; width: 26%; display: flex; flex-direction: column; gap: 0.55em; padding: 0.8em 0.9em; border: 1px solid var(--line-2); border-radius: 0.8em; background: var(--bg-2); box-shadow: var(--shadow-md); }
.rd-panel-head { display: flex; align-items: center; gap: 0.45em; font-size: 0.72em; font-weight: 800; }
.rd-panel-head img { width: 1.3em; height: 1.3em; border-radius: 0.3em; }
.rd-live { display: flex; align-items: center; color: var(--fg-2); font-size: 0.72em; font-weight: 700; white-space: nowrap; }
.rd-live .rd-dot { animation: rd-pulse 1.2s ease-in-out infinite; }
@keyframes rd-pulse { 50% { opacity: 0.35; } }
.rd-count-label { color: var(--fg-3); font-size: 0.68em; font-weight: 700; }
.rd-count { display: grid; font-family: var(--font-display); font-size: 2em; font-weight: 800; line-height: 1; }
.rd-count > span { grid-area: 1 / 1; }
.rd-toast { position: absolute; right: 4%; top: 10%; width: 26%; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0.35em 0.55em; padding: 0.7em 0.75em; border: 1px solid var(--line-2); border-radius: 0.7em; background: var(--bg-4); box-shadow: var(--shadow-md); }
.rd-toast b { overflow: hidden; font-size: 0.72em; white-space: nowrap; text-overflow: ellipsis; }
.rd-toast > .rd-line { grid-column: 1 / -1; background: var(--line-2); }
.rd-toast-tag { grid-column: 1 / -1; justify-self: start; margin-top: 0.2em; padding: 0.15em 0.55em; border: 1px dashed var(--fg-3); border-radius: 0.4em; color: var(--fg-2); font-size: 0.66em; font-weight: 800; white-space: nowrap; }

/* ---------- recorded thumbnails ---------- */
.rd-mini-draw { position: relative; display: flex; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 0.35em; background: var(--app-bg); box-shadow: 0 0 0 1px var(--line); }
.rd-mini-draw > i { display: block; }
.rd-mini-rail { flex: none; width: 9%; border-right: 1px solid var(--app-line); background: var(--app-side); }
.rd-mini-art { display: grid; place-items: center; flex: 1; min-width: 0; padding: 7%; background: oklch(94% 0.006 265); }
.rd-mini-art > i { position: relative; display: block; width: 100%; max-height: 100%; aspect-ratio: 4 / 3; border-radius: 0.15em; background: #fff; }
.rd-mini-side { position: relative; flex: none; width: 24%; border-left: 1px solid var(--app-line); background: var(--app-side); }
.rd-mini-swatches { display: flex; flex-wrap: wrap; gap: 0.5em 8%; padding: 16% 12%; }
.rd-mini-swatches > i { position: relative; display: block; width: 20%; aspect-ratio: 1; border-radius: 50%; background: var(--app-accent); }
.rd-mini-swatches > i:nth-child(2) { background: var(--rd-lime); }
.rd-mini-swatches > i:nth-child(3) { background: oklch(70% 0.15 60); }
.rd-mini-swatches > i:nth-child(4) { background: oklch(60% 0.15 300); }
.rd-mini-target .demo-bubble { left: auto; right: calc(100% + 1.4em); }

/* ---------- Studio, where both recorders end ---------- */
.rd-overlay { position: absolute; inset: 0; z-index: 7; display: flex; flex-direction: column; background: var(--bg); }
.rd-studio-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.rd-studio-body .demo-canvas { flex: 1; min-height: 0; }
.rd-studio-body .demo-canvas .rd-mini-draw { width: min(100cqw, 100cqh * 16 / 10); font-size: 1.15em; }
.rd-timeline { position: relative; flex: none; padding: 0.7em 1em 0.8em; border-top: 1px solid var(--line); }
.rd-ruler { display: block; height: 0.45em; margin-bottom: 0.4em; background: repeating-linear-gradient(90deg, var(--ruler-tick) 0 1px, transparent 1px 1.2em); }
.rd-clips { display: flex; gap: 0.25em; height: 2.1em; }
.rd-clip { position: relative; display: flex; align-items: center; flex: var(--w) 1 0; min-width: 0; padding: 0 0.55em; border: 1px solid var(--clip-border); border-radius: var(--clip-radius); background: var(--clip-bg); color: var(--fg-2); font-family: var(--font-mono); font-size: 0.7em; font-weight: 700; }
.rd-clip > span { position: relative; }
.rd-clip-on ~ span { color: var(--sig); }
.rd-clip-on { position: absolute; inset: -1px; border: 1px solid var(--clip-border-selected); border-radius: inherit; background: var(--clip-bg-selected); }
.rd-clip-on::before { content: ""; position: absolute; left: -0.3em; top: -0.9em; bottom: -0.5em; width: var(--playhead-width); background: var(--playhead); }

@container (max-width: 560px) {
  .rd-targets { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); }
  .rd-inspect { width: 30%; padding-inline: 0.6em; }
  .rd-frame { top: 13%; width: 60%; height: 74%; }
  .rd-saved { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 28em; }
  .rd-panel, .rd-toast { width: 28%; }
  .demo-shots { max-width: calc(100% - 2em); }
}
@media (max-width: 760px) {
  .rec-demo .demo-steps { gap: 12px; }
  .rec-demo .demo-step-title { font-size: 13px; }
}
