:root {
  /* softer, earthier palette */
  --c-intro: #a95a4f;
  --c-drive: #c07a4a;
  --c-comp: #4f7f95;
  --c-filter: #7d6890;
  --c-trem: #bb9850;
  --c-chorus: #55918a;
  --c-phaser: #a8687c;
  --c-delay: #66885f;
  --c-reverb: #5f6a9e;
  --c-ink: #3b322d;

  --paper: #f2ece0;
  --card: #fbf8f1;
  --ink: #2d2622;
  --ink-2: #5e534c;
  --ink-3: #8d8277;
  --line: rgba(45, 38, 34, .13);
  --accent: var(--c-intro);
  --display: "Fraunces", Georgia, serif;
  --body: "DM Sans", system-ui, -apple-system, Segoe UI, sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --logo: "Bungee", "Fraunces", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(45,38,34,.05) 1px, transparent 1.2px);
  background-size: 22px 22px;
  color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.5;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: color-mix(in oklab, var(--accent) 30%, transparent); }

/* ---------- progress (thin, segmented) ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 4px; display: flex; gap: 2px; z-index: 50; }
.progress button { flex: 1; border: 0; padding: 0; height: 100%; background: rgba(45,38,34,.1); cursor: pointer; transition: background .3s; }
.progress button.done { background: color-mix(in oklab, var(--seg) 75%, var(--paper)); }
.progress button.cur { background: var(--seg); }
.progress button:hover { background: color-mix(in oklab, var(--seg) 55%, var(--paper)); }

/* ---------- pages ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 30px 20px 110px; }
.page { display: none; }
.page.active { display: block; animation: pageIn .38s cubic-bezier(.2,.7,.2,1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; gap: 18px; align-items: flex-start; margin: 6px 0 14px; }
.chapter-num {
  font-family: var(--logo); font-size: 21px; color: var(--card); background: var(--accent);
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none;
  box-shadow: 0 4px 0 color-mix(in oklab, var(--accent) 60%, black); transform: rotate(-4deg); margin-top: 4px;
}
.family { margin: 0; font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 500; }
.page h2 { font-family: var(--display); font-variation-settings: "SOFT" 100; font-weight: 750; font-size: clamp(28px, 4.4vw, 42px); line-height: 1.05; margin: 2px 0 6px; letter-spacing: -.01em; }
.hook { margin: 0; font-size: 18.5px; color: var(--ink-2); max-width: 660px; }
.hook b { color: var(--ink); }

.points { list-style: none; padding: 0; margin: 0 0 16px 70px; display: flex; flex-wrap: wrap; gap: 8px; }
.points li { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; font-size: 15px; color: var(--ink-2); }
.points li b { color: color-mix(in oklab, var(--accent) 85%, black); margin-right: 4px; }

.try { margin: 16px 0 0 70px; font-size: 15.5px; color: var(--ink-2); max-width: 760px; }
.try b { font-family: var(--logo); font-weight: 400; font-size: 12px; letter-spacing: .06em; color: var(--card); background: var(--accent); padding: 2px 8px; border-radius: 6px; margin-right: 8px; vertical-align: 1px; }
.try i { color: var(--ink); font-style: normal; font-weight: 700; }
.try .aside { color: var(--ink-3); font-size: 14px; }
@media (max-width: 640px) { .points, .try { margin-left: 0; } }

/* ---------- hero ---------- */
.page-hero { text-align: center; }
.page-hero.active { display: grid; place-items: center; min-height: calc(100vh - 160px); }
.hero-inner { max-width: 820px; }
.kicker { font-family: var(--mono); text-transform: uppercase; letter-spacing: .14em; font-size: 13px; color: var(--ink-2); margin: 0 0 8px; }
.page-hero h1 {
  font-family: var(--display); font-variation-settings: "SOFT" 100, "opsz" 144; font-weight: 800;
  font-size: clamp(52px, 10vw, 112px); line-height: .92; margin: 0 0 18px; letter-spacing: -.02em;
}
.page-hero h1 em { font-style: italic; color: var(--c-intro); font-weight: 700; }
.lede { font-size: clamp(18px, 2.2vw, 21px); color: var(--ink-2); max-width: 560px; margin: 0 auto 30px; }
.mini-board {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 22px 22px 26px;
  background: linear-gradient(#4a413b, #3a322d); border-radius: 16px; margin: 0 auto 30px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.06), 0 14px 30px rgba(45,38,34,.22); width: fit-content; max-width: 100%; position: relative;
}
.mini-board::before { content: ""; position: absolute; left: 10px; right: 10px; top: 50%; height: 3px; background: #221c19; z-index: 0; border-radius: 2px; }
.mini-pedal {
  position: relative; z-index: 1; width: 74px; height: 104px; border-radius: 10px; text-decoration: none;
  background: linear-gradient(165deg, color-mix(in oklab, var(--c) 88%, white), var(--c) 45%, color-mix(in oklab, var(--c) 82%, black));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 5px 0 color-mix(in oklab, var(--c) 55%, black), 0 8px 12px rgba(0,0,0,.3);
  display: flex; flex-direction: column; align-items: center; padding-top: 10px; gap: 7px; transition: transform .15s;
}
.mini-pedal:hover, .mini-pedal:focus-visible { transform: translateY(-4px) rotate(-2deg); }
.mini-pedal .mk { display: flex; gap: 8px; }
.mini-pedal .mk i { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fbf7ee, #d8ccb4); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.mini-pedal b { font-family: var(--logo); font-weight: 400; font-size: 9.5px; letter-spacing: .03em; background: #f7f1e4; color: var(--ink); padding: 1px 5px; border-radius: 4px; }
.mini-pedal .ms { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f5f5f5, #a0a0a0 60%, #626262); margin-top: auto; margin-bottom: 9px; }
.mini-pedal .ml { position: absolute; top: 6px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: #e8543f; box-shadow: 0 0 5px #e8543f; animation: blink 2.4s infinite; animation-delay: var(--d, 0s); }
@keyframes blink { 0%, 70%, 100% { opacity: 1 } 80% { opacity: .25 } }
.hero-actions { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; align-items: center; }
.big-btn {
  display: inline-block; text-decoration: none; background: var(--ink); color: var(--paper); font-weight: 700;
  padding: 14px 26px; border-radius: 999px; font-size: 18px; box-shadow: 0 5px 0 #000, 0 10px 18px rgba(0,0,0,.16); transition: transform .1s, box-shadow .1s;
}
.big-btn:hover { transform: translateY(-2px); }
.big-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #000; }
.hero-note { color: var(--ink-2); font-size: 15px; }

/* ---------- bench ---------- */
.bench {
  background: linear-gradient(180deg, #fbf8f1, #f7f1e5); border-radius: 22px; padding: 16px 18px 18px;
  box-shadow: 0 1px 0 var(--line), 0 16px 36px rgba(45,38,34,.07); border: 1px solid rgba(45,38,34,.07);
}
.bench-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.bench-body { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: start; }
.bench-graphs { display: grid; gap: 14px; min-width: 0; }
.bench-graphs.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 880px) { .bench-body { grid-template-columns: 1fr; justify-items: center; } .bench-graphs { width: 100%; } }
@media (max-width: 600px) { .bench-graphs.two { grid-template-columns: 1fr; } .bench { padding: 12px; border-radius: 16px; } }

.transport { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.play-btn {
  display: inline-flex; align-items: center; gap: 10px; border: 0; cursor: pointer; background: var(--accent); color: #fff;
  font-weight: 700; padding: 9px 18px 9px 14px; border-radius: 999px; box-shadow: 0 4px 0 color-mix(in oklab, var(--accent) 60%, black);
  transition: transform .08s, box-shadow .08s; min-width: 100px;
}
/* sparkle: marks the play button as the place to start, until it is first pressed */
.play-btn.sparkle {
  position: relative;
  background-image: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.38) 45%, rgba(255,255,255,.08) 55%, transparent 70%);
  background-size: 260% 100%; background-repeat: no-repeat;
  animation: shine 2.6s ease-in-out infinite, glow 2.6s ease-in-out infinite;
}
.play-btn.sparkle::before, .play-btn.sparkle::after {
  content: "✦"; position: absolute; pointer-events: none; color: color-mix(in oklab, var(--accent) 55%, #ffd877);
  font-size: 13px; line-height: 1; animation: twinkle 2.6s ease-in-out infinite;
}
.play-btn.sparkle::before { top: -9px; right: -4px; }
.play-btn.sparkle::after { bottom: -7px; left: -6px; font-size: 10px; animation-delay: 1.3s; }
@keyframes shine { 0% { background-position: 130% 0; } 55%, 100% { background-position: -40% 0; } }
@keyframes glow {
  0%, 100% { box-shadow: 0 4px 0 color-mix(in oklab, var(--accent) 60%, black), 0 0 0 0 color-mix(in oklab, var(--accent) 45%, transparent); }
  50% { box-shadow: 0 4px 0 color-mix(in oklab, var(--accent) 60%, black), 0 0 0 7px color-mix(in oklab, var(--accent) 0%, transparent); }
}
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0deg); } 35% { opacity: 1; transform: scale(1.1) rotate(25deg); } 65% { opacity: 0; transform: scale(.5) rotate(50deg); } }
.play-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in oklab, var(--accent) 60%, black); }
.play-icon { width: 0; height: 0; border-left: 12px solid currentColor; border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.play-btn.playing .play-icon { width: 12px; height: 12px; border: 0; background: currentColor; border-radius: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.chip { border: 1.5px solid var(--line); background: var(--card); padding: 4px 12px; border-radius: 999px; cursor: pointer; font-size: 14px; color: var(--ink-2); transition: .12s; }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip.live { border-style: dashed; }

/* ---------- graphs ---------- */
.graph { margin: 0; background: var(--card); border-radius: 14px; padding: 10px 12px; border: 1px solid var(--line); min-width: 0; }
.graph figcaption { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-2); margin-bottom: 6px; display: flex; justify-content: space-between; gap: 10px; }
.graph figcaption .hint { text-transform: none; letter-spacing: 0; color: var(--ink-3); }
.graph-canvas { position: relative; width: 100%; }
.graph-canvas canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- pedal ---------- */
.pedal {
  --c: var(--accent);
  position: relative; width: 300px; max-width: 100%; border-radius: 20px; padding: 22px 20px 20px;
  background: linear-gradient(165deg, color-mix(in oklab, var(--c) 86%, white) 0%, var(--c) 40%, color-mix(in oklab, var(--c) 84%, black) 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.28), inset 0 -3px 0 rgba(0,0,0,.14),
    0 9px 0 -1px color-mix(in oklab, var(--c) 55%, black), 0 18px 28px rgba(45,38,34,.22);
  display: flex; flex-direction: column; align-items: center; gap: 14px; user-select: none; -webkit-user-select: none;
}
.pedal .screw { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f0f0f0, #979797 70%); box-shadow: inset 0 0 0 1px rgba(0,0,0,.22); }
.pedal .screw::after { content: ""; position: absolute; left: 2px; right: 2px; top: 5px; height: 1.5px; background: rgba(0,0,0,.45); transform: rotate(35deg); }
.pedal .s1 { left: 9px; top: 9px; } .pedal .s2 { right: 9px; top: 9px; } .pedal .s3 { left: 9px; bottom: 9px; } .pedal .s4 { right: 9px; bottom: 9px; }
.pedal-knobs { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 14px; }
.pedal-name { background: #f7f1e4; color: var(--ink); border-radius: 10px; padding: 7px 14px 6px; text-align: center; min-width: 70%; box-shadow: inset 0 -2px 0 rgba(0,0,0,.07), 0 2px 0 rgba(0,0,0,.16); }
.pedal-name b { display: block; font-family: var(--logo); font-weight: 400; font-size: 21px; line-height: 1.1; letter-spacing: .02em; }
.pedal-name small { display: block; font-family: var(--mono); font-size: 11px; color: var(--ink-2); letter-spacing: .06em; text-transform: uppercase; }
.pedal-row { display: flex; align-items: flex-end; justify-content: center; gap: 22px; width: 100%; }
.pedal-foot { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fs-hint { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.9); text-shadow: 0 1px 0 rgba(0,0,0,.3); }
.footswitch {
  width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer; position: relative;
  background: radial-gradient(circle at 38% 32%, #ffffff, #c4c4c4 45%, #7a7a7a 80%, #585858);
  box-shadow: 0 0 0 6px rgba(0,0,0,.16), 0 0 0 8px rgba(255,255,255,.12), 0 6px 0 #474747, 0 10px 14px rgba(0,0,0,.3);
  transition: transform .06s, box-shadow .06s;
}
.footswitch::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f6f6f6, #adadad); box-shadow: inset 0 -2px 3px rgba(0,0,0,.22); }
.footswitch:active { transform: translateY(4px); box-shadow: 0 0 0 6px rgba(0,0,0,.16), 0 0 0 8px rgba(255,255,255,.12), 0 2px 0 #474747, 0 4px 6px rgba(0,0,0,.3); }
.led { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #7d3a33, #44160f); box-shadow: inset 0 0 0 1.5px rgba(0,0,0,.3); transition: .12s; }
.pedal.on .led { background: radial-gradient(circle at 40% 35%, #ffd0c2, #f0503a 50%, #b51f10); box-shadow: 0 0 9px 2px rgba(240, 80, 58, .55), inset 0 0 0 1.5px rgba(0,0,0,.2); }
.led.flash { background: radial-gradient(circle at 40% 35%, #fff2b0, #f2bf3a 55%, #a87a10) !important; box-shadow: 0 0 10px 3px rgba(242,191,58,.6) !important; }
.pedal-top { display: flex; align-items: center; gap: 10px; }
.pedal .seg { background: rgba(0,0,0,.2); }
.pedal .play-btn { --accent: #3b322d; }

/* knobs */
.knob { display: flex; flex-direction: column; align-items: center; width: 70px; }
.knob-dial {
  --angle: 0deg; width: 54px; height: 54px; border-radius: 50%; position: relative; cursor: grab; touch-action: none; outline: none;
  background: radial-gradient(circle at 36% 30%, #fdfbf5, #ece2cd 48%, #c4b493 92%);
  box-shadow: 0 3px 0 #8c7b5b, 0 6px 10px rgba(0,0,0,.24), inset 0 -2px 2px rgba(0,0,0,.1);
}
.knob-dial::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; background: conic-gradient(from -135deg, rgba(255,255,255,.7) 0 calc((var(--angle) + 135deg)), rgba(0,0,0,.16) 0 270deg, transparent 0); -webkit-mask: radial-gradient(circle, transparent 30px, #000 31px, #000 33px, transparent 34px); mask: radial-gradient(circle, transparent 30px, #000 31px, #000 33px, transparent 34px); }
.knob-dial::after { content: ""; position: absolute; left: 50%; top: 5px; width: 4px; height: 17px; margin-left: -2px; background: var(--ink); border-radius: 3px; transform-origin: 2px 22px; transform: rotate(var(--angle)); }
.knob-dial:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ink), 0 6px 10px rgba(0,0,0,.24); }
.knob-dial.dragging { cursor: grabbing; }
.knob-label { margin-top: 9px; font-family: var(--logo); font-size: 10.5px; letter-spacing: .05em; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.35); text-transform: uppercase; text-align: center; line-height: 1.1; cursor: help; }
.knob-value { font-family: var(--mono); font-size: 11.5px; color: var(--ink); background: rgba(251,248,241,.88); border-radius: 6px; padding: 0 5px; margin-top: 3px; min-width: 46px; text-align: center; white-space: nowrap; }
.knob.small { width: 62px; }
.knob.small .knob-dial { width: 42px; height: 42px; }
.knob.small .knob-dial::before { -webkit-mask: radial-gradient(circle, transparent 24px, #000 25px, #000 27px, transparent 28px); mask: radial-gradient(circle, transparent 24px, #000 25px, #000 27px, transparent 28px); }
.knob.small .knob-dial::after { height: 13px; top: 4px; transform-origin: 2px 17px; }
.knob.small .knob-label { font-size: 9.5px; margin-top: 7px; }
.knob.small .knob-value { font-size: 10.5px; min-width: 40px; }

/* tooltip */
.tip {
  position: fixed; left: 0; top: 0; z-index: 100; max-width: 230px; background: var(--ink); color: #f7f1e4; padding: 8px 11px; border-radius: 10px;
  font-size: 13.5px; line-height: 1.35; pointer-events: none; opacity: 0; transition: opacity .12s;
  box-shadow: 0 8px 20px rgba(0,0,0,.22);
}
.tip b { display: block; font-family: var(--logo); font-weight: 400; font-size: 11px; letter-spacing: .06em; color: #e3c48e; margin-bottom: 2px; text-transform: uppercase; }
.tip.show { opacity: 1; }
.tip::after { content: ""; position: absolute; left: var(--ax, 50%); bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: var(--ink); }
.tip.below::after { bottom: auto; top: -6px; border: 6px solid transparent; border-top: 0; border-bottom-color: var(--ink); }

/* segmented */
.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: 18px; background: rgba(45,38,34,.07); }
.seg-btn { border: 0; background: transparent; padding: 4px 11px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.92); }
.seg-btn.active { background: #f7f1e4; color: var(--ink); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.bench-head .seg-btn, .board-presets .seg-btn { color: var(--ink-2); }
.bench-head .seg-btn.active, .board-presets .seg-btn.active { background: var(--ink); color: var(--paper); }
.seg.small .seg-btn { font-size: 11.5px; padding: 3px 8px; }
.ctl-label { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.9); text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.ctl-group { display: flex; flex-direction: column; align-items: center; gap: 4px; }

/* comp meter */
.gr-meter { width: 100%; background: #221c19; border-radius: 8px; padding: 6px 8px; box-shadow: inset 0 2px 4px rgba(0,0,0,.5); }
.gr-meter .gr-label { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: #c2b391; letter-spacing: .06em; }
.gr-leds { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin-top: 4px; direction: rtl; }
.gr-leds i { height: 9px; border-radius: 2px; background: #3a302a; transition: background .05s; }
.gr-leds i.lit { background: #e6a53e; box-shadow: 0 0 5px rgba(230,165,62,.6); }
.gr-leds i.lit.hot { background: #e0583e; box-shadow: 0 0 5px rgba(224,88,62,.6); }

/* wah treadle */
.treadle-wrap { perspective: 520px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.treadle {
  width: 140px; height: 130px; border-radius: 16px 16px 12px 12px; cursor: ns-resize; touch-action: none; outline: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0) 0 10px, rgba(0,0,0,.32) 10px 13px), linear-gradient(#48423e, #2a2522);
  border: 3px solid #1c1816; box-shadow: 0 8px 0 #151210, 0 14px 20px rgba(0,0,0,.3);
  transform-origin: 50% 85%; transition: transform .03s linear; position: relative;
}
.treadle::after { content: "↑ toe  ·  heel ↓"; position: absolute; left: 0; right: 0; bottom: -30px; text-align: center; font-family: var(--mono); font-size: 10.5px; color: rgba(255,255,255,.88); letter-spacing: .06em; }
.treadle-wrap { position: relative; }
.drag-hint {
  position: absolute; top: 34px; left: 50%; transform: translateX(-50%); pointer-events: none; z-index: 2;
  background: #fbf8f1; color: var(--ink); font: 700 12px/1 var(--body); padding: 6px 10px; border-radius: 999px;
  box-shadow: 0 3px 10px rgba(0,0,0,.35); white-space: nowrap; animation: nudge 1.4s ease-in-out infinite;
}
.drag-hint b { font-size: 15px; vertical-align: -1px; }
@keyframes nudge { 0%, 100% { transform: translate(-50%, -7px); } 50% { transform: translate(-50%, 9px); } }
.treadle { cursor: grab; }
.treadle.dragging { cursor: grabbing; }
.treadle:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.treadle-readout { margin-top: 24px; font-family: var(--mono); font-size: 12px; background: rgba(251,248,241,.88); color: var(--ink); border-radius: 6px; padding: 0 8px; }
.pedal.wah, .pedal.wide { width: 390px; }
.wah-row { display: flex; align-items: center; justify-content: center; gap: 18px; width: 100%; }
.wah-ctls { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.wah-row .treadle { width: 130px; height: 120px; }
@media (max-width: 440px) { .wah-row { flex-direction: column; } }

/* ---------- board ---------- */
.order-line, .cheat-order { font-family: var(--mono); font-size: 13.5px; margin: 0 0 14px 70px; line-height: 2.2; }
@media (max-width: 640px) { .order-line { margin-left: 0; } }
.ol-chip { border: 1.5px solid color-mix(in oklab, var(--c) 55%, var(--paper)); color: color-mix(in oklab, var(--c) 70%, black); padding: 2px 10px; border-radius: 999px; white-space: nowrap; transition: background .2s, color .2s, border-color .2s; }
.ol-chip.on { background: var(--c); border-color: var(--c); color: #fff; }
.ol-lbl, .ol-arrow { color: var(--ink-3); }
.ol-arrow { margin: 0 5px; }
.ol-note { margin-left: 14px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.cheat-order { margin: 26px 0 0; text-align: center; }
.cheat-order span { background: var(--c); color: #fff; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.cheat-order .lbl { background: none; color: var(--ink-3); padding: 0; margin-right: 8px; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; }

/* board on the left (two rows of four), output graphs stacked beside it; one long row on very wide screens */
.board-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; }
.board-top { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (max-width: 1100px) {
  .board-main { grid-template-columns: minmax(0, 1fr); }
  .board-top { grid-template-columns: 1fr 1fr; order: -1; }
}
@media (max-width: 700px) { .board-top { grid-template-columns: 1fr; } }
@media (min-width: 1541px) {
  .page-wide .bench-board { width: min(calc(100vw - 40px), 1540px); position: relative; left: 50%; translate: -50% 0; }
  .board-main { grid-template-columns: minmax(0, 1fr); }
  .board-top { grid-template-columns: 1fr 1fr; order: -1; }
}
.board-presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.board-presets .lbl { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.board { background: linear-gradient(#4a413b, #383029); border-radius: 18px; padding: 20px 16px 18px; box-shadow: inset 0 2px 0 rgba(255,255,255,.06), inset 0 -4px 0 rgba(0,0,0,.22); position: relative; }
.board-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 14px; align-items: stretch; max-width: 760px; margin: 0 auto; padding: 4px 0 2px; }
.board-sp { display: none; width: 36px; }
@media (min-width: 880px) and (max-width: 1540px) { .board-sp { display: block; } }
@media (min-width: 1541px) { .board-row { max-width: none; flex-wrap: nowrap; } }
.board-io { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; color: #e3d7bf; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; gap: 6px; width: 36px; }
.board-io .io-icon .ico { width: 28px; height: 28px; stroke-width: 1.5; display: block; }
/* patch cables: a short lead from each box back to the one before it */
.board-row > .pedal.compact::before, .board-row > .board-io:last-child::before {
  content: ""; position: absolute; left: -14px; top: 50%; width: 14px; height: 5px; margin-top: -2px; background: #1d1816; box-shadow: 0 1px 0 rgba(255,255,255,.07);
}
.board .pedal.compact { cursor: grab; transition: transform .12s, box-shadow .12s; }
.board .pedal.compact.dragging { cursor: grabbing; transform: translateY(-7px) rotate(-1.5deg); z-index: 2;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.28), inset 0 -3px 0 rgba(0,0,0,.14), 0 9px 0 -1px color-mix(in oklab, var(--c) 55%, black), 0 26px 34px rgba(0,0,0,.45); }
.board-row.sorting { cursor: grabbing; }
.board-row.sorting .pedal.compact:not(.dragging) { filter: saturate(.8) brightness(.94); }
.pedal.compact { width: 150px; padding: 16px 10px 14px; gap: 10px; border-radius: 14px; }
.pedal.compact .pedal-name { padding: 4px 6px 3px; min-width: 0; width: 100%; }
.pedal.compact .pedal-name b { font-size: 13.5px; }
.pedal.compact .pedal-name small { font-size: 9px; }
.pedal.compact .pedal-knobs { gap: 6px 4px; }
.pedal.compact .pedal-row { margin-top: auto; }
.pedal.compact .footswitch { width: 46px; height: 46px; }
.pedal.compact .footswitch::after { inset: 11px; }
.pedal.compact .screw { width: 8px; height: 8px; }
.pedal.compact .screw::after { top: 3.5px; }
.pedal.compact .seg.small { flex-wrap: nowrap; }
.pedal.compact .seg.small .seg-btn { padding: 3px 5px; font-size: 10.5px; }
.move-btns { display: flex; gap: 6px; }
.move-btn { border: 0; width: 28px; height: 24px; border-radius: 7px; background: rgba(0,0,0,.22); color: #fff; cursor: pointer; font-size: 13px; line-height: 1; }
.move-btn:hover { background: rgba(0,0,0,.38); }
.move-btn:disabled { opacity: .3; cursor: default; }
.pedal.compact.moved { animation: bump .35s ease; }
@keyframes bump { 40% { transform: translateY(-8px) rotate(-2deg); } }
.board-hint { color: #c8bb9c; font-size: 13px; text-align: center; margin: 12px 0 0; font-family: var(--mono); }

/* ---------- quiz ---------- */
.quiz { margin: 8px 0 0 70px; }
@media (max-width: 640px) { .quiz { margin-left: 0; } }
.quiz-card { background: var(--card); border: 2px solid var(--ink); border-radius: 20px; padding: 24px; box-shadow: 7px 7px 0 var(--c-intro); }
.quiz-dots { display: flex; gap: 6px; }
.quiz-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.quiz-dots i.right { background: var(--c-delay); } .quiz-dots i.wrong { background: var(--c-intro); } .quiz-dots i.cur { box-shadow: 0 0 0 2px var(--ink); }
.quiz-q { font-family: var(--display); font-size: 26px; margin: 0 0 14px; font-variation-settings: "SOFT" 100; }
.quiz-play { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.quiz-play .play-btn { --accent: var(--c-ink); }
.quiz-play .play-btn.dry { --accent: #8d8277; }
.quiz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .quiz-opts { grid-template-columns: 1fr; } }
.quiz-opt { border: 2px solid var(--ink); background: var(--paper); border-radius: 14px; padding: 11px 14px; cursor: pointer; text-align: left; font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; transition: transform .08s; }
.quiz-opt:hover:not(:disabled) { transform: translateY(-2px); background: #fff; }
.quiz-opt .sw { width: 14px; height: 14px; border-radius: 4px; background: var(--c); flex: none; }
.quiz-opt.right { background: #e2eddc; border-color: var(--c-delay); }
.quiz-opt.wrong { background: #f3dfda; border-color: var(--c-intro); }
.quiz-opt:disabled { cursor: default; }
.quiz-feedback { margin-top: 14px; padding: 12px 16px; border-radius: 12px; background: var(--paper); display: none; }
.quiz-feedback.show { display: block; }
.quiz-feedback b { font-family: var(--display); font-size: 19px; }
.quiz-next { margin-top: 12px; }
.quiz-final { text-align: center; }
.quiz-final .score { font-family: var(--logo); font-size: 72px; line-height: 1; color: var(--c-intro); margin: 6px 0; }
.btn { border: 0; cursor: pointer; background: var(--ink); color: var(--paper); font-weight: 700; padding: 10px 20px; border-radius: 999px; box-shadow: 0 4px 0 #000; transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }

/* ---------- cheat sheet ---------- */
.cheat { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 8px 0 0; }
@media (max-width: 900px) { .cheat { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .cheat { grid-template-columns: 1fr; } }
.cheat-card { text-decoration: none; background: var(--card); border-radius: 14px; padding: 14px 14px 12px; border-left: 7px solid var(--c); box-shadow: 0 1px 0 var(--line), 0 8px 18px rgba(45,38,34,.05); transition: transform .15s; }
.cheat-card:hover { transform: translateY(-3px); }
.cheat-card h4 { margin: 0 0 4px; font-family: var(--display); font-size: 19px; font-variation-settings: "SOFT" 100; }
.cheat-card p { margin: 0 0 6px; font-size: 15px; }
.cheat-card small { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.sign { font-family: var(--display); font-size: 30px; font-style: italic; text-align: center; margin: 34px 0 0; }

/* ---------- pager (bottom bar) ---------- */
.pager {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px max(16px, calc((100vw - 1120px) / 2 + 20px)) 14px; background: linear-gradient(rgba(242,236,224,0), var(--paper) 40%);
  pointer-events: none;
}
.pager > * { pointer-events: auto; }
.pager-back, .pager-next { border: 0; cursor: pointer; border-radius: 999px; font-weight: 700; white-space: nowrap; transition: transform .08s, box-shadow .08s, opacity .2s; }
.pager-back { background: var(--card); color: var(--ink-2); padding: 11px 18px; border: 1.5px solid var(--line); }
.pager-back:hover { color: var(--ink); border-color: var(--ink-3); }
.pager-back.hidden { opacity: 0; pointer-events: none; }
.pager-next { background: var(--ink); color: var(--paper); padding: 12px 22px; font-size: 16.5px; box-shadow: 0 4px 0 #000, 0 8px 16px rgba(0,0,0,.15); }
.pager-next:hover { transform: translateY(-1px); }
.pager-next:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.pager-next .nx { opacity: .6; font-weight: 500; margin-right: 6px; }
.dock { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; background: rgba(45,38,34,.92); color: var(--paper); border-radius: 999px; font-size: 13.5px; min-width: 0; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.dock-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.dock-dot { width: 8px; height: 8px; border-radius: 50%; background: #6d625a; flex: none; }
.dock.playing .dock-dot { background: #8fcf86; box-shadow: 0 0 7px #8fcf86; }
.dock-stop { border: 0; background: var(--c-intro); color: #fff; border-radius: 999px; width: 28px; height: 28px; cursor: pointer; font-size: 11px; flex: none; }
.dock-stop:disabled { background: #574d46; color: #998d82; cursor: default; }
.dock-vol { display: flex; align-items: center; gap: 4px; }
.dock-vol input { width: 80px; accent-color: #c9a26b; }
.dock-file { cursor: pointer; border: 1.5px solid rgba(255,255,255,.25); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; white-space: nowrap; }
.dock-file:hover { border-color: #fff; }
@media (max-width: 760px) {
  .dock-text, .dock-file { display: none; }
  .dock { padding: 6px 10px; }
  .dock-vol input { width: 64px; }
  .pager-next .nx { display: none; }
  .pager-back { padding: 11px 14px; }
}
@media (max-width: 420px) { .dock-vol { display: none; } }

.toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 8px 16px; border-radius: 10px; z-index: 70; font-size: 14px; opacity: 0; transition: opacity .25s; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; }

@media (max-width: 560px) {
  main { padding-top: 22px; }
  .page-head { gap: 12px; }
  .chapter-num { width: 42px; height: 42px; font-size: 17px; }
  .pedal { padding: 20px 14px 18px; }
  .mini-board::before { display: none; }
  .mini-board { gap: 10px; padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .page.active { animation: none; }
  .play-btn.sparkle, .play-btn.sparkle::before, .play-btn.sparkle::after, .drag-hint { animation: none; }
  .play-btn.sparkle::before, .play-btn.sparkle::after { opacity: 1; }
  .drag-hint { transform: translateX(-50%); }
  .mini-pedal .ml { animation: none; }
}
.bench-pedal { min-width: 0; max-width: 100%; display: flex; justify-content: center; }
@media (max-width: 880px) { .bench-pedal { width: 100%; } }
@media (max-width: 440px) { .pedal.wah .pedal-knobs { gap: 8px; } }
.credits { text-align: center; font-size: 13px; color: var(--ink-3); margin: 10px 0 0; }

/* ---------- ear training: side score panel ---------- */
.quiz { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 22px; align-items: start; max-width: 980px; }
@media (max-width: 860px) { .quiz { grid-template-columns: 1fr; max-width: 760px; } }
.quiz-stats { padding: 4px 2px; font-size: 13px; }
.qs-label { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.qs-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.qs-score { font-family: var(--mono); color: var(--ink-3); }
.qs-score b { font-size: 18px; font-weight: 500; color: var(--ink); }
.qs-streak { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin: 4px 0 14px; }
.qs-sub { margin-bottom: 4px; }
.split { display: block; height: 5px; border-radius: 999px; overflow: hidden; background: var(--c-intro); }
.split.big { height: 8px; }
.split.empty { background: var(--line); }
.split i { display: block; height: 100%; background: var(--c-delay); transition: width .4s; }
.qs-row { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; align-items: center; padding: 6px 0; }
.qs-row .split { grid-column: 1 / -1; }
.qs-name { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); min-width: 0; }
.qs-name .sw { width: 8px; height: 8px; border-radius: 2px; background: var(--c); flex: none; }
.qs-num { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.qs-review { margin-left: 2px; font: 500 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--c-intro); }
.stat-reset { margin-top: 8px; background: none; border: 0; color: var(--ink-3); font-size: 12px; text-decoration: underline; cursor: pointer; padding: 0; }

/* ---------- icons & glyphs ---------- */
.ico { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; flex: none; }
.chip .ico, .hero-note .ico { margin-right: 6px; }
.dock-vol .ico { width: 17px; height: 17px; }
.glyph { width: 72px; height: 28px; display: block; fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.glyph .ghost { opacity: .45; stroke-width: 1.5; stroke-dasharray: 2.5 3.5; }
.glyph .soft { opacity: .4; }
.glyph .fill { fill: var(--c); stroke: none; }
.glyph .ghost-fill { fill: var(--c); stroke: none; opacity: .28; }
.glyph .wash { fill: var(--c); stroke: none; opacity: .45; }
.cheat-card .glyph { margin: 0 0 10px; }
.quiz-feedback .glyph { float: right; margin: 2px 0 6px 14px; }

/* ---------- keyboard focus ---------- */
:where(button, a, label.dock-file):focus-visible { outline: 2.5px solid var(--ink); outline-offset: 2px; }
:where(.pedal, .board, .dock, .tip) :where(button, a):focus-visible { outline-color: #fff; }
.progress button:focus-visible { outline-offset: -1px; }

/* ---------- hero extras ---------- */
.keys { margin: 26px 0 0; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.keys kbd { font: 500 11px/1 var(--mono); color: var(--ink-2); background: var(--card); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 3px 7px; margin: 0 2px 0 20px; display: inline-block; }
.keys kbd + kbd { margin-left: -4px; }
.keys kbd:first-child { margin-left: 0; }
@media (hover: none) { .keys { display: none; } }
/* a little pulse of signal running down the cable behind the pedals */
.mini-board::after {
  content: ""; position: absolute; top: 50%; left: 10px; width: 46px; height: 3px; z-index: 0; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #e8b76a 60%, transparent); animation: travel 3.6s linear infinite;
}
@keyframes travel { from { left: 10px; } to { left: calc(100% - 56px); } }
@media (max-width: 760px) { .mini-board::after { display: none; } }

/* ---------- first-visit knob hint: caption + a wiggle on the first dial ---------- */
.knob-hint { margin: -4px 0 -2px; font: 600 11.5px/1 var(--body); color: #fff; background: rgba(0,0,0,.24); padding: 5px 11px; border-radius: 999px; transition: opacity .5s; }
.knob-hint b { font-size: 13px; }
.knob-hint.gone { opacity: 0; }
.pedal.hinting .pedal-knobs .knob:first-child .knob-dial::after { animation: wiggle 2.8s ease-in-out infinite; }
@keyframes wiggle { 0%, 55%, 100% { rotate: 0deg; } 66% { rotate: -18deg; } 78% { rotate: 16deg; } 89% { rotate: -6deg; } }

/* ---------- presets row ---------- */
.preset-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-left: 6px; }
.preset-bar .lbl { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- signal-path diagram ---------- */
.bench-pedal { flex-direction: column; align-items: center; gap: 14px; }
.flow { width: 0; min-width: 100%; max-width: 390px; padding: 10px 8px 6px; }
.flow figcaption { padding: 0 4px; }
.bench-graphs .flow { width: auto; min-width: 0; max-width: none; }
.bench-graphs.two .flow { grid-column: 1 / -1; }
.bench-graphs .flow svg { max-width: 384px; margin: 0 auto; }
.pedal.wide .pedal-knobs { gap: 12px 8px; }
.flow svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--body); }
.flow .fw { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.flow .fa { fill: var(--ink-2); }
.flow .fw.ctl { stroke: var(--accent); stroke-dasharray: 3 3; }
.flow .fa.ctl { fill: var(--accent); }
.flow .fw.dim, .flow .fa.dim { opacity: .25; }
.flow .fw.pulse { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 1 13; opacity: 0; }
.flow.playing .fw.pulse { opacity: 1; animation: march .6s linear infinite; }
@keyframes march { to { stroke-dashoffset: -14; } }
.flow .fb rect, .flow .fb circle { fill: var(--card); stroke: var(--accent); stroke-width: 1.5; transition: fill .12s; }
.flow .fb.ctl rect { stroke-dasharray: 4 3; }
.flow .fb text { font-size: 11.5px; font-weight: 600; fill: var(--ink); text-anchor: middle; transition: fill .12s; }
.flow .fb.sum path { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.flow .fb.hot rect, .flow .fb.hot circle { fill: var(--accent); stroke-dasharray: none; }
.flow .fb.hot text { fill: #fff; }
.flow .fb.hot path { stroke: #fff; }
.flow .fw.hot { stroke-width: 2.6; opacity: 1; }
.flow .fa.hot { opacity: 1; }
.flow .fs { font-family: var(--mono); font-size: 9.5px; fill: var(--ink-3); }
.flow .fs.ctl { fill: color-mix(in oklab, var(--accent) 78%, black); }
.flow .fio { font-family: var(--mono); font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; fill: var(--ink-3); text-anchor: middle; }
.flow .fd { fill: var(--ink-2); }
.flow svg.off .fbody { opacity: .28; }
.flow svg.off .pulse { display: none; }
.flow .fbypass rect { fill: var(--card); stroke: var(--line); }
.flow .fbypass text { font-family: var(--mono); font-size: 9.5px; fill: var(--ink-2); text-anchor: middle; }
/* a knob lights up with its block, and the other way round */
.knob.hot .knob-dial { box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 3px 0 #8c7b5b, 0 6px 10px rgba(0,0,0,.24); }
.seg.hot { box-shadow: 0 0 0 2px rgba(255,255,255,.8); }
.treadle.hot { border-color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .mini-board::after, .pedal.hinting .knob-dial::after, .flow.playing .fw.pulse { animation: none; }
  .mini-board::after { display: none; }
}

/* ---------- small screens: chain line wraps, board fits two pedals a row ---------- */
.order-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; line-height: 1.5; }
@media (max-width: 480px) {
  .board { padding: 14px 8px 14px; }
  .board-row { gap: 18px 10px; }
  .pedal.compact { width: 142px; padding: 16px 7px 14px; }
  .board-io { display: none; }
  .board-row > .pedal.compact::before, .board-row > .board-io:last-child::before { left: -10px; width: 10px; }
}
