:root {
  --paper: #fff; --ink: #000;
  --font: "Avenir Next", "Avenir", "Nunito Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
:root[data-tint="1"] { --paper: #edd4a3; }
:root[data-tint="2"] { --paper: #a3c9f2; }
:root[data-tint="3"] { --paper: #a3deb3; }
:root[data-tint="4"] { --paper: #f5b8bf; }
:root[data-tint="5"] { --paper: #c7b0f2; }
:root[data-tint="6"] { --paper: #fad66b; }
@media (prefers-color-scheme: dark) {
  :root { --paper: #000; --ink: #fff; }
  :root[data-tint="1"] { --paper: #000; --ink: #f2d9a8; }
  :root[data-tint="2"] { --paper: #000; --ink: #8fc2ff; }
  :root[data-tint="3"] { --paper: #000; --ink: #85e6a8; }
  :root[data-tint="4"] { --paper: #000; --ink: #ffa8c2; }
  :root[data-tint="5"] { --paper: #000; --ink: #d19ef5; }
  :root[data-tint="6"] { --paper: #000; --ink: #ffd461; }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper); color: var(--ink);
  font: 600 11px/2.1 var(--font);
  letter-spacing: .24em; text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
.sr, .js .box span, .js .name {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
h2 { font: inherit; margin: 0; }
p { margin: 0; }

/* ---------- canvas version ---------- */
.js, .js body { overflow: hidden; overscroll-behavior: none; }
.js body {
  position: fixed; inset: 0;
  touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
  cursor: grab;
}
.js body.pull { cursor: grabbing; }
.js body.point { cursor: pointer; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: none; }
.js #c { display: block; }

#logo {
  display: block; width: min(150px, 36vw); height: auto; margin: 22vh auto 6vh;
  fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round;
}
.js #logo { position: fixed; left: 50%; top: 50%; margin: 0; transform: translate(-50%, -50%); }
.js #logo.gone { visibility: hidden; }

/* Boxes and the back box are drawn on the canvas; these invisible links sit exactly over
   them for keyboard focus, screen readers and the no-script page. */
.js .box, .js #back {
  position: fixed; left: 0; top: 0; display: block; pointer-events: none;
  border-radius: 4px; outline: none;
}
.js .box:focus-visible, .js #back:focus-visible,
.ui:focus-visible, .panel a:focus-visible {
  outline: 1.5px solid var(--ink); outline-offset: 6px; border-radius: 4px;
}
.js [hidden] { display: none !important; }

.js .panel {
  position: fixed; left: 0; top: 0; display: none;
  padding: 0 22px; text-align: center; opacity: 0;
  transition: opacity .35s ease; outline: none;
  user-select: text; -webkit-user-select: text; cursor: auto; touch-action: auto;
}
.js .panel.on { display: flex; flex-direction: column; justify-content: center; }
.js .panel.in { opacity: 1; }
.js .panel h2 { opacity: .38; margin-bottom: 1.1em; }
.js .panel p { line-height: 1.8; }
.js .panel p + p { margin-top: .75em; }
.panel a { text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 1px; }

.ui {
  position: fixed; z-index: 3; width: 44px; height: 44px; padding: 12px;
  border: 0; margin: 0; background: none; color: var(--ink); cursor: pointer;
  opacity: .32; transition: opacity .25s;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.ui:hover, .ui[aria-pressed="true"] { opacity: .75; }
.ui svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; overflow: visible; }
#snd { right: max(8px, env(safe-area-inset-right)); bottom: max(8px, env(safe-area-inset-bottom)); }
#tint { left: max(8px, env(safe-area-inset-left)); bottom: max(8px, env(safe-area-inset-bottom)); }
#snd line { transform-box: fill-box; transform-origin: center; transform: scaleY(.01); transition: transform .4s ease; vector-effect: non-scaling-stroke; }
#snd[aria-pressed="true"] line { animation: breathe 1.6s ease-in-out infinite alternate; }
#snd[aria-pressed="true"] line:nth-child(2) { animation-delay: -.5s; }
#snd[aria-pressed="true"] line:nth-child(3) { animation-delay: -1.1s; }
#snd[aria-pressed="true"] line:nth-child(4) { animation-delay: -.3s; }
@keyframes breathe { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
  #snd[aria-pressed="true"] line { animation: none; transform: scaleY(.7); }
}
#tint circle { transition: r .2s; }
#tint:active circle { r: 2.5; }

/* ---------- no-script fallback: a quiet static page ---------- */
html:not(.js) #c, html:not(.js) .ui { display: none; }
html:not(.js) body { text-align: center; padding: 0 24px 12vh; }
html:not(.js) nav { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 9vh; }
html:not(.js) .box { border: 2px solid currentColor; border-radius: 3px; padding: 22px 18px; text-decoration: none; min-width: 110px; }
html:not(.js) .panel { max-width: 360px; margin: 0 auto 7vh; }
html:not(.js) .panel h2 { opacity: .4; }
html:not(.js) .name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
html:not(.js) #back { display: none; }
