/* the fabric sandbox: the chrome is as little as possible; everything that matters is stitched on the cloth */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { touch-action: none; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
#gl:active { cursor: grabbing; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible { outline: 2px solid #f08f7c; outline-offset: 2px; border-radius: 6px; }
#sound { position: fixed; top: max(2px, env(safe-area-inset-top)); left: 6px; width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink3); opacity: .8; transition: color .2s var(--ease-out), opacity .2s; }
#sound svg { width: 22px; height: 22px; } #sound .w { opacity: .25; } #sound[aria-pressed="true"] { color: var(--gold); opacity: 1; } #sound[aria-pressed="true"] .w { opacity: 1; }
#skip, #more { position: fixed; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); min-height: 44px; min-width: 44px; padding: 0 16px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill); color: var(--ink3); font: 400 14px/1 var(--f-ar); transition: opacity .4s var(--ease-out); }
#skip { border: 1px solid var(--hair); background: rgba(10, 9, 8, .5); }
#more svg { display: none; }   /* the way forward is a stitched thread drawn on the overlay; this is its hand */
#more { width: 88px; height: 64px; bottom: max(6px, env(safe-area-inset-bottom)); }
#skip.off, #more.off { opacity: 0; pointer-events: none; }
@keyframes nudge { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(4px); } }
#veil { position: fixed; inset: 0; pointer-events: none; transition: opacity .7s var(--ease-out);
  background: radial-gradient(ellipse 62% 55% at 50% 48%, rgba(255, 214, 160, 0.07), rgba(0, 0, 0, 0) 70%), radial-gradient(ellipse 85% 80% at 50% 50%, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.62) 100%),
    linear-gradient(rgba(10, 9, 8, 0.38), rgba(10, 9, 8, 0.38)), url("../img/cloth-s.bf9882d287cd.jpg") center / var(--tile, 330px) var(--tile, 330px) repeat, #0d0c0b; }
#veil.gone { opacity: 0; }
/* the beat thread's knots (drawn on the cloth layer; these are their hands) */
#knots { position: fixed; top: 0; right: 0; width: 44px; height: 100%; pointer-events: none; }
#knots .knot { position: absolute; right: 0; width: 44px; height: 44px; pointer-events: auto; border-radius: 50%; }
#knots .knot:disabled { pointer-events: none; }
#skip { display: none; }

/* the way forward on a phone: a small pill under the thread (23 Oct, his note: "help users know they should scroll") */
#next { position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); min-height: 40px; padding: 0 20px; border-radius: var(--r-pill);
  font: 500 15px/1 var(--f-ar); color: #f3ece2; background: rgba(20, 17, 14, .72); border: 1px solid rgba(214, 164, 66, .55); transition: opacity .35s var(--ease-out); display: none; }
@media (max-width: 699px) { #next { display: flex; align-items: center; } #more { bottom: max(52px, calc(env(safe-area-inset-bottom) + 36px)); height: 44px; } }
#next.off { opacity: 0; pointer-events: none; }
/* the beat thread: the act beside the current knot; on a desk, a knot's name on hover; on a phone, where you are */
#act { position: fixed; right: 40px; transform: translateY(-50%); font: 500 13px/1 var(--f-ar); color: #e9c97a; letter-spacing: .01em; pointer-events: none; transition: top .5s var(--ease-out), opacity .4s var(--ease-out);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9); white-space: nowrap; }
#tip { position: fixed; right: 46px; transform: translateY(-50%); font: 500 14px/1 var(--f-ar); color: #f3ece2; background: rgba(16, 14, 12, .85); border: 1px solid rgba(214, 164, 66, .45);
  padding: 7px 11px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .15s; white-space: nowrap; }
#tip.on { opacity: 1; }
#count { position: fixed; right: 9px; bottom: max(24px, calc(env(safe-area-inset-bottom) + 8px)); font: 500 13px/1 var(--f-ar); color: #d8cfc2; pointer-events: none; display: none; text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }
@media (max-width: 699px) { #count { display: block; } #act { right: 30px; font-size: 12px; } }
/* the first visit, on a phone: a thumb that swipes up */
#hint { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; }
#hint.on { opacity: 1; }
#hint .thumb { position: absolute; left: calc(50% - 22px); top: 80%; width: 44px; height: 44px; border-radius: 50%; background: rgba(243, 236, 226, .22); border: 1.5px solid rgba(243, 236, 226, .55);
  animation: thumb 1.6s var(--ease-io) infinite; }
