/* Spill web demo page. WD-DESIGN (Fable direction 2026-11-18): everything on the page is the render or FLAT PRINT on the desk.
   No pills, no backdrop-filter, no box-shadow, no translucent boxes, radius 0. Two materials: the photographed objects and
   a few words of print. */
@font-face {               /* Jost (OFL, fonts/OFL.txt), self-hosted, Latin subset: the fallback for the panel's silkscreen face */
  font-family: "Jost"; src: url("fonts/Jost-var.woff") format("woff");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
:root {
  --desk: #0a0a0a;         /* WD-BLACK: the site's black (site.css --bg); = stage.js DESK */
  --print: #E6E3DC;        /* print white */
  --dim: #8F8C85;          /* dim print */
  --hair: #5C5A56;         /* hairline */
  --gold: #96815E;         /* the panel's gold, measured: median of the solid gold strokes in art panel_base (WD-DESIGN) */
  --sheet: #1C1C1C;        /* the one solid surface (patch list, phone step sheet) */
  --font: "Jost", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--desk); }
body { font: 400 13px/1.3 var(--font); color: var(--print); }
button { font: inherit; color: inherit; }
#stage { position: fixed; inset: 0; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }

/* WD-BLACK: loading. The poster (the module's first frame, poster.js places it where the canvas will draw the module) shows at
   once; the canvas fades in over it when the art is in (body.ready); a quiet print line at the bottom counts the art. */
#poster { position: fixed; left: 0; top: 0; width: 0; height: 0; visibility: hidden; pointer-events: none; user-select: none; }
#poster.placed { visibility: visible; }
#stage { opacity: 0; transition: opacity 0.45s ease; }
body.ready #stage { opacity: 1; }
body.ready #poster { transition: visibility 0s 0.5s; visibility: hidden; }
#loading {
  position: fixed; left: 0; right: 0; bottom: 22px; z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 7px;
  pointer-events: none; transition: opacity 0.3s ease;
}
#loading .plabel { font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); line-height: 1; }
#loading .track { display: block; width: 96px; height: 1px; background: var(--hair); }
#loading .track i { display: block; height: 1px; width: 0; background: var(--print); transition: width 0.2s linear; }
body.ready #loading { opacity: 0; }
body:not(.ready) #start { cursor: progress; }

/* start: the whole window is the start button (invisible; the screen says TAP TO START). An error shows as print. */
#start {
  position: fixed; inset: 0; z-index: 4; margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer;
}
#start.gone { display: none; }
#start:focus-visible { outline: 1px solid var(--dim); outline-offset: -6px; }
#start .err { position: absolute; left: 0; right: 0; bottom: 24px; font-size: 13px; color: var(--print); text-align: center; }

/* ---- patch menu: print at x 38, y 32; the list = a solid square sheet --------------------------------------------------- */
#bar { position: fixed; left: 38px; top: 26px; display: flex; gap: 32px; align-items: flex-start; z-index: 5; }
#bar button { cursor: pointer; }
#patchBtn, #stepsBtn {
  min-height: 44px; padding: 3px 0 0; border: 0; background: none; text-align: left;
  display: flex; flex-direction: column; justify-content: flex-start; gap: 5px;
}
#bar .plabel { font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); line-height: 1; }
#bar .pcur { font-size: 18px; font-weight: 500; color: var(--print); line-height: 1.1; white-space: nowrap; }
#patchBtn:hover .pcur, #patchBtn[aria-expanded="true"] .pcur, #stepsBtn:hover .pcur {
  text-decoration: underline; text-decoration-color: var(--hair); text-decoration-thickness: 1px; text-underline-offset: 5px;
}
#patchBtn:focus-visible, #stepsBtn:focus-visible { outline: 1px solid var(--dim); outline-offset: 4px; }
#stepsBtn { display: none; }
#patchList {
  position: absolute; left: 0; top: 50px; margin: 0; padding: 0; list-style: none; width: 320px;
  background: var(--sheet); border: 1px solid var(--hair);
  max-height: calc(100vh - 110px); overflow-y: auto;   /* WD-POLISH: 32 factory presets */
  scrollbar-width: thin; scrollbar-color: var(--hair) var(--sheet);
}
#patchList[hidden] { display: none; }
#patchList button {
  width: 100%; min-height: 44px; padding: 7px 14px 8px 14px; border: 0; border-left: 2px solid transparent; background: transparent;
  text-align: left; display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
#patchList li + li button { border-top: 1px solid #2A2927; }
#patchList button:hover, #patchList button:focus-visible { background: #262523; outline: none; }
#patchList button[aria-checked="true"] { border-left-color: var(--gold); }
#patchList .pname { font-size: 14px; font-weight: 500; color: var(--print); }
#patchList .phear { font-size: 12px; color: var(--dim); line-height: 1.35; }

