/* Play Fast Guitar
   ------------------------------------------------------------------
   Three themes: light (default), dark, wood. Every colour is a custom
   property redefined per theme — there are NO colour literals below the
   token blocks, which is what makes a per-theme contrast audit possible.

   Contents:
     1. Themes / tokens
     2. Base
     3. Header / footer / theme switch
     4. Hero, sections, cards, prose
     5. Controls
     6. The tool: meter, readouts, level, devices
     7. Curve graph, slot heatmap, history
     8. Forms
     9. Utilities + reduced motion
   ------------------------------------------------------------------ */

/* ===================== 1. Themes ===================== */
:root,
:root[data-theme="light"] {
  --bg:        #F7F8F9;
  --surface:   #FFFFFF;
  --surface-2: #EEF2F6;
  --line:      #DDE4EC;
  --line-2:    #BFC9D4;

  --ink:       #0F141B;
  --ink-body:  #313C49;
  /* Measured against --surface-2 (#EEF2F6), the lightest bed small labels sit
     on, not against --bg. Same trap as the gray theme: passing on the page and
     failing on the panel is the usual way this goes wrong. */
  --ink-mute:  #56616E;

  /* Blue carries text, orange does not. #F6821F is 2.4:1 on white — fine as a
     lamp or a fill, never as a label. That is why --led exists separately. */
  --accent:     #0051C3;
  --accent-2:   #003682;
  --accent-ink: #FFFFFF;
  --accent-wash:#E7F0FD;

  --led:      #F6821F;
  --led-off:  #C8D0D9;
  --led-glow: 0 0 6px rgba(246,130,31,.55);

  --good:  #0F7A43;
  --ok:    #A65A00;
  --bad:   #BE1622;
  --early: #0A5E92;
  --late:  #8A2569;

  --meter-bed: #E6ECF2;
  --shadow: 0 1px 2px rgba(15,25,40,.06), 0 8px 24px rgba(15,25,40,.07);

  --display: "Barlow Condensed", "Oswald", "Inter", system-ui, sans-serif;
  --display-tracking: .05em;
  --display-case: uppercase;
}

/* The gray mode: same layout, low glare, for practising at night. */
:root[data-theme="gray"] {
  --bg:        #1B1D22;
  --surface:   #282B31;
  --surface-2: #33373E;
  --line:      #3A3E46;
  --line-2:    #4A4F59;

  --ink:       #C8CCD2;
  --ink-body:  #A8ADB5;
  /* Against --surface-2 (#33373E): #939AA3 passed on bg at 5.95 and failed on
     the strip at 4.21. The strip is the binding constraint. */
  --ink-mute:  #9AA1AA;

  --accent:     #5CA0FF;
  --accent-2:   #8FBEFF;
  --accent-ink: #0A1729;
  --accent-wash:#16233A;

  --led:      #F6821F;
  --led-off:  #454A54;
  --led-glow: 0 0 7px rgba(246,130,31,.7);

  --good:  #4ECB8F;
  --ok:    #E9A33C;
  --bad:   #FF7B80;   /* #FF6B70 was 4.32 on the strip */
  --early: #5BB8E8;
  --late:  #E886C4;

  --meter-bed: #15171B;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 6px 20px rgba(0,0,0,.45);

  --display: "Barlow Condensed", "Oswald", "Inter", system-ui, sans-serif;
  --display-tracking: .06em;
  --display-case: uppercase;
}

