/* Game-HUD styling: condensed italic display type, hard drop shadows,
   no solid panels — text sits directly on the scene like a PS2-era menu. */
:root {
  --text: #efe6cf;
  --dim: rgba(239, 230, 207, .58);
  --accent: #e2a64c;          /* warm, from the scene palette */
  --cool: #8fb2c4;
  --shade: rgba(8, 8, 8, .78);
  --gut: clamp(16px, 2.6vw, 36px);
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --mono: "Share Tech Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --drop: 0 2px 0 rgba(0, 0, 0, .75), 0 0 10px rgba(0, 0, 0, .45);
  --zt: clamp(34px, 4.2vw, 56px);   /* zone title size (the download button is placed from it) */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  background: #232526; color: var(--text);
  font: 500 16px/1.25 var(--display);
  -webkit-font-smoothing: antialiased; overscroll-behavior: none;
  text-shadow: var(--drop);
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-shadow: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* keycap prompt glyph */
kbd {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  font: 400 12px/1 var(--mono); color: var(--text); text-shadow: none;
  border: 1.5px solid rgba(239, 230, 207, .85); border-radius: 4px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .02));
  box-shadow: 0 2px 0 rgba(0, 0, 0, .6);
}

#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; }
.vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(120% 95% at 50% 45%, transparent 60%, rgba(6, 6, 6, .22) 100%); }
.letterbox {
  position: fixed; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .3) 0, transparent 14%, transparent 80%, rgba(0, 0, 0, .36) 100%);
}

/* top bar */
.top {
  position: fixed; top: 0; left: 0; right: 0;
  padding: calc(var(--gut) * .6) var(--gut) 0;
  display: flex; justify-content: space-between; align-items: center;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.mark { font: italic 800 34px/1 var(--display); letter-spacing: -0.02em; }
.top nav { display: flex; gap: clamp(16px, 2.4vw, 32px); align-items: center; }
.top nav a, .top nav button {
  font: italic 700 17px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--dim);
  transition: color .2s, transform .2s var(--ease);
}
.top nav a:hover, .top nav button:hover { color: var(--accent); transform: translateY(-1px); }

/* sound control: a digital vernier caliper slides open to the left of the toggle.
   The jaw gap is the volume (closed = 0, fully open = 100); the LCD reads it out. */
.sound { display: flex; align-items: center; gap: 12px; }
/* opens on hover (or keyboard focus); slides back out and fades when you move away.
   Mouse focus doesn't hold it open: only :focus-visible (keyboard) does. */
.caliper-wrap {
  width: 0; opacity: 0; overflow: hidden; pointer-events: none; transform: translateX(24px);
  transition: width .45s var(--ease) .05s, opacity .3s ease .05s, transform .45s var(--ease) .05s;
}
.sound:hover .caliper-wrap, .sound:has(:focus-visible) .caliper-wrap {
  width: 206px; opacity: 1; pointer-events: auto; transform: none;
  transition: width .4s var(--ease), opacity .2s ease, transform .4s var(--ease);
}
/* the caliper itself is flat-shaded SVG (js/caliper.js): hard facets, no gradients */
.caliper {
  position: relative; width: 200px; height: 46px; margin: 2px 3px 0;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .6)) drop-shadow(0 0 6px rgba(0, 0, 0, .3));
}
.caliper-svg { display: block; overflow: visible; shape-rendering: geometricPrecision; }
.caliper-head { transition: transform .12s var(--ease); }
/* the real slider sits on top, invisible, so dragging, keys and screen readers all work */
.caliper input[type=range] {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize;
  -webkit-appearance: none; appearance: none;
}

