/* base */
:root {
  --parchment: #e9c99a;
  --ink: #33200f;
  --wood: #2a1e0c;
  --glow: rgb(255 196 120 / .75);
  --font-sign: "Obra Letra", "IM Fell English", Georgia, serif;
  --font-body: "Obra Letra", "IM Fell English", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #000;
  color: var(--parchment);
  font: 18px/1.5 var(--font-body);
  display: grid;
  place-items: center;
  overflow: hidden;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--parchment); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* frame stuff (frame.png is 1804x1077) */
.stage {
  position: relative;
  aspect-ratio: 1804 / 1077;
  width: min(100vw, calc(100vh * 1804 / 1077));
  container-type: inline-size; /* so cqw works */
}
.frame {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 10;
  view-transition-name: frame;
}
/* hole in the frame: x47 y50, 1710x979 */
.opening {
  position: absolute;
  left: 2.605%; top: 4.643%; width: 94.79%; height: 90.90%;
  overflow-x: hidden; overflow-y: auto;
  background: #000;
  scrollbar-width: thin;
  scrollbar-color: #5a4220 #000;
}
/* padding so stuff doesnt go under the corners */
.inner { padding: 4.5cqw; min-height: 100%; }

/* old nav plaques */
.nav {
  position: absolute; z-index: 11; top: .4%; left: 50%; transform: translateX(-50%);
  display: flex; gap: 1.2cqw;
  view-transition-name: nav;
}
.plaque, .status {
  font: 600 clamp(12px, 1.05cqw, 18px)/1 var(--font-sign);
  letter-spacing: .06em;
  color: var(--ink);
  background: var(--parchment);
  border: 2px solid var(--wood);
  border-radius: 3px;
  min-height: 44px; min-width: 44px;
  padding: 0 1.1cqw;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: transform .15s ease-out, filter .15s ease-out;
}
.plaque:hover, .plaque:focus-visible { transform: translateY(1px) scale(1.05); filter: drop-shadow(0 0 8px var(--glow)); }
.plaque[aria-current="page"] { background: #f6dfb8; }
.status {
  position: absolute; z-index: 11; top: .4%; right: 7%; margin: 0;
  font-size: clamp(11px, .9cqw, 16px);
  background: #3b2a12; color: var(--parchment);
  view-transition-name: status;
}
.status.open { background: #2f4a1f; }

/* glow */
.glow { transition: transform .15s ease-out, filter .15s ease-out; }
.glow:hover, .glow:focus-visible { filter: drop-shadow(0 0 12px var(--glow)) brightness(1.08); }

/* splash */
/* splash box. sized so the hole is 16:9 and fits the video */
body.framed .stage {
  aspect-ratio: 1.7048;
  width: min(70vw, calc(70vh * 1.7048));
}
body.framed .frame { object-fit: fill; }
body.framed .opening { overflow: hidden; }

/* back button top right (back.png 79x78) */
.back-btn {
  position: absolute; top: 4.643%; right: 2.605%; width: 3.4cqw;   /* same as .opening so it sits in the corner */ aspect-ratio: 79 / 78; z-index: 10;
  background: url(assets/back.png) center / contain no-repeat;
  view-transition-name: back;   /* so it doesnt move between pages */
  transition: transform .15s, filter .15s;
}
.back-btn:hover, .back-btn:focus-visible { transform: scale(1.1); filter: drop-shadow(0 0 8px var(--glow)) brightness(1.1); outline: none; }
.splash-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.enter {
  position: absolute; z-index: 12;
  right: 5%; bottom: -3.5%;
  width: max(160px, 17%); aspect-ratio: 1234 / 542;
  display: block;
}
.enter img { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .15s ease-out; }
.enter .hover { opacity: 0; }
.enter:hover .hover, .enter:focus-visible .hover { opacity: 1; }
.enter:hover, .enter:focus-visible { transform: scale(1.04); }

/* shelf page
   bg, bottles and vignette are all 1920x1080
   x y w h = where each bottle is in the image */
.scene { position: absolute; inset: 0; }
.scene img, .scene video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
/* shopkeeper - keeper.png is 940x1347
   kx = left/right, ky = top, kh = height
   counter covers her bottom half */
.keeper {
  --kx: 66.7%; --ky: 17.7%; --kh: 168%;
  position: absolute; left: var(--kx); top: var(--ky); height: var(--kh);
  aspect-ratio: 940 / 1347; translate: -50% 0;
  will-change: transform;   /* helps performance */
  /* fade her out under the counter or you can see through it */
  -webkit-mask: linear-gradient(#000 37%, transparent 41%);
          mask: linear-gradient(#000 37%, transparent 41%);
}
/* lighting on her: make her a bit warmer/darker to match the video + glow on the edges */
.scene .keeper img {
  filter:
    sepia(.22) saturate(.85) brightness(.8) contrast(1.06)
    drop-shadow(-3px -2px 5px rgb(255 170 90 / .45));
}
/* shadow gradient on her. not animated bc that lagged */
.keeper::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg,
    rgb(255 185 110 / .6) 0%, rgb(255 185 110 / 0) 38%,
    rgb(25 12 4 / 0) 52%, rgb(25 12 4 / .65) 100%);
  mix-blend-mode: soft-light;
  -webkit-mask: url(assets/keeper.png) center / contain no-repeat;
          mask: url(assets/keeper.png) center / contain no-repeat;
}
/* inherits false so its faster */
@property --mx { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --my { syntax: "<number>"; inherits: false; initial-value: 0; }
/* parallax. framed.js sets mx/my. depth = how much it moves (1 = all, .5 = half)
   scaled up 4% so you dont see the edges */
.parallax {
  position: absolute; inset: 0; --mx: 0; --my: 0; --shift: 2%; --depth: 1;
  transform: translate(calc(var(--mx) * var(--shift) * var(--depth) * -1), calc(var(--my) * var(--shift) * var(--depth) * -1)) scale(1.04);
  will-change: transform;
}
.vignette { pointer-events: none; z-index: 2; }
.bottle-btn {
  position: absolute; z-index: 1;
  left: calc(var(--x) / 1920 * 100%); top: calc(var(--y) / 1080 * 100%);
  width: calc(var(--w) / 1920 * 100%); height: calc(var(--h) / 1080 * 100%);
  padding: 0; border: 0; cursor: pointer; display: block;
  background: var(--img, url(assets/shelf1-items.webp)) no-repeat;   /* which image to use */
  background-size: calc(1920 / var(--w) * 100%) calc(1080 / var(--h) * 100%);
  background-position: calc(var(--x) / (1920 - var(--w)) * 100%) calc(var(--y) / (1080 - var(--h)) * 100%);
  transform-origin: 50% 100%;   /* grow from the bottom */
  transition: transform .15s ease-out, filter .15s ease-out;
}
.bottle-btn:hover, .bottle-btn:focus-visible {
  transform: scale(1.08);
  filter: drop-shadow(0 0 10px var(--glow)) drop-shadow(0 0 3px var(--glow)) brightness(1.08);
  outline: none;
}
.bottle-btn::after {
  content: attr(data-name);
  position: absolute; left: 50%; top: 100%; transform: translate(-50%, 6px);
  white-space: nowrap; pointer-events: none;
  font: 600 clamp(11px, 1cqw, 16px) var(--font-sign); color: var(--ink);
  background: var(--parchment); border: 1px solid var(--wood); padding: .15em .6em; border-radius: 2px;
  opacity: 0; transition: opacity .15s;
}
.bottle-btn:hover::after, .bottle-btn:focus-visible::after { opacity: 1; }

/* shop labels (shop-labels.webp 2000x1125, each one is 376x127). lx ly = top left of the label
   shows above the item on hover */
.bottle-btn.has-label::after { content: none; }
.plank {
  position: absolute; left: 50%; bottom: calc(100% + 1cqw);
  width: 13cqw; aspect-ratio: 376 / 127;
  translate: -50% 0;
  background: url(assets/shop-labels.webp) no-repeat;
  background-size: calc(2000 / 376 * 100%) calc(1125 / 127 * 100%);
  background-position: calc(var(--lx) / (2000 - 376) * 100%) calc(var(--ly) / (1125 - 127) * 100%);
  opacity: 0; transition: opacity .15s; pointer-events: none;
}
.bottle-btn:hover .plank, .bottle-btn:focus-visible .plank { opacity: 1; }
/* hovered one goes on top so the label isnt covered */
/* wait for the fade before dropping back down */
.bottle-btn:has(.shelf-label) { transition: transform .15s ease-out, filter .15s ease-out, z-index 0s .15s; }
.bottle-btn:has(.shelf-label):is(:hover, :focus-visible) { z-index: 2; transition-delay: 0s; }
/* bottle grows 8% so shrink the label back so it doesnt */
.plank.shelf-label { transform-origin: 50% 0; transition: opacity .15s, scale .15s ease-out; }
.bottle-btn:is(:hover, :focus-visible) .plank.shelf-label { scale: calc(1 / 1.08); }
/* shelf labels (shelf1-labels.webp, 360x120 each), under the bottle */
.plank.shelf-label { top: calc(100% + .5cqw); bottom: auto; width: 15cqw; }
.plank.shelf-label, .info h2 {
  aspect-ratio: 3;
  background: url(assets/shelf1-labels.webp) no-repeat;
  background-size: calc(1920 / 360 * 100%) calc(1080 / 120 * 100%);
  background-position: calc(var(--lx) / (1920 - 360) * 100%) calc(var(--ly) / (1080 - 120) * 100%);
}

/* tint: add class tint + --tint color. multiplies color on the bottle, not the cork */
.tint::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--tint); mix-blend-mode: multiply;
  -webkit-mask:
    linear-gradient(transparent var(--tint-from, 30%), #000 calc(var(--tint-from, 30%) + 4%)) 0 0 / 100% 100% no-repeat,
    var(--img, url(assets/shelf1-items.webp)) no-repeat;
  -webkit-mask-size: 100% 100%, calc(1920 / var(--w) * 100%) calc(1080 / var(--h) * 100%);
  -webkit-mask-position: 0 0, calc(var(--x) / (1920 - var(--w)) * 100%) calc(var(--y) / (1080 - var(--h)) * 100%);
  -webkit-mask-composite: source-in;
  mask:
    linear-gradient(transparent var(--tint-from, 30%), #000 calc(var(--tint-from, 30%) + 4%)) 0 0 / 100% 100% no-repeat,
    var(--img, url(assets/shelf1-items.webp)) no-repeat;
  mask-size: 100% 100%, calc(1920 / var(--w) * 100%) calc(1080 / var(--h) * 100%);
  mask-position: 0 0, calc(var(--x) / (1920 - var(--w)) * 100%) calc(var(--y) / (1080 - var(--h)) * 100%);
  mask-composite: intersect;
}

/* zoomed in view */
.scene { container-type: size; }
.inspect { position: absolute; inset: 0; z-index: 5; background: rgb(0 0 0 / .6); }
.inspect[hidden] { display: none; }
.inspect-bottle {
  position: absolute; right: 12cqw; top: 50%; transform: translateY(-50%);
  /* as big as fits */
  width: min(40cqw, calc(75cqh * var(--w) / var(--h)));
  aspect-ratio: var(--w) / var(--h);
  /* big version of the bottles image */
  background: url("assets/shelf1-items@2x.png") no-repeat;
  background-size: calc(1920 / var(--w) * 100%) calc(1080 / var(--h) * 100%);
  background-position: calc(var(--x) / (1920 - var(--w)) * 100%) calc(var(--y) / (1080 - var(--h)) * 100%);
  filter: drop-shadow(0 0 18px var(--glow));
  cursor: zoom-out;
}
/* card bg - card.webp, paper is at x 0-893 y 405-1080 */
.info {
  position: absolute; left: 0; bottom: 0; width: 46.5cqw; height: 62.5cqh;
  translate: 0 22cqh;   /* push it down */
  --lw: 32cqw; --lift: 2cqh;   /* label size + gap */
  background: url(assets/card.webp) 0 100% / calc(1920 / 893 * 100%) calc(1080 / 675 * 100%) no-repeat;
  color: var(--ink);
  padding: 4cqh 5cqw 9cqh 5cqw;
  font: clamp(14px, 1.5cqw, 20px)/1.45 var(--font-body);
  animation: rise .25s ease-out .15s both;
}
/* label pic as the heading, text still there for screen readers */
.info h2 { position: absolute; left: 50%; translate: -50% 0; bottom: calc(100% + var(--lift)); width: var(--lw); margin: 0; color: transparent; font-size: 1px; overflow: hidden; }
.info .price { font-weight: 700; margin: 0 0 .5em; }
.info .blurb { margin: 0; }
::view-transition-group(picked) { animation-duration: .4s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }

/* lottery
   ticket is 1050x600, everything is in those pixels */
.ticket {
  position: absolute; left: 44%; top: 17%; translate: -50% 0;
  width: 58%; aspect-ratio: 1050 / 600;
  /* tilt it so its lying on the table */
  transform: perspective(1400px) rotateX(14deg) rotateZ(-3deg);
}
/* new ticket slides in */
.ticket.dealt { animation: deal .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes deal { from { translate: calc(-50% + 50cqw) 45cqh; opacity: .3; } }

/* coin = reveal all (coin.png 1367x747, coin at 660,260 216x204) */
.coin {
  position: absolute; left: 80%; top: 22%; width: 10cqw; aspect-ratio: 216 / 204;
  padding: 0; border: 0; cursor: pointer;
  background: url(assets/lottery/coin.png) no-repeat;
  background-size: calc(1367 / 216 * 100%) calc(747 / 204 * 100%);
  background-position: calc(660 / (1367 - 216) * 100%) calc(260 / (747 - 204) * 100%);
  transition: transform .15s ease-out, filter .15s ease-out;
}

/* zoom whole table when hovering the ticket */
.table-layer { position: absolute; inset: 0; transform-origin: 44% 46.5%; transition: scale .5s cubic-bezier(.2, .8, .2, 1); }
.scene:has(.ticket:hover) .table-layer { scale: 1.07; }
/* ticket corner sticking out = new ticket */
.ticket-stack {
  position: absolute; left: 90%; top: 66%; width: 40%; aspect-ratio: 1050 / 600;
  padding: 0; border: 0; cursor: pointer;
  background: url(assets/lottery/ticket-cover.webp) center / 100% 100% no-repeat;
  rotate: -24deg; transform-origin: 0 0;
  transition: transform .15s ease-out, filter .15s ease-out;
}
.coin:hover, .coin:focus-visible, .ticket-stack:hover, .ticket-stack:focus-visible {
  transform: scale(1.06); filter: drop-shadow(0 0 10px var(--glow)) brightness(1.08); outline: none;
}
.ticket > img, .ticket canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ticket canvas { touch-action: none; cursor: crosshair; transition: opacity .6s ease-out; }
.ticket canvas.gone { opacity: 0; pointer-events: none; }
.cell {
  position: absolute; overflow: hidden;
  left: calc(var(--cx) / 1050 * 100%); top: calc(var(--cy) / 600 * 100%);
  width: calc(134 / 1050 * 100%); height: calc(134 / 600 * 100%);
}
.cell img {  /* make the symbols fill the square */
  position: absolute; left: 50%; top: 50%; height: 110%; width: auto; translate: -50% -50%;
}
.cell.win { background: rgb(255 214 120 / .55); box-shadow: inset 0 0 0 3px #ffd36a; }
.lotto-msg {
  position: absolute; left: 44%; top: 83%; translate: -50% 0; width: 58%; margin: 0;
  text-align: center; text-shadow: 0 1px 3px #000;
  font: clamp(14px, 1.5cqw, 22px)/1.3 var(--font-body); color: var(--parchment);
}
.lotto-msg strong { font-family: var(--font-sign); }

/* ledger
   book-plane is 1200x880, the js bends it onto the book in book.webp
   each page is strips that bend so it curves like the art
   --a = angle (0 = right side, -180 = left side) */
@property --a { syntax: "<number>"; inherits: true; initial-value: 0; }
.book-plane {
  position: absolute; left: 0; top: 0; width: 1200px; height: 880px;
  transform-origin: 0 0; transform-style: preserve-3d;
}
.sheet {
  --z: 0;
  position: absolute; left: 50%; top: 0; width: 50%; height: 100%;
  transform-style: preserve-3d; transform-origin: 0 50%;   /* spine */
  /* keeps the page from flying up while turning */
  transform:
    matrix3d(1,0,0,0, 0,1,0,0, 0,calc(var(--lift, 0) * -.85 * sin(calc(var(--a) * 1deg))),1,0, 0,0,0,1)
    perspective(2400px) rotateY(calc(var(--a) * 1deg)) translateZ(calc(var(--z) * .4px));
}
.sheet.leaf { transition: --a .6s cubic-bezier(.3, .7, .3, 1); cursor: grab; }
.sheet.leaf.dragging { transition: none; cursor: grabbing; }
.sheet.fixed { --z: -50; pointer-events: none; }        /* bottom pages */
.sheet.fixed.left { --z: 50; --a: -180; }

/* strip. --j = bend angle, --dip = spine dip */
.strip {
  position: absolute; top: 0; height: 100%;
  transform-style: preserve-3d; transform-origin: 0 50%;
  --f: cos(calc(var(--a) * 1deg));
  transform: translateZ(calc(var(--dip, 0) * var(--f) * 1px)) rotateY(calc(var(--j) * var(--f) * 1deg));
}
.strip > .strip { left: 100%; --dip: 0; }   /* only the first one dips */
.clip { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; }
.clip.back { transform: rotateY(180deg); }
/* whole page inside each strip so text lines up */
.page-content {
  position: absolute; top: 0; width: 600px; height: 100%; isolation: isolate;
  padding: 70px 64px 60px 74px; color: #3a2410;
  font: 30px/1.4 var(--font-body);
}
.clip.back .page-content { padding: 70px 74px 60px 64px; }
/* paper texture (page.webp). back pages are flipped */
.page-content::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url(assets/ledger/page.webp) 0 0 / calc(2000 / 1215 * 100%) 100% no-repeat;
  filter: sepia(.35) saturate(1.15) brightness(.93);
}
.clip.back .page-content::before { transform: scaleX(-1); }
/* shadow near the spine */
.page-content::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgb(40 20 5 / .5), rgb(40 20 5 / 0) 22%);
  opacity: calc(.45 - sin(calc(var(--a) * 1deg)) * .55);
}
.clip.back .page-content::after { background: linear-gradient(270deg, rgb(40 20 5 / .5), rgb(40 20 5 / 0) 22%); }
.page-content h2 { font: 700 46px/1.1 var(--font-sign); margin: 0 0 .5em; }
.page-content h3 { font: 700 36px/1.2 var(--font-sign); margin: 0 0 .5em; }
.page-content p { margin: 0 0 .7em; }
.page-content ul { list-style: none; padding: 0; margin: 0; }
.page-content li { display: flex; gap: .4em; padding: .15em 0; }
.page-content li .dots { flex: 1; border-bottom: 2px dotted rgb(58 36 16 / .5); translate: 0 -.35em; }
.page-content .folio { position: absolute; bottom: 34px; left: 0; right: 0; text-align: center; font-size: 20px; opacity: .7; }
.page-content.title { display: flex; flex-direction: column; justify-content: center; text-align: center; }
.page-content.title h2 { font-size: 64px; }

/* custom orders
   desk.webp is 2000x1125, paper is around x 620-1170 y 260-990 */
.order-form {
  --ink: #3b2412;
  --pen: #1e2236;              /* what they type */
  --rule: rgb(59 36 18 / .4);  /* lines */
  position: absolute; left: 31.6%; top: 23.6%; width: 26.3%; height: 63.6%;
  display: flex; flex-direction: column; gap: .8cqw;
  color: var(--ink); font: clamp(10px, 1.25cqw, 21px)/1.35 var(--font-body);
}
.order-form h2 { font: 700 clamp(15px, 1.75cqw, 30px)/1 var(--font-sign); letter-spacing: .08em; margin: 0; text-align: center; }
/* line under title */
.order-form h2::after {
  content: "❦"; display: block; margin-top: .25em; font-size: .6em; letter-spacing: 0;
  background: linear-gradient(90deg, transparent, var(--ink) 25% 42%, transparent 42% 58%, var(--ink) 58% 75%, transparent) center / 100% 1px no-repeat;
}
.order-done .ooc { display: block; opacity: .75; }
.order-form label, .order-form legend { font: 600 .82em var(--font-sign); letter-spacing: .05em; }
/* label + line next to it */
.line { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: .6em; }
.line .error { grid-column: 1 / -1; }
.order-form input[type="text"], .order-form textarea {
  display: block; width: 100%; min-width: 0;
  font: italic 1.08em/1.6 var(--font-body); color: var(--pen); background: transparent;
  border: 0; border-bottom: 1px solid var(--rule); border-radius: 0;
  padding: 0 .2em; outline: none; transition: background-color .15s, border-color .15s;
}
.order-form ::placeholder { color: rgb(59 36 18 / .38); font-size: .85em; }
/* lined paper */
.order-form .grow { flex: 1; display: flex; flex-direction: column; }
.order-form textarea {
  flex: 1; min-height: 2.4em; resize: none; margin-top: .1em; border-bottom: 0;
  background: repeating-linear-gradient(transparent 0 calc(1.6em - 1px), var(--rule) calc(1.6em - 1px) 1.6em) local;
}
.order-form input:focus-visible, .order-form textarea:focus-visible { border-bottom-color: var(--ink); background-color: rgb(255 236 190 / .35); }
.order-form fieldset { border: 0; padding: .4em 0 0; margin: 0; border-top: 1px solid var(--rule); }
.order-form legend { float: left; width: 100%; padding: 0; margin-bottom: .2em; }   /* float fixes it overlapping the border */
.urgency { display: flex; justify-content: space-between; gap: .3em .8em; flex-wrap: wrap; padding: 0 .3em; }
.urgency label { font: 1em var(--font-body); letter-spacing: 0; display: inline-flex; align-items: center; gap: .35em; cursor: pointer; min-height: 24px; }
/* checkboxes (actually radios) */
.urgency input {
  appearance: none; width: 1em; height: 1em; margin: 0; flex: none; cursor: pointer;
  border: 1.5px solid var(--ink); border-radius: 1px; display: grid; place-items: center;
}
.urgency input::after { content: "✓"; font: 700 1.25em/1 var(--font-body); color: var(--pen); opacity: 0; translate: .1em -.15em; rotate: -8deg; }
.urgency input:checked::after { opacity: 1; }
.urgency input:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 2px; }
.order-form .error { color: #8a1c10; font-style: italic; font-size: .85em; min-height: 1.1em; margin: .1em 0 0; }
.order-form .error:empty { min-height: 0; }
.order-form [aria-invalid="true"] { border-bottom-color: #8a1c10; }
/* send button (send.webp, plank at 358,280 1286x566) */
.send {
  position: absolute; left: 68%; top: 77%; width: 16cqw; aspect-ratio: 1286 / 566;
  padding: 0; border: 0; cursor: pointer;
  background: url(assets/custom/send.webp) no-repeat;
  background-size: calc(2000 / 1286 * 100%) calc(1125 / 566 * 100%);
  background-position: calc(358 / (2000 - 1286) * 100%) calc(280 / (1125 - 566) * 100%);
  transition: transform .15s ease-out, filter .15s ease-out;
}
.send:hover, .send:focus-visible { transform: scale(1.05); filter: drop-shadow(0 0 10px var(--glow)) brightness(1.06); outline: none; }
.order-done { text-align: center; justify-content: center; }
.order-done pre {
  white-space: pre-wrap; text-align: left; font: inherit; margin: 0;
  max-height: 60%; overflow: auto; border-top: 2px dotted rgb(58 36 16 / .5); border-bottom: 2px dotted rgb(58 36 16 / .5); padding: .5em 0;
}
.ink-btn {
  align-self: center; font: 600 .95em var(--font-sign); color: #3a2410; background: transparent;
  border: 2px solid #3a2410; border-radius: 3px; min-height: 40px; padding: 0 1em; cursor: pointer;
}
.ink-btn:hover, .ink-btn:focus-visible { background: rgb(255 240 200 / .4); outline: none; }

/* old greybox shop */
.room { position: relative; height: 100%; overflow: hidden; --mx: 0; --my: 0; }
.layer { position: absolute; inset: -2%; transform: translate(calc(var(--mx) * var(--d) * 1cqw), calc(var(--my) * var(--d) * 1cqw)); }
.wall { background: repeating-linear-gradient(90deg, #1d150b 0 6cqw, #21180d 6cqw 12cqw); }
.shelves {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 3cqw;
  inset: 12% 8% 38% 8%;
}
.shelf-link {
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  border: 2px dashed #6b5030; border-radius: 4px;
  background: repeating-linear-gradient(180deg, transparent 0 22%, #4a3418 22% 25%);
  text-decoration: none; padding-bottom: .8cqw;
}
.shelf-link .label {
  font: 600 clamp(12px, 1.1cqw, 18px) var(--font-sign); color: var(--ink);
  background: var(--parchment); padding: .3em .7em; border-radius: 2px; opacity: .8;
}
.shelf-link:hover .label, .shelf-link:focus-visible .label { opacity: 1; }
.counter {
  inset: auto 14% 4% 14%; height: 26%;
  border: 2px dashed #7a5a34; border-radius: 4px; background: #2c2010;
  display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: center; justify-items: center;
}
.signpost {
  position: relative; text-decoration: none; text-align: center;
  font: 600 clamp(12px, 1cqw, 17px) var(--font-sign);
  border: 2px dashed #8a6a40; border-radius: 4px; padding: 1cqw 1.4cqw; min-width: 44px; min-height: 44px;
}
.signpost::after {
  content: ""; position: absolute; top: -6px; right: 10px; width: 10px; height: 22px;
  background: #9b1c1c; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%);
}
.centerpiece { color: #a88b62; font-size: 14px; text-align: center; }
.portrait { position: absolute; left: 3%; top: 64%; }
.hint { position: absolute; right: 3%; top: 60%; margin: 0; max-width: 22%; text-align: right; font-size: clamp(11px, .85cqw, 15px); color: #b89a70; }

/* old greybox shelf */
.shelf-head {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  font: 600 clamp(12px, 1.05cqw, 18px) var(--font-sign);
  position: sticky; top: 0; z-index: 2; background: #000; padding: .5rem 0;
}
.shelf-head a { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.shelf-head h1 { font: inherit; font-size: 1.4em; margin: 0; }
.cabinet { position: relative; margin-top: 1rem; border: 2px dashed #6b5030; border-radius: 4px; padding: 2cqw 3cqw 4cqw; }
.cabinet-back {
  position: absolute; inset: 0; z-index: -1;
  background: repeating-linear-gradient(90deg, #1a120a 0 4cqw, #1f160c 4cqw 8cqw);
}
.row {
  display: flex; justify-content: space-around; align-items: flex-end;
  min-height: 15cqw; border-bottom: 1cqw solid #4a3418; margin-bottom: 4cqw;
}
.item {
  appearance: none; border: 0; background: none; cursor: pointer; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: .4cqw;
  color: var(--parchment); font: inherit;
}
.item .bottle {
  width: 5.5cqw; height: 8cqw; min-width: 44px; min-height: 60px;
  border-radius: 40% 40% 8% 8% / 30% 30% 8% 8%;
  background: var(--c, #6a8a5a); border: 2px solid rgb(255 255 255 / .15);
  display: grid; place-items: center;
  font: 600 clamp(14px, 1.6cqw, 26px) var(--font-sign); color: rgb(0 0 0 / .5);
}
.item .tag {
  font: 600 clamp(11px, .9cqw, 15px) var(--font-sign); color: var(--ink);
  background: var(--parchment); padding: .15em .5em; border-radius: 2px;
  opacity: 0; transition: opacity .15s;
}
.item:hover .bottle, .item:focus-visible .bottle { transform: scale(1.08); filter: drop-shadow(0 0 10px var(--glow)); }
.item .bottle { transition: transform .15s ease-out, filter .15s ease-out; }
.item:hover .tag, .item:focus-visible .tag { opacity: 1; }
.item.sold-out .bottle { opacity: .4; }
.item.sold-out .tag { opacity: .85; }

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .cabinet-back { animation: drift linear both; animation-timeline: scroll(nearest); }
  }
}
@keyframes drift { to { transform: translateY(12%); } }

/* old lore card */
dialog.card {
  width: min(92vw, 480px); border: 3px solid var(--wood); border-radius: 4px;
  background: var(--parchment); color: var(--ink); padding: 1.5rem 1.75rem;
  font: 18px/1.5 var(--font-body);
}
dialog.card::backdrop { background: rgb(0 0 0 / .6); }
dialog.card[open] { animation: rise .2s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.card h2 { font: 700 1.5rem var(--font-sign); margin: 0 0 .25rem; }
.card .price { font-weight: 700; margin: 0 0 .75rem; }
.card .soldout { display: inline-block; background: var(--ink); color: var(--parchment); font: 600 13px var(--font-sign); padding: .2em .6em; margin-left: .5rem; }
.card .close {
  position: absolute; top: .5rem; right: .5rem; min-width: 44px; min-height: 44px;
  font: 600 1.4rem var(--font-sign); background: none; border: 0; color: var(--ink); cursor: pointer;
}

/* old text pages */
.page h1 { font: 700 clamp(22px, 2.4cqw, 40px) var(--font-sign); margin: 2.5cqw 0 1rem; }
.page h2 { font: 600 clamp(16px, 1.5cqw, 26px) var(--font-sign); margin: 2rem 0 .5rem; border-bottom: 1px solid #5a4220; padding-bottom: .25rem; }
.page p, .page li { max-width: 60ch; }
.ledger { list-style: none; padding: 0; margin: 0; max-width: 70ch; }
.ledger li { display: flex; gap: .5rem; padding: .35rem 0; max-width: none; }
.ledger .dots { flex: 1; border-bottom: 1px dotted #6b5030; transform: translateY(-.35em); }
.ledger .gone { text-decoration: line-through; opacity: .6; }
.placeholder { color: #a88b62; font-style: italic; }

/* page transitions */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: fade-out .25s ease-in both; }
::view-transition-new(root) { animation: fade-in .3s ease-out .1s both; }
::view-transition-group(*) { animation-duration: .45s; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) {
    animation-duration: .01ms !important; transition-duration: .01ms !important;
  }
  .item:hover .bottle, .item:focus-visible .bottle, .enter:hover, .enter:focus-visible, .plaque:hover { transform: none; }
}

/* mute button (framed.js adds it) */
.mute-btn {
  position: absolute; left: 0; top: calc(100% + 1cqw); width: 3.2cqw; min-width: 36px; aspect-ratio: 1;
  padding: .3cqw; border: 0; cursor: pointer;
  background: none; color: var(--parchment, #e8d5a8); opacity: .4;
  view-transition-name: mute;
  transition: transform .15s, filter .15s, opacity .15s;
}
.mute-btn svg { width: 100%; height: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mute-btn svg path:first-child { fill: currentColor; }
.mute-btn .cross, .mute-btn[aria-pressed="true"] .waves { display: none; }
.mute-btn[aria-pressed="true"] .cross { display: inline; }
.mute-btn:hover, .mute-btn:focus-visible { opacity: 1; outline: none; }