:root {
  --r: 10px; --r-lg: 16px; --r-pill: 999px;
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem;
  --s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem; --s-8: 4.5rem;
  --shell: 1120px;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --measure: 66ch;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  /* Panel lettering. Only the rig theme swaps this for a condensed face — the
     other three themes are documents, and condensed caps in running text is a
     headache. */
  --display: var(--sans);
  --display-tracking: 0;
  --display-case: none;
  --t-xs: .78rem; --t-sm: .9rem; --t-base: 1.02rem;
  --t-lede: clamp(1.08rem, 1rem + .5vw, 1.26rem);
  --t-h3: clamp(1.1rem, 1rem + .45vw, 1.28rem);
  --t-h2: clamp(1.55rem, 1.25rem + 1.6vw, 2.3rem);
  --t-h1: clamp(2.1rem, 1.5rem + 3.2vw, 3.7rem);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ===================== 2. Base ===================== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink-body);
  font-family: var(--sans); font-size: var(--t-base); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { color: var(--ink); line-height: 1.14; margin: 0 0 var(--s-4); font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: var(--t-h1); } h2 { font-size: var(--t-h2); } h3 { font-size: var(--t-h3); line-height: 1.28; }
p { margin: 0 0 1.1em; max-width: var(--measure); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-2); }
strong { color: var(--ink); font-weight: 650; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-6) 0; }

.shell { max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.eyebrow { font-size: var(--t-xs); font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--accent); margin: 0 0 var(--s-3); }
.lede { font-size: var(--t-lede); color: var(--ink-body); }
.mute { color: var(--ink-mute); font-size: var(--t-sm); }

/* ===================== 3. Header / footer ===================== */
.masthead { border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; background: var(--bg); }
.masthead .shell { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 62px; }
.wordmark { display: inline-flex; align-items: center; gap: .5rem; font-weight: 750; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.wordmark svg { flex: none; }
.wordmark em { font-style: normal; color: var(--accent); }
.nav { display: flex; gap: var(--s-5); align-items: center; }
.nav a { color: var(--ink-body); text-decoration: none; font-size: var(--t-sm); font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }

.themeswitch { display: inline-flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; }
.themeswitch button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: var(--ink-mute); border-radius: var(--r-pill);
  width: 34px; height: 30px; display: grid; place-items: center; font-size: 15px; line-height: 1;
}
.themeswitch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* Nav is NOT hidden on small screens — there is no burger to replace it, so
   hiding leaves phone visitors with no navigation. It scrolls instead. */
@media (max-width: 780px) {
  .masthead .shell { flex-wrap: wrap; padding-block: var(--s-3); min-height: 0; }
  .nav { order: 3; width: 100%; gap: var(--s-4); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
}

.footer { border-top: 1px solid var(--line); margin-top: var(--s-8); padding: var(--s-7) 0 var(--s-6); color: var(--ink-mute); font-size: var(--t-sm); }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: var(--s-6); }
@media (max-width: 720px) { .footer__grid { grid-template-columns: 1fr; } }
.footer h3 { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .12em; color: var(--ink); margin-bottom: var(--s-3); }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-2); }
.footer a { color: var(--ink-mute); text-decoration: none; }
.footer a:hover { color: var(--accent); }
.footer__legal { margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--line); font-size: var(--t-xs); }

/* ===================== 4. Sections ===================== */
.hero { padding: clamp(2.2rem, 5vw, 4rem) 0 var(--s-5); }
.hero h1 { max-width: 17ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { max-width: 56ch; }
.section { padding: var(--s-8) 0; }
.section--tint { background: var(--surface); border-block: 1px solid var(--line); }
.section__head { max-width: 62ch; margin-bottom: var(--s-6); }
.grid { display: grid; gap: var(--s-4); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5); }
.section--tint .card { background: var(--surface-2); }
.card h3 { margin-bottom: var(--s-2); }
.card p { margin: 0; font-size: var(--t-sm); color: var(--ink-mute); }
.prose { max-width: 68ch; }
.prose h2 { margin-top: var(--s-7); } .prose h3 { margin-top: var(--s-6); }
.prose ul { padding-left: 1.15rem; } .prose li { margin-bottom: var(--s-2); }