/* ---- step rows (stepseq.js): only for patched gates, on the plug's line; printed ticks ------------------------------------ */
#steps { position: fixed; inset: 0; pointer-events: none; z-index: 3; }
#steps .srow[hidden], #steps .sempty[hidden] { display: none; }
.srow { --c: #ccc; }
.shead { display: flex; align-items: center; gap: 8px; height: 22px; }
.sname { font-size: 14px; font-weight: 600; letter-spacing: 0.02em; color: var(--print); }
.ssub { font-size: 11.5px; color: var(--dim); }
.srate {                                         /* the rate: plain text, right-aligned, 34 px hit */
  pointer-events: auto; margin: -6px 0 -6px auto; min-width: 34px; height: 34px; padding: 0 0 0 8px;
  border: 0; background: none; color: var(--print); cursor: pointer; text-align: right;
  font-size: 12px; font-weight: 500; letter-spacing: 0.04em; font-variant-numeric: tabular-nums;
}
.srate:hover { text-decoration: underline; text-decoration-color: var(--hair); text-underline-offset: 4px; }
.srate:focus-visible { outline: 1px solid var(--dim); outline-offset: -4px; }
.scells { display: flex; }
.scell {
  pointer-events: auto; position: relative; width: 34px; height: 34px; padding: 0; border: 0; background: none;
  cursor: pointer; flex: none;
}
.scell::before {                                 /* the mark: a printed tick 6 x 16 */
  content: ''; position: absolute; left: 14px; top: 9px; width: 6px; height: 16px; box-sizing: border-box;
  border: 1px solid var(--hair);
}
.scell.on::before { background: var(--c); border-color: var(--c); }
.scell::after {                                  /* the playing step: a 6 x 2 print-white dash under the tick */
  content: ''; position: absolute; left: 14px; top: 28px; width: 6px; height: 2px; background: var(--print); display: none;
}
.scell.now::after { display: block; }
.scell:hover::before { border-color: var(--dim); }
.scell.on:hover::before { border-color: var(--c); }
.scell:focus-visible { outline: none; }
.scell:focus-visible::before { outline: 1px solid var(--print); outline-offset: 2px; }
.scell.beat { margin-left: 4px; }

/* beside the panel: each row placed by stepseq.js on its gate plug's line */
#steps.side .srow { position: absolute; width: 556px; }
#steps.side.c8 .srow { width: 276px; }
#steps.side.c8 .scells { flex-wrap: wrap; }
#steps.side.c8 .scell:nth-child(9) { margin-left: 0; }
#steps.side .sempty { display: none; }

/* sheet (phone / narrow window): opened from the bar; a solid square sheet with a hairline top */
#steps.sheet {
  inset: auto 0 0 0; max-height: 72vh; overflow-y: auto; padding: 14px 16px 72px; pointer-events: auto;
  background: var(--sheet); border-top: 1px solid var(--hair);
  transform: translateY(100%); transition: transform 0.25s ease; visibility: hidden;
}
#steps.sheet.open { transform: none; visibility: visible; }
#steps.sheet .srow { margin-bottom: 14px; }
#steps.sheet .scells { flex-wrap: wrap; max-width: 600px; }
#steps .sempty { margin: 4px 0 12px; font-size: 12px; color: var(--dim); }
body.compact #stepsBtn, body.portrait #stepsBtn { display: flex; }
@media (max-width: 620px) {
  #steps.sheet .scells { display: grid; grid-template-columns: repeat(8, 40px); gap: 2px 3px; }
  #steps.sheet .scell { width: 40px; height: 40px; }
  #steps.sheet .scell::before { left: 17px; top: 12px; }
  #steps.sheet .scell::after { left: 17px; top: 31px; }
  #steps.sheet .scell.beat { margin-left: 0; }
  #steps.sheet .scell:nth-child(4n + 1):not(:nth-child(8n + 1)) { margin-left: 4px; }
}

/* ---- volume: a speaker glyph (16 px, 1.5 stroke, dim) at right 24 / bottom 20, 34 px hit, click mutes; on hover / focus a
   72 x 2 hairline track with a 2 x 12 tick ----------------------------------------------------------------------------- */
#vol { position: fixed; right: 15px; bottom: 11px; display: flex; align-items: center; gap: 4px; z-index: 6; }
#vol[hidden] { display: none; }
#mute {
  width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; background: none;
  color: var(--dim); cursor: pointer;
}
#mute:hover, #mute:focus-visible { color: var(--print); }
#mute:focus-visible { outline: 1px solid var(--dim); outline-offset: -4px; }
#mute .cross { display: none; }
#mute.off .wave { display: none; }
#mute.off .cross { display: inline; }
#volume {
  -webkit-appearance: none; appearance: none; width: 72px; height: 34px; margin: 0; background: none; cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