/* drawer select list */
.index {
  position: fixed; left: var(--gut); top: 50%; transform: translateY(-50%);
  width: 250px;
  transition: opacity .45s var(--ease), transform .45s var(--ease);
  /* stronger read over a busy background: heavier shadow + a soft haze that fades out (no box) */
  text-shadow: 0 2px 0 rgba(0, 0, 0, .85), 0 0 14px rgba(0, 0, 0, .7);
}
.index::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset: -40px -90px -40px calc(-1 * var(--gut));
  background: radial-gradient(70% 60% at 30% 50%, rgba(8, 8, 8, .5), rgba(8, 8, 8, .22) 55%, transparent 80%);
}
.index .label {
  font: 400 11px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: rgba(239, 230, 207, .78);
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.index ol { list-style: none; }
.index button {
  position: relative; width: 100%; display: grid; grid-template-columns: 16px 46px 1fr; align-items: center;
  padding: 6px 8px 6px 4px; text-align: left; color: rgba(239, 230, 207, .84);
  transition: color .2s, padding .3s var(--ease);
}
.index button::before { /* highlight bar */
  content: ""; position: absolute; inset: 2px 0; z-index: -1; opacity: 0;
  background: linear-gradient(90deg, rgba(226, 166, 76, .38), rgba(226, 166, 76, .08) 70%, transparent);
  transition: opacity .2s;
}
.index .sw { width: 0; height: 0; border-left: 8px solid var(--accent); border-top: 5px solid transparent; border-bottom: 5px solid transparent; opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .3s var(--ease); filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .7)); }
.index .c { font: 400 12px/1 var(--mono); letter-spacing: .04em; }
.index .t { font: italic 700 21px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.index button.on, .index button:hover { color: var(--text); padding-left: 10px; }
.index button.on::before { opacity: 1; }
.index button.on .sw { opacity: 1; transform: none; }
.index button.on .c { color: var(--accent); }

/* inspect panel (drawer preview) */
.card {
  position: fixed; left: 0; top: 50%;
  width: min(440px, 100vw); padding: 22px 70px 20px var(--gut);
  background: linear-gradient(90deg, var(--shade) 0%, rgba(8, 8, 8, .62) 62%, transparent 100%);
  opacity: 0; pointer-events: none; transform: translate(-18px, -50%);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tab, var(--accent)); box-shadow: 0 0 14px var(--tab, var(--accent)); }