/* ===================== 5. Controls ===================== */
.btn {
  appearance: none; cursor: pointer; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 46px; padding: 0 1.25rem; border-radius: var(--r-pill);
  font: 650 1rem/1 var(--sans); background: var(--accent); color: var(--accent-ink);
  transition: transform .12s var(--ease), background .12s var(--ease);
}
.btn:hover { background: var(--accent-2); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn--sm { min-height: 38px; padding: 0 .9rem; font-size: var(--t-sm); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.ctl { display: grid; gap: var(--s-2); }
.ctl > label { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .09em; color: var(--ink-mute); font-weight: 650; }
.ctl input[type="number"], .ctl select, select.input {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: .5rem .65rem; font: 600 1rem/1.2 var(--mono);
  min-height: 44px;
}
select.input { font-family: var(--sans); font-weight: 500; width: 100%; max-width: 420px; }
.ctl input[type="range"] { width: 200px; accent-color: var(--accent); }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.seg button {
  appearance: none; border: 0; background: transparent; color: var(--ink-mute);
  font: 600 var(--t-sm)/1 var(--sans); padding: .5rem .8rem; border-radius: var(--r-pill);
  cursor: pointer; min-height: 36px;
}
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* ===================== 6. The tool ===================== */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(1rem, 3vw, 1.75rem); margin-top: var(--s-6); box-shadow: var(--shadow); }
.tool__head { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: end; justify-content: space-between; margin-bottom: var(--s-5); }
.tool__title { margin: 0; font-size: var(--t-h3); }
.controls { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: flex-end; }

.meter { position: relative; height: 140px; margin: var(--s-5) 0 var(--s-4); background: var(--meter-bed); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.meter__zone { position: absolute; top: 0; bottom: 0; }
.meter__zone--early { left: 0; right: 54%; background: color-mix(in srgb, var(--early) 10%, transparent); }
.meter__zone--late { left: 54%; right: 0; background: color-mix(in srgb, var(--late) 10%, transparent); }
.meter__pocket { position: absolute; top: 0; bottom: 0; left: 46%; width: 8%; background: color-mix(in srgb, var(--good) 16%, transparent); border-inline: 1px dashed var(--good); }
.meter__centre { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--good); }
.meter__scale { position: absolute; inset: auto 0 6px 0; display: flex; justify-content: space-between; padding: 0 .6rem; font: 600 var(--t-xs)/1 var(--mono); color: var(--ink-mute); }
.meter__hit { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--ok); animation: drop .9s var(--ease) forwards; }
.meter__hit.is-good { background: var(--good); }
.meter__hit.is-bad { background: var(--bad); }
@keyframes drop { from { opacity: 1; transform: scale(1.5); } to { opacity: 0; transform: scale(.7) translateY(24px); } }

.beatdots { display: flex; gap: 7px; justify-content: center; margin-bottom: var(--s-4); flex-wrap: wrap; }
.beatdot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); transition: background .08s linear, transform .08s linear; }
.beatdot.is-on { background: var(--accent); transform: scale(1.55); }
.beatdot.is-accent { background: var(--ink-mute); }

.readouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: var(--s-3); }
.readout { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s-3) var(--s-4); }
.readout b { display: block; font: 700 1.6rem/1.05 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.readout span { display: block; font-size: var(--t-xs); color: var(--ink-mute); margin-top: .3rem; text-transform: uppercase; letter-spacing: .07em; }
.readout.is-good b { color: var(--good); }
.readout.is-bad b { color: var(--bad); }

.verdict { margin-top: var(--s-4); padding: var(--s-4); border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.verdict strong { color: var(--accent); }

.note { display: flex; gap: .6rem; font-size: var(--t-sm); color: var(--ink-mute); background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r); padding: var(--s-3) var(--s-4); margin-top: var(--s-4); }
.note p { margin: 0; max-width: none; }
.note--warn { border-left-color: var(--bad); }
.note--ok { border-left-color: var(--good); }
.status { font: 600 var(--t-sm)/1.45 var(--mono); color: var(--ink-mute); min-height: 1.45em; margin-top: var(--s-3); }

/* Latency breakdown + the direct-monitoring hint. Both are secondary readouts
   under the status line: mono so the numbers align, and never louder than the
   status text they sit beneath. */
.latencydetail {
  font: 500 var(--t-xs)/1.5 var(--mono);
  color: var(--ink-mute);
  margin-top: var(--s-2);
}
.latencydetail b { color: var(--ink); font-weight: 700; }
.latencydetail .warn { color: var(--ok); }

.rig__hint {
  font: 400 var(--t-xs)/1.5 var(--sans);
  color: var(--ink-mute);
  margin: var(--s-2) 0 0;
  padding: var(--s-3) var(--s-4);
  border-left: 2px solid var(--line-2);
  background: var(--surface-2);
  max-width: 62ch;
}
.rig__hint b { color: var(--ink); font-weight: 650; }

/* ---- latency counter ---------------------------------------------------
   Tabular figures so the number does not jitter sideways as it changes — a
   readout that shifts while you watch it reads as unstable even when the
   value is fine. */
.counter {
  display: inline-flex; align-items: baseline; gap: 1px;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  padding: 3px 9px; border-radius: var(--r);
  background: var(--meter-bed); border: 1px solid var(--line);
  color: var(--ink);
}
.counter__num  { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; }
.counter__unit { font-size: .68rem; color: var(--ink-mute); font-weight: 600; }
/* Uncalibrated is the default and it is a warning, not a neutral state. */
.counter.is-idle .counter__num { color: var(--ink-mute); }
.counter.is-good .counter__num { color: var(--good); }
.counter.is-warn .counter__num { color: var(--ok); }
.counter.is-bad  .counter__num { color: var(--bad); }

/* ---- logo -------------------------------------------------------------- */
.logo { display: block; flex: none; }
.wordmark { display: inline-flex; align-items: center; gap: var(--s-3); }

/* ---- feature icons ------------------------------------------------------
   The icon sits between the LED and the label, and dims when the feature is
   off so the row reads at a glance as lit/unlit rather than needing the label. */
.feature .ficon { flex: none; opacity: .55; transition: opacity .12s; }
.feature[aria-pressed="true"] .ficon { opacity: 1; }

/* --- input level --- */
.levelrow { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-3); }
.levelbar { position: relative; flex: 1 1 auto; height: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); overflow: hidden; }
.levelbar__fill { position: absolute; inset: 0 100% 0 0; background: var(--good); transition: right .05s linear; }
.levelbar__fill.is-hot { background: var(--ok); }
.levelbar__fill.is-clip { background: var(--bad); }
.levelbar__peak { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); opacity: .6; }

/* ===================== 7. Curve, slots, history ===================== */
.curve { width: 100%; height: auto; display: block; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); }
.curve .grid-line { stroke: var(--line); stroke-width: 1; }
.curve .zone-ok { fill: color-mix(in srgb, var(--good) 12%, transparent); }
.curve .zone-push { fill: color-mix(in srgb, var(--ok) 12%, transparent); }
.curve .target-line { fill: none; stroke: var(--line-2); stroke-width: 2.5; stroke-dasharray: 6 5; }
.curve .achieved-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; }
.curve .pt { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; cursor: grab; }
.curve .pt.is-pass { fill: var(--good); stroke: var(--good); }
.curve .pt.is-fail { fill: var(--bad); stroke: var(--bad); }
.curve .now { stroke: var(--accent); stroke-width: 2; }
.curve text { font: 600 11px var(--mono); fill: var(--ink-mute); }

.slots { display: grid; grid-auto-flow: column; gap: var(--s-2); margin-top: var(--s-4); }
.slot { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s-3); text-align: center; }
.slot__name { font: 700 1.1rem/1 var(--mono); color: var(--ink); }
.slot__val { font: 600 var(--t-sm)/1 var(--mono); margin-top: .4rem; font-variant-numeric: tabular-nums; }
.slot.is-good .slot__val { color: var(--good); }
.slot.is-warn .slot__val { color: var(--ok); }
.slot.is-bad .slot__val { color: var(--bad); }
.slot__bar { height: 4px; margin-top: .5rem; border-radius: 2px; background: var(--line); }

