/* Shared look for the keyboard guides at keys.qingbo.us/guides/: a slate desk, the boards in
   their real colours, and the LED colours as the only bright accents. */
:root {
  --desk: #dde3e8; --mat: #e9edf0; --sheet: #f6f8f9; --ink: #18202a; --muted: #586572; --rule: #c2cbd3;
  --win: #f2d4bf;
  --led-white: #f4f1e8; --led-orange: #ff7a1a; --led-green: #1fcb6a; --led-blue: #3d7bff; --led-off: #3a3f45;
  --scr-bg: #1b1d21; --scr-panel: #24272c; --scr-line: #33373d; --scr-ink: #e8e6e1; --scr-muted: #9aa0a8; --scr-accent: #d97757;
  --focus: #18202a;
  font-family: "Archivo", ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  font-variation-settings: "wdth" 100;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --desk: #12171c; --mat: #1a2027; --sheet: #20272f; --ink: #e5eaee; --muted: #94a1ad; --rule: #2e3842;
    --win: #6b4a37; --led-off: #2a2f35; --focus: #e5eaee; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --desk: #12171c; --mat: #1a2027; --sheet: #20272f; --ink: #e5eaee; --muted: #94a1ad; --rule: #2e3842;
  --win: #6b4a37; --led-off: #2a2f35; --focus: #e5eaee; color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--desk); color: var(--ink); font-size: 17px; line-height: 1.55; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { font-weight: 700; line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(36px, 6vw, 68px); font-variation-settings: "wdth" 125; font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: clamp(24px, 3.2vw, 34px); font-variation-settings: "wdth" 118; margin-bottom: 14px; }
h3 { font-size: 18px; font-variation-settings: "wdth" 108; }
p { margin: 0 0 12px; }
.lede { font-size: 19px; color: var(--muted); max-width: 620px; margin-top: 12px; }
kbd {
  font: inherit; font-size: 0.86em; font-weight: 600; font-variation-settings: "wdth" 92;
  background: #f3f1ec; color: #2a2b2e; border: 1px solid #cfcac0; border-bottom-width: 2.5px;
  border-radius: 6px; padding: 0 6px; white-space: nowrap;
}
code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .84em; background: color-mix(in srgb, var(--ink) 8%, transparent); padding: 1px 5px; border-radius: 5px; }
header.top { padding: 40px 0 6px; }
section.block { padding: 56px 0 0; }
footer.end { color: var(--muted); font-size: 14px; padding: 56px 0 40px; }

