:root {
  --ink: #120b10;
  --ink-2: #1d1219;
  --ink-3: #2a1a23;
  --cream: #f6eee3;
  --muted: rgba(246, 238, 227, 0.62);
  --line: rgba(246, 238, 227, 0.14);
  --scarlet: #e8382d;
  --scarlet-2: #ff5a45;
  --amber: #ffb35c;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; }

/* film grain */
.grain {
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 50;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
  mix-blend-mode: overlay;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); } 60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* HUD */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(12px + var(--safe-top)) 16px 0;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.steps { display: flex; gap: 6px; }
.steps button {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(18, 11, 16, .35);
  font-size: 12px; font-weight: 600; color: var(--muted);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  cursor: pointer; transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), transform .2s var(--ease);
  position: relative;
}
.steps button::after { content: ""; position: absolute; inset: -8px -3px; }
.steps button:active { transform: scale(.96); }
.steps button.on { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.steps button.seen:not(.on) { color: var(--cream); border-color: rgba(246, 238, 227, .4); }
.mute {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(18, 11, 16, .35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: grid; place-items: center; cursor: pointer;
}
.mute svg { width: 20px; height: 20px; fill: none; stroke: var(--cream); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mute .spk { fill: var(--cream); }
.mute .x { display: none; }
.mute[aria-pressed="true"] .wave { display: none; }
.mute[aria-pressed="true"] .x { display: block; }

/* scenes */
.scene {
  position: fixed; inset: 0;
  visibility: hidden;
  clip-path: circle(0% at var(--x, 50%) var(--y, 50%));
}
.scene.is-active { visibility: visible; clip-path: circle(150% at var(--x, 50%) var(--y, 50%)); z-index: 2; }
.scene.entering { visibility: visible; z-index: 3; animation: reveal 1s var(--ease) forwards; }
.scene.leaving { visibility: visible; z-index: 1; clip-path: circle(150% at 50% 50%); }
@keyframes reveal {
  from { clip-path: circle(0% at var(--x, 50%) var(--y, 50%)); }
  to   { clip-path: circle(150% at var(--x, 50%) var(--y, 50%)); }
}

.kicker {
  margin: 0 0 6px;
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--amber); font-weight: 600;
}
.muted { color: var(--muted); margin: 0; font-size: 14px; }
h2 {
  font-family: var(--serif); font-weight: 400; font-style: italic;
  font-variation-settings: "SOFT" 100, "opsz" 72;
  font-size: clamp(30px, 8vw, 44px); line-height: 1; margin: 0 0 8px;
  letter-spacing: -.01em;
}

/* buttons */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(246, 238, 227, .06);
  color: var(--cream); font-weight: 600; font-size: 15px; letter-spacing: .01em;
  cursor: pointer; white-space: nowrap;
  transition: transform .25s var(--ease), background .25s, opacity .25s;
}
.btn:active { transform: scale(.96); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.btn.primary:hover { background: #fff; }
.btn.ghost { background: rgba(18, 11, 16, .4); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn.small { height: 42px; padding: 0 16px; font-size: 14px; font-weight: 500; }
.btn[disabled] { opacity: .35; pointer-events: none; }

/* INTRO: the case file */
#intro { background: radial-gradient(130% 90% at 50% 120%, #2a1018 0%, #0c0709 70%); }
.lamp {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(34vmax 30vmax at var(--gx, 50%) var(--gy, 38%), rgba(255, 196, 120, .30), rgba(255, 170, 90, .08) 45%, transparent 70%);
}
.intro-inner {
  position: relative; height: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: calc(64px + var(--safe-top)) 18px calc(28px + var(--safe-bot));
  gap: 22px;
}
.dossier {
  --paper: #efe4cf;
  position: relative; width: 100%; max-width: 440px;
  padding: 26px 22px 22px;
  color: #241a1a;
  background:
    linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0) 30%),
    repeating-linear-gradient(0deg, rgba(90, 60, 30, .035) 0 1px, transparent 1px 3px),
    var(--paper);
  border-radius: 4px 4px 6px 6px;
  box-shadow: 0 30px 60px rgba(0,0,0,.55), 0 2px 0 rgba(255,255,255,.4) inset, 0 0 0 1px rgba(60,40,20,.15);
  transform: rotate(-1.2deg) translateY(30px); opacity: 0;
  transition: transform 1.1s var(--ease), opacity .8s var(--ease);
  will-change: transform;
}
.dossier.in { transform: rotate(-1.2deg); opacity: 1; }
.dossier::before { /* folder tab */
  content: ""; position: absolute; top: -14px; left: 22px; width: 120px; height: 18px;
  background: var(--paper); border-radius: 6px 6px 0 0;
  box-shadow: 0 -1px 0 rgba(60,40,20,.12);
}
.clip {
  position: absolute; top: -18px; left: 168px; width: 22px; height: 54px;
  border: 3px solid #9a9a9a; border-radius: 12px; border-bottom-color: transparent;
  box-shadow: 1px 2px 2px rgba(0,0,0,.3);
}
.dos-head {
  display: flex; justify-content: space-between;
  font-family: "Courier Prime", ui-monospace, monospace; font-weight: 700;
  font-size: 12px; letter-spacing: .2em; color: #6b5444;
  border-bottom: 1px dashed rgba(60,40,20,.35); padding-bottom: 10px; margin-bottom: 16px;
}
.kicker.ink { color: var(--scarlet); }
.name {
  margin: 0 0 14px;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(56px, 17vw, 96px);
  line-height: .9; letter-spacing: -.04em;
  display: flex; flex-wrap: wrap; color: #1a1112;
  cursor: default;
}
.name .ch {
  display: inline-block; will-change: transform;
  font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 144, "wght" var(--w, 400);
  transition: color .4s;
  opacity: 0;
}
.name .ch.in { opacity: 1; }
.name .ch:nth-child(even) { font-style: italic; }
.name .ch.hot { color: var(--scarlet); }
.facts {
  margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px;
  font-family: "Courier Prime", ui-monospace, monospace; font-size: 15px;
}
.facts dt { color: #7a6151; text-transform: uppercase; font-size: 12px; letter-spacing: .12em; padding-top: 2px; }
.facts dd { margin: 0; opacity: 0; transform: translateX(-6px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.facts dd.in { opacity: 1; transform: none; }
.redact {
  position: relative; display: inline; cursor: pointer;
  color: transparent; transition: color .5s .15s;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  background: linear-gradient(#141010, #141010) no-repeat left / 100% 100%;
  border-radius: 1px; padding: 0 2px;
  transition: background-size .55s var(--ease), color .4s .2s;
}
.redact.open { background-size: 0% 100%; background-position: right; color: #241a1a; }
.tap-hint { margin: 14px 0 0; font-size: 12px; color: #6b5444; font-family: "Courier Prime", monospace; transition: opacity .4s; }
.tap-hint.gone { opacity: 0; }
.stamp {
  position: absolute; right: 18px; top: 58px;
  font-family: "Courier Prime", monospace; font-weight: 700; font-size: 26px; letter-spacing: .14em;
  color: var(--scarlet); padding: 4px 12px; border: 3px solid currentColor; border-radius: 6px;
  opacity: 0; transform: rotate(-14deg) scale(2.4);
  mix-blend-mode: multiply;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='r'%3E%3CfeTurbulence baseFrequency='.8' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.7'/%3E%3C/filter%3E%3Crect width='120' height='60' filter='url(%23r)'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cfilter id='r'%3E%3CfeTurbulence baseFrequency='.8' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.7'/%3E%3C/filter%3E%3Crect width='120' height='60' filter='url(%23r)'/%3E%3C/svg%3E");
  pointer-events: none;
}
.stamp.slam { animation: slam .45s cubic-bezier(.5, 0, .7, 1.4) forwards; }
@keyframes slam {
  0% { opacity: 0; transform: rotate(-14deg) scale(2.4); }
  70% { opacity: .95; transform: rotate(-14deg) scale(.94); }
  100% { opacity: .88; transform: rotate(-14deg) scale(1); }
}
.shake { animation: shake .3s linear; }
@keyframes shake {
  0%,100% { translate: 0 0; } 25% { translate: -3px 2px; } 50% { translate: 3px -2px; } 75% { translate: -2px -1px; }
}
#enter { opacity: 0; transition: opacity 1s var(--ease), transform .25s var(--ease); }
#enter.in { opacity: 1; }
.hint { font-size: 12px; color: rgba(246, 238, 227, .55); margin: -8px 0 0; opacity: 0; transition: opacity 1s .4s; }
.hint.in { opacity: 1; }

/* CAKE */
#cake { background: #0f090d; }
#cakeCanvas, #pinataCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.cake-top, .pin-top {
  position: absolute; left: 0; right: 0; top: calc(60px + var(--safe-top));
  padding: 0 20px; pointer-events: none;
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.cake-top.dim { opacity: 0; transform: translateY(-10px); }
.dock {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 16px calc(16px + var(--safe-bot));
  background: linear-gradient(to top, rgba(15, 9, 13, .94) 55%, rgba(15, 9, 13, 0));
  display: flex; flex-direction: column; gap: 12px;
  animation: dockIn .6s var(--ease);
}
.dock[hidden] { display: none; }
@keyframes dockIn { from { opacity: 0; transform: translateY(20px); } }
.tools {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px; padding: 0 16px;
}
.tools::-webkit-scrollbar { display: none; }
.tool {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 14px 0 10px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(246, 238, 227, .05);
  font-size: 14px; font-weight: 500; color: var(--muted); cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .2s var(--ease);
}
.tool:active { transform: scale(.96); }
.tool i { width: 18px; height: 18px; border-radius: 50%; background: var(--c, #fff); box-shadow: inset 0 -3px 4px rgba(0, 0, 0, .3), inset 0 2px 3px rgba(255, 255, 255, .35); }
.tool[aria-selected="true"] { background: rgba(246, 238, 227, .14); color: var(--cream); border-color: rgba(246, 238, 227, .5); }
.swatches { display: flex; gap: 10px; min-height: 36px; align-items: center; flex-wrap: wrap; }
.sw {
  position: relative;
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  background: var(--c);
  box-shadow: inset 0 -5px 8px rgba(0, 0, 0, .28), inset 0 3px 5px rgba(255, 255, 255, .3), 0 0 0 1px rgba(255, 255, 255, .08);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.sw[aria-checked="true"] { transform: scale(1.12); box-shadow: inset 0 -5px 8px rgba(0, 0, 0, .28), inset 0 3px 5px rgba(255, 255, 255, .3), 0 0 0 2px var(--ink), 0 0 0 4px var(--cream); }
.sw.multi { background: conic-gradient(var(--c1), var(--c2), var(--c3), var(--c4), var(--c1)); }
.sw-label { font-size: 13px; color: var(--muted); margin-left: 4px; }
.dock-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dock-actions .primary { flex: 1; max-width: 240px; margin-left: auto; }

.blow { align-items: center; text-align: center; background: linear-gradient(to top, rgba(8, 5, 7, .9) 30%, rgba(8, 5, 7, 0)); }
.blow-line { margin: 0; font-family: var(--serif); font-style: italic; font-size: 20px; max-width: 26ch; }
.meter { width: 160px; height: 4px; border-radius: 4px; background: rgba(246, 238, 227, .12); overflow: hidden; opacity: .3; transition: opacity .4s; }
.meter.live { opacity: 1; }
.meter i { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--amber), var(--scarlet-2)); }
.btn.hold { overflow: hidden; width: 200px; touch-action: none; }
.hold-fill { position: absolute; inset: 0; background: rgba(255, 179, 92, .25); transform-origin: left; transform: scaleX(0); }
.btn.hold { transition: transform .16s var(--ease), border-color .16s; }
.btn.hold.on { transform: scale(.97); border-color: rgba(255, 179, 92, .6); }
.hold-label { position: relative; }
.after { align-items: stretch; }
.dock.settling { pointer-events: none; }
.wish-made {
  margin: 0 0 4px; text-align: center;
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: 40px; line-height: 1;
}
.nogl { position: absolute; inset: 0; display: grid; place-content: center; gap: 16px; text-align: center; padding: 24px; }
.nogl[hidden] { display: none; }

/* PINATA */
#pinata { background: #1a0b12; }
.photo-card {
  position: absolute; left: 16px; right: 16px; bottom: calc(18px + var(--safe-bot));
  max-width: 420px; margin: 0 auto;
  padding: 20px; border-radius: 22px;
  background: rgba(18, 11, 16, .72);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  display: flex; flex-direction: column; gap: 12px;
  animation: dockIn .7s var(--ease);
  transition: opacity .4s, transform .4s var(--ease);
}
.photo-card.gone { opacity: 0; transform: translateY(20px); pointer-events: none; }
.photo-card h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 26px; line-height: 1.05; }
.photo-card .btn { width: 100%; }
.change-photo { position: absolute; right: 16px; top: calc(60px + var(--safe-top)); }
.change-photo[hidden] { display: none; }
.pin-top { padding-right: 140px; }

/* FINALE: the statement */
#finale {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .36 0 0 0 0 .22 0 0 0 .7 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)'/%3E%3C/svg%3E"),
    radial-gradient(120% 70% at 50% 0%, rgba(255, 190, 120, .12), transparent 60%),
    radial-gradient(3px 3px at 20% 30%, rgba(0,0,0,.25), transparent),
    #2b1c16;
  background-attachment: local;
  overflow-y: auto; overflow-x: hidden;
}
.string { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; overflow: visible; }
.string path { fill: none; stroke: var(--scarlet); stroke-width: 2.2; stroke-linecap: round; filter: drop-shadow(0 3px 2px rgba(0,0,0,.45)); }
.finale-inner {
  position: relative; z-index: 1; min-height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(64px + var(--safe-top)) 18px calc(28px + var(--safe-bot));
  max-width: 520px; margin: 0 auto;
}
.polaroids { position: relative; height: 148px; width: 260px; margin-bottom: 14px; flex: none; }
.polaroid {
  position: absolute; top: 0; margin: 0; width: 108px; padding: 6px 6px 26px;
  background: #f4efe6; border-radius: 2px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, .5), 0 2px 5px rgba(0, 0, 0, .3);
  transform: rotate(var(--r)) translateY(-30px); opacity: 0;
  transition: opacity .6s var(--ease), transform .8s cubic-bezier(.3, 1.4, .5, 1);
}
.polaroid.in { opacity: 1; transform: rotate(var(--r)); }
.polaroid .ph { aspect-ratio: 1; background: #1b1117; overflow: hidden; }
.polaroid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.polaroid figcaption { position: absolute; bottom: 7px; left: 0; right: 0; text-align: center; font-family: "Courier Prime", monospace; text-transform: uppercase; letter-spacing: .15em; color: #5a4636; font-size: 11px; }
.p1 { left: 6px; --r: -7deg; }
.p2 { right: 6px; top: 14px; --r: 6deg; }
.polaroid[hidden] { display: none; }
.pin {
  position: absolute; top: -6px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; z-index: 3;
  background: radial-gradient(circle at 35% 30%, #ff8a7a, var(--scarlet) 45%, #7d1510);
  box-shadow: 0 3px 3px rgba(0,0,0,.45);
}
.statement {
  position: relative; width: 100%;
  padding: 20px 20px 60px; text-align: left; color: #241a1a;
  background: linear-gradient(180deg, rgba(255,255,255,.4), rgba(255,255,255,0) 25%), #f3ecdc;
  box-shadow: 0 24px 50px rgba(0,0,0,.5);
  transform: rotate(.8deg) translateY(30px); opacity: 0;
  transition: opacity .7s var(--ease), transform 1s var(--ease);
}
.statement.in { opacity: 1; transform: rotate(.8deg); }
.statement .dos-head { margin-bottom: 14px; }
.finale-title {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(34px, 10vw, 52px); line-height: 1; margin: 0 0 14px; color: #1a1112;
}
.finale-title em { font-style: normal; color: var(--scarlet); }
.note { font-family: "Courier Prime", monospace; font-size: 15px; line-height: 24px; margin: 0 0 12px; min-height: 72px; }
.note .caret { display: inline-block; width: 8px; height: 17px; background: #241a1a; vertical-align: -3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.sign { font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--scarlet); margin: 0; opacity: 0; transition: opacity 1s; }
.sign.in { opacity: 1; }
.stamp.closed { top: auto; bottom: 16px; right: 16px; font-size: 19px; }
.finale-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 16px; opacity: 0; transition: opacity 1s; }
.finale-actions.in { opacity: 1; }

/* evidence tag kicker + counter */
.kicker.tag {
  display: inline-block; position: relative;
  font-family: "Courier Prime", monospace; letter-spacing: .2em;
  color: #241a1a; background: #f0d9a8; padding: 4px 10px 4px 18px; border-radius: 2px 6px 6px 2px;
  font-size: 11px; margin-bottom: 10px;
}
.kicker.tag::before { content: ""; position: absolute; left: 6px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: #120b10; }
.counter { margin: 8px 0 0; font-family: "Courier Prime", monospace; font-size: 12px; letter-spacing: .16em; color: var(--muted); }
.counter b { color: var(--cream); font-size: 15px; }
.counter[hidden] { display: none; }
.sealed { margin: -6px 0 2px; text-align: center; font-family: "Courier Prime", monospace; font-size: 13px; color: var(--muted); }

/* overlay fx */
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }
.toast {
  position: fixed; left: 50%; top: calc(64px + var(--safe-top)); z-index: 45;
  transform: translate(-50%, -10px); opacity: 0;
  padding: 10px 16px; border-radius: 999px; font-size: 14px;
  background: rgba(246, 238, 227, .95); color: var(--ink);
  transition: opacity .35s var(--ease), transform .35s var(--ease); pointer-events: none;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 760px) {
  .dock { left: 50%; right: auto; width: 560px; transform: translateX(-50%); background: none; }
  @keyframes dockIn { from { opacity: 0; } }
  .cake-top, .pin-top { left: 50%; right: auto; width: 560px; transform: translateX(-50%); padding: 0; }
  .cake-top.dim { transform: translateX(-50%) translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
}

/* camera flash between exhibits, then the scene develops like a print */
.flash { position: fixed; inset: 0; background: #fffdf6; opacity: 0; pointer-events: none; z-index: 60; }
.flash.pop { animation: flash 1s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes flash { 0% { opacity: 0; } 7% { opacity: .96; } 100% { opacity: 0; } }
.scene.develop { animation: develop 1.3s cubic-bezier(.25,.6,.3,1); }
@keyframes develop {
  0% { filter: sepia(.85) saturate(.25) brightness(1.75) contrast(.5); }
  55% { filter: sepia(.3) saturate(.75) brightness(1.12) contrast(.88); }
  100% { filter: none; }
}

/* dusting for prints over the statement */
.latent { position: relative; }
.dust, .dust-motes { position: absolute; inset: -6px -8px; width: calc(100% + 16px); height: calc(100% + 12px); }
.dust { touch-action: none; cursor: crosshair; z-index: 2; transition: opacity .6s ease; border-radius: 2px; }
.dust.gone { opacity: 0; pointer-events: none; }
.dust-motes { pointer-events: none; z-index: 3; }
.dust-hint {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); z-index: 4; pointer-events: none;
  margin: 0; text-align: center; font-family: "Courier Prime", monospace; font-size: 13px; letter-spacing: .04em; color: #5a4636;
  transition: opacity .4s ease; animation: hintPulse 2.4s ease-in-out infinite;
}
.dust-hint span { display: block; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--scarlet); margin-bottom: 6px; }
.dust-hint.gone { opacity: 0; animation: none; }
@keyframes hintPulse { 50% { opacity: .55; } }
.reveal-all { margin-top: 14px; }
@media (prefers-reduced-motion: reduce) {
  .flash.pop, .scene.develop, .dust-hint { animation: none; }
}
.reveal-all[hidden] { display: none; }

/* text wrapping */
h1, h2, .finale-title { text-wrap: balance; }
p, .note, .facts dd { text-wrap: pretty; }
/* keyboard focus */
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.redact:focus-visible { outline-offset: 2px; }

/* press states and touch targets */
.sw::after { content: ""; position: absolute; inset: -5px; }
.sw:active { transform: scale(.94); }
.mute:active, .redact:active { transform: scale(.94); }
.mute { transition: transform .16s var(--ease); }
.pin-top h2, .pin-top .muted, .counter { text-shadow: 0 0 6px #1a0b12, 0 0 16px #1a0b12; }
.blow-line, .sealed, .muted, .tap-hint { text-wrap: balance; }

/* reduced motion: keep fades, drop movement */
@keyframes fadeOnly { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .stamp.slam { animation: none; opacity: .88; transform: rotate(-14deg); }
  .shake { animation: none; }
  .polaroid, .polaroid.in { transform: rotate(var(--r)); }
  .facts dd { transform: none; }
  .dock, .photo-card { animation-name: fadeOnly; }
  .btn:active, .tool:active, .sw:active, .mute:active, .redact:active, .btn.hold.on { transform: none; }
}