.history { width: 100%; height: auto; display: block; }
.history .axis { stroke: var(--line); stroke-width: 1; }
.history .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.history .dot { fill: var(--accent); }
.history text { font: 600 10px var(--mono); fill: var(--ink-mute); }

table.data { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
table.data th, table.data td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
table.data th { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-mute); font-weight: 700; }
table.data td.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ===================== 8. Forms ===================== */
.signup { display: flex; flex-wrap: wrap; gap: var(--s-3); max-width: 520px; }
.signup input[type="email"] { flex: 1 1 240px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 0 1.05rem; min-height: 46px; font: 500 1rem/1 var(--sans); }
.signup input::placeholder { color: var(--ink-mute); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.formstatus { font-size: var(--t-sm); margin-top: var(--s-3); min-height: 1.4em; }
.formstatus.is-bad { color: var(--bad); }
.formstatus.is-ok { color: var(--good); }

/* ===================== 9. Utilities ===================== */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.stack > * + * { margin-top: var(--s-4); }
.row { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; }
.spread { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; justify-content: space-between; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .meter__hit { animation: none; opacity: .9; }
}

/* ===================================================================
   10. Minimalist pass
   ===================================================================
   Flatter than before: shadows off, hairline borders, more air. At large
   sizes weight is what stops something reading as minimal, so weight is
   what gets removed. */
:root { --shadow: none; }
.tool, .card, .pedal, .inputpanel { box-shadow: none; }
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--tint { background: transparent; border-block: 1px solid var(--line); }
.hero--tight { padding-bottom: var(--s-4); }
.switches { display: flex; gap: var(--s-2); align-items: center; }

/* ===================================================================
   11. Vector art — one markup, three modes
   =================================================================== */
.art { display: block; width: 100%; height: auto; color: var(--ink); }
.art .art-body, .art .art-detail, .art .art-accent {
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}

/* One art style — the thin line. The bold and two-tone modes and their switch
   are gone: three looks meant every drawing had to survive three treatments,
   and the fine line is the one that suits an instrument panel. */
.art .art-body   { stroke: currentColor; stroke-width: 2.2; }
.art .art-detail { stroke: currentColor; stroke-width: 1.6; opacity: .42; }
.art .art-accent { stroke: var(--accent); stroke-width: 2.2; }

/* ===================================================================
   12. The pedalboard
   =================================================================== */
.inputpanel { border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-5); background: var(--surface); }
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); margin-top: var(--s-5); }
@media (max-width: 1000px) { .board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .board { grid-template-columns: 1fr; } }

.pedal { grid-column: span 2; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); display: flex; flex-direction: column; }
.pedal--sm { grid-column: span 2; }
.pedal--lg { grid-column: span 2; }
@media (min-width: 1001px) { .pedal--sm { grid-column: span 1; } .pedal--lg { grid-column: span 2; } }
@media (max-width: 640px) { .pedal, .pedal--sm, .pedal--lg { grid-column: span 1; } }
.pedal.is-on { border-color: var(--accent); }
.pedal.is-dragging { opacity: .55; }
body.is-rearranging { user-select: none; }

.pedal__head { display: grid; grid-template-columns: auto 44px 1fr auto; gap: var(--s-3); align-items: start; }
.pedal__art { width: 44px; color: var(--ink-mute); }
.pedal.is-on .pedal__art { color: var(--accent); }
.pedal__title h3 { margin: 0; font-size: var(--t-h3); }
.pedal__title p { margin: .15rem 0 0; font-size: var(--t-xs); color: var(--ink-mute); max-width: none; }
.pedal__grip { appearance: none; border: 0; background: transparent; color: var(--ink-mute); cursor: grab; font-size: 16px; line-height: 1; padding: 4px 2px; touch-action: none; }
.pedal__grip:active { cursor: grabbing; }
.pedal__tools { display: flex; gap: 2px; }
.iconbtn { appearance: none; border: 0; background: transparent; color: var(--ink-mute); cursor: pointer; width: 28px; height: 28px; border-radius: var(--r); font-size: 13px; line-height: 1; }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.pedal__body { flex: 1 1 auto; margin: var(--s-4) 0; }
.pedal__foot { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: var(--s-3); }
.pedal__status { font-size: var(--t-xs); color: var(--ink-mute); flex: 1 1 auto; }

