/* Click Simulator: light, tactile, toy-like. Palette follows the Click renders
   (white shell, amber keys, green LED windows) on the #f0f0f0 stage of the hero viewer. */
:root {
  --bg: #f0f0f0;
  --bg-2: #e6e6e6;
  --ink: #121212;
  --ink-2: #4b4b4b;
  --mute: #8a8a8a;
  --card: #ffffff;
  --line: rgba(18, 18, 18, 0.09);
  --yellow: #f4c421;
  --yellow-hi: #ffd84a;
  --yellow-lo: #c99a0a;
  --green: #4fae6c;
  --blue: #3b6df0;
  --code-bg: #14181c;
  --code-ink: #d7dde4;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 10px;
  --shadow-card: 0 1px 0 #fff inset, 0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 26px -8px rgba(0, 0, 0, 0.12);
  --shadow-pop: 0 1px 0 #fff inset, 0 2px 4px rgba(0, 0, 0, 0.06), 0 18px 34px -10px rgba(0, 0, 0, 0.2);
  --font-ui: "Outfit", ui-rounded, "SF Pro Rounded", "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Manrope", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
code, kbd, pre { font-family: var(--font-mono); }
h2, h3 { font-family: var(--font-ui); margin: 0; letter-spacing: -0.01em; }
.skip { position: absolute; left: 8px; top: -48px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 99; }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
.eyebrow { display: block; font: 500 11px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); }
kbd { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; }