/* ---------- the board (kit/board.js) ---------- */
.kit-board { display: flex; gap: 4%; align-items: flex-start; justify-content: center; }
.kit-board svg { flex: 1 1 0; min-width: 0; height: auto; overflow: visible; }
.kit-glove80 { gap: 7%; }
.kc-case { fill: var(--case); } .kc-edge { fill: var(--case-edge); } .kc-shadow { fill: rgba(0,0,0,.2); }
.kc-plate { fill: var(--plate); } .kc-cover { fill: #1d1e22; }
.kc-window { fill: var(--win); opacity: .82; } .kc-chip { fill: #2b2b2e; }
.kit-glove80 .kc-case { stroke: rgba(255,255,255,.06); stroke-width: 1; }
.k .lip { fill: color-mix(in srgb, var(--cap) 82%, #000); }
.k .cap { fill: var(--cap-top); transition: transform .08s; }
.k text { fill: var(--legend); font-family: inherit; font-weight: 600; text-anchor: middle; dominant-baseline: central; font-variation-settings: "wdth" 88; }
.k text.hold { font-size: 8.5px; fill: color-mix(in srgb, var(--legend) 55%, transparent); letter-spacing: .04em; }
.k .press { fill: #d97757; opacity: 0; transition: opacity .1s; }
.k.down .press { opacity: .55; }
.k.down .cap { transform: translateY(1.5px); }
.k.ghost text { opacity: .35; }
.k.held .cap { fill: color-mix(in srgb, var(--held) 30%, var(--cap-top)); }
.k .mark { fill: none; stroke: transparent; stroke-width: 3.5; }
/* marks: blue reads on the orange and the black cases alike */
.k[data-mark="tap"] .mark { stroke: #2f6bff; stroke-width: 4.5; animation: ring 1.2s ease-in-out infinite; }
.k[data-mark="tap"] .cap { fill: color-mix(in srgb, #2f6bff 22%, var(--cap-top)); }
.k[data-mark="hold"] .mark { stroke: #8a4dff; stroke-width: 4.5; }
.k[data-mark="clear"] .mark { stroke: #e0241b; stroke-width: 4.5; stroke-dasharray: 6 4; }
.k[data-mark="clear"] .cap { fill: color-mix(in srgb, #e0241b 16%, var(--cap-top)); }
@keyframes ring { 50% { stroke-opacity: .35; } }
.knob-shadow { fill: rgba(0,0,0,.25); }
.knob-face { transform-box: fill-box; transform-origin: center; transition: transform .25s cubic-bezier(.3,1.4,.5,1); }
.knob-tick { stroke: #5d636b; stroke-width: 3; stroke-linecap: round; }
/* LEDs: in the gap between two keys (Cornix), or under a key (Glove80) */
.gapled-well { fill: #151517; }
.gapled-die { fill: #4a4f56; transition: fill .3s; }
.gapled.on .gapled-die { fill: var(--c); filter: drop-shadow(0 0 3px var(--c)) drop-shadow(0 0 9px var(--c)); }
.gapled-tag { font-size: 9px; font-weight: 700; text-anchor: middle; fill: color-mix(in srgb, var(--legend) 70%, transparent); }
.keyglow { fill: transparent; transition: fill .3s; }
.keyglow.on { fill: var(--c); filter: drop-shadow(0 0 4px var(--c)) drop-shadow(0 0 10px var(--c)); }
[data-mode="dim"] { animation: breathe 2.4s ease-in-out infinite; }
[data-mode="pulse"] { animation: pulse 1.6s ease-in-out infinite; }
[data-mode="blink"] { animation: blinkled 1s steps(1) infinite; }
@keyframes breathe { 0%, 100% { opacity: .7; } 50% { opacity: .4; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes blinkled { 50% { opacity: 0; } }

/* ---------- a big LED, for legends ---------- */
.bulb {
  width: 46px; height: 46px; border-radius: 50%; background: var(--led-off); flex: none;
  box-shadow: inset 0 -4px 8px rgba(0,0,0,.25); transition: background .3s, box-shadow .3s;
}
.bulb.on { background: var(--c); box-shadow: 0 0 18px 4px color-mix(in srgb, var(--c) 60%, transparent), 0 0 40px 10px color-mix(in srgb, var(--c) 25%, transparent), inset 0 -4px 8px rgba(0,0,0,.12); }
.bulb.sm { width: 22px; height: 22px; }
.bulb.dim { animation: breathe 2.4s ease-in-out infinite; }

/* ---------- picture cards ---------- */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.shot { margin: 0; }
.shot img, .shot .pic { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-radius: 14px; background: var(--mat); box-shadow: 0 12px 28px -18px rgba(0,0,0,.5); }
.shot figcaption { margin-top: 10px; }
.shot figcaption b { display: block; font-size: 17px; font-variation-settings: "wdth" 110; }
.shot figcaption span { color: var(--muted); font-size: 15px; }
.btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; background: var(--ink); color: var(--sheet); border-radius: 999px; padding: 9px 16px; margin: 4px 8px 4px 0; font-size: 15px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- the film (kit/tour.js) ---------- */
/* ---------- the film ---------- */
.film { background: var(--mat); border-radius: 28px; padding: 18px; margin-top: 28px; }
.stage {
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px;
  grid-template-areas: "screen side" "board board";
}
@media (max-width: 760px) { .stage { grid-template-columns: minmax(0, 1fr); grid-template-areas: "side" "screen" "board"; } }

/* the app window */
.screen {
  grid-area: screen; background: var(--scr-bg); color: var(--scr-ink); border-radius: 14px; overflow: hidden;
  display: grid; grid-template-rows: 32px 1fr; min-height: 300px; position: relative;
  box-shadow: 0 14px 30px -18px rgba(0,0,0,.55); font-size: 13.5px;
}
.titlebar { display: flex; align-items: center; gap: 7px; padding: 0 12px; background: var(--scr-panel); border-bottom: 1px solid var(--scr-line); color: var(--scr-muted); font-size: 12px; }
.titlebar i { width: 10px; height: 10px; border-radius: 50%; background: #4a4e55; display: inline-block; }
.titlebar span { margin-left: 8px; }
.app { display: grid; grid-template-columns: 136px minmax(0, 1fr); min-height: 0; }
@media (max-width: 460px) { .app { grid-template-columns: minmax(0, 1fr); } .app .sessions { display: none; } .screen { min-height: 250px; } }
.sessions { border-right: 1px solid var(--scr-line); padding: 10px 8px; display: grid; align-content: start; gap: 4px; background: #1f2125; }
.sessions .lbl { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--scr-muted); padding: 2px 6px 4px; }
.sess { display: flex; align-items: center; gap: 7px; padding: 5px 6px; border-radius: 7px; color: var(--scr-muted); font-size: 12.5px; transition: background .25s; }
.sess.cur { background: #2c3036; color: var(--scr-ink); }
.sess b { width: 8px; height: 8px; border-radius: 50%; flex: none; background: transparent; border: 1.5px solid #555a61; transition: background .25s, border-color .25s, box-shadow .25s; }
.sess b[data-st="working"] { background: var(--led-white); border-color: var(--led-white); opacity: .75; }
.sess b[data-st="attention"] { background: var(--led-orange); border-color: var(--led-orange); box-shadow: 0 0 8px var(--led-orange); }
.sess b[data-st="done"] { background: var(--led-green); border-color: var(--led-green); }
.chat { display: grid; grid-template-rows: 1fr auto; min-height: 0; position: relative; }
.log { padding: 14px 16px 6px; display: flex; flex-direction: column; justify-content: flex-end; gap: 7px; overflow: hidden; min-height: 0; }
.msg { line-height: 1.45; animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } }
.msg.user { align-self: flex-end; background: #2e3239; padding: 7px 11px; border-radius: 12px 12px 4px 12px; max-width: 86%; }
.msg.tool { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; color: var(--scr-muted); }
.msg.tool::before { content: "⏺ "; color: var(--scr-accent); }
.msg.ok { color: #8fdcab; }
.msg.ok::before { content: "✓ "; }
.status { padding: 0 16px; font-size: 12px; color: var(--scr-muted); display: flex; align-items: center; gap: 7px; min-height: 18px; }
.status .spin { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--scr-accent); border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.composer { margin: 6px 12px 12px; background: var(--scr-panel); border: 1px solid var(--scr-line); border-radius: 12px; padding: 9px 11px 8px; }
.composer .text { min-height: 20px; white-space: pre-wrap; }
.composer .text:empty::before { content: "Ask Claude…"; color: #6c727a; }
.composer .text.caret::after { content: ""; display: inline-block; width: 1.5px; height: 1.05em; background: var(--scr-ink); vertical-align: -2px; margin-left: 1px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.composer .row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; gap: 8px; }
.chip-effort { font-size: 11.5px; border: 1px solid var(--scr-line); border-radius: 999px; padding: 1px 9px; color: var(--scr-muted); transition: color .3s, border-color .3s; }
.chip-effort.flash { color: var(--scr-ink); border-color: var(--scr-accent); }
.mic { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--scr-muted); }
.mic svg { width: 14px; height: 14px; }
.mic.on { color: #ff8d7a; }
.mic .bars { display: none; gap: 2px; align-items: center; height: 12px; }
.mic.on .bars { display: inline-flex; }
.mic .bars i { width: 2px; background: currentColor; border-radius: 1px; animation: bar .6s ease-in-out infinite alternate; }
.mic .bars i:nth-child(2) { animation-delay: .15s; } .mic .bars i:nth-child(3) { animation-delay: .3s; } .mic .bars i:nth-child(4) { animation-delay: .45s; }
@keyframes bar { from { height: 3px; } to { height: 12px; } }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10,11,13,.45); opacity: 0; pointer-events: none; transition: opacity .2s; }
.overlay.show { opacity: 1; }
.card { background: var(--scr-panel); border: 1px solid var(--scr-line); border-radius: 12px; padding: 12px 14px; min-width: 210px; box-shadow: 0 18px 40px -16px rgba(0,0,0,.7); transform: translateY(6px); transition: transform .2s; }
.overlay.show .card { transform: none; }
.card h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--scr-muted); font-weight: 600; }
.levels { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.levels li { padding: 5px 10px; border-radius: 7px; display: flex; justify-content: space-between; gap: 16px; transition: background .15s; }
.levels li.hi { background: #3a3f47; }
.levels li .cur { color: var(--scr-muted); font-size: 11px; }
.perm code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; background: #1b1d21; padding: 2px 6px; border-radius: 5px; }
.perm .opts { display: grid; gap: 3px; margin-top: 10px; }
.perm .opts span { padding: 4px 9px; border-radius: 7px; }
.perm .opts span:first-child { background: #3a3f47; }

/* the side panel: the two LEDs, big, plus the caption */
.side { grid-area: side; display: grid; gap: 12px; align-content: start; }
.lamps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lamp { background: var(--sheet); border: 1px solid var(--rule); border-radius: 16px; padding: 12px; display: grid; justify-items: center; gap: 6px; text-align: center; }
@keyframes breathe { 50% { opacity: .38; } }
.lamp b { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-variation-settings: "wdth" 115; }
.lamp span { font-size: 13.5px; color: var(--muted); min-height: 1.4em; }
.caption { background: var(--sheet); border: 1px solid var(--rule); border-radius: 16px; padding: 14px 16px; min-height: 150px; }
.caption .no { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-variation-settings: "wdth" 115; }
.caption h3 { font-size: 24px; font-variation-settings: "wdth" 118; margin: 4px 0 6px; }
.caption p { margin: 0; color: var(--ink); }

/* player controls */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.controls button {
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--sheet);
  border: 1px solid var(--rule); border-radius: 999px; padding: 6px 13px; cursor: pointer; min-height: 38px;
}
.controls .play { background: var(--ink); color: var(--sheet); border-color: var(--ink); min-width: 92px; }
.scenes { display: flex; flex-wrap: wrap; gap: 6px; }
.scenes button { padding: 6px 11px; }
.scenes button[aria-current="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.progress { flex: 1 1 100%; height: 4px; border-radius: 4px; background: var(--rule); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--case); }


.board-area { grid-area: board; padding-top: 6px; }
.side .lamp b { white-space: nowrap; }

/* reading the light */
.legend { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: center; }
@media (max-width: 760px) { .legend { grid-template-columns: minmax(0, 1fr); } }
.states { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.states > div { background: var(--sheet); border: 1px solid var(--rule); border-radius: 18px; padding: 16px; display: grid; justify-items: start; gap: 2px; }
.states .bulb { margin-bottom: 10px; }
.states b { font-size: 18px; font-variation-settings: "wdth" 110; }
.states span:not(.bulb) { color: var(--muted); font-size: 15px; }
.where { margin: 0; background: var(--mat); border-radius: 22px; padding: 22px 22px 16px; }
.where figcaption { color: var(--muted); font-size: 15px; margin-top: 10px; }
.where .kit-board svg { max-width: 420px; }

/* the video */
.reel video { width: 100%; height: auto; border-radius: 16px; background: #000; display: block; }
.reel p { margin-top: 12px; }

/* recording: the film alone, framed for 1280x720 */
body.record { background: var(--mat); overflow: hidden; }
body.record .gbar, body.record header.top, body.record footer.end, body.record .controls { display: none; }
body.record .wrap { max-width: none; padding: 0; }
body.record .film { margin: 0; border-radius: 0; height: 100vh; padding: 22px 28px; }
body.record .stage { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); grid-template-areas: "screen side" "board board"; height: 100%; grid-template-rows: auto 1fr; }
body.record #board { height: 100%; align-items: center; }
body.record #board svg { max-height: 300px; }
body.record.kit-glove80-page #board svg { max-height: 330px; }

/* ---------- pairing (kit/pair.js) ---------- */
.pair-hero { margin-top: 26px; }
.pair-board { margin: 0; background: var(--mat); border-radius: 28px; padding: 28px 22px 18px; }
.keys-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin-top: 18px; font-size: 15px; color: var(--muted); }
.keys-legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 18px; height: 18px; border-radius: 5px; border: 3px solid; display: inline-block; }
.sw.hold { border-color: #8a4dff; } .sw.tap { border-color: #2f6bff; background: color-mix(in srgb, #2f6bff 22%, transparent); } .sw.clear { border-color: #e0241b; border-style: dashed; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; counter-reset: step; }
@media (max-width: 760px) { .steps { grid-template-columns: minmax(0, 1fr); } }
.step { background: var(--sheet); border: 1px solid var(--rule); border-radius: 22px; padding: 14px 14px 18px; counter-increment: step; }
.step .pic { background: var(--mat); border-radius: 14px; padding: 16px; min-height: 210px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.step h3 { font-size: 20px; padding: 0 4px; display: flex; gap: 10px; align-items: baseline; }
.step h3::before { content: counter(step); font-size: 14px; font-weight: 700; width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--ink); color: var(--sheet); display: inline-grid; place-items: center; transform: translateY(-2px); }
.step p { margin: 6px 4px 0; color: var(--muted); }
.step .pic.two { gap: 14px; }
.step .pic.two figure { margin: 0; flex: 1; text-align: center; color: var(--muted); font-size: 14px; }
.step .pic svg { max-height: 200px; }
.kit-glove80.pic svg { max-height: 250px; }
.step .pic.kit-board { gap: 3%; }
.machines { gap: 12px; flex-wrap: wrap; }
.mac { background: #f5f5f7; color: #1d1d1f; border-radius: 10px; width: 230px; box-shadow: 0 10px 24px -14px rgba(0,0,0,.5); font: 13px/1.3 -apple-system, "Segoe UI", sans-serif; overflow: hidden; }
.mac-bar { display: flex; align-items: center; gap: 5px; padding: 7px 9px; background: #e8e8ea; font-weight: 600; font-size: 12px; }
.mac-bar i { width: 9px; height: 9px; border-radius: 50%; background: #c8c8cc; } .mac-bar span { margin-left: 6px; }
.mac-body { padding: 8px 10px 10px; }
.mac-row { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 7px; padding: 7px 9px; }
.mac-row span { flex: 1; } .mac-row svg { width: 20px; height: 20px; fill: none; stroke: #6e6e73; stroke-width: 1.5; stroke-linecap: round; }
.toggle { width: 28px; height: 16px; border-radius: 9px; background: #34c759; position: relative; } .toggle::after { content: ""; position: absolute; right: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.mac-lbl { font-size: 11px; color: #6e6e73; font-weight: 600; margin: 10px 2px 5px; }
.connect { font-weight: 500; font-size: 12px; background: #fff; border: 1px solid #c7c7cc; border-radius: 6px; padding: 2px 9px; box-shadow: 0 0 0 3px rgba(255,122,26,.55); animation: ring 1.4s ease-in-out infinite; }
.term { margin: 0; background: #16181c; color: #c9d1d9; border-radius: 10px; padding: 10px 12px; font: 11px/1.55 "JetBrains Mono", ui-monospace, monospace; white-space: pre; overflow: hidden; max-width: 100%; box-shadow: 0 10px 24px -14px rgba(0,0,0,.5); }
.typed { background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; font-size: 18px; min-width: 70%; }
.typed i { display: inline-block; width: 2px; height: 1.1em; background: var(--ink); vertical-align: -3px; margin-left: 2px; animation: blinkled 1s steps(1) infinite; }
.profiles { display: flex; flex-wrap: wrap; gap: 12px; }
.prof { background: var(--sheet); border: 1px solid var(--rule); border-radius: 16px; padding: 12px 16px; display: grid; grid-template-columns: auto auto; gap: 0 10px; align-items: center; min-width: 150px; }
.prof .bulb { grid-row: span 2; }
.prof:not(:has(.bulb)) { grid-template-columns: auto; }
.prof b { font-size: 17px; } .prof span:last-child { color: var(--muted); font-size: 14px; }
.note { color: var(--muted); font-size: 15px; margin-top: 12px; }
.trouble { display: grid; gap: 8px; max-width: 760px; }
.trouble details { background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 12px 16px; }
.trouble summary { font-weight: 600; cursor: pointer; }
.trouble details p { margin: 8px 0 0; color: var(--muted); }