.stomp { appearance: none; cursor: pointer; display: inline-flex; align-items: center; gap: .5rem; min-height: 42px; padding: 0 1.1rem; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: transparent; color: var(--ink); font: 650 var(--t-sm)/1 var(--sans); }
.stomp:hover { background: var(--surface-2); }
.stomp__led { width: 9px; height: 9px; border-radius: 50%; background: var(--led-off); transition: background .12s, box-shadow .12s; }
.pedal.is-on .stomp { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pedal.is-on .stomp__led { background: var(--led); box-shadow: var(--led-glow); }

/* ===================================================================
   12b. The rig bar + feature toggles
   ===================================================================
   The tray of "add a pedal" cards is gone. Adding and removing is now one
   row of toggles at the top, which is both fewer clicks and honest about
   what it does: these are the six features, lit ones are on the board.

   Everything in here is theme-token only, so the rack look is the `rig`
   theme's doing and the same markup still reads correctly in light and wood. */

.rig { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.rig__strip { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.rig__strip:last-child { border-bottom: 0; }

.rig__unit { display: flex; align-items: center; gap: var(--s-2); }
.rig__label { font: 600 var(--t-xs)/1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); white-space: nowrap; }
.rig__value { font: 700 var(--t-sm)/1 var(--mono); color: var(--accent); font-variant-numeric: tabular-nums; min-width: 4.2em; }
.rig__spacer { flex: 1 1 auto; }

/* Thin horizontal meter, like the IN/OUT strips on a rack unit. */
.vu { position: relative; width: clamp(90px, 18vw, 190px); height: 8px; background: var(--meter-bed); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.vu__fill { position: absolute; inset: 0 100% 0 0; background: var(--accent); transition: right .06s linear; }
.vu__fill.is-hot { background: var(--ok); }
.vu__fill.is-clip { background: var(--bad); }

/* A toggle that reads as ON at a glance: amber fill, dark ink. The screenshot's
   Gate/Limit buttons do exactly this and it is the only unambiguous state
   marker on a dark panel. */
/* min-height, not more padding: these are pressed on a tablet propped against
   a guitar, and they measured 30px — comfortably missable. */
.rigtoggle { appearance: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 40px; font: 600 var(--t-xs)/1 var(--display); letter-spacing: .08em; text-transform: uppercase; padding: .5rem .8rem; border-radius: 4px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-body); }
.rigtoggle:hover { border-color: var(--accent); color: var(--ink); }
.rigtoggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.rig__slider { width: clamp(80px, 14vw, 150px); accent-color: var(--accent); }

/* The feature row. */
.features { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.feature { appearance: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 40px; gap: .45rem; font: 600 var(--t-xs)/1 var(--display); letter-spacing: .07em; text-transform: uppercase; padding: .5rem .75rem; border-radius: 4px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-body); }
/* An LED, not a shrunken illustration. The tool drawings are built at a 120px
   viewBox and say so; at 18px — and at bold art mode's 5px strokes — they
   collapse into smudges. A lit dot is also simply the right metaphor for
   "this unit is powered". */
.feature__led { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--led-off); transition: background .12s, box-shadow .12s; }
.feature[aria-pressed="true"] .feature__led { background: var(--led); box-shadow: var(--led-glow); }
.feature:hover { border-color: var(--accent); color: var(--ink); }
.feature[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.feature:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* Panel lettering: only the rig theme opts in, via the --display tokens. */
.pedal__title h3 { font-family: var(--display); letter-spacing: var(--display-tracking); text-transform: var(--display-case); }

/* The warning that has to be read before it is useful, not after. */
.feedbacknote { font-size: var(--t-xs); color: var(--ink-mute); margin: var(--s-2) 0 0; max-width: none; }
.feedbacknote strong { color: var(--ok); }

/* ===================================================================
   13. Tool internals
   =================================================================== */
.tuner { text-align: center; }
.tuner__note { font: 700 3.2rem/1 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.is-intune .tuner__note { color: var(--good); }
.tuner__cents { font-size: var(--t-sm); color: var(--ink-mute); margin-top: .2rem; }
.tuner__dial { margin: var(--s-4) 0 var(--s-3); }
.tuner__scale { display: flex; justify-content: space-between; font-size: var(--t-xs); color: var(--ink-mute); margin-bottom: .3rem; }
.tuner__track { position: relative; height: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); }
.tuner__zone { position: absolute; top: 0; bottom: 0; left: 45%; width: 10%; background: color-mix(in srgb, var(--good) 30%, transparent); }
.tuner__needle { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--accent); border-radius: 2px; left: 50%; transition: left .08s linear; }
.tuner__strings { display: flex; justify-content: space-between; margin-top: var(--s-3); font: 600 var(--t-sm)/1 var(--mono); color: var(--ink-mute); }
.tuner__strings .is-near { color: var(--accent); }

.bigread { text-align: center; margin-bottom: var(--s-3); }
.bigread b { display: block; font: 700 2.8rem/1 var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.bigread span { font-size: var(--t-xs); color: var(--ink-mute); text-transform: uppercase; letter-spacing: .08em; }

.phase { font: 650 var(--t-sm)/1.4 var(--sans); color: var(--accent); margin: 0; }

.profile { display: grid; gap: var(--s-2); }
.profile__row { display: grid; grid-template-columns: 8em 1fr 2.4em; gap: var(--s-3); align-items: center; font-size: var(--t-sm); }
.profile__row.is-current .profile__name { color: var(--accent); font-weight: 650; }
.profile__track { height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); overflow: hidden; }
.profile__fill { display: block; height: 100%; background: var(--line-2); transition: width .3s var(--ease); }
.profile__fill.is-good { background: var(--good); }
.profile__fill.is-warn { background: var(--ok); }
.profile__fill.is-bad { background: var(--bad); }
.profile__score { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }

.pedal .meter { height: 96px; }
.pedal .readouts { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.pedal .readout b { font-size: 1.3rem; }

/* ===================================================================
   14. Big art — heroes
   ===================================================================
   These are meant to be LARGE. At this size a fine line is what keeps it
   minimal; weight is what would stop it being so. */
.hero--art .shell { display: grid; grid-template-columns: 1fr auto; gap: var(--s-6); align-items: center; }
.heroart { width: clamp(180px, 26vw, 320px); color: var(--ink-mute); opacity: .9; }
.heroart .art { width: 100%; }
@media (max-width: 820px) {
  .hero--art .shell { grid-template-columns: 1fr; }
  .heroart { width: 150px; justify-self: start; opacity: .55; }
}

/* Section-break art: a big quiet mark between sections. */
.artbreak { display: flex; justify-content: center; padding: var(--s-7) 0; color: var(--ink-mute); opacity: .35; }
.artbreak .art { width: clamp(120px, 18vw, 200px); }

/* Pedal header art gets more room, and the title stops fighting it. */
.pedal__head { grid-template-columns: auto 56px 1fr auto; }
.pedal__art { width: 56px; }
.pedal--lg .pedal__head { grid-template-columns: auto 72px 1fr auto; }
.pedal--lg .pedal__art { width: 72px; }
.pedal__title p { text-wrap: pretty; }
@media (max-width: 480px) {
  .pedal__head { grid-template-columns: auto 44px 1fr; row-gap: var(--s-2); }
  .pedal__art { width: 44px; }
  .pedal__tools { grid-column: 1 / -1; justify-content: flex-end; }
}
