:root {
  color-scheme:light;
  --page:#f8f8f5;
  --ink:#20211e;
  --muted:#575b54;
  --line:#d6d8cf;
  --blue:#2747bf;
  --sans:"Instrument Sans","Helvetica Neue",Arial,sans-serif;
  --serif:"Iowan Old Style","Baskerville",Georgia,serif;
  --mono:"IBM Plex Mono","SFMono-Regular",Consolas,monospace;
  font-family:var(--sans);
  color:var(--ink);
  background:var(--page);
}
* { box-sizing:border-box }
body { margin:0 }
button,input { font:inherit }
button { color:inherit; cursor:pointer; -webkit-tap-highlight-color:transparent }
button,summary { touch-action:manipulation }
:focus-visible { outline:2px solid var(--blue); outline-offset:4px }
button { border:0; background:none }
.symbols,.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%) }
.studio { width:min(1100px,calc(100% - clamp(36px,10vw,144px))); margin:auto; padding:clamp(17px,4vh,42px) 0 25px }
header,footer,.tools,.materials,.pressure,.sound,.notes-header { display:flex; align-items:center }
header { justify-content:space-between; margin-bottom:clamp(22px,4.4vh,46px) }
h1,h2,p { margin:0 }
h1 { display:flex; align-items:center; gap:10px; font:600 clamp(23px,2vw,29px)/1 var(--sans); letter-spacing:-.065em }
h1 svg { width:30px; height:30px; color:var(--blue) }
#about { min-height:44px; padding:0 0 0 12px; font-size:.92rem; text-decoration:underline; text-decoration-color:#a8aaa0; text-underline-offset:5px }
#about:hover { color:var(--blue); text-decoration-color:var(--blue) }
.sheet { position:relative; isolation:isolate }
.sheet::before { content:""; position:absolute; left:.5%; right:.2%; top:6px; bottom:-3px; z-index:-1; background:#dedbcf; transform:rotate(-.22deg); box-shadow:0 8px 19px -12px #382c1c65 }
#pad { position:relative; height:clamp(330px,54svh,545px); min-width:0; overflow:hidden; isolation:isolate; color:#272622; background:#ebe8db; touch-action:none; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; cursor:crosshair; box-shadow:0 1px 2px #4e472b32,0 10px 28px -26px #25190b8a }
#texture,#trace { position:absolute; inset:0; width:100%; height:100%; pointer-events:none }
#trace { z-index:3 }
#print { position:absolute; width:51%; height:88%; right:3.2%; top:6%; pointer-events:none }
.imprint { position:absolute; left:7%; top:50%; width:43%; transform:translateY(-48%); pointer-events:none }
#material-name { font:400 clamp(70px,7.9vw,116px)/.91 var(--serif); letter-spacing:-.079em; max-width:4.55em; text-wrap:balance }
#hint { display:inline-flex; align-items:center; gap:9px; margin-top:clamp(19px,3vw,37px); font-size:clamp(.9rem,1.22vw,1.04rem); color:#353931; transition:opacity .18s }
#hint svg { stroke-dasharray:51; animation:draw-stroke .95s ease-out both; width:30px; height:21px; color:var(--blue) }
#pad.is-active #hint { opacity:0 }
#pad #hint[role=status] { opacity:1; max-width:30ch }
body[data-material=sandpaper] #pad,body[data-material=sandpaper] #hint,body[data-material=sandpaper] #hint svg { color:#faf8e8 }
.tools { align-items:center; justify-content:space-between; gap:16px; padding:24px 0 21px; border-bottom:1px solid var(--line) }
.materials { gap:5px }
.materials button { display:flex; align-items:center; gap:9px; position:relative; min-height:44px; padding:7px 12px; border:1px solid transparent; border-radius:5px; font-weight:480; font-size:.95rem; white-space:nowrap; transition:background .16s,border-color .16s }
.materials button:first-child { margin-left:-2px }
.materials button:hover { background:#efefea }
.materials button[aria-pressed=true] { background:#ebede8; border-color:#babeb1 }
.materials canvas { width:24px; height:28px; border-radius:1px; box-shadow:0 0 0 1px #0002,0 2px 3px #0002; transform:rotate(-3deg); transition:transform .16s }
.materials button:hover canvas { transform:rotate(2deg) translateY(-2px) }
.pressure { gap:10px; font-size:.88rem }
#pressure { width:clamp(65px,7vw,112px); height:44px; margin:0; appearance:none; background:transparent; cursor:pointer; accent-color:var(--blue) }
#pressure::-webkit-slider-runnable-track { height:2px; background:linear-gradient(to right,var(--blue) 0 var(--pressure,50%),#c8cbc2 var(--pressure,50%) 100%) }
#pressure::-webkit-slider-thumb { appearance:none; margin-top:-5px; width:12px; height:12px; border:0; border-radius:50%; background:var(--blue) }
#pressure::-moz-range-track { height:2px; background:#c8cbc2 }
#pressure::-moz-range-progress { height:2px; background:var(--blue) }
#pressure::-moz-range-thumb { width:12px; height:12px; border:0; border-radius:50%; background:var(--blue) }
#pressure-value { min-width:4ch; text-align:right; color:var(--muted); font:.81rem var(--mono) }
footer { justify-content:space-between; margin-top:5px }
#demo,#mute { display:flex; gap:7px; align-items:center; min-height:44px; font-size:.88rem; padding:4px 0 }
#demo:hover,#mute:hover { color:var(--blue) }
#demo svg,#mute svg { width:17px; height:17px }
#demo svg { color:var(--blue) }
button .toggled,button[aria-pressed=true] .normal { display:none }
button[aria-pressed=true] .toggled { display:inline }
.sound { gap:11px }
#scope { width:62px; height:20px; color:var(--blue) }
dialog { width:min(495px,calc(100% - 32px)); max-height:85svh; padding:clamp(20px,4vw,32px); border:1px solid #c3c6bb; border-radius:7px; background:var(--page); color:var(--ink); box-shadow:0 15px 80px #1c201938; overflow:auto }
dialog::backdrop { background:#282b2359 }
.notes-header { justify-content:space-between; gap:10px; margin-bottom:17px }
.notes-header h2 { font:400 2.4rem/1 var(--serif); letter-spacing:-.055em }
.notes-header button { font-size:26px; width:44px; height:44px; margin:-8px; font-weight:300 }
.notes-body { font-size:1rem; line-height:1.5 }
.notes-body p { margin:.85em 0 }
.lede { font-weight:550 }
.notes-body a { color:var(--blue); text-underline-offset:3px }
.source-link { display:inline-block; margin-bottom:1em }
.sound-sources { border-top:1px solid var(--line); border-bottom:1px solid var(--line); font-size:.9rem; padding:12px 0 }
.sound-sources summary { cursor:pointer }
.keys { color:var(--muted); font-size:.85rem }
kbd { font:.85em var(--mono); border:1px solid var(--line); padding:2px 4px; border-radius:3px }
@media(max-width:850px) {
  .studio { width:calc(100% - 44px) }
  .materials button { gap:7px; padding-inline:8px }
  .tools { gap:10px }
  .pressure { gap:7px }
  #print { right:2% }
}
@media(max-width:680px) {
  .studio { width:calc(100% - 36px); max-width:540px; padding-top:11px }
  header { margin-bottom:18px }
  h1 { gap:7px; font-size:23px }
  h1 svg { width:25px; height:25px }
  #about { font-size:.88rem }
  #pad { height:clamp(318px,55svh,480px) }
  #print { height:65%; width:90%; top:.5%; right:5% }
  .imprint { inset:auto 6% 8%; width:auto; transform:none }
  #material-name { max-width:none; font-size:clamp(44px,12.9vw,72px); line-height:.98; letter-spacing:-.071em }
  #hint { font-size:.88rem; margin-top:10px; gap:6px }
  #hint svg { width:24px; height:16px }
  .tools { display:block; padding:16px 0 0 }
  .materials { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:3px }
  .materials button { flex-direction:column; justify-content:center; gap:7px; padding:8px 0; min-height:63px; font-size:clamp(.74rem,3vw,.94rem) }
  .materials button:first-child { margin:0 }
  .materials canvas { width:24px; height:20px }
  .pressure { gap:12px; margin:6px 2px 0 }
  #pressure { flex:1; width:auto }
  footer { margin-top:1px }
}
@keyframes draw-stroke { from { stroke-dashoffset:51 } to { stroke-dashoffset:0 } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none!important; animation:none!important } }
