@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
:root {
  --bg: #ece9e2;
  --text: #24272b;
  --soft: #4d5258;
  --line: rgba(36, 39, 43, .22);
  --chip: rgba(250, 249, 246, .78);
  --sans: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { background: var(--bg); color: var(--text); font: 400 1rem/1.35 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
button { font: inherit; color: inherit; }

#glass { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
#glass.stir { cursor: grabbing; }

/* ── a lab bench label in the top-left corner ── */
.top { position: fixed; z-index: 2; top: max(22px, env(safe-area-inset-top)); left: max(26px, env(safe-area-inset-left)); max-width: 21rem; pointer-events: none; }
h1 { font: 700 2.6rem/1 var(--sans); letter-spacing: -.035em; }
.tag { margin-top: .45rem; font-size: 1rem; color: var(--soft); text-wrap: pretty; }

.badge { position: fixed; z-index: 3; top: max(22px, env(safe-area-inset-top)); right: max(22px, env(safe-area-inset-right));
         display: inline-flex; align-items: center; gap: .4em; min-height: 32px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px;
         background: var(--chip); color: var(--text); text-decoration: none; font: 400 .8125rem/1 var(--sans); letter-spacing: .02em; white-space: nowrap; }
.badge svg { width: 1.9em; height: auto; flex: none; }
@media (hover: hover) { .badge:hover { border-color: var(--text); } }

/* ── controls on the bench below the glass ── */
.bench { position: fixed; z-index: 2; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center;
         gap: 10px; padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right)); pointer-events: none; }
.bench > * { pointer-events: auto; }
.hint { font-size: .9375rem; color: var(--soft); text-align: center; }
.coarse { display: none; }
@media (pointer: coarse) { .fine { display: none; } .coarse { display: inline; } }
.row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 14px; }
.inks, .acts { display: flex; min-width: 0; margin: 0; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--chip); }
.ink { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 11px 0 9px; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
       font-size: .875rem; }
.ink i { width: 18px; height: 18px; border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%; background: var(--c); box-shadow: inset -3px -3px 0 rgba(0, 0, 0, .14), inset 2px 2px 0 rgba(255, 255, 255, .28); }
.ink input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.ink:has(input:checked) { background: var(--text); color: var(--bg); }
.ink:has(input:checked) i { box-shadow: 0 0 0 2px var(--bg); }
.ink:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 2px; }
.btn { min-height: 40px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: .875rem; white-space: nowrap; }
.btn[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.btn:disabled { opacity: .45; cursor: default; }
@media (hover: hover) { .ink:hover:not(:has(input:checked)), .btn:hover:not(:disabled):not([aria-pressed="true"]) { background: rgba(36, 39, 43, .08); } }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.msg { position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; padding: 32px; text-align: center; font-size: 1.25rem; color: var(--soft); }
.msg[hidden] { display: none; }
.loading { position: fixed; inset: 0; z-index: 1; display: grid; place-items: center; pointer-events: none; color: var(--soft); }
.loading[hidden] { display: none; }

.embed .ui, .embed .loading { display: none; }

@media (max-width: 760px) {
  .ink span { display: none; }
  .ink { padding: 0 10px; }
  .ink i { width: 20px; height: 20px; }
}
@media (max-width: 520px) {
  .top { top: max(14px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); max-width: 13.5rem; }
  h1 { font-size: 2rem; }
  .tag { font-size: .875rem; }
  .badge { top: max(14px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); padding: 6px 9px; font-size: .75rem; }
  .row { gap: 8px; }
  .btn { padding: 0 11px; }
}
@media (max-width: 370px) {
  .btn { padding: 0 8px; }
}
@media print {
  .bench, .badge { display: none; }
}
