:root {
  --bg: #121110;
  --bg-2: #1a1816;
  --strip: #1d1b18;
  --ink: #ece6da;
  --ink-2: #a39c8f;
  --ink-3: #918a7f; /* ≥4.5:1 on #121110, #1d1b18 and the glass panels */
  --line: rgba(236, 230, 218, 0.14);
  --accent: #e3b443;
  --red: #d4472f;
  --paper: #f3ecdc;
  --sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --display: 'Ojuju', ui-sans-serif, system-ui, sans-serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --gutter: clamp(16px, 2.2vw, 28px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
[hidden] { display: none !important; }

/* ── chrome ────────────────────────────────────────────────── */
.chrome {
  position: fixed; left: 0; right: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 14px var(--gutter);
  font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.05em;
  pointer-events: none;
  transition: opacity 0.6s var(--ease), translate 0.6s var(--ease);
}
.chrome > * { pointer-events: auto; }
.chrome::before { content: ''; position: absolute; inset: 0 0 -28px; z-index: -1; pointer-events: none; background: linear-gradient(rgba(var(--scrim, 18, 17, 16), 0.92), rgba(var(--scrim, 18, 17, 16), 0.6) 55%, transparent); transition: background 0.6s; }
.chrome, .chrome a, .chrome button { transition-property: color, background-color, opacity, translate; transition-duration: 0.6s; }

.vignette { transition: opacity 0.9s; }
.chrome.bottom::before { inset: -36px 0 0; background: linear-gradient(transparent, rgba(18, 17, 16, 0.6) 45%, rgba(18, 17, 16, 0.92)); }
body:not(.on-field) .chrome.bottom::before { opacity: 0; }
.chrome.top { top: 0; padding-top: max(14px, env(safe-area-inset-top)); }
.chrome.bottom { bottom: 0; padding-bottom: max(14px, env(safe-area-inset-bottom)); align-items: end; }
.brand { font-weight: 500; letter-spacing: 0.08em; justify-self: start; }
.brand em { font-style: normal; color: var(--ink-3); margin-left: 10px; letter-spacing: 0.04em; }
.views { display: flex; gap: 4px; background: var(--pill, rgba(18, 17, 16, 0.72)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.views a { padding: 7px 12px 6px; border-radius: 999px; color: var(--ink-2); transition: color 0.2s, background 0.2s; }
.views a:hover { color: var(--ink); }
.views a[aria-current='page'] { background: var(--ink); color: var(--on-ink, #0b0a09); }
.right { justify-self: end; display: flex; align-items: center; gap: 18px; }
.right button, .right a { color: var(--ink-2); transition: color 0.2s; padding: 6px 0; }
.right button:hover, .right a:hover { color: var(--ink); }
.snd b, .count b { color: var(--ink); font-weight: 500; }
.count b { font-variant-numeric: tabular-nums; }
.count.bump b { animation: bump 0.6s var(--spring); display: inline-block; }
@keyframes bump { 40% { scale: 1.6; color: var(--accent); } }
.chrome { animation: chrome-in 0.9s var(--ease) both 0.2s; }
.chrome.bottom { animation-delay: 0.5s; }
@keyframes chrome-in { from { opacity: 0; } }

.views .layout { display: flex; gap: 2px; margin-left: 6px; padding-left: 8px; border-left: 1px solid var(--line); transition: opacity 180ms ease, scale 200ms var(--ease), visibility 0s; transform-origin: left center; }
.views .layout button { padding: 7px 10px 6px; border-radius: 999px; color: var(--ink-3); transition: color 0.2s, background 0.2s; }
.views .layout button:hover { color: var(--ink); }
.views .layout button[aria-pressed='true'] { background: rgba(236, 230, 218, 0.14); color: var(--ink); }
body:not(.on-field) .views .layout { opacity: 0; scale: 0.96; visibility: hidden; transition: opacity 150ms ease, scale 150ms var(--ease), visibility 0s 150ms; }
@keyframes wheel { 0% { translate: 0 0; opacity: 1; } 70% { translate: 0 7px; opacity: 0; } 100% { opacity: 0; } }

/* ── views ─────────────────────────────────────────────────── */
main { position: fixed; inset: 0; }
.view { position: absolute; inset: 0; }
.field-view { cursor: grab; touch-action: none; }
.field-view.dragging { cursor: grabbing; }
.field-view.hovering { cursor: none; }
/* two engines share the view and cross-fade: the globe (loose) and the stockbook sheet (grid) */
.stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; pointer-events: none; transition: opacity 200ms var(--ease); }
.stage.on { opacity: 1; pointer-events: auto; }
#orbit { background: radial-gradient(90% 80% at 50% 50%, #1c1a17 0%, #121110 60%, #0d0c0b 100%); }
body.no-fade .stage { transition: none; }
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(5, 5, 4, 0.75) 100%); }

.cursor {
  position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none;
  width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  border: 1.5px solid rgba(236, 230, 218, 0.85); box-shadow: 0 0 18px rgba(236, 230, 218, 0.25), inset 0 0 12px rgba(236, 230, 218, 0.15);
  scale: 0.2; opacity: 0; transition: scale 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
}
.cursor.on { scale: 1; opacity: 1; }

/* index */
.index-view { overflow-y: auto; padding: 108px var(--gutter) 80px; scrollbar-width: thin; }
.index-head { display: grid; grid-template-columns: 1fr minmax(0, 340px); gap: 24px; align-items: end; margin-bottom: 40px; }
.index-head h1, .album-head h1 { margin: 0; font: 700 clamp(46px, 7.4vw, 120px)/0.9 var(--display); letter-spacing: -0.04em; }
.index-head h1 i, .album-head h1 i { font-style: normal; font-weight: 250; color: var(--ink-3); white-space: nowrap; }
.index-head p, .album-head p { margin: 0; color: var(--ink-2); font-size: 13.5px; text-wrap: pretty; }
.index-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.index-list li { border-bottom: 1px solid var(--line); }
.index-list button {
  width: 100%; display: grid; grid-template-columns: 52px 1.1fr 1.6fr 0.5fr 1.1fr 24px; gap: 16px; align-items: baseline;
  padding: 15px 0 14px; text-align: left;
  font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2);
  transition: color 150ms ease, translate 200ms var(--ease);
}
.index-list .st { color: var(--ink); }
.index-list .rl { font: 500 clamp(20px, 2.1vw, 28px)/1 var(--display); text-transform: none; letter-spacing: -0.02em; color: var(--ink); }
.index-list .got { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--ink-3); justify-self: end; }
.index-list .got.on { background: var(--red); border-color: var(--red); }
.index-list:hover button { color: var(--ink-3); }
.index-list:hover .st, .index-list:hover .rl { color: var(--ink-3); }
.index-list button:focus-visible { color: var(--ink-2); translate: 14px 0; }
@media (hover: hover) and (pointer: fine) { .index-list button:hover { color: var(--ink-2); translate: 14px 0; } }
.index-list button:hover .st, .index-list button:hover .rl, .index-list button:focus-visible .rl { color: var(--ink); }
.index-float {
  position: fixed; left: 0; top: 0; z-index: 15; pointer-events: none; width: 210px;
  opacity: 0; scale: 0.96; transition: opacity 160ms var(--ease), scale 160ms var(--ease);
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.55));
}
.index-float.on { opacity: 1; scale: 1; }
.index-float canvas { width: 100%; height: auto; display: block; }