/* ---------- layout ---------- */
.app {
  display: grid;
  grid-template-columns: clamp(280px, 21vw, 340px) minmax(380px, 1fr) clamp(580px, 47vw, 860px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top top top" "lib stage pipe" "foot foot foot";
  height: 100vh; height: 100dvh;
}
.app > * { min-width: 0; }
.topbar { grid-area: top; }
.library { grid-area: lib; }
.stage-wrap { grid-area: stage; }
.pipeline { grid-area: pipe; }
.credit { grid-area: foot; }

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 22px 6px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-ui); }
.brand-mark { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 30px; height: 26px; padding: 5px; background: #fff; border-radius: 10px; box-shadow: var(--shadow-card); }
.brand-mark i { background: var(--yellow); border-radius: 3px; box-shadow: 0 2px 0 var(--yellow-lo); }
.brand-name { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.brand-sub { font: 500 11px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); padding-top: 3px; }
.tagline { margin: 0 auto; font: 500 12px var(--font-mono); letter-spacing: 0.06em; color: var(--ink-2); }
.tagline b { color: var(--yellow-lo); padding: 0 6px; }
.topbar-actions { display: flex; gap: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px;
  background: #fff; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 999px;
  font: 600 13px var(--font-ui); box-shadow: 0 1px 0 #fff inset;
  transition: transform .12s ease, border-bottom-width .12s ease, background .15s ease;
}
.chip:hover { background: #fffdf3; }
.chip:active { transform: translateY(2px); border-bottom-width: 1px; }
.chip-sm { height: 28px; padding: 0 11px; font-size: 12px; }
.chip[aria-pressed="false"] { color: var(--mute); }

/* ---------- prompt library ---------- */
.library { padding: 12px 8px 12px 22px; overflow-y: auto; min-height: 0; }
.lib-head { padding: 8px 8px 14px 2px; }
.lib-head h2 { font-size: 24px; margin: 8px 0 6px; font-weight: 650; }
.lib-head p { margin: 0; color: var(--ink-2); font-size: 13px; }
.cards { list-style: none; margin: 0; padding: 0 12px 8px 2px; display: grid; gap: 12px; }

.card {
  --tint: #eee;
  position: relative; width: 100%; text-align: left;
  display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: start;
  padding: 12px 14px 14px;
  background: var(--card); border: 2px solid transparent; border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), box-shadow .18s ease, border-color .15s;
  overflow: hidden;
}
.card:hover { transform: translateY(-3px) rotate(-0.4deg); box-shadow: var(--shadow-pop); }
.card:active { transform: translateY(1px) scale(.985); }
.card .glyph {
  display: grid; place-items: center; width: 56px; height: 56px; font-size: 28px;
  background: var(--tint); border-radius: 18px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: transform .3s cubic-bezier(.3, 1.8, .5, 1);
}
.card:hover .glyph { transform: rotate(-8deg) scale(1.08); }
.card .body { display: block; min-width: 0; }
.card .title { display: block; font: 650 17px/1.25 var(--font-ui); margin: 1px 0 3px; letter-spacing: -0.01em; }
.card .prompt { display: block; margin: 0 0 8px; color: var(--ink-2); font-size: 12.5px; line-height: 1.4; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag, .badge {
  font: 500 10.5px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 999px; background: #f3f3f3; color: var(--ink-2);
}
.badge.best { background: #fff6d6; color: #7a5a00; }
.badge.live { background: #e3f6ea; color: #1d7a3f; }
.card .progress-strip { position: absolute; left: 0; bottom: 0; height: 4px; width: calc(var(--p, 0) * 1%); background: linear-gradient(90deg, var(--yellow), var(--yellow-hi)); border-radius: 0 4px 4px 0; transition: width .25s linear; }
.card[aria-current="true"] { border-color: var(--yellow); }
.card[aria-current="true"] .glyph { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px) rotate(4deg); } }
.lib-foot { padding: 6px 14px 20px 4px; margin: 6px 0 0; color: var(--mute); font-size: 12px; }
.linklike { display: block; margin-top: 8px; padding: 0; background: none; border: 0; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; font-size: 12px; }

/* ---------- stage ---------- */
.stage-wrap { padding: 6px 8px 8px; min-height: 0; min-width: 0; }
.stage {
  position: relative; height: 100%; min-height: 360px; border-radius: 32px; overflow: hidden;
  background:
    radial-gradient(70% 55% at 50% 42%, #fff 0%, rgba(255, 255, 255, 0) 70%),
    radial-gradient(120% 90% at 50% 30%, #f6f6f6 0%, #ececec 55%, #dedede 100%);
  box-shadow: 0 1px 0 #fff inset, 0 0 0 1px var(--line), 0 20px 40px -20px rgba(0, 0, 0, 0.25);
  touch-action: none;
}
.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
.stage-status {
  position: absolute; left: 18px; top: 16px; z-index: 3; display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 14px 8px 12px; background: rgba(255, 255, 255, .86); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 999px; font: 600 13px var(--font-ui);
  box-shadow: var(--shadow-card); max-width: calc(100% - 150px);
}
.stage-status #status-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mute); flex: none; }
.app[data-phase="write"] .dot, .app[data-phase="compile"] .dot { background: var(--blue); animation: blink 1s infinite; }
.app[data-phase="burn"] .dot { background: #e8870e; animation: blink .6s infinite; }
.app[data-phase="play"] .dot { background: var(--green); box-shadow: 0 0 0 4px rgba(79, 174, 108, .2); }
@keyframes blink { 50% { opacity: .25; } }
.stage-tools { position: absolute; right: 16px; top: 16px; z-index: 3; display: flex; gap: 8px; }

.hud {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 2;
  display: flex; gap: 16px; padding: 6px 14px; border-radius: 12px; background: rgba(18, 18, 18, .86); color: #f6efdc;
  font: 500 12px var(--font-mono); letter-spacing: .04em; pointer-events: none;
}
.hud[hidden] { display: none; }
.hud em { font-style: normal; color: #a99f86; margin-right: 6px; }
.hud b { font-weight: 500; font-size: 14px; font-variant-numeric: tabular-nums; }

.actionbar {
  position: absolute; left: 0; right: 0; bottom: 18px; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none;
}
.pads { display: flex; gap: 12px; align-items: flex-end; }
.actionbar .pad-mode, .actionbar .hints-both { display: none; }
.app[data-keys="both"] .actionbar .pad-mode { display: grid; min-width: 118px; }
.app[data-keys="both"] .actionbar .hints-both { display: flex; }
.app[data-keys="both"] .actionbar .hints-one { display: none; }
.pad {
  pointer-events: auto; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  display: grid; place-items: center; gap: 1px; min-width: 184px; height: 62px; padding: 6px 28px;
  background: linear-gradient(180deg, var(--yellow-hi), var(--yellow)); color: #3a2c00;
  border: 0; border-bottom: 7px solid var(--yellow-lo); border-radius: 20px;
  box-shadow: 0 14px 22px -8px rgba(160, 120, 0, .45), 0 1px 0 rgba(255, 255, 255, .7) inset;
  transition: transform .06s ease, border-bottom-width .06s ease, box-shadow .06s ease;
}
.pad-label { font: 700 17px/1 var(--font-ui); letter-spacing: .08em; }
.pad-hint { font: 500 10px/1 var(--font-mono); letter-spacing: .04em; opacity: .65; }
.pad:active, .pad.is-down { transform: translateY(5px); border-bottom-width: 2px; box-shadow: 0 6px 10px -6px rgba(160, 120, 0, .5); }
.app[data-phase="play"] .pad.nudge { animation: nudge 1.4s ease-in-out 3; }
@keyframes nudge { 40% { transform: translateY(-6px); } 60% { transform: translateY(2px); } }
.hints { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin: 0; padding: 0 16px; color: var(--ink-2); font: 500 11px var(--font-mono); text-shadow: 0 1px 0 rgba(255, 255, 255, .8); }
.hints b { color: var(--ink); font-weight: 600; }

.usb {
  position: absolute; right: 18px; top: 66px; z-index: 4; width: 216px; padding: 12px 14px 14px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-pop); transform: translate(24px, 0) scale(.92); opacity: 0; pointer-events: none;
  transition: transform .35s cubic-bezier(.3, 1.6, .5, 1), opacity .25s ease;
}
.usb.on { transform: none; opacity: 1; }
.usb-head { display: flex; align-items: center; gap: 8px; font-family: var(--font-ui); }
.usb-state { margin-left: auto; font: 500 10px var(--font-mono); letter-spacing: .08em; color: #a86a00; background: #fff3d8; padding: 3px 7px; border-radius: 999px; }
.usb-file { display: flex; align-items: center; gap: 8px; margin: 12px 0 10px; font: 500 12px var(--font-mono); }
.usb-file em { margin-left: auto; font-style: normal; color: var(--mute); font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: #e9e9e9; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--yellow), var(--yellow-hi)); border-radius: 99px; }

.no-webgl { position: absolute; left: 50%; top: 62px; transform: translateX(-50%); z-index: 4; width: min(520px, calc(100% - 32px)); padding: 12px 16px; background: #fff7e0; border: 1px solid #f0d27a; border-radius: 14px; font-size: 13px; }
.no-webgl p { margin: 0; }
.no-webgl[hidden] { display: none; }

/* flat fallback device (no WebGL) */
.dev2d { position: absolute; left: 50%; top: 52%; width: min(300px, 44vh); aspect-ratio: 48.5 / 74.7; transform: translate(-50%, -52%); }
.dev2d .body { position: absolute; inset: 0; background: #fff; border-radius: 34% 34% 30% 30% / 20% 20% 14% 14%; box-shadow: 0 -4px 0 #ddd inset, 0 24px 30px -14px rgba(0, 0, 0, .35), 0 0 0 2px #ececec; }
.dev2d .screen { position: absolute; left: 26%; right: 26%; top: 17%; aspect-ratio: 2 / 1; background: #060607; border-radius: 4px; box-shadow: 0 0 0 4px #efefef, 0 0 0 5px #d8d8d8 inset; overflow: hidden; }
.dev2d .screen canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.dev2d .led { position: absolute; top: 17%; width: 5%; height: 20%; border-radius: 3px; background: #6bbf82; transition: background .05s, box-shadow .05s; }
.dev2d .led.l { left: 10%; } .dev2d .led.r { right: 10%; }
.dev2d .keys { position: absolute; left: 8%; right: 8%; top: 46%; height: 28%; display: grid; grid-template-columns: 1fr 1fr; gap: 3%; padding: 3%; background: #2b2b2b; border-radius: 10px; }
.dev2d .key { border: 0; border-radius: 12px; background: linear-gradient(#f6cd45, #eab922); border-bottom: 7px solid #b78808; font: 700 10px var(--font-mono); letter-spacing: .08em; color: #6a4d00; touch-action: none; transition: transform .06s, border-bottom-width .06s; }
.dev2d .key.is-down { transform: translateY(5px); border-bottom-width: 2px; }

/* ---------- pipeline ---------- */
.pipeline { padding: 12px 26px 10px 18px; min-height: 0; display: flex; flex-direction: column; gap: 10px; }

/* the laptop that runs the build, USB-C cabled to the device */
.laptop { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; filter: drop-shadow(0 22px 22px rgba(0, 0, 0, .22)); }
.lid { position: relative; flex: 1 1 auto; min-height: 0; display: flex; padding: 16px 12px 12px; border-radius: 22px 22px 6px 6px;
  background: linear-gradient(#1a1b1f, #0d0e10); box-shadow: 0 0 0 1.5px #2d2f35 inset, 0 1px 0 rgba(255, 255, 255, .16) inset; }
.cam { position: absolute; top: 6px; left: 50%; width: 5px; height: 5px; border-radius: 50%; background: #2b2f36; transform: translateX(-50%); box-shadow: 0 0 0 1px #17181b; }
.screen { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 12px; padding: 10px 12px 14px;
  background: linear-gradient(180deg, #eef0f3, #e2e5eb); border-radius: 8px; scrollbar-width: thin; }
.screen-bar { display: flex; align-items: center; gap: 10px; flex: none; }
.screen-title { font: 500 11px var(--font-mono); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usb-link { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; white-space: nowrap;
  font: 500 10.5px var(--font-mono); color: #1d7a3f; background: #e3f6ea; transition: background .2s, color .2s; }
.usb-link i { width: 7px; height: 7px; border-radius: 50%; background: #2fae60; }
.usb-link[data-state="boot"] { color: #8a5a00; background: #fff1d1; }
.usb-link[data-state="boot"] i { background: #e8870e; animation: blink .6s infinite; }
.usb-link[data-state="off"] { color: #6b6b6b; background: #ececec; }
.usb-link[data-state="off"] i { background: #aaa; }
.base { position: relative; flex: none; height: 17px; margin: 0 -12px; border-radius: 2px 2px 20px 20px / 2px 2px 13px 13px;
  background: linear-gradient(#eceef1, #adb1b8); box-shadow: 0 1px 0 #fff inset, 0 -1px 0 #7b7f86 inset; }
.base .notch { position: absolute; left: 50%; top: 0; width: 92px; height: 5px; transform: translateX(-50%); background: linear-gradient(#9a9ea5, #c6c9ce); border-radius: 0 0 9px 9px; }
.base .port { position: absolute; left: 0; top: 5px; width: 8px; height: 6px; border-radius: 3px; background: #1d1e22; box-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
.base .port i { position: absolute; left: 12px; top: 1px; width: 4px; height: 4px; border-radius: 50%; background: #7a7e85; transition: background .15s, box-shadow .15s; }
.pipeline[data-link="active"] .base .port i { background: #ffd84a; box-shadow: 0 0 6px 2px rgba(255, 200, 40, .8); animation: blink .35s infinite; }

/* USB-C cable overlay: from the device's bottom to the laptop's side port */
.cable { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 6; pointer-events: none; overflow: visible; }
.cable-shadow { fill: none; stroke: rgba(0, 0, 0, .14); stroke-width: 8; stroke-linecap: round; transform: translateY(7px); filter: blur(3px); }
.cable-body { fill: none; stroke: #2a2c31; stroke-width: 5.5; stroke-linecap: round; }
.cable-flow { fill: none; stroke: #ffd84a; stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 1 15; opacity: 0; transition: opacity .25s; }
.cable[data-active="true"] .cable-flow { opacity: 1; animation: cable-flow .7s linear infinite; }
@keyframes cable-flow { to { stroke-dashoffset: 16; } }
.plug-metal { fill: #cfd2d8; stroke: #8b8e95; stroke-width: 1; }
.plug-sleeve { fill: #2a2c31; stroke: #3b3e44; stroke-width: 1; }
.plug-line { fill: #4a4e55; }
.pipe-head { display: grid; grid-template-columns: 1fr auto; align-items: end; padding-top: 4px; }
.pipe-head .eyebrow { grid-column: 1 / -1; }
.pipe-head h2 { font-size: 18px; font-weight: 650; margin-top: 8px; color: var(--ink); }
.steps { list-style: none; display: flex; justify-content: space-between; margin: 4px 0 0; padding: 0; position: relative; }
.steps::before { content: ""; position: absolute; left: 14px; right: 14px; top: 13px; height: 3px; border-radius: 3px; background: #dcdcdc; }
.step { position: relative; z-index: 1; display: grid; justify-items: center; gap: 6px; font: 600 11px var(--font-mono); letter-spacing: .05em; color: var(--mute); text-transform: uppercase; }
.step-dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid #d4d4d4; font: 700 12px var(--font-ui); transition: all .25s cubic-bezier(.3, 1.8, .5, 1); }
.step[data-state="active"] { color: var(--ink); }
.step[data-state="active"] .step-dot { background: var(--yellow); border-color: var(--yellow-lo); transform: scale(1.18); animation: bob 1.2s ease-in-out infinite; }
.step[data-state="done"] { color: var(--ink-2); }
.step[data-state="done"] .step-dot { background: var(--green); border-color: var(--green); color: #fff; font-size: 0; }
.step[data-state="done"] .step-dot::after { content: "✓"; font-size: 14px; }
.step-headline { margin: 0; font: 600 15px var(--font-ui); min-height: 22px; }
.bubble { display: grid; gap: 4px; padding: 10px 14px; background: #fff; border-radius: 16px 16px 16px 4px; box-shadow: var(--shadow-card); animation: pop .35s cubic-bezier(.3, 1.8, .5, 1); }
.bubble[hidden] { display: none; }
.bubble-who { font: 500 10px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.bubble p { margin: 0; font-size: 13px; }
@keyframes pop { from { transform: scale(.9) translateY(6px); opacity: 0; } }

.panel { background: var(--code-bg); color: var(--code-ink); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 18px 30px -18px rgba(0, 0, 0, .55); min-width: 0; }
.panel-bar { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #1d2227; border-bottom: 1px solid #0d1013; min-height: 38px; }
.lights { display: inline-flex; gap: 5px; }
.lights i { width: 9px; height: 9px; border-radius: 50%; background: #3a424a; }
.lights i:nth-child(1) { background: #ff6159; } .lights i:nth-child(2) { background: #ffbd2e; } .lights i:nth-child(3) { background: #28c940; }
.panel-meta { margin-left: auto; font: 500 11px var(--font-mono); color: #7f8b96; white-space: nowrap; }
.panel-title { font: 500 11px var(--font-mono); color: #98a4af; letter-spacing: .06em; }
.tabs { display: flex; gap: 4px; min-width: 0; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
.tab { flex: none; background: none; border: 0; padding: 4px 9px; border-radius: 8px; font: 500 11.5px var(--font-mono); color: #8d99a5; white-space: nowrap; }
.tab[aria-selected="true"] { background: #2a3138; color: #f1f4f7; }
.code { flex: 1 1 220px; min-height: 200px; }
.code-body, .log-body { margin: 0; padding: 10px 0 14px; overflow: auto; font: 400 11.5px/1.55 var(--font-mono); flex: 1; tab-size: 4; counter-reset: ln; }
.code-body code, .log-body code { display: block; white-space: pre; min-width: max-content; }
.code-body .l { display: block; padding: 0 14px 0 0; }
.code-body .l::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 38px; padding-right: 12px; text-align: right; color: #55616c; user-select: none; }
.code-body .l.cur::after { content: "▍"; color: #f4c421; animation: blink 1s steps(2) infinite; }
.placeholder { padding: 0 16px; color: #55616c; }
.log { flex: 0 0 auto; }
.log-body { height: 120px; flex: none; padding: 8px 14px; color: #b9c3cc; }
.log-body .ok { color: #7fdc9a; } .log-body .warn { color: #ffcb6b; } .log-body .dim { color: #6b7782; } .log-body .cmd { color: #f1f4f7; } .log-body .acc { color: #82aaff; }
.progress { height: 3px; background: #0d1013; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f4c421, #ffe27a); transition: width .2s linear; }

/* syntax colours */
.tk-kw { color: #c792ea; } .tk-ty { color: #82aaff; } .tk-cm { color: #637381; font-style: italic; } .tk-st { color: #c3e88d; }
.tk-nu { color: #f78c6c; } .tk-pp { color: #ff9cac; } .tk-fn { color: #ffd479; } .tk-mc { color: #89ddff; }

.sim-note { margin: 0; color: var(--mute); font-size: 11.5px; line-height: 1.5; }
.sim-note code { font-size: 11px; background: #e7e7e7; padding: 1px 5px; border-radius: 5px; }
.credit { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; padding: 8px 22px 12px; color: var(--mute); font-size: 11.5px; }
.credit a { color: var(--ink-2); }
.credit code { font-size: 11px; }

/* ---------- responsive ---------- */
@media (min-width: 1240px) and (max-height: 940px) {
  .lib-head p { display: none; }
  .lib-head { padding-bottom: 8px; }
  .cards { gap: 10px; }
  .card { grid-template-columns: 46px 1fr; gap: 12px; padding: 10px 12px 12px; }
  .card .glyph { width: 46px; height: 46px; font-size: 23px; border-radius: 15px; }
  .card .title { font-size: 16px; }
  .card .prompt { font-size: 12px; margin-bottom: 6px; }
  .log-body { height: 120px; }
  .bubble { padding: 8px 12px; }
}
@media (max-width: 1399px) {
  .tagline { display: none; }
}
@media (max-width: 1239px) {
  .app {
    height: auto; min-height: 100dvh;
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    grid-template-areas: "top top" "lib stage" "pipe pipe" "foot foot";
  }
  .library { max-height: none; overflow: visible; }
  .stage-wrap { height: 640px; position: sticky; top: 0; align-self: start; z-index: 5; background: var(--bg); }
}
@media (max-width: 760px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "top" "stage" "lib" "pipe" "foot";
  }
  .topbar { padding: 10px 14px 4px; gap: 8px; }
  .brand-sub { display: none; }
  .topbar-actions { margin-left: auto; }
  .chip { height: 32px; padding: 0 12px; }
  .stage-wrap { height: min(58vh, 470px); min-height: 330px; padding: 4px 8px 6px; }
  .stage { border-radius: 26px; min-height: 0; }
  .stage-status { left: 12px; top: 12px; font-size: 12px; padding: 6px 12px 6px 10px; max-width: calc(100% - 128px); }
  .stage-tools { right: 10px; top: 12px; }
  .stage-tools .chip-txt { display: none; }
  .hud { top: 54px; font-size: 11px; padding: 4px 12px; gap: 12px; }
  .actionbar { bottom: 10px; gap: 6px; }
  .pad { min-width: 168px; height: 54px; }
  .hints { display: none; }
  .usb { right: 10px; top: 70px; width: 170px; transform: translate(0, -10px) scale(.94); }
  .usb.on { transform: none; }
  .library { padding: 4px 0 4px 14px; overflow: visible; }
  .lib-head { padding: 6px 14px 8px 2px; }
  .lib-head h2 { font-size: 20px; }
  .lib-head p { display: none; }
  .cards { display: flex; gap: 10px; overflow-x: auto; padding: 4px 14px 14px 2px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .card { flex: 0 0 min(78vw, 290px); width: min(78vw, 290px); scroll-snap-align: start; }
  .lib-foot { padding-left: 2px; }
  .pipeline { padding: 6px 22px 18px; display: flex; }
  .credit { padding: 6px 14px 20px; }
  .steps { margin-top: 0; }
}
@media (max-width: 380px) {
  .chip-txt { display: none; }
  .step { letter-spacing: 0; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation: none !important; transition-duration: 0.01ms !important; }


/* ---------- landscape laptop (desktop + tablet) ---------- */
.pipeline { justify-content: center; padding: 12px 26px 10px 14px; }
.laptop { flex: none; width: 100%; margin: 0 auto; }
.lid { flex: none; aspect-ratio: 16 / 11.6; padding: 18px 14px 14px; }
.screen { display: flex; flex-direction: column; gap: 10px; overflow: hidden; padding: 10px 14px 14px; }
.screen-title { flex: 1 1 auto; min-width: 0; margin: 0; font: 600 12.5px var(--font-ui); letter-spacing: 0; color: var(--ink); }
.top { flex: none; display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 1fr); gap: 6px 18px; align-items: center; }
.top .steps { margin: 0; }
.top .step-headline { font: 600 13px/1.3 var(--font-ui); min-height: 0; }
.work { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 12px; }
.work .code { flex: none; min-height: 0; min-width: 0; }
.work .code-body, .work .log-body { font-size: 12px; }
.work .code-body { min-height: 0; }
.work .side { min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.work .bubble { flex: none; max-height: 76px; overflow: auto; padding: 8px 12px; }
.work .bubble p { font-size: 12px; line-height: 1.4; }
.work .log { flex: 1 1 auto; min-height: 0; }
.work .log-body { height: auto; flex: 1; min-height: 0; }
.base { margin: 0 -10px; }
.sim-note { padding: 0 4px; }
@media (max-width: 1239px) {
  .pipeline { padding: 8px 26px 18px; justify-content: flex-start; }
  .laptop { width: min(100%, 900px); }
}
@media (max-width: 760px) {
  .pipeline { padding: 6px 18px 18px; }
  .lid { aspect-ratio: auto; padding: 16px 10px 12px; }
  .screen { overflow: visible; }
  .top { grid-template-columns: 1fr; }
  .work { grid-template-columns: 1fr; display: flex; flex-direction: column; }
  .work .code { flex: none; min-height: 260px; }
  .work .side { flex: none; }
  .work .bubble { max-height: none; }
  .work .log { flex: none; }
  .work .log-body { height: 170px; flex: none; }
}