@keyframes thumb { 0% { transform: translateY(40px); opacity: 0; } 20% { opacity: 1; } 75% { transform: translateY(-70px); opacity: .9; } 100% { transform: translateY(-80px); opacity: 0; } }
#knots .knot { width: 44px; height: 44px; }

/* the language: a toggle in the corner opposite the sound; English is the mirror (the thread and its marks on the left) */
#lang { position: fixed; top: max(2px, env(safe-area-inset-top)); right: 6px; min-width: 44px; height: 40px; padding: 0 10px; display: grid; place-items: center; border-radius: var(--r-pill);
  font: 500 14px/1 var(--f-ar); color: #e9c97a; opacity: .9; }
#lang:hover { opacity: 1; color: #f6d68a; }
[dir="ltr"] #knots { right: auto; left: 0; } [dir="ltr"] #knots .knot { right: auto; left: 0; }
[dir="ltr"] #act { right: auto; left: 40px; } [dir="ltr"] #tip { right: auto; left: 46px; } [dir="ltr"] #count { right: auto; left: 9px; }
[dir="ltr"] #act, [dir="ltr"] #tip, [dir="ltr"] #next, [dir="ltr"] #count { font-family: "Readex Pro", system-ui, sans-serif; }
@media (max-width: 699px) { [dir="ltr"] #act { left: 30px; } }

/* a desk: the way forward is at the foot of the beat thread (its hand sits there) */
@media (min-width: 700px) { #more { left: auto; right: -4px; transform: none; bottom: calc(12vh - 64px); width: 52px; height: 56px; } [dir="ltr"] #more { right: auto; left: -4px; } }

/* the corner controls sit in the top 40 px; every beat's words start below that (his note: "a bit better layout") */
@media (max-width: 699px) { #sound svg { width: 20px; height: 20px; } #lang { font-size: 13px; } }

#act.off { opacity: 0; }

/* ---- v2 (24 Oct): the top bar. Its marks are stitched over the cloth (the overlay); these are their hands. The comma (home) on the start
   side; the language and the sound on the other, and on a phone the ≡ that opens the linen sheet. The bottom-left corner stays clear. */
#bar { position: fixed; inset: 0 0 auto 0; height: 60px; pointer-events: none; }
#bar button, #rooms button { pointer-events: auto; position: fixed; }
#home { width: 44px; height: 52px; border-radius: 10px; }
#menu { top: 8px; left: 10px; width: 48px; height: 44px; border-radius: 10px; display: block; }
#rooms .room { color: transparent; font-size: 1px; border-radius: 8px; }
#rooms .room:hover { background: rgba(214, 164, 66, .08); }
#sound { top: 8px; left: 62px; } #lang { top: 8px; left: 106px; right: auto; height: 44px; }
@media (max-width: 699px) { #menu { display: block; } #sound { left: 62px; } #lang { left: 106px; } }
[dir="ltr"] #menu { left: auto; right: 10px; } [dir="ltr"] #sound { left: auto; right: 62px; } [dir="ltr"] #lang { left: auto; right: 106px; }
@media (max-width: 699px) { [dir="ltr"] #sound { right: 62px; } [dir="ltr"] #lang { right: 106px; } }
#more { left: 50%; transform: translateX(-50%); bottom: max(10px, env(safe-area-inset-bottom)); width: 88px; height: 56px; }
@media (min-width: 700px) { #more { left: 50%; right: auto; transform: translateX(-50%); bottom: 4px; } }
/* the phone's sheet: linen, sliding up from the bottom; crisp printed names */
#sheet { position: fixed; inset: 0; background: rgba(8, 7, 6, .45); opacity: 0; pointer-events: none; transition: opacity .25s var(--ease-out); z-index: 5; }
#sheet.on { opacity: 1; pointer-events: auto; }
#sheet .list { position: absolute; left: 10px; right: 10px; bottom: max(14px, env(safe-area-inset-bottom)); padding: 14px 10px 10px; border-radius: 6px;
  background: #cdbf9f url("../img/linen.945b7c290c41.jpg") center / 520px auto; box-shadow: 0 10px 40px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(80, 60, 30, .25);
  transform: translateY(24px); transition: transform .3s var(--ease-out); display: grid; gap: 4px; }
#sheet.on .list { transform: none; }
#sheet .list button { min-height: 52px; font: 600 18px/1.2 "Readex Pro", var(--f-ar); color: #2b2520; text-align: start; padding: 0 14px; border-radius: 4px;
  background: rgba(255, 250, 240, .35); }
#sheet .list button:active { background: rgba(214, 164, 66, .25); }

@media (min-width: 700px) { #sheet .list { left: auto; right: auto; width: 360px; top: 64px; bottom: auto; inset-inline-end: 14px; } }