#vol:hover #volume, #vol:focus-within #volume { opacity: 1; pointer-events: auto; }
#volume:focus { outline: none; }
#volume::-webkit-slider-runnable-track { height: 2px; background: var(--hair); border: 0; }
#volume::-webkit-slider-thumb { -webkit-appearance: none; width: 2px; height: 12px; margin-top: -5px; background: var(--print); border: 0; border-radius: 0; }
#volume::-moz-range-track { height: 2px; background: var(--hair); border: 0; }
#volume::-moz-range-thumb { width: 2px; height: 12px; background: var(--print); border: 0; border-radius: 0; }
#volume:focus-visible::-webkit-slider-thumb { background: #fff; }

/* phone: the print sits at the bottom, the list opens upward */
body.portrait #bar { top: auto; bottom: 12px; left: 16px; z-index: 6; gap: 28px; }
body.portrait #patchList { top: auto; bottom: 52px; width: min(320px, calc(100vw - 32px)); }
body.portrait #bar .pcur { font-size: 16px; }
body.portrait #patchBtn .pcur { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
body:not(.ready) #bar { visibility: hidden; }

/* ---- WD-HELP: the help panel, lower left (help.js; Fable tutorial plan section 1). Flat print on the desk: no box, no rule,
   no background. Tag 11 / 500 / +0.14 em gold; KEY in a 76 px column, 11 / 500 / +0.14 em dim; text 13 / 400 print; 19 px
   lines, one line each (cut, never wrapped). pointer-events none except the links. help.js places it (left / bottom / width). */
#help { position: fixed; z-index: 3; pointer-events: none; user-select: none; -webkit-user-select: none; }
#help[hidden] { display: none; }
#help .hbody { transition: opacity 0.12s linear; }
#help .htag, #help .hkey {
  font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; line-height: 19px; white-space: nowrap;
}
#help .htag { color: var(--gold); overflow: hidden; }
#help .hsub { color: var(--dim); margin-left: 12px; }
#help .hrow { display: flex; height: 19px; line-height: 19px; white-space: nowrap; overflow: hidden; }
#help .hkey { flex: none; width: 76px; color: var(--dim); }
#help .htxt { font-size: 13px; font-weight: 400; color: var(--print); overflow: hidden; }
#help .hrow.dim .htxt { color: var(--dim); }
#help .hlinks { display: flex; gap: 20px; margin-top: 6px; height: 19px; align-items: center; }
#help .hlink, #help .hon {
  pointer-events: auto; padding: 0; border: 0; background: none; cursor: pointer;
  font-size: 11.5px; color: var(--dim); line-height: 19px;
}
#help .hlink:hover, #help .hon:hover, #help .hlink:focus-visible, #help .hon:focus-visible { color: var(--print); outline: none; }
#help .hlink[hidden] { display: none; }
#help .hon { display: none; position: fixed; left: 38px; bottom: 11px; height: 34px; min-width: 34px; text-align: left; }
#help.off .hbody, #help.off .hlinks { display: none; }
#help.off .hon { display: block; }
@media (hover: none) { #help { display: none; } }        /* L1: hover devices only (the phone strip is a later lane) */
body.portrait #help { display: none; }
/* WD-TOUR: a text line that is a link (the tour line, the tour offer, "Load Shimmering"); the tour line in print, underlined;
   the tour's DOM parts in the panel's gold (the Gate 1 row's name in step 3, the PRESET print's label in step 7) */
#help .hrow .hline { font-size: 13px; text-align: left; white-space: nowrap; overflow: hidden; }
#help .hrow.dim .hline { color: var(--dim); }
#help .hrow .hline.htl { color: var(--print); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
#help .hrow .hline:hover { color: var(--print); }
.srow.tour .sname { color: var(--gold); }
#patchBtn.tour .pcur { color: var(--gold); }

/* ---- WD-EASY: the OLED value list (oled-menu.js): flat print on one solid sheet, square, no shadow ------------------------ */
#oledMenu {
  position: fixed; z-index: 6; box-sizing: border-box; margin: 0; padding: 0;
  background: #111; border: 1px solid #262626; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: #262626 #111;
}
#oledMenu[hidden] { display: none; }
#oledMenu .omhead {
  height: 28px; box-sizing: border-box; padding: 10px 14px 0 16px; line-height: 1;
  font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold);
}
#oledMenu .omrow {
  display: block; width: 100%; height: 36px; box-sizing: border-box; padding: 0 14px; border: 0;
  border-left: 2px solid transparent; border-top: 1px solid #1C1C1C; background: transparent;
  font: 500 14px/34px var(--font); color: var(--print); text-align: left; cursor: pointer; white-space: nowrap;
}
#oledMenu .omrow:hover, #oledMenu .omrow:focus-visible { background: #1C1C1C; outline: none; }
#oledMenu .omrow[aria-selected="true"] { border-left-color: var(--gold); }
