@font-face{font-family:Oswald;src:url('assets/Oswald.ttf') format('truetype');font-weight:200 700;font-display:swap}
:root{color-scheme:light;--bg:#f5f5f0;--surface:#ffffff;--ink:#181d1d;--muted:#666e6b;--line:#d9dfda;--accent:#9de5d8;--accent-ink:#246554;--track:#dfe6e0;--shadow:0 16px 40px #243c3010;--heading:Oswald,'Arial Narrow',sans-serif}
:root[data-theme=dark]{color-scheme:dark;--bg:#151a19;--surface:#1e2523;--ink:#f1f3ed;--muted:#adb8b0;--line:#3c4741;--accent:#9de5d8;--accent-ink:#a5ead8;--track:#34423c;--shadow:0 16px 40px #0003}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:Arial,Helvetica,sans-serif;-webkit-font-smoothing:antialiased}button,input,select{font:inherit;color:inherit}button{cursor:pointer}button,a,input,select{-webkit-tap-highlight-color:transparent}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,[role=slider]:focus-visible{outline:3px solid var(--accent-ink);outline-offset:5px}button{touch-action:manipulation}button:disabled{cursor:default;opacity:.5}button svg{display:block}a{color:inherit}.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}
.site-header{max-width:1140px;margin:auto;padding:25px 34px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:12px;text-decoration:none}.brand-logo{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:var(--accent)}.brand-logo img{width:23px;height:32px;object-fit:contain}.brand>span:last-child{font:500 19px/1.1 var(--heading);letter-spacing:.5px}.brand>span>span{display:block;font-size:12px;letter-spacing:2px;margin-top:5px}.theme-toggle{border:1px solid var(--line);border-radius:24px;background:transparent;display:flex;gap:9px;align-items:center;min-height:42px;padding:9px 15px;font-size:12px}.theme-toggle svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round}.theme-toggle .sun{display:none}[data-theme=dark] .theme-toggle .sun{display:block}[data-theme=dark] .theme-toggle .moon{display:none}
main{max-width:1072px;margin:auto;padding:36px 34px 42px}.page-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:25px}h1{font:500 54px/1.2 var(--heading);text-transform:uppercase;margin:0;letter-spacing:.2px}.status{display:flex;gap:8px;align-items:center;font-size:11px;letter-spacing:.2px;color:var(--muted)}.status i{width:6px;height:6px;border-radius:50%;background:var(--muted)}body.is-playing .status i{background:var(--accent-ink)}.instrument{display:grid;grid-template-columns:1fr 1fr;gap:70px;align-items:center}.tempo-panel{text-align:center;min-width:0}.tempo-dial{position:relative;width:100%;max-width:380px;margin:auto;touch-action:none;user-select:none;cursor:grab;border-radius:50%}.tempo-dial:active{cursor:grabbing}.tempo-dial::before{content:"";display:block;padding-top:100%}.dial-face{position:absolute;top:0;left:0;width:100%;height:100%;overflow:visible}.dial-track,.dial-progress{fill:none;stroke-width:10;stroke-linecap:round}.dial-track{stroke:var(--track)}.dial-progress{stroke:var(--accent-ink);stroke-dasharray:33.333 100}.dial-handle{fill:var(--bg);stroke:var(--accent-ink);stroke-width:3}.dial-tick{stroke:var(--muted);stroke-width:1;opacity:.55}.dial-tick.major{stroke-width:1.4;opacity:.9}.logo-position{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.pulse-logo{position:absolute;top:22.5%;left:22.5%;width:55%;height:55%;min-width:0;min-height:0;border-radius:50%;background:var(--accent);box-shadow:var(--shadow);border:1px solid #1111;overflow:hidden;will-change:transform}.pulse-logo img{position:absolute;top:13.5%;left:15%;display:block;width:70%;height:73%;min-width:0;min-height:0;max-width:none;object-fit:contain}.dial-limit{position:absolute;bottom:3%;font-size:11px;font-variant-numeric:tabular-nums;color:var(--muted)}.dial-min{left:24%}.dial-max{right:23%}.tempo-value{display:flex;align-items:center;justify-content:center;gap:24px;margin-top:-6px}.step-button{display:grid;place-items:center;width:43px;height:43px;padding:0;border:1px solid var(--line);border-radius:50%;background:transparent;font-size:27px;font-weight:300}.step-button:hover{background:var(--surface)}.bpm-label{display:flex;flex-direction:column;align-items:center}.bpm-label input{width:150px;font:500 76px/1 var(--heading);text-align:center;background:transparent;border:0;padding:0;appearance:textfield;-moz-appearance:textfield;font-variant-numeric:tabular-nums}.bpm-label input::-webkit-inner-spin-button,.bpm-label input::-webkit-outer-spin-button{appearance:none;margin:0}.bpm-unit{font-size:10px;letter-spacing:2px;color:var(--muted);margin-top:3px}.tempo-mark{font:400 17px/1.5 var(--heading);color:var(--accent-ink);margin:13px 0 5px}.dial-help{font-size:11px;color:var(--muted);margin:0;line-height:1.6}
.rhythm-panel{min-width:0;border-left:1px solid var(--line);padding-left:40px}.signature-row{display:flex;align-items:center;justify-content:space-between;gap:20px}h2{font-size:11px;font-weight:400;margin:0 0 5px;letter-spacing:.4px;color:var(--muted)}.time-signature{display:flex;align-items:center;gap:5px}.time-signature select{font:500 41px/1.2 var(--heading);border:0;border-bottom:1px solid var(--line);background:transparent;padding:0 15px 4px 2px;width:79px;border-radius:0;cursor:pointer}.time-signature select option{background:var(--surface);color:var(--ink);font:20px Arial,sans-serif}.signature-slash{font:300 38px var(--heading);color:var(--muted)}.beat-position{display:flex;flex-direction:column;align-items:flex-end;gap:8px}.beat-position span:first-child{font:400 20px var(--heading)}.beat-position span:last-child{font-size:10px;color:var(--muted);text-align:right}.signature-help{font-size:10px;color:var(--muted);margin:12px 0 24px;line-height:1.5}.beat-buttons{display:flex;flex-wrap:wrap;gap:8px}.beat-button{width:43px;height:43px;display:grid;place-items:center;position:relative;border:1px solid var(--line);border-radius:50%;background:var(--surface);color:var(--ink);font:400 17px var(--heading);padding:0;transition:background .07s,border-color .07s}.beat-button[data-accent="2"]{border:2px solid var(--accent-ink)}.beat-button[data-accent="2"]::after{content:"";position:absolute;top:4px;border-top:3px solid var(--accent-ink);border-left:3px solid transparent;border-right:3px solid transparent}.beat-button[data-accent="0"]{border-style:dashed;color:var(--muted);opacity:.6}.beat-button.is-current{background:var(--accent);color:#152c25;border-color:var(--accent);box-shadow:0 0 0 3px var(--bg),0 0 0 4px var(--accent-ink)}.beat-button.is-current::after{border-top-color:#152c25}.beat-help{font-size:10px;color:var(--muted);line-height:1.6;margin:13px 0 27px}.accent-key{color:var(--accent-ink)}.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.field{font-size:11px;color:var(--muted)}.field select{display:block;width:100%;margin-top:8px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:4px;padding:11px 9px;font-size:12px;min-height:42px}.volume-row{margin-top:23px}.volume-row>label{display:flex;justify-content:space-between;font-size:11px;color:var(--muted)}.volume-row output{font-variant-numeric:tabular-nums}.volume-controls{display:flex;align-items:center;gap:13px;margin-top:7px}.volume-controls input{width:100%;height:27px;margin:0;accent-color:var(--accent-ink);cursor:pointer}.mute-button{border:0;background:transparent;padding:8px;color:var(--muted);border-radius:4px}.mute-button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.sound-muted{display:none}.mute-button[aria-pressed=true] .sound-muted{display:block}.mute-button[aria-pressed=true] .sound-waves{display:none}.transport{display:grid;grid-template-columns:1.2fr 1fr;gap:12px;margin-top:24px}.start-button{background:var(--accent);color:#162721;border:1px solid var(--accent);border-radius:4px;min-height:60px;display:flex;align-items:center;justify-content:center;gap:12px;font:500 22px var(--heading);letter-spacing:.3px}.start-button svg{width:20px;height:20px;fill:currentColor}.stop-icon{display:none}.is-playing .stop-icon{display:block}.is-playing .play-icon{display:none}.tap-button{border:1px solid var(--line);background:var(--surface);border-radius:4px;font:400 18px var(--heading);padding:8px}.tap-button>span{display:block;font:10px/1.5 Arial,sans-serif;color:var(--muted);margin-top:3px}.tap-button:active{border-color:var(--accent-ink);background:var(--track)}.shortcuts{font-size:10px;color:var(--muted);margin:18px 0 0;text-align:center;line-height:1.8}.shortcuts>span{margin:0 7px}kbd{font:inherit;border:1px solid var(--line);border-radius:3px;padding:2px 5px}.audio-message{border-left:2px solid var(--accent-ink);padding:10px 13px;margin:15px 0 0;font-size:12px;line-height:1.6;color:var(--ink)}
footer{max-width:1072px;margin:auto;padding:23px 34px;display:flex;justify-content:space-between;gap:18px;border-top:1px solid var(--line);color:var(--muted);font-size:10px;line-height:1.5}footer span:first-child{font-family:var(--heading);font-size:13px;letter-spacing:.2px}
@media(max-width:850px){.instrument{gap:30px}.rhythm-panel{padding-left:25px}.time-signature select{font-size:34px;width:68px}.signature-row{gap:12px}.beat-position span:first-child{font-size:17px}.tempo-dial{max-width:340px}.tempo-value{gap:12px}.bpm-label input{width:127px;font-size:68px}.page-heading{margin-bottom:20px}}
@media(max-width:650px){.site-header{padding:18px 23px}.brand-logo{width:38px;height:38px}.brand-logo img{height:28px}.brand>span:last-child{font-size:17px}.brand>span>span{font-size:10px}.theme-toggle{min-height:38px;padding:8px 12px}main{padding:27px 23px 32px}.page-heading{margin-bottom:15px}h1{font-size:40px}.status{font-size:10px}.instrument{grid-template-columns:1fr;gap:32px}.tempo-dial{max-width:310px}.tempo-value{margin-top:-9px;gap:25px}.bpm-label input{font-size:64px;width:125px}.tempo-mark{margin-top:11px}.rhythm-panel{border-left:0;border-top:1px solid var(--line);padding:28px 0 0}.time-signature select{font-size:38px;width:76px}.beat-position span:first-child{font-size:20px}.signature-help{margin-bottom:21px}.beat-buttons{gap:10px}.beat-button{width:44px;height:44px}.beat-help{margin-bottom:24px}.transport{margin-top:24px}.shortcuts{display:none}footer{padding:20px 23px}.dial-help{font-size:10px}}
@media(max-width:360px){main,.site-header,footer{padding-inline:18px}h1{font-size:36px}.tempo-dial{max-width:280px}.beat-position span:last-child{font-size:9px}.time-signature select{width:66px}.instrument{gap:25px}footer{flex-direction:column;gap:5px}.brand{gap:8px}.brand>span:last-child{font-size:16px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important}}



/* Mobile sections share the normal document flow. */
.header-actions{display:flex;align-items:center;gap:20px}
@media(max-width:650px){
 main{padding-top:18px}
 .tempo-panel{padding-block:8px 14px}
 .tempo-dial{max-width:280px}
 .header-actions{gap:12px}
}

@media(max-width:360px){
 .header-actions{gap:10px}
 .header-actions .status>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
}


@media(max-width:650px){.instrument{display:block}.rhythm-panel{margin-top:26px}}

/* Page scrolling never changes tempo; touch dragging starts on the handle. */
.tempo-dial{touch-action:pan-y}
.dial-handle{touch-action:none}



.dial-face{display:block}

.dial-hit{position:absolute;z-index:1;width:48px;height:48px;transform:translate(-50%,-50%);border-radius:50%;touch-action:none;cursor:grab}
.dial-handle{pointer-events:none}

/* The tempo dial and BPM controls always occupy separate rows. */
@media(max-width:650px){
 .tempo-panel{display:block}
 .tempo-dial{max-width:310px}
 .tempo-value{display:flex;margin-top:0;gap:25px}
 .bpm-label input{font-size:64px;width:125px}
 .step-button{width:43px;height:43px;font-size:27px}
 .tempo-mark{margin:11px 0 5px;font-size:17px}
 .dial-help{font-size:10px}
 .dial-limit{font-size:11px}
}
@media(min-width:651px) and (max-width:950px) and (max-height:500px){
 .site-header{padding-block:10px}
 main{padding-top:14px}
 .instrument{align-items:start;gap:30px}
 .tempo-panel{display:block;position:static}
 .tempo-dial{max-width:280px}
 .tempo-value{display:flex;margin-top:0;gap:20px}
 .bpm-label input{font-size:58px;width:115px}
 .step-button{width:40px;height:40px;font-size:25px}
}

.signature-row{margin-bottom:24px}


/* Only the playback buttons stay fixed; all settings scroll in one flow. */
@media(max-width:650px), (max-width:950px) and (max-height:500px){
 body{padding-bottom:calc(104px + env(safe-area-inset-bottom))}
 .tempo-panel,.rhythm-panel{position:static;z-index:auto}
 .tempo-dial{max-width:min(310px,calc(100svh - 190px))}
 .transport{position:fixed;z-index:10;bottom:0;left:0;right:0;margin:0;padding:12px 23px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--bg);box-shadow:0 -6px 20px #00000008}
 .transport .start-button{min-height:56px}
}