.credits { margin-top: 64px; max-width: 880px; color: var(--ink-3); font-size: 12px; }
.credits h2 { margin: 0 0 8px; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.credits p { margin: 0 0 16px; max-width: 60ch; }
.credits ul { list-style: none; margin: 0; padding: 0; columns: 2 320px; column-gap: 32px; }
.credits li { padding: 4px 0; break-inside: avoid; }
.credits li span { color: var(--ink-2); }
.credits a, .d-meta .credit a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.credits a:hover, .d-meta .credit a:hover { color: var(--ink); }
.credits i { font-style: normal; color: var(--ink-3); }
.d-meta .credit { color: var(--ink-3); font-size: 12.5px; }
/* album */
.album-view { overflow-y: auto; padding: 108px var(--gutter) 80px; }
.album-head { display: grid; grid-template-columns: 1fr minmax(0, 340px); gap: 24px; align-items: end; margin-bottom: 40px; }
.album-actions { grid-column: 2; }
.ghost { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); border-bottom: 1px solid currentColor; padding-bottom: 2px; }
.ghost:hover { color: var(--ink-2); }
.album-pages { display: grid; gap: 22px; }
.page {
  background: #0c0b0a; border-radius: 6px; padding: 22px 22px 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 30px 60px -30px #000;
}
.page h3 { margin: 0 0 14px; display: flex; justify-content: space-between; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.page h3 b { color: var(--ink); font-weight: 500; }
.strip {
  position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 28vw), 1fr)); gap: clamp(12px, 2vw, 26px);
  padding: 16px 4px 22px; margin-bottom: 14px;
}
.strip::before { content: ''; position: absolute; left: -22px; right: -22px; top: 46%; bottom: 0; background: linear-gradient(rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025) 12%, rgba(255, 255, 255, 0.02)); border-top: 1px solid rgba(255, 255, 255, 0.12); pointer-events: none; z-index: 2; }
.slot { position: relative; aspect-ratio: 520 / 660; cursor: pointer; }
.slot canvas { position: absolute; inset: 0; width: 100%; height: 100%; transition: translate 200ms var(--ease), rotate 200ms var(--ease); filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.5)); }
@media (hover: hover) and (pointer: fine) { .slot:hover canvas { translate: 0 -6px; rotate: -1.5deg; } }
.slot.empty { border: 1px dashed rgba(236, 230, 218, 0.18); border-radius: 3px; display: grid; place-items: center; text-align: center; padding: 8px; }
.slot.empty span { font: 600 19px/1.05 'Caveat', cursive; color: var(--ink-3); }
.slot.empty small { display: block; font: 500 11px var(--mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; }
.slot.empty:hover { border-color: var(--ink-3); }
.slot.empty:hover span { color: var(--ink-2); }
.slot.fresh canvas { animation: mount 0.9s var(--spring); }
@keyframes mount { from { translate: 0 -40px; rotate: 8deg; opacity: 0; } }

/* ── detail ────────────────────────────────────────────────── */
.detail { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr); --mid: clamp(28px, 4.5vw, 88px); }
.d-backdrop { position: absolute; inset: 0; background: rgba(10, 9, 8, 0.86); backdrop-filter: blur(14px) saturate(0.8); -webkit-backdrop-filter: blur(14px) saturate(0.8); opacity: 0; transition: opacity 240ms var(--ease); }
.detail.open .d-backdrop { opacity: 1; }
.d-stage { position: relative; display: grid; align-items: center; justify-items: end; perspective: 1400px; padding: 80px var(--mid) 80px 40px; pointer-events: none; }
.d-card {
  position: relative; width: min(56vh, 32vw, 460px); aspect-ratio: 520 / 660;
  transform-style: preserve-3d; pointer-events: auto; touch-action: none; cursor: grab;
  transition: opacity 240ms var(--ease), scale 300ms var(--ease);
  opacity: 0; scale: 0.96;
}
.detail.open .d-card { opacity: 1; scale: 1; }
.d-card.from-quad { scale: 1; transition: opacity 120ms ease; }
.detail.focus .d-card { cursor: move; }
.d-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; filter: drop-shadow(0 40px 50px rgba(0, 0, 0, 0.6)) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4)); }
.d-face canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.d-mark { opacity: 0; transition: opacity 0.05s; }
.d-mark.on { opacity: 1; }
.d-glare { position: absolute; inset: 4%; pointer-events: none; mix-blend-mode: soft-light; background: radial-gradient(circle at var(--gx, 30%) var(--gy, 20%), rgba(255, 255, 255, 0.55), transparent 45%); opacity: 0.8; }
.d-back {
  transform: rotateY(180deg);
  -webkit-mask: var(--perf); mask: var(--perf);
  background:
    linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 45%, transparent 60%),
    repeating-linear-gradient(0deg, rgba(120, 100, 60, 0.05) 0 2px, transparent 2px 5px),
    #eee4cc;
  color: #4b4a52; padding: 14% 12%;
  font: 600 clamp(18px, 2.2vw, 28px)/1.15 'Caveat', cursive;
}
.d-back .hinge { position: absolute; left: 30%; right: 30%; top: 8%; height: 16%; background: rgba(255, 255, 255, 0.55); border: 1px solid rgba(0, 0, 0, 0.06); rotate: -2deg; }
.d-back .cat { position: absolute; bottom: 12%; right: 12%; text-align: right; }
.d-back .gum { font: 500 10px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: #a79c80; position: absolute; left: 12%; bottom: 8%; }
.d-rubber { position: absolute; left: 50%; top: 50%; width: 170px; height: 220px; margin: -110px 0 0 -85px; pointer-events: none; opacity: 0; z-index: 3; }
.d-rubber .handle { position: absolute; left: 50%; top: 0; width: 62px; height: 120px; margin-left: -31px; border-radius: 31px 31px 10px 10px; background: radial-gradient(circle at 35% 25%, #a26a3c, #5a3218 70%); box-shadow: inset -6px -6px 14px rgba(0, 0, 0, 0.4); }
.d-rubber .base { position: absolute; left: 0; right: 0; top: 112px; height: 64px; border-radius: 10px; background: linear-gradient(#6b4022, #3e2412 55%, #1c1c26 56%); box-shadow: 0 20px 30px rgba(0, 0, 0, 0.45); }
.d-rubber.down { animation: slam 0.9s var(--ease) forwards; }
@keyframes slam {
  0% { opacity: 0; translate: 40px -160px; rotate: 8deg; scale: 1.15; }
  30% { opacity: 1; translate: 0 -120px; rotate: -4deg; scale: 1.1; }
  46% { translate: 0 -40px; rotate: 0; scale: 1; }
  52% { translate: 0 -34px; scale: 0.96 1.02; }
  70% { translate: 0 -70px; opacity: 1; }
  100% { translate: -60px -260px; rotate: -12deg; opacity: 0; }
}
.d-card.thud { animation: thud 0.4s var(--ease); }
@keyframes thud { 0% { scale: 1; } 30% { scale: 0.975; } 100% { scale: 1; } }
.d-text {
  position: relative; z-index: 2; display: flex; flex-direction: column; gap: 18px;
  padding: 26px var(--gutter) 30px var(--mid); overflow-y: auto;
  opacity: 0; translate: 16px 0;
}
.detail.open .d-text { opacity: 1; translate: 0 0; }
.d-top { display: flex; justify-content: space-between; align-items: center; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); }
.d-n { font-variant-numeric: tabular-nums; color: var(--ink); }
.d-nav { display: flex; gap: 6px; }
.d-nav button { height: 30px; min-width: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); transition: color 0.2s, border-color 0.2s; text-transform: uppercase; }
.d-nav button:hover { color: var(--ink); border-color: var(--ink-3); }
.d-state { margin: 0; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.d-title { margin: -8px 0 0; font: 700 clamp(40px, 4.6vw, 68px)/0.95 var(--display); letter-spacing: -0.035em; text-wrap: balance; }
.d-story { margin: 0; font-size: 16px; font-weight: 400; line-height: 1.55; color: #d6cfc2; max-width: 46ch; text-wrap: pretty; }
.d-meta { margin: 0; display: grid; grid-template-columns: auto 1fr; border-top: 1px solid var(--line); }
/* one row per pair: the label column stays shared (subgrid) and label + value sit on one baseline */
.d-row { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: baseline; padding: 10px 0 9px; border-bottom: 1px solid var(--line); }
.d-meta dt, .d-meta dd { margin: 0; }
.d-meta dd { line-height: 1.45; }
.d-meta dt { font: 500 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); padding-right: 24px; }
.d-meta dd { color: var(--ink); }

/* ── responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .brand em { display: none; }
  .chrome.bottom { grid-template-columns: 1fr; justify-items: center; }
  .chrome.top { grid-template-columns: auto 1fr; }
  .chrome.top .views { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .right { gap: 12px; }
  .index-view, .album-view { padding-top: 120px; }
  .index-head, .album-head { grid-template-columns: 1fr; }
  .album-actions { grid-column: 1; }
  .index-list button { grid-template-columns: 34px 1fr 16px; row-gap: 4px; }
  .index-list .zn, .index-list .er { display: none; }
  .index-list .st { grid-column: 2; grid-row: 1; }
  .index-list .rl { grid-column: 2; grid-row: 2; }
  .index-list .got { grid-column: 3; grid-row: 1; }
  .index-float { display: none; }
  .detail { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; align-content: start; overflow-y: auto; overflow-x: hidden; }
  .d-text, .d-stage { min-width: 0; }
  .d-title { font-size: clamp(34px, 10vw, 48px); overflow-wrap: anywhere; }
  .d-stage { --cw: min(66vw, 300px); height: calc(var(--cw) * 660 / 520 + 84px); padding: 64px 16px 20px; }
  .d-card { width: var(--cw); }
  .d-stage { justify-items: center; padding-inline: 16px; }
  .d-copy { padding-bottom: 0; max-width: none; }
  .d-rail { max-width: none; }
  .d-text { overflow: visible; padding: 8px 16px 40px; }
  .d-state { margin-top: 6px; }
  .d-backdrop { position: fixed; }
}

@media (prefers-reduced-motion: reduce) {
  /* keep fades and colour changes; drop movement */
  *, *::before, *::after { transition-property: opacity, color, background-color, border-color, visibility !important; }
  .d-rubber.down, .slot.fresh canvas, .d-ripple, .d-hint.on, .count.bump b, .mouse i { animation: none !important; }
  .d-hint.on { opacity: 0.6; }
}

/* ── ASCII era: sleeping chrome, refine, visit, hidden interactions ── */
:root { --out: cubic-bezier(0.16, 1, 0.3, 1); --inout: cubic-bezier(0.4, 0, 0.2, 1); }
.chrome.top { transition: opacity 150ms var(--ease), translate 150ms var(--ease); }
body.on-field.idle .chrome.top { opacity: 0; translate: 0 -10px; pointer-events: none; transition: opacity 400ms ease, translate 400ms ease; }
body.on-field.idle .chrome.top:focus-within { opacity: 1; translate: 0 0; pointer-events: auto; }
body.on-field.idle .refine:not(.open) { opacity: 0.35; }
.chrome.bottom { grid-template-columns: 1fr; justify-items: center; }
.chrome.bottom::before { display: none; }
body:not(.on-field) .refine { opacity: 0; pointer-events: none; }

/* refine: a small pill that opens upward into the zone list (after the product-grid reference) */
.refine { position: relative; display: grid; justify-items: center; transition: opacity 0.4s var(--out); }
.refine-pill {
  display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 14px;
  font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink);
  background: rgba(24, 22, 20, 0.66); border: 1px solid var(--line); border-radius: 999px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: background-color 0.15s ease, scale 0.15s var(--out);
}
.refine-pill:active { scale: 0.97; }
.refine-pill i { font-style: normal; font-size: 11px; color: var(--ink-2); transition: rotate 0.25s var(--out); }
.refine.open .refine-pill i { rotate: 180deg; }
.refine-panel {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  width: max-content; max-width: min(560px, 92vw);
  display: grid; grid-template-columns: repeat(4, auto); gap: 4px 6px; padding: 12px 14px;
  background: rgba(24, 22, 20, 0.72); border: 1px solid var(--line); border-radius: 12px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transform-origin: 50% 100%; opacity: 0; scale: 0.96; translate: -50% 6px; pointer-events: none; visibility: hidden;
  transition: opacity 0.18s ease, scale 0.22s var(--out), translate 0.22s var(--out), visibility 0s 0.22s;
}
.refine.open .refine-panel { opacity: 1; scale: 1; translate: -50% 0; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.refine-panel button {
  position: relative; padding: 7px 8px; text-align: left; white-space: nowrap;
  font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3);
  transition: color 0.15s ease;
}
.refine-panel button::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: 3px; height: 1px; background: currentColor; scale: 0 1; transform-origin: left; transition: scale 0.25s var(--out); }
.refine-panel button:hover, .refine-panel button:focus-visible { color: var(--ink); }
.refine-panel button:hover::after, .refine-panel button[aria-pressed='true']::after { scale: 1 1; }
.refine-panel button[aria-pressed='true'] { color: var(--ink); }

/* detail: zoom focus hides the text so the stamp can fill the room (gallery reference) */
.d-text { transition: opacity 240ms var(--ease) 40ms, translate 240ms var(--ease) 40ms; }
.detail.focus .d-text { opacity: 0; translate: 32px 0; pointer-events: none; }
.d-close { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.05em; transition: color 0.15s ease, border-color 0.15s ease, scale 0.15s var(--out); }
.d-close:hover { color: var(--ink); border-color: var(--ink-3); }
.d-close:active { scale: 0.97; }
.d-rail { display: flex; gap: 8px; padding: 2px 0 6px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none;
  -webkit-mask: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); mask: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.d-rail { flex: none; max-width: 520px; } /* never let the scrolling panel squeeze it; same measure as the copy */
.d-rail .d-thumb { scroll-snap-align: center; }
.d-top { flex: none; }
.d-rail .d-thumb:first-child { margin-inline-start: 16px; }
.d-rail .d-thumb:last-child { margin-inline-end: 16px; }
.d-thumb { flex: none; width: 46px; aspect-ratio: 520 / 660; border-radius: 2px; opacity: 0.45; transition: opacity 150ms ease, translate 200ms var(--ease); }
.d-thumb canvas { width: 100%; height: 100%; display: block; }
@media (hover: hover) and (pointer: fine) { .d-thumb:hover { opacity: 0.85; translate: 0 -3px; } }
.d-thumb.on { opacity: 1; box-shadow: 0 0 0 1px var(--ink); }
.d-thumb:active { scale: 0.96; }
.d-copy { display: flex; flex-direction: column; gap: 18px; margin-block: auto; padding-bottom: 116px; max-width: 520px; }
.d-ghost { position: fixed; z-index: 1; pointer-events: none; }
.d-ghost canvas { width: 100%; height: 100%; display: block; }

/* hold ring: fills while you press; complete it and the rubber stamp comes down */
.d-hold { position: fixed; z-index: 50; width: 64px; height: 64px; margin: -32px 0 0 -32px; pointer-events: none; opacity: 0; rotate: -90deg; transition: opacity 0.15s ease; }
.d-hold circle { fill: none; stroke: #ece6da; stroke-width: 2.5; opacity: 0.9; stroke-dasharray: 0 164; }
.d-hold.on { opacity: 1; }
.d-hold.fill circle { animation: holdfill 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards; } /* the double-tap lands: a quick ring closes */
@keyframes holdfill { from { stroke-dasharray: 0 164; } to { stroke-dasharray: 164 0; } }

/* the corner you'd lift a stamp by: hover it and the stamp turns over */
.d-peel { position: absolute; right: 0; bottom: 0; width: 26%; height: 22%; pointer-events: none; opacity: 0;
  background: linear-gradient(135deg, transparent 70%, rgba(20, 18, 16, 0.55) 70.5%, rgba(238, 228, 204, 0.95) 72%, #d9cfb4 100%);
  transition: opacity 0.2s ease; }
.d-card.peeling .d-peel { opacity: 1; }

/* the instrument shimmers if you linger, and ripples when struck */
.d-hint { position: absolute; inset: 14% 12% 26%; pointer-events: none; border-radius: 40%; opacity: 0;
  background: radial-gradient(closest-side, rgba(236, 230, 218, 0.18), transparent); transition: opacity 0.8s ease; }
.d-hint.on { opacity: 1; animation: hint 2.4s ease-in-out infinite; }
@keyframes hint { 50% { opacity: 0.35; scale: 1.04; } }
.d-ripple { position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; pointer-events: none;
  border: 2px solid rgba(236, 230, 218, 0.9); animation: ripple 0.9s var(--out) forwards; }
@keyframes ripple { to { scale: 9; opacity: 0; } }

@media (max-width: 900px) {
  .refine-panel { grid-template-columns: repeat(2, auto); }
  .detail.focus .d-text { translate: 0 24px; }
}

/* ── interface fixes: visible cues for the hidden gestures, keyboard + screen-reader paths ── */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: var(--gutter); top: 12px; z-index: 60; padding: 10px 14px; border-radius: 8px; background: var(--ink); color: #0b0a09; font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; translate: 0 -160%; transition: translate 150ms var(--ease); }
.skip:focus-visible { translate: 0 0; }
.d-gestures { margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font: 500 11.5px var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
.d-gestures li { list-style: none; display: flex; align-items: center; gap: 6px; }
.d-gestures kbd { font: inherit; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--ink-2); }
.d-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.d-acts:not(:focus-within) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.d-acts button { height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); font-weight: 500; }