.card .code { font: 400 12px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.card h2 { font: italic 800 44px/.95 var(--display); text-transform: uppercase; letter-spacing: -0.005em; margin: 8px 0 14px; }
.card dl { display: grid; gap: 5px; max-width: 300px; }
.card dl div { display: flex; align-items: baseline; gap: 8px; font-size: 17px; }
.card dl div::after { content: ""; order: 1; flex: 1; border-bottom: 1px dotted rgba(239, 230, 207, .35); transform: translateY(-4px); }
.card dt { font: 400 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.card dd { order: 2; font-weight: 600; }
.card .summary { margin: 14px 0 18px; max-width: 32ch; font-size: 17px; line-height: 1.3; color: rgba(239, 230, 207, .82); }
.card .actions { display: flex; gap: 22px; }
.card .actions button { display: inline-flex; align-items: center; gap: 9px; font: italic 700 18px/1 var(--display); text-transform: uppercase; letter-spacing: .04em; transition: color .2s, transform .2s var(--ease); }
.card .actions button:hover { color: var(--accent); transform: translateX(2px); }
.card .actions .primary kbd { border-color: var(--accent); color: var(--accent); }

/* area readout (bottom right), like a game zone name */
.zone { position: fixed; right: var(--gut); bottom: calc(var(--gut) * .8); text-align: right; pointer-events: none; }
.zone .kicker { font: 400 12px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); display: flex; gap: 6px; justify-content: flex-end; align-items: baseline; }
.zone .kicker b { font-weight: 400; color: var(--text); }
.zone .kicker i { font-style: normal; opacity: .5; margin: 0 4px; }
.zone-title {
  font: italic 800 var(--zt)/.95 var(--display); text-transform: uppercase; letter-spacing: -0.005em;
  margin-top: 6px; -webkit-text-stroke: 1px rgba(0, 0, 0, .35);
  text-shadow: 0 3px 0 rgba(0, 0, 0, .8), 0 0 18px rgba(0, 0, 0, .5);
}

/* control prompts (bottom left) */
.hint {
  position: fixed; left: var(--gut); bottom: calc(var(--gut) * .8);
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; max-width: 60vw;
  font: italic 600 17px/1 var(--display); text-transform: uppercase; letter-spacing: .03em;
  transition: opacity .4s var(--ease);
}
.hint span { display: inline-flex; align-items: center; gap: 8px; }
.hint:empty { display: none; }

/* back to drawer (folio only) */
.back {
  position: fixed; left: 50%; top: calc(var(--gut) * .6 + 13px); transform: translate(-50%, -8px);
  display: inline-flex; gap: 9px; align-items: center;
  font: italic 700 18px/1 var(--display); text-transform: uppercase; letter-spacing: .04em;
  opacity: 0; pointer-events: none;
  transition: opacity .4s var(--ease), transform .4s var(--ease), color .2s;
}
.back:hover { color: var(--accent); }

/* download folio: sits above the area title, ringed by a red markup revision cloud.
   Its offset is the zone's own height (kicker 12 + gap 6 + title) plus the cloud's
   16px overhang and a 10px gap, so the cloud clears the kicker at every width. */
.download-wrap {
  position: fixed; right: calc(var(--gut) + 14px); bottom: calc(var(--gut) * .8 + 44px + var(--zt) * .95);
  --markup: #d4563f;
}
.download {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 9px;
  font: italic 700 18px/1 var(--display); text-transform: uppercase; letter-spacing: .04em;
  padding: 8px 6px; transition: color .2s, transform .2s var(--ease);
}
.download small { font: 400 11px/1 var(--mono); letter-spacing: .12em; color: var(--dim); }
.download kbd { border-color: var(--markup); color: #fff; background: linear-gradient(180deg, rgba(212, 86, 63, .55), rgba(212, 86, 63, .25)); }
.download:hover { color: var(--accent); transform: translateY(-1px); }
.revcloud { position: absolute; overflow: visible; pointer-events: none; animation: revcloud 3.2s ease-in-out infinite; transform-origin: center; }
.revcloud path { fill: rgba(212, 86, 63, .07); stroke: var(--markup); stroke-width: 1.8; stroke-linejoin: round; filter: drop-shadow(0 1.5px 0 rgba(0, 0, 0, .55)); }
.revcloud .tag polygon { fill: var(--markup); stroke: rgba(0, 0, 0, .35); stroke-width: 1; }
.revcloud .tag text { font: 700 11px/1 var(--display); fill: #fff; text-anchor: middle; }
/* subtle "look here": the cloud breathes, never flashes */
@keyframes revcloud { 0%, 100% { opacity: .62; transform: scale(1); } 50% { opacity: 1; transform: scale(1.025); } }
.download-wrap:hover .revcloud { animation-play-state: paused; opacity: 1; }
.toast {
  position: absolute; right: 0; bottom: calc(100% + 18px); white-space: nowrap;
  font: italic 700 15px/1 var(--display); text-transform: uppercase; letter-spacing: .04em;
  background: rgba(8, 8, 8, .78); padding: 8px 12px; border-left: 3px solid var(--markup);
  opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .3s, transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .revcloud { animation: none; opacity: .9; } }

/* idle prompt: ghost cursor that glides to the top drawer and "clicks" */
/* gentle: a small hairline ring that drifts in slowly, then sends out one soft ripple */
.ghost {
  position: fixed; left: 0; top: 0; z-index: 4; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  border: 1px solid rgba(239, 230, 207, .65); background: rgba(239, 230, 207, .05);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .45), 0 0 10px rgba(0, 0, 0, .25);
  opacity: 0; pointer-events: none;
  transition: transform 1.6s cubic-bezier(.45, .05, .25, 1), opacity .7s ease;
}
.ghost::after { content: ""; position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; margin: -1.5px; border-radius: 50%; background: rgba(239, 230, 207, .75); }
.ghost.show { opacity: 1; }
/* small white caption beside the ring */
.ghost-label {
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  font: 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .75), 0 0 8px rgba(0, 0, 0, .55);
}
.ghost.press::before {
  content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid rgba(239, 230, 207, .7);
  animation: ghost-ring 1.8s cubic-bezier(.2, .6, .3, 1) 1 forwards;
}
@keyframes ghost-ring { from { transform: scale(1); opacity: .7; } to { transform: scale(2.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ghost { transition: opacity .6s ease; } .ghost.press::before { animation: none; } }

/* title screen ("press start") */
.start {
  position: fixed; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; gap: 10px;
  background: radial-gradient(80% 70% at 50% 50%, rgba(10, 10, 10, .35), rgba(10, 10, 10, .72));
  color: var(--text); cursor: pointer; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .7s var(--ease);
}
.start-kicker { font: 400 12px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase; color: var(--dim); }
.start-title {
  font: italic 800 clamp(56px, 10vw, 128px)/.9 var(--display); text-transform: uppercase; letter-spacing: -0.01em;
  -webkit-text-stroke: 1px rgba(0, 0, 0, .35); text-shadow: 0 4px 0 rgba(0, 0, 0, .8), 0 0 30px rgba(0, 0, 0, .5);
}
.start-prompt { margin-top: 18px; display: inline-flex; gap: 10px; align-items: center; font: italic 700 20px/1 var(--display); text-transform: uppercase; letter-spacing: .05em; animation: start-blink 1.6s ease-in-out infinite; }
/* "better with sound": headphones icon with a slow, soft glow — noticed, not shouted */
.start-note {
  margin-top: 6px; display: inline-flex; align-items: center; gap: 9px;
  font: 400 12px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: rgba(239, 230, 207, .8);
  animation: start-note 3.4s ease-in-out infinite;
}
/* thin cream line icon, same colour and weight as the mono text beside it */
.headphones { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1.5px 0 rgba(0, 0, 0, .7)); }
@keyframes start-note {
  0%, 100% { opacity: .7; text-shadow: var(--drop); }
  50% { opacity: 1; text-shadow: var(--drop), 0 0 12px rgba(226, 166, 76, .45); }
}
@keyframes start-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
body[data-state="start"] .start { opacity: 1; pointer-events: auto; }
body[data-state="start"] :is(.top, .zone, .download-wrap) { opacity: 0; pointer-events: none; }
.top, .zone, .download-wrap { transition: opacity .6s var(--ease); }
@media (prefers-reduced-motion: reduce) { .start-prompt, .start-note { animation: none; } }

/* state-driven visibility */
body:is([data-state="folio"], [data-state="board"]) .back { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
body[data-state="preview"] .card { opacity: 1; pointer-events: auto; transform: translate(0, -50%); }
body:not([data-state="chest"]):not([data-state="intro"]) .index { opacity: 0; transform: translate(-14px, -50%); pointer-events: none; }
body:is([data-state="pulling"], [data-state="putting"], [data-state="opening"], [data-state="closing"], [data-state="intro"], [data-state="preview"]) .hint { opacity: 0; }

/* loading screen: the scale bar from a drawing sheet, over a faint drafting grid and
   a floor plan that draws itself in as --p goes 0 → 1. Type matches the HUD:
   italic condensed caps for words, mono for numbers. */
.loader {
  --line: rgba(239, 230, 207, .42); --ink: rgba(239, 230, 207, .9);
  position: fixed; inset: 0; z-index: 8; display: grid; place-content: center; overflow: hidden;
  background:
    repeating-linear-gradient(0deg, rgba(239, 230, 207, .045) 0 1px, transparent 1px 120px),
    repeating-linear-gradient(90deg, rgba(239, 230, 207, .045) 0 1px, transparent 1px 120px),
    repeating-linear-gradient(0deg, rgba(239, 230, 207, .02) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(239, 230, 207, .02) 0 1px, transparent 1px 24px),
    radial-gradient(75% 70% at 50% 45%, #26302f, #141a1a);
  background-position: center;
  transition: opacity .9s var(--ease), visibility 0s linear .9s;
}
.loader.done { opacity: 0; visibility: hidden; }
/* the construction grid: chain lines slide in one after another, then their
   bubbles appear. Pure CSS transforms/opacity, so they stay smooth even while
   the page is busy building the scene. */
.loader-grid { position: absolute; inset: 0; pointer-events: none; --chain: rgba(239, 230, 207, .12); }
.gl { position: absolute; overflow: hidden; }
.gl.v { top: 16%; bottom: 7%; width: 1px; }
.gl.h { left: 20%; right: 8%; height: 1px; }
.gl i { position: absolute; inset: 0; animation: gl-draw 1.7s cubic-bezier(.45, 0, .2, 1) calc(.15s + var(--i) * .1s) both; }
.gl.v i { background: repeating-linear-gradient(180deg, var(--chain) 0 22px, transparent 22px 28px, var(--chain) 28px 31px, transparent 31px 37px); --from: translateY(-100%); }
.gl.h i { background: repeating-linear-gradient(90deg, var(--chain) 0 22px, transparent 22px 28px, var(--chain) 28px 31px, transparent 31px 37px); --from: translateX(-100%); }
@keyframes gl-draw { from { transform: var(--from); } to { transform: none; } }
.gb {
  position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 1px solid rgba(239, 230, 207, .16); border-radius: 50%;
  display: grid; place-items: center; font: 400 13px/1 var(--mono); color: rgba(239, 230, 207, .26); text-shadow: none;
  animation: gb-in 1.2s ease-out calc(.55s + var(--i) * .1s) both; transition: color .5s ease;
}
.gb.col { top: calc(16% - 22px); }
.gb.row { left: calc(20% - 22px); }
@keyframes gb-in { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .gl i, .gb { animation: none; } }
/* a soft pool of dark behind the bar so it stays readable over the linework */
.loader-inner { position: relative; width: clamp(240px, 32vw, 400px); }
.loader-inner::before { content: ""; position: absolute; inset: -60px -90px; z-index: -1; background: radial-gradient(closest-side, rgba(18, 23, 23, .85), transparent); }
.scalebar { position: relative; height: 12px; }
.sb-cells { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 5fr; grid-template-rows: 1fr 1fr; border: 1px solid var(--line); }
.sb-cells span:not(:nth-child(6n+1)) { border-left: 1px solid var(--line); }
.sb-cells span:nth-child(-n+6) { border-bottom: 1px solid var(--line); }
/* the inked layer: full-strength lines and solid alternate cells, revealed left to right */
.sb-fill { --line: var(--ink); }
.sb-fill .on { background: var(--ink); }
/* The reveal: a window that slides right while the inked bar inside slides the
   opposite way, so the ink stays put and is uncovered left to right. Both are
   transforms run by js/loader.js as Web Animations, so the browser keeps them
   moving smoothly even while the page is busy building the 3D scene. */
.sb-reveal { position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; overflow: hidden; transform: translateX(-100%); will-change: transform; }
.sb-reveal .sb-fill { inset: 4px 0; transform: translateX(100%); will-change: transform; }
/* the pen: a short stroke riding the leading edge */
.sb-edge { position: absolute; right: 0; top: 0; bottom: 0; width: 1px; background: var(--text); opacity: .85; transition: opacity .4s ease; }
.loader.full .sb-edge { opacity: 0; }
.sb-labels { position: relative; height: 20px; font: 400 11px/1 var(--mono); color: var(--dim); }
.sb-labels span { position: absolute; top: 8px; transform: translateX(-50%); }
.sb-labels span::before { content: ""; position: absolute; left: 50%; top: -8px; width: 1px; height: 4px; background: var(--line); }
.sb-labels b { position: absolute; left: 100%; margin-left: 3px; font-weight: 400; }
.loader-foot { margin-top: 16px; display: flex; justify-content: space-between; align-items: baseline; }
#load-msg { font: italic 700 20px/1 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.loader-scale { font: 400 11px/1 var(--mono); letter-spacing: .1em; color: var(--dim); }
/* words wait for their fonts (see js/loader.js), then fade up */
.loader :is(.loader-foot, .sb-labels) { transition: opacity .5s ease; }
.loader:not(.type-ready) :is(.loader-foot, .sb-labels) { opacity: 0; }
.loader:not(.type-ready) .gb { color: transparent; }

.nojs { position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; padding: 24px; text-align: center; font-size: 18px; background: #1b2121; }
.nogl-msg, .noload-msg { display: none; }
body[data-state="nogl"] .nogl-msg, body[data-state="noload"] .noload-msg { display: grid; }
body:is([data-state="nogl"], [data-state="noload"]) .loader { display: none; }

/* compact layouts: phones, and tablets held upright. The scene fills the width
   there, so the drawer list (which would sit on top of the chest) goes, the
   preview card becomes a sheet along the bottom, and Back tucks under the mark. */
@media (max-width: 760px), (max-width: 1100px) and (orientation: portrait) {
  .index { display: none; }
  .card { top: auto; bottom: 0; transform: translate(0, 12px); width: 100vw; padding: 18px 20px 18px; background: linear-gradient(0deg, var(--shade) 0%, rgba(8, 8, 8, .6) 75%, transparent 100%); }
  .card::before { width: auto; height: 3px; right: 0; bottom: auto; }
  body[data-state="preview"] .card { transform: none; }
  body[data-state="preview"] .zone { display: none; }
  body[data-state="preview"] .download-wrap { opacity: 0; pointer-events: none; }
  .back { left: var(--gut); top: calc(var(--gut) * .6 + 52px); transform: translate(0, -8px); }
  body:is([data-state="folio"], [data-state="board"]) .back { transform: none; }
}
@media (max-width: 760px) {
  :root { --zt: 30px; }
  /* the menu stays (it is the only way to About / Contact); it steps aside while the caliper is open */
  .top nav { gap: 12px; }
  .top nav a, .top nav button { font-size: 15px; }
  .top nav:has(.sound:hover, .sound :focus-visible) a { display: none; }
  .hint { bottom: auto; top: calc(var(--gut) * .6 + 46px); max-width: 80vw; font-size: 15px; }
  .back { top: calc(var(--gut) * .6 + 78px); }
  .card h2 { font-size: 34px; }
  .card .summary { display: none; }
  .card .actions { margin-top: 16px; }   /* the gap the hidden summary used to give */
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; }
}
